diff --git a/livesupport/modules/htmlUI/var/conf.php b/livesupport/modules/htmlUI/var/conf.php
index 84899adb4..28394563d 100644
--- a/livesupport/modules/htmlUI/var/conf.php
+++ b/livesupport/modules/htmlUI/var/conf.php
@@ -23,7 +23,7 @@
Author : $Author: sebastian $
- Version : $Revision: 1.19 $
+ Version : $Revision: 1.20 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/htmlUI/var/Attic/conf.php,v $
------------------------------------------------------------------------------*/
@@ -142,8 +142,9 @@ define('UI_SCRATCHPAD_MAXLENGTH_KEY', 'djBagMaxlength');
## session keys
define('UI_SCRATCHPAD_SESSNAME', 'SCRATCHPAD');
define('UI_STATIONINFO_SESSNAME', 'STATIONINFO');
-define('UI_SEARCH_SESSNAME', 'SEARCH');
+define('UI_SEARCH_SESSNAME', 'L_SEARCH');
define('UI_PLAYLIST_SESSNAME', 'PLAYLIST');
+define('UI_BROWSE_SESSNAME', 'L_BROWSE');
define('UI_MDATA_KEY_TITLE', 'dc:title');
define('UI_MDATA_KEY_ARTIST', 'dc:creator');
diff --git a/livesupport/modules/htmlUI/var/formmask/general.inc.php b/livesupport/modules/htmlUI/var/formmask/general.inc.php
index c0d7f8597..c826b2e4e 100755
--- a/livesupport/modules/htmlUI/var/formmask/general.inc.php
+++ b/livesupport/modules/htmlUI/var/formmask/general.inc.php
@@ -367,7 +367,7 @@ $ui_fmask = array(
'type' => 'select',
'label' => 'Rows per Page',
'options' => array(
- 1 => 1,
+ #1 => 1,
5 => 5,
10 => 10,
25 => 25,
@@ -378,7 +378,7 @@ $ui_fmask = array(
array(
'element' => 'clear',
'type' => 'button',
- 'label' => 'Clear',
+ 'label' => 'Reset',
'attributes' => array('onClick' => "this.form.reset(); hpopup('".UI_HANDLER."?act=SEARCH.clear', 'SF')"),
'groupit' => TRUE,
),
diff --git a/livesupport/modules/htmlUI/var/html/ui_browser.php b/livesupport/modules/htmlUI/var/html/ui_browser.php
index 461b2f789..a0d3e1c55 100644
--- a/livesupport/modules/htmlUI/var/html/ui_browser.php
+++ b/livesupport/modules/htmlUI/var/html/ui_browser.php
@@ -56,6 +56,7 @@ if ($uiBrowser->userid) {
$Smarty->assign('PLid', $uiBrowser->PLAYLIST->activeId);
$Smarty->register_object('PL', $uiBrowser->PLAYLIST);
$Smarty->register_object('BROWSE', $uiBrowser->BROWSE);
+ $Smarty->register_object('SEARCH', $uiBrowser->SEARCH);
switch ($_REQUEST['act']){
case "fileBrowse":
@@ -106,24 +107,13 @@ if ($uiBrowser->userid) {
case "SEARCH":
- if (is_array($uiBrowser->SEARCH->criteria['form']) ){
- $Smarty->assign('searchResults', $uiBrowser->SEARCH->results);
- $Smarty->assign('showSearchResults', TRUE);
- };
-
$Smarty->assign('searchForm', $uiBrowser->SEARCH->form($uiBrowser->id, $ui_fmask));
$Smarty->assign('showLibrary', TRUE);
break;
case "BROWSE":
- /*
- if (is_array($uiBrowser->SEARCH->criteria) ){
- $Smarty->assign('searchres', $uiBrowser->SEARCH->results);
- $Smarty->assign('showSearchRes', TRUE);
- }; */
-
- $Smarty->assign('browseForm', $uiBrowser->BROWSE->browseForm($uiBrowser->id, $ui_fmask));
+ $Smarty->assign('browseForm', $uiBrowser->BROWSE->browseForm($uiBrowser->id, $ui_fmask['browse']));
$Smarty->assign('showLibrary', TRUE);
break;
diff --git a/livesupport/modules/htmlUI/var/templates/library/browseForm.tpl b/livesupport/modules/htmlUI/var/templates/library/browseForm.tpl
index 158d38223..3f230a277 100755
--- a/livesupport/modules/htmlUI/var/templates/library/browseForm.tpl
+++ b/livesupport/modules/htmlUI/var/templates/library/browseForm.tpl
@@ -27,8 +27,4 @@
-
- {BROWSE->endResult assign=endResult}
- {$endResult}
-
-
\ No newline at end of file
diff --git a/livesupport/modules/htmlUI/var/templates/library/main.tpl b/livesupport/modules/htmlUI/var/templates/library/main.tpl
index bedfc1e62..718480cd6 100755
--- a/livesupport/modules/htmlUI/var/templates/library/main.tpl
+++ b/livesupport/modules/htmlUI/var/templates/library/main.tpl
@@ -2,12 +2,12 @@
{if $searchForm}
{include file="library/searchForm.tpl"}
+ {SEARCH->getResult assign=searchResults}
{/if}
-{if $showSearchResults}
- {include file="library/searchResults.tpl"}
-{/if}
-
-{if $browseForm}
+{if $browseForm}
{include file="library/browseForm.tpl"}
+ {BROWSE->getResult assign=searchResults}
{/if}
+
+{include file="library/results.tpl"}
\ No newline at end of file
diff --git a/livesupport/modules/htmlUI/var/templates/library/searchResults.tpl b/livesupport/modules/htmlUI/var/templates/library/results.tpl
similarity index 87%
rename from livesupport/modules/htmlUI/var/templates/library/searchResults.tpl
rename to livesupport/modules/htmlUI/var/templates/library/results.tpl
index 9cf56a04a..c64859f02 100755
--- a/livesupport/modules/htmlUI/var/templates/library/searchResults.tpl
+++ b/livesupport/modules/htmlUI/var/templates/library/results.tpl
@@ -1,7 +1,7 @@
{*Smarty template*}
-
+
-
+
{if $searchResults.count > 0}
@@ -22,12 +22,6 @@
{$i.creator} |
{$i.duration} |
{$i.type} |
-
{/foreach}
diff --git a/livesupport/modules/htmlUI/var/ui_browse.class.php b/livesupport/modules/htmlUI/var/ui_browse.class.php
index bd40bd5b3..8b3bd66c8 100755
--- a/livesupport/modules/htmlUI/var/ui_browse.class.php
+++ b/livesupport/modules/htmlUI/var/ui_browse.class.php
@@ -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;
}
}
diff --git a/livesupport/modules/htmlUI/var/ui_scratchpad.class.php b/livesupport/modules/htmlUI/var/ui_scratchpad.class.php
index 83e2b0b41..641c2d00e 100755
--- a/livesupport/modules/htmlUI/var/ui_scratchpad.class.php
+++ b/livesupport/modules/htmlUI/var/ui_scratchpad.class.php
@@ -66,7 +66,7 @@ class uiScratchPad
function addItem($id)
{
if(!$this->Base->STATIONPREFS[UI_SCRATCHPAD_MAXLENGTH_KEY]) {
- $this->Base->_retMsg('ScratchPad length is not set in System Preferences, so it cannot be used.');
+ if ($this->verbose) $this->Base->_retMsg('ScratchPad length is not set in System Preferences, so it cannot be used.');
return false;
}
@@ -75,7 +75,7 @@ class uiScratchPad
foreach ($sp as $key=>$val) {
if ($val['id'] == $item['id']) {
unset($sp[$key]);
- $this->Base->_retMsg('Entry $1 was already on SP since $2.\nMoved to Top.', $item['title'], $val['added']);
+ if ($this->verbose) $this->Base->_retMsg('Entry $1 was already on SP since $2.\nMoved to Top.', $item['title'], $val['added']);
} else {
#$this->Base->incAccessCounter($id);
}
@@ -97,10 +97,8 @@ class uiScratchPad
$ids = array($ids);
foreach ($ids as $id) {
- #$info = $this->Base->_getMetaInfo($id);
$sp =& $this->get();
foreach ($sp as $key=>$val) {
- #if ($val['id'] == $info['id']) {
if ($val['id'] == $id) {
unset ($sp[$key]);
#$this->Base->decAccessCounter($id);
@@ -117,20 +115,16 @@ class uiScratchPad
foreach ($this->items as $key=>$val) {
$s[$key] = $val[$by];
}
-
$curr = $this->order[$by];
$this->order = array();
(is_null($curr) || $curr=='DESC') ? $this->order[$by] = 'ASC' : $this->order[$by] = 'DESC';
-
switch($this->order[$by]) {
case "ASC": asort($s); break;
case "DESC": arsort($s); break;
}
-
foreach ($s as $key=>$val) {
$res[] = $this->items[$key];
}
-
$this->items = $res;
}
diff --git a/livesupport/modules/htmlUI/var/ui_search.class.php b/livesupport/modules/htmlUI/var/ui_search.class.php
index 69b94347a..09b905267 100755
--- a/livesupport/modules/htmlUI/var/ui_search.class.php
+++ b/livesupport/modules/htmlUI/var/ui_search.class.php
@@ -14,6 +14,12 @@ class uiSearch
$this->Base->redirUrl = $this->reloadUrl;
}
+
+ function getResult()
+ {
+ return $this->results;
+ }
+
function form($id, &$mask2)
{
include dirname(__FILE__).'/formmask/metadata.inc.php';
@@ -22,8 +28,8 @@ class uiSearch
foreach ($mask['pages'] as $key=>$val) {
foreach ($mask['pages'][$key] as $v){
- if (!$v['rule']) {
- $col1[$this->Base->_formElementEncode($v['element'])] = $v['label'];
+ if ($v['type']) {
+ $col1[$this->Base->_formElementEncode($v['element'])] = tra($v['label']);
if (isset($val['relation']))
$col2[$this->Base->_formElementEncode($v['element'])] = $mask2['relations'][$v['relation']];
else