Wbl patch
This commit is contained in:
@@ -623,6 +623,17 @@ class CmnFns {
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the 'wb_action' value
|
||||
* @param none
|
||||
* @return value
|
||||
*/
|
||||
function get_wb_action($get_name = 'wb_action') {
|
||||
// If there isnt one set, return NULL
|
||||
$result = (isset($_POST[$get_name])) ? $_POST[$get_name] : NULL;
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the 'query_string' value
|
||||
* @param none
|
||||
@@ -704,5 +715,62 @@ class CmnFns {
|
||||
echo "parent.location.href = '" . $location . "';";
|
||||
echo "</SCRIPT>";
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Generate HTML for search engine
|
||||
* @param $content_type: 'B' (attachment) or 'S' (spam)
|
||||
*/
|
||||
function rulesSearchEngine($content_type, $submit_page) {
|
||||
global $conf;
|
||||
|
||||
$fields_array = array("f" => translate('From'), "t" => translate('To'));
|
||||
|
||||
?>
|
||||
<table border=0 width="100%">
|
||||
<form action="<? echo $submit_page ?>" method="get" name="wblist">
|
||||
|
||||
<tr><td colspan=2 align="center"><? echo translate('Search for rules whose:'); ?> </td></tr>
|
||||
<tr><td align="right">
|
||||
<?
|
||||
$i = 1;
|
||||
$array_size = count($fields_array);
|
||||
foreach ($fields_array as $k => $name) {
|
||||
echo "\t\t\t$name: \n";
|
||||
echo "\t\t\t<select name='" . $k . "_criterion' class='button'>\n";
|
||||
echo "\t\t\t<option value='contains'";
|
||||
echo "contains" == CmnFns::getGlobalVar($k . '_criterion', GET) ? " selected='true'>" : ">";
|
||||
echo translate('contains') . "</option>\n";
|
||||
echo "\t\t\t<option value='not_contain'";
|
||||
echo "not_contain" == CmnFns::getGlobalVar($k . '_criterion', GET) ? " selected='true'>" : ">";
|
||||
echo translate('doesn\'t contain') . "</option>\n";
|
||||
echo "\t\t\t<option value='equals'";
|
||||
echo "equals" == CmnFns::getGlobalVar($k . '_criterion', GET) ? " selected='true'>" : ">";
|
||||
echo translate('equals') . "</option>\n";
|
||||
echo "\t\t\t<option value='not_equal'";
|
||||
echo "not_equal" == CmnFns::getGlobalVar($k . '_criterion', GET) ? " selected='true'>" : ">";
|
||||
echo translate('doesn\'t equal') . "</option>\n";
|
||||
echo "\t\t\t</select>\n";
|
||||
echo "\t\t\t<input type='text' name='" . $k . "_string' size='20' value='"
|
||||
. CmnFns::getGlobalVar($k . '_string', GET) . "' />\n";
|
||||
echo ($i % 2) ? "\t\t\t </td>\n\t\t\t<td align='left'> \n" : "\t\t\t </td></tr>\n\t\t\t<tr><td align='right'> \n";
|
||||
$i ++;
|
||||
}
|
||||
|
||||
$i ++;
|
||||
echo ($i % 2) ? " </td></tr>\n\t\t\t<tr><td colspan='2' align='center'> \n" : " </td><td align='left'> ";
|
||||
?>
|
||||
<input type="submit" class="button" name="search_action" value="<? echo translate('Search'); ?>" />
|
||||
<? if (CmnFns::didSearch())
|
||||
echo "<input type=\"submit\" class=\"button\" name=\"search_action\" value=\"" . translate('Clear search results') . "\" />";
|
||||
?>
|
||||
</td></tr>
|
||||
</form>
|
||||
</table>
|
||||
<?
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user