*** empty log message ***
This commit is contained in:
parent
81662c2b41
commit
9dd294a34d
30 changed files with 457 additions and 183 deletions
|
@ -29,6 +29,7 @@ class uiSearch
|
|||
|
||||
function searchForm($id, &$mask2)
|
||||
{
|
||||
#print_r($this->criteria['form']);
|
||||
include dirname(__FILE__).'/formmask/metadata.inc.php';
|
||||
$form = new HTML_QuickForm('search', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
||||
$form->setConstants(array('id'=>$id, 'counter'=>$this->criteria['counter'] ? $this->criteria['counter'] : UI_SEARCH_MIN_ROWS));
|
||||
|
@ -86,25 +87,74 @@ class uiSearch
|
|||
$this->criteria['counter']++;
|
||||
$this->criteria['conditions'][$key] = array('cat' => $this->Base->_formElementDecode($val[0]),
|
||||
'op' => $val[1],
|
||||
'val' => stripslashes($val[2]));
|
||||
'val' => stripslashes($val[2])
|
||||
);
|
||||
$this->criteria['form'][$key] = array(0 => $val[0],
|
||||
1 => $val[1],
|
||||
2 => stripslashes($val[2]));
|
||||
2 => stripslashes($val[2])
|
||||
);
|
||||
}
|
||||
}
|
||||
$this->Base->redirUrl = UI_BROWSER.'?act=SEARCH';
|
||||
$this->searchDB();
|
||||
}
|
||||
|
||||
|
||||
function simpleSearchForm(&$mask)
|
||||
{
|
||||
$form = new HTML_QuickForm('simplesearch', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
||||
$this->Base->_parseArr2Form($form, $mask);
|
||||
$renderer =& new HTML_QuickForm_Renderer_Array(true, true);
|
||||
$form->accept($renderer);
|
||||
$output = $renderer->toArray();
|
||||
#print_r($output);
|
||||
return $output;
|
||||
|
||||
}
|
||||
|
||||
|
||||
function simpleSearch(&$formdata)
|
||||
{
|
||||
$this->results = NULL;
|
||||
$this->criteria['conditions'] = NULL;
|
||||
$this->criteria['offset'] = NULL;
|
||||
|
||||
$this->criteria['operator'] = UI_SIMPLESEARCH_FILETYPE;
|
||||
$this->criteria['filetype'] = UI_SIMPLESEARCH_OPERATOR;
|
||||
$this->criteria['limit'] = UI_SIMPLESEARCH_LIMIT;
|
||||
$this->criteria['counter'] = UI_SIMPLESEARCH_ROWS;
|
||||
$this->criteria['form']['operator'] = 'OR'; ## $criteria['form'] is used for retransfer to form ##
|
||||
$this->criteria['form']['filetype'] = 'File';
|
||||
$this->criteria['form']['limit'] = 5;
|
||||
|
||||
for ($n = 1; $n<=UI_SIMPLESEARCH_ROWS; $n++) {
|
||||
$this->criteria['conditions'][$n] = array('cat' => constant('UI_SIMPLESEARCH_CAT'.$n),
|
||||
'op' => constant('UI_SIMPLESEARCH_OP'.$n),
|
||||
'val' => stripslashes($formdata['criterium'])
|
||||
);
|
||||
$this->criteria['form']['row_'.$n] = array(0 => $this->Base->_formElementEncode(constant('UI_SIMPLESEARCH_CAT'.$n)),
|
||||
1 => constant('UI_SIMPLESEARCH_OP'.$n),
|
||||
2 => stripslashes($formdata['criterium'])
|
||||
);
|
||||
}
|
||||
$this->Base->redirUrl = UI_BROWSER.'?act=SEARCH';
|
||||
$this->searchDB();
|
||||
}
|
||||
|
||||
|
||||
function searchDB()
|
||||
{
|
||||
$this->results = array('page' => $this->criteria['offset']/$this->criteria['limit']);
|
||||
#print_r($this->criteria);
|
||||
$results = $this->Base->gb->localSearch($this->criteria, $this->Base->sessid);
|
||||
if (PEAR::isError($results)) {
|
||||
#print_r($results);
|
||||
return FALSE;
|
||||
}
|
||||
foreach ($results['results'] as $rec) {
|
||||
$this->results['items'][] = $this->Base->_getMetaInfo($this->Base->gb->_idFromGunid($rec));
|
||||
}
|
||||
$this->results['cnt'] = $results['cnt'];
|
||||
#print_r($this->criteria);
|
||||
#print_r($this->results);
|
||||
$this->pagination($results);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue