*** empty log message ***

This commit is contained in:
sebastian 2005-03-02 12:59:54 +00:00
parent 4dc37a1c9c
commit 36f6ca0b06
9 changed files with 60 additions and 67 deletions

View file

@ -8,10 +8,10 @@ class uiBrowse
$this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
if (!is_array($this->col)) {
$this->col[1]['category'] = 'dc:title';
$this->col[2]['category'] = 'dc:creator';
$this->col[3]['category'] = 'dc:source';
$this->setCategory(array('col' => 1, 'category' => $this->col[1]['category']));
#$this->col[1]['category'] = 'dc:genre';
#$this->col[2]['category'] = 'dc:creator';
#$this->col[3]['category'] = 'dc:title';
#$this->setCategory(array('col' => 1, 'category' => $this->col[1]['category']));
}
#print_r($this->col);
}
@ -26,18 +26,19 @@ class uiBrowse
function browseForm($id, $mask2)
{
include dirname(__FILE__).'/formmask/metadata.inc.php';
$mask2['category']['options'][0] = tra('Select a Value');
foreach ($mask['pages'] as $key=>$val) {
foreach ($mask['pages'][$key] as $v){
if (!$v['rule']) $mask2['browse']['category']['options'][$this->Base->_formElementEncode($v['element'])] = $v['label'];
if ($v['type']) $mask2['category']['options'][$this->Base->_formElementEncode($v['element'])] = tra($v['label']);
}
};
for($n=1; $n<=3; $n++) {
$form = new HTML_QuickForm('col'.$n, UI_STANDARD_FORM_METHOD, UI_HANDLER);
$form->setConstants(array('id' => $id, 'col' => $n, 'category' => $this->Base->_formElementEncode($this->col[$n]['category'])));
$mask2['browse']['value']['options'] = $this->_options($this->col[$n]['values']['results']);
$mask2['browse']['value']['default'] = $this->col[$n]['form_value'];
$this->Base->_parseArr2Form($form, $mask2['browse']);
$mask2['value']['options'] = $this->_options($this->col[$n]['values']['results']);
$mask2['value']['default'] = $this->col[$n]['form_value'];
$this->Base->_parseArr2Form($form, $mask2);
$form->validate();
$renderer =& new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer);
@ -68,13 +69,17 @@ class uiBrowse
if ($formdata['value'][0] == '%%all%%') {
$this->col[$next]['criteria'] = NULL;
} else {
$this->col[$next]['criteria'] = array('conditions' =>
array(
array('cat' => $this->Base->_formElementDecode($formdata['category']),
'op' => '=',
'val' => $formdata['value'][0]
)
)
$this->col[$next]['criteria'] = array(
'operator' => 'and',
'conditions' =>
array_merge($this->col[$which]['criteria']['conditions'],
array(
array('cat' => $this->Base->_formElementDecode($formdata['category']),
'op' => '=',
'val' => $formdata['value'][0]
)
)
)
);
}
$this->col[$next]['values'] = $this->Base->gb->browseCategory($this->col[$next]['category'], $this->col[$next]['criteria'], $this->Base->sessid);
@ -102,22 +107,29 @@ class uiBrowse
{
$this->col[$which]['form_value'] = NULL;
$which++;
for ($col=$which; $col<=3; $col++) {
#$this->col[$col]['criteria'] = NULL;
for ($col=$which; $col<=4; $col++) {
$this->col[$col]['criteria'] = NULL;
$this->col[$col]['values'] = NULL;
$this->col[$col]['form_value'] = NULL;
}
}
function endResult()
function getResult()
{
for($col=1; $col<=3; $col++) {
#print_r($this->col[$col]);
for($col=4; $col>=1; $col--) {
if (is_array($this->col[$col]['criteria'])) {
#echo $col; print_r($this->col[$col]['criteria']);
break;
}
}
#$this->result = $this->Base->gb->localSearch($this->col[3]['criteria'], $this->Base->sessid);
#print_r($this->result);
$results = $this->Base->gb->localSearch($this->col[$col]['criteria'], $this->Base->sessid);
$this->results['count'] = $results['cnt'];
foreach ($results['results'] as $rec) {
$this->results['items'][] = $this->Base->_getMetaInfo($this->Base->gb->_idFromGunid($rec));
}
#print_r($this->results);
return $this->results;
}
}