Location: PHPKode > projects > Community Learning Network > cln/lib/CLN/interfaces/kbSearch.html
<?php
/*
 * KB Search Interface
 *
 * Copyright (c) 2003-4 St. Christopher House
 *
 * Developed by The Working Group Inc.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.  
 *
 * @version $Id: kbSearch.html,v 1.10 2005/01/25 21:15:06 derekbrooks Exp $
 *
 */
 
$currentColumn = $this->sortColumn;
$currentDirection = $this->sortDirection;
$opposite['ASC'] = 'DESC';
$opposite['DESC'] = 'ASC';

$dir = $currentColumn == 'ko.title' ? $opposite[$currentDirection] : 'ASC';
$href['title'] = appendToURL(cleanURL($GLOBALS['path']), $this->getParams() . '&orderColumn=ko.title&direction=' . $dir);

$dir = $currentColumn == 'ko.modId' ? $opposite[$currentDirection] : 'ASC';
$href['type'] = appendToURL(cleanURL($GLOBALS['path']), $this->getParams() . '&orderColumn=ko.modId&direction=' . $dir);

$dir = $currentColumn == 'ko.created' ? $opposite[$currentDirection] : 'ASC';
$href['created'] = appendToURL(cleanURL($GLOBALS['path']), $this->getParams() . '&orderColumn=ko.created&direction=' . $dir);

$dir = $currentColumn == 'ko.modified' ? $opposite[$currentDirection] : 'ASC';
$href['modified'] = appendToURL(cleanURL($GLOBALS['path']), $this->getParams() . '&orderColumn=ko.modified&direction=' . $dir);

$formURL = appendToURL(cleanURL($GLOBALS['path']), $this->getParams());

?>

<form name="kbSearch" action="<?php echo $formURL; ?>" method="post">

<fieldset class="kbSearchFieldset" id="kbSearchOuterShell">
	<legend accesskey="s">Search the Knowledge Base</legend>
	<ul class="kbSearchTab">
	<?php
	
	$kbSearchPieces = Array('kbSearchBasic' => 'Basic KB Search', 'kbSearchCreated' => 'Created', 'kbSearchModified' => 'Last Changed', 'kbSearchProgram' => 'Program', 'kbSearchDetailed' => 'Detailed Metadata Fields');
		
	// Loop through the fieldsets, displaying each of them, and setting the current one.
	foreach ($kbSearchPieces as $name => $title) {
		echo '<li class="kbSearchTab link"><a href="javascript:showHideByLink(\'' . $name . '\',\''. CLN_CLEAN_URL_BASE .'\')">' . $title. '</a></li>';
	}
	
	?>
	</ul>
	
	<?php 
	
	echo $this->getCoreSearchForm();
	
	echo $this->getMetadataSearchForm();
	
	?>
	
	<div class="grRow">
		<span class="grFormLabel">
			<input class="grFormElementSubmit" id="submitKbSearch" type="submit" name="submitKbSearch" value="Search" /></span>	
			<input class="grFormElementSubmit" type="submit" name="ReturnToPanel" value="<?php echo ADMIN_BTN_CANCEL_RETURN; ?>" />
	</div>

</fieldset>
<br class="anchor"/>
<?php

echo $this->getSearchResults();

echo $this->getPagingNavigation(); 

?>
<table border="0" cellpadding="2">
	<tr>
		<td><p><b>&nbsp;</b></p></td>
		<td><p><b><a href="<?php echo $href['title']; ?>">Title</a></b></p></td>
		<td><p><b><a href="<?php echo $href['type']; ?>">Type</a></b></p></td>
		<td><p><b><a href="<?php echo $href['created']; ?>">Created</a></b></p></td>
		<td><p><b><a href="<?php echo $href['modified']; ?>">Modified</a></b></p></td>
	</tr>

<?php
while ($result = $this->getNextResult()) {
	?>
	<tr>
		<td><p><input type="radio" name="kbSearchResultKoId" value="<?php echo $result->koId; ?>" /></p></td>
		<td><p><?php echo $result->title; ?></p></td>
		<td><p><?php echo $_SESSION['Module_Loader']->getModuleName($result->modId); ?></p></td>
		<td><p><?php echo date("m/d/y", $result->created); ?></p></td>
		<td><p><?php echo date("m/d/y", $result->modified); ?></p></td>
	</tr>
	<?php
}
?>

</table>

<?php
echo $this->getPagingNavigation();
?>


<span class="clnFormLine">
	<label class="clnFormLabel"  for="kbSearch"></label>
	<input class="clnFormInput" type="submit" id="kbSearch" name="kbSearch" value="Choose Selected Item" />	
	<input class="clnFormInput" type="submit" name="ReturnToPanel" value="<?php echo ADMIN_BTN_CANCEL_RETURN; ?>" />
</span>

</form>
Return current item: Community Learning Network