phpldapadmin/lib/search_form_simple.php

82 lines
2.6 KiB
PHP
Raw Normal View History

2009-06-30 09:22:30 +00:00
<?php
2009-06-30 11:46:44 +00:00
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/search_form_simple.php,v 1.16.2.2 2007/12/26 09:26:33 wurley Exp $
2009-06-30 09:29:51 +00:00
/**
* @package phpLDAPadmin
*/
?>
2009-06-30 10:26:08 +00:00
<script type="text/javascript" language="javascript">
2009-06-30 10:46:00 +00:00
function focus_filter() {
document.simple_search_form.filter.focus();
}
2009-06-30 09:22:30 +00:00
</script>
2009-06-30 10:46:00 +00:00
<form action="cmd.php" method="get" class="search" name="simple_search_form">
<input type="hidden" name="cmd" value="search" />
2009-06-30 08:05:37 +00:00
<input type="hidden" name="search" value="true" />
<input type="hidden" name="form" value="simple" />
<input type="hidden" name="scope" value="sub" />
2009-06-30 10:46:00 +00:00
<input type="hidden" name="format" value="<?php echo $entry['format']; ?>" />
2009-06-30 08:05:37 +00:00
2009-06-30 10:46:00 +00:00
<table class="search" border=0>
<tr><td class="title"><?php echo _('Simple Search Form'); ?></td></tr>
2009-06-30 09:29:51 +00:00
2009-06-30 10:46:00 +00:00
<?php
2009-06-30 11:46:44 +00:00
$as = $_SESSION[APPCONFIG]->isCommandAvailable('search', 'advanced_search');
$ps = $_SESSION[APPCONFIG]->isCommandAvailable('search', 'predefined_search');
2009-06-30 10:46:00 +00:00
if ($as | $ps) {
echo '<tr><td class="subtitle">(';
if ($as) {
echo '<a href="cmd.php?cmd=search&amp;server_id=';
echo $ldapserver->server_id;
echo '&amp;form=advanced">';
echo _('Advanced Search Form');
echo '</a>';
if ($ps) echo ' | ';
}
if ($ps) {
echo '<a href="cmd.php?cmd=search&amp;server_id=';
echo $ldapserver->server_id;
echo '&amp;form=predefined">';
echo _('Predefined Searches');
echo '</a>';
}
echo ')</td></tr>';
}
?>
2009-06-30 09:29:51 +00:00
2009-06-30 10:46:00 +00:00
<tr><td>&nbsp;</td></tr>
<tr><td><small><b><?php echo _('Server'); ?></b></small><br /> <?php echo $server_menu_html; ?><br /></td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td><small><b><?php echo _('Search for entries whose'); ?></b></small></td></tr>
<tr><td>
2009-06-30 09:29:51 +00:00
<select name="attribute">
2009-06-30 11:46:44 +00:00
<?php foreach ($_SESSION[APPCONFIG]->GetValue('search','attributes') as $id => $attribute) { ?>
2009-06-30 10:46:00 +00:00
<option value="<?php echo rawurlencode($attribute); ?>"<?php echo $attribute==$entry['attr']?' selected="true"':''; ?>>
2009-06-30 11:46:44 +00:00
<?php echo htmlspecialchars($_SESSION[APPCONFIG]->getFriendlyName($attribute)); ?>
2009-06-30 09:29:51 +00:00
</option>
<?php } ?>
</select>
<select name="criterion">
2009-06-30 10:26:08 +00:00
<?php
2009-06-30 11:46:44 +00:00
foreach ($_SESSION[APPCONFIG]->GetValue('search','criteria_options') as $c) { ?>
2009-06-30 10:46:00 +00:00
<option value="<?php echo $c; ?>"<?php echo $c==$entry['criterion']?' selected="true"':''; ?>>
2009-06-30 10:26:08 +00:00
<?php echo htmlspecialchars(_($c)); ?>
2009-06-30 09:29:51 +00:00
</option>
2009-06-30 10:46:00 +00:00
<?php } ?>
2009-06-30 09:29:51 +00:00
</select>
2009-06-30 10:46:00 +00:00
<input type="text" name="filter" id="filter" size="20" value="<?php echo htmlspecialchars($entry['filter']['clean']); ?>" />
</td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td><center><input type="submit" value="<?php echo _('Search'); ?>" /></center></td></tr>
2009-06-30 08:05:37 +00:00
</table>
</form>
2009-06-30 09:29:51 +00:00
2009-06-30 10:26:08 +00:00
<script type="text/javascript" language="javascript">
2009-06-30 10:46:00 +00:00
// Move the cursor to the filter field
focus_filter();
2009-06-30 09:22:30 +00:00
</script>