From 5fc8fb9d42c7a6720dca3618027e77352ab31599 Mon Sep 17 00:00:00 2001 From: sebastian Date: Wed, 23 Feb 2005 22:57:14 +0000 Subject: [PATCH] *** empty log message *** --- .../modules/htmlUI/var/Smarty/ChangeLog | 2 +- .../var/Smarty/libs/Config_File.class.php | 2 +- .../htmlUI/var/Smarty/libs/Smarty.class.php | 2 +- .../var/Smarty/libs/Smarty_Compiler.class.php | 2 +- livesupport/modules/htmlUI/var/conf.php | 25 ++++-- .../modules/htmlUI/var/html/styles.css | 3 +- .../modules/htmlUI/var/html/ui_browser.php | 6 +- .../modules/htmlUI/var/html/ui_handler.php | 8 +- .../examples/smarty-dynamic-fancygroup.tpl | 2 +- .../examples/smarty-dynamic-green.tpl | 2 +- .../var/templates/examples/smarty-dynamic.tpl | 2 +- .../var/templates/fileBrowse/objects.tpl | 59 ++++++------ .../modules/htmlUI/var/templates/header.tpl | 1 - .../htmlUI/var/templates/masterpanel.tpl | 2 +- .../var/templates/popup/_reload_parent.tpl | 1 - .../templates/script/myKontextMenue.js.tpl | 89 ++++++++++++------- .../htmlUI/var/templates/search/results.tpl | 41 +++++++-- .../modules/htmlUI/var/ui_base.inc.php | 6 +- .../modules/htmlUI/var/ui_handler.class.php | 8 +- .../modules/htmlUI/var/ui_search.class.php | 41 +++++++-- 20 files changed, 201 insertions(+), 103 deletions(-) diff --git a/livesupport/modules/htmlUI/var/Smarty/ChangeLog b/livesupport/modules/htmlUI/var/Smarty/ChangeLog index 605fe239d..ddb96d346 100644 --- a/livesupport/modules/htmlUI/var/Smarty/ChangeLog +++ b/livesupport/modules/htmlUI/var/Smarty/ChangeLog @@ -2979,7 +2979,7 @@ * libs/Smarty.class.php libs/Smarty_Compiler.class.php: - added CVS $Id: ChangeLog,v 1.1 2005/02/23 13:07:34 sebastian Exp $ + added CVS $Id: ChangeLog,v 1.2 2005/02/23 22:57:14 sebastian Exp $ 2003-03-31 Messju Mohr diff --git a/livesupport/modules/htmlUI/var/Smarty/libs/Config_File.class.php b/livesupport/modules/htmlUI/var/Smarty/libs/Config_File.class.php index fa8de012b..1e2e960aa 100644 --- a/livesupport/modules/htmlUI/var/Smarty/libs/Config_File.class.php +++ b/livesupport/modules/htmlUI/var/Smarty/libs/Config_File.class.php @@ -25,7 +25,7 @@ * @package Smarty */ -/* $Id: Config_File.class.php,v 1.1 2005/02/23 13:04:59 sebastian Exp $ */ +/* $Id: Config_File.class.php,v 1.2 2005/02/23 22:57:14 sebastian Exp $ */ /** * Config file reading class diff --git a/livesupport/modules/htmlUI/var/Smarty/libs/Smarty.class.php b/livesupport/modules/htmlUI/var/Smarty/libs/Smarty.class.php index 44bdbb518..bebf28c16 100755 --- a/livesupport/modules/htmlUI/var/Smarty/libs/Smarty.class.php +++ b/livesupport/modules/htmlUI/var/Smarty/libs/Smarty.class.php @@ -30,7 +30,7 @@ * @version 2.6.6 */ -/* $Id: Smarty.class.php,v 1.1 2005/02/23 13:04:59 sebastian Exp $ */ +/* $Id: Smarty.class.php,v 1.2 2005/02/23 22:57:14 sebastian Exp $ */ /** * DIR_SEP isn't used anymore, but third party apps might diff --git a/livesupport/modules/htmlUI/var/Smarty/libs/Smarty_Compiler.class.php b/livesupport/modules/htmlUI/var/Smarty/libs/Smarty_Compiler.class.php index 53461ffe0..ac6524c05 100644 --- a/livesupport/modules/htmlUI/var/Smarty/libs/Smarty_Compiler.class.php +++ b/livesupport/modules/htmlUI/var/Smarty/libs/Smarty_Compiler.class.php @@ -26,7 +26,7 @@ * @package Smarty */ -/* $Id: Smarty_Compiler.class.php,v 1.1 2005/02/23 13:04:59 sebastian Exp $ */ +/* $Id: Smarty_Compiler.class.php,v 1.2 2005/02/23 22:57:14 sebastian Exp $ */ /** * Template compiling class diff --git a/livesupport/modules/htmlUI/var/conf.php b/livesupport/modules/htmlUI/var/conf.php index c1e5ad8b7..35a690dd3 100644 --- a/livesupport/modules/htmlUI/var/conf.php +++ b/livesupport/modules/htmlUI/var/conf.php @@ -23,13 +23,19 @@ Author : $Author: sebastian $ - Version : $Revision: 1.13 $ + Version : $Revision: 1.14 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/htmlUI/var/Attic/conf.php,v $ ------------------------------------------------------------------------------*/ +/** + * \file conf.php + * storageServer configuration file + */ + /** * configuration structure: + * *
*
dsn
datasource setting *
tblNamePrefix
prefix for table names in the database @@ -38,6 +44,7 @@ *
bufferDir
directory for temporary files *
transDir
directory for incomplete transferred files *
accessDir
directory for symlinks to accessed files + *
isArchive
local/central flag *
storageUrlPath
path-URL-part of storageServer base dir *
storageXMLRPC
XMLRPC server script address relative to storageUrlPath *
storageUrlHost, storageUrlPort
host and port of storageServer @@ -57,14 +64,13 @@ $config = array( ), 'tblNamePrefix' => 'ls_', 'authCookieName'=> 'lssid', - #'storageDir' => dirname(getcwd()).'/stor', - #'bufferDir' => dirname(getcwd()).'/stor/buffer', - #'transDir' => dirname(getcwd()).'/trans', - #'accessDir' => dirname(getcwd()).'/access', + 'StationPrefsGr'=> 'StationPrefs', + 'AllGr' => 'All', 'storageDir' => dirname(__FILE__).'/../../storageServer/var/stor', 'bufferDir' => dirname(__FILE__).'/../../storageServer/var/stor/buffer', 'transDir' => dirname(__FILE__).'/../../storageServer/var/trans', 'accessDir' => dirname(__FILE__).'/../../storageServer/var/access', + 'isArchive' => FALSE, /* ==================================================== URL configuration */ 'storageUrlPath' => '/livesupportStorageServer', @@ -80,6 +86,13 @@ $config = array( 'archiveAccountLogin' => 'root', 'archiveAccountPass' => 'q', + /* ============================================== scheduler configuration */ + 'schedulerUrlPath' => '', + 'schedulerXMLRPC' => 'RC2', + 'schedulerUrlHost' => 'localhost', + 'schedulerUrlPort' => 3344, + + /* ==================================== aplication-specific configuration */ 'objtypes' => array( 'RootNode' => array('Folder'), 'Storage' => array('Folder', 'File', 'Replica'), @@ -108,8 +121,6 @@ $config = array( ); - - define('UI_HANDLER', 'ui_handler.php'); define('UI_BROWSER', 'ui_browser.php'); define('UI_FORM_STANDARD_METHOD', 'POST'); diff --git a/livesupport/modules/htmlUI/var/html/styles.css b/livesupport/modules/htmlUI/var/html/styles.css index d09db6e97..9494a5964 100755 --- a/livesupport/modules/htmlUI/var/html/styles.css +++ b/livesupport/modules/htmlUI/var/html/styles.css @@ -50,8 +50,7 @@ } #scratchpad { - text-align: center; - width: 300px; + width: 400px; border-style : dotted; padding : 5px; margin-top: 10px; diff --git a/livesupport/modules/htmlUI/var/html/ui_browser.php b/livesupport/modules/htmlUI/var/html/ui_browser.php index 1bb3a40f8..ad204a706 100644 --- a/livesupport/modules/htmlUI/var/html/ui_browser.php +++ b/livesupport/modules/htmlUI/var/html/ui_browser.php @@ -12,6 +12,10 @@ if (is_array($_REQUEST['popup'])){ $Smarty->display('popup/_close.tpl'); break; + case "_clear_parent": + $Smarty->display('popup/_clear_parent.tpl'); + break; + case "login": $Smarty->assign('login', $uiBrowser->login($Smarty, $ui_fmask)); $Smarty->display('popup/login.tpl'); @@ -91,7 +95,7 @@ if ($uiBrowser->userid) { case "SEARCH": if (is_array($uiBrowser->SEARCH->criteria) ){ - $Smarty->assign('searchres', $uiBrowser->SEARCH->results); + $Smarty->assign('searchres', $uiBrowser->SEARCH->results); $Smarty->assign('showSearchRes', TRUE); }; diff --git a/livesupport/modules/htmlUI/var/html/ui_handler.php b/livesupport/modules/htmlUI/var/html/ui_handler.php index 26876ab81..9a88eca80 100644 --- a/livesupport/modules/htmlUI/var/html/ui_handler.php +++ b/livesupport/modules/htmlUI/var/html/ui_handler.php @@ -1,4 +1,4 @@ -SEARCH->clear($_REQUEST); + $uiHandler->SEARCH->clear(); + break; + + case "SEARCH.setOffset": + $uiHandler->SEARCH->setOffset($_REQUEST['page']); break; case "activatePL": diff --git a/livesupport/modules/htmlUI/var/templates/examples/smarty-dynamic-fancygroup.tpl b/livesupport/modules/htmlUI/var/templates/examples/smarty-dynamic-fancygroup.tpl index a23bd5e1d..e7b9f7c7a 100644 --- a/livesupport/modules/htmlUI/var/templates/examples/smarty-dynamic-fancygroup.tpl +++ b/livesupport/modules/htmlUI/var/templates/examples/smarty-dynamic-fancygroup.tpl @@ -1,4 +1,4 @@ - + diff --git a/livesupport/modules/htmlUI/var/templates/examples/smarty-dynamic-green.tpl b/livesupport/modules/htmlUI/var/templates/examples/smarty-dynamic-green.tpl index 344ddb664..2b35355f4 100644 --- a/livesupport/modules/htmlUI/var/templates/examples/smarty-dynamic-green.tpl +++ b/livesupport/modules/htmlUI/var/templates/examples/smarty-dynamic-green.tpl @@ -1,4 +1,4 @@ - + {$element.label}: diff --git a/livesupport/modules/htmlUI/var/templates/examples/smarty-dynamic.tpl b/livesupport/modules/htmlUI/var/templates/examples/smarty-dynamic.tpl index 5fc278e6b..89d8f1a40 100644 --- a/livesupport/modules/htmlUI/var/templates/examples/smarty-dynamic.tpl +++ b/livesupport/modules/htmlUI/var/templates/examples/smarty-dynamic.tpl @@ -1,5 +1,5 @@ - + Smarty template for Array renderer diff --git a/livesupport/modules/htmlUI/var/templates/fileBrowse/objects.tpl b/livesupport/modules/htmlUI/var/templates/fileBrowse/objects.tpl index bf7d1efca..648465f32 100755 --- a/livesupport/modules/htmlUI/var/templates/fileBrowse/objects.tpl +++ b/livesupport/modules/htmlUI/var/templates/fileBrowse/objects.tpl @@ -10,44 +10,51 @@ {if $GLOBALS.pid}[go up]{/if} - {foreach from=$structure.listdata item=o} - + {foreach from=$structure.listdata item=i} + - - {if $o.type eq 'Folder'} - [{$o.title}] + + {if $i.type eq 'Folder'} + [{$i.title}] {else} - {$o.title} + {$i.title} {/if} - {$o.type} + {$i.type} -  [rename] -  [move] -  [copy] -  [permissions] +  [rename] +  [move] +  [copy] +  [permissions]
  - {if ($delOverride eq $o.id)} - [DEL] + {if ($delOverride eq $i.id)} + [DEL] {else} - [DEL] + [DEL] {/if} - {if $o.type != 'Folder'} -  [Access] -  [vMData] -  [Analyze] + {if $i.type != 'Folder'} +  [Access] +  [vMData] +  [Analyze]   - {if $o.type eq 'webstream'} - [Replace] - {elseif $o.type eq 'audioclip'} - [Replace] + {if $i.type eq 'webstream'} + [Replace] + {elseif $i.type eq 'audioclip'} + [Replace] {/if} -  [eMData] -  [SP] +  [eMData] +  [SP] {/if}   diff --git a/livesupport/modules/htmlUI/var/templates/header.tpl b/livesupport/modules/htmlUI/var/templates/header.tpl index da10f10b8..bf2f9f2b2 100755 --- a/livesupport/modules/htmlUI/var/templates/header.tpl +++ b/livesupport/modules/htmlUI/var/templates/header.tpl @@ -6,7 +6,6 @@ {include file="script/basics.js.tpl"} {include file="script/myKontextMenue.js.tpl"} - \ No newline at end of file diff --git a/livesupport/modules/htmlUI/var/templates/masterpanel.tpl b/livesupport/modules/htmlUI/var/templates/masterpanel.tpl index 2d17baf9a..a45268668 100755 --- a/livesupport/modules/htmlUI/var/templates/masterpanel.tpl +++ b/livesupport/modules/htmlUI/var/templates/masterpanel.tpl @@ -9,7 +9,7 @@ {/if} {if $SCRATCHPAD} - {include file="ScratchPad.tpl"} + {include file="scratchPad.tpl"} {/if} {if $structure} diff --git a/livesupport/modules/htmlUI/var/templates/popup/_reload_parent.tpl b/livesupport/modules/htmlUI/var/templates/popup/_reload_parent.tpl index b5884b830..4bfa6f32f 100644 --- a/livesupport/modules/htmlUI/var/templates/popup/_reload_parent.tpl +++ b/livesupport/modules/htmlUI/var/templates/popup/_reload_parent.tpl @@ -1,4 +1,3 @@ diff --git a/livesupport/modules/htmlUI/var/templates/script/myKontextMenue.js.tpl b/livesupport/modules/htmlUI/var/templates/script/myKontextMenue.js.tpl index 3434f3f47..617a3ff04 100755 --- a/livesupport/modules/htmlUI/var/templates/script/myKontextMenue.js.tpl +++ b/livesupport/modules/htmlUI/var/templates/script/myKontextMenue.js.tpl @@ -5,39 +5,50 @@ // Nur für IE 5+ und NN 6+ ie5=(document.getElementById && document.all && document.styleSheets)?1:0; nn6=(document.getElementById && !document.all)?1:0; - -function initMenu(id, type) { - if (ie5 || nn6) { - menuWidth = 0, - menuHeight = 0; - //menuStatus = 0; - - sp2="  "; - sp5=sp2+sp2+" "; // Leerzeichen als Abstandshalter (flexibler und code-sparender als eine aufwendige Tabellenkonstruktion) - oF="onfocus='if(this.blur)this.blur()'"; // Um hässlichen Linkrahmen in einigen Browsern zu vermeiden - - if (type == 'playlist') - document.getElementById('menucontainer').innerHTML = - ""; - else - document.getElementById('menucontainer').innerHTML = - ""; - } -} - - menuStatus = 0; -document.onmousedown = hideMenu; +document.onmouseup = hideMenu; +document.write(''); +menuWidth = 0, +menuHeight = 0; + +function menu(id) { + var menuHeader = ""; + var menuHtml = ''; + var sp2 = "  "; + var sp5 = sp2+sp2+" "; // Leerzeichen als Abstandshalter (flexibler und code-sparender als eine aufwendige Tabellenkonstruktion) ; + var oF = "onfocus='if(this.blur)this.blur()'"; // Um hässlichen Linkrahmen in einigen Browsern zu vermeiden; + var entry = new Array(); + //menuStatus = 0; + + for (var i = 1; i < menu.arguments.length; ++i) { + switch (menu.arguments[i]) { + case "PL.activate": + menuHtml = menuHtml + "  Activate this Playlist  "; + break; + case "PL.display": + menuHtml = menuHtml + "  Display this Playlist  "; + break; + case "PL.addItem": + menuHtml = menuHtml + "  Add File to Playlist  "; + break; + case "PL.newUsingItem": + menuHtml = menuHtml + "  New Playlist using File  "; + break; + case "SP.addItem": + menuHtml = menuHtml + "  Add File to ScratchPad  "; + break; + case "SP.removeItem": + menuHtml = menuHtml + "  Remove  "; + break; + case "delete": + menuHtml = menuHtml + "  !Delete File!  "; + break; + } + } + document.getElementById('menucontainer').innerHTML = menuHeader + menuHtml + menuFooter; -function contextmenu(id, type){ - initMenu(id, type); document.oncontextmenu = showMenu; return false; } @@ -69,14 +80,24 @@ function hideMenu(e) { menuStatus=0; } } + +var passed=false; +function highlight() +{ + //if (!passed) alert('try rightclick in lists...'); + passed = true; +} + +function darklight() +{ + +} - - - {/literal} diff --git a/livesupport/modules/htmlUI/var/templates/search/results.tpl b/livesupport/modules/htmlUI/var/templates/search/results.tpl index b83ed0a22..e587b5273 100755 --- a/livesupport/modules/htmlUI/var/templates/search/results.tpl +++ b/livesupport/modules/htmlUI/var/templates/search/results.tpl @@ -3,7 +3,7 @@
-{if is_array($searchres)} +{if $searchres.count > 0} @@ -11,20 +11,43 @@ - {foreach from=$searchres item=s} - - - - - + {foreach from=$searchres.items item=i} + + + + + {/foreach} + + + + + + +
{tra 0=Title}{tra 0=Duration} {tra 0=Type}
{$s.title}{$s.creator}{$s.duration}{$s.type}
{$i.title}{$i.creator}{$i.duration}{$i.type}
+ {if $searchres.prev}back{/if} + count: {$searchres.count} + go: + {foreach from=$searchres.pages item=p key=k} + {$p} + {/foreach} + + {if $searchres.next}forward{/if} +
{else} No match found. diff --git a/livesupport/modules/htmlUI/var/ui_base.inc.php b/livesupport/modules/htmlUI/var/ui_base.inc.php index 421f4d6a0..5a8efea57 100644 --- a/livesupport/modules/htmlUI/var/ui_base.inc.php +++ b/livesupport/modules/htmlUI/var/ui_base.inc.php @@ -230,19 +230,21 @@ class uiBase { $ia = $this->gb->analyzeFile($id, $this->sessid); $s = $ia['playtime_seconds']; + $extent = date('H:i:s', floor($s)-date('Z')).substr(number_format($s, 6), strpos(number_format($s, 6), '.')); if ($format=='array') { return array( - 'Format.Extent' => date('H:i:s', round($s)-date('Z')).substr(number_format($s, 6), strpos(number_format($s, 6), '.')), + 'Format.Extent' => $extent, 'Format.Medium.Bitrate' => $ia['audio']['bitrate'], 'Format.Medium.Channels' => $ia['audio']['channelmode'], 'Format.Medium.Samplerate' => $ia['audio']['sample_rate'], 'Format.Medium.Encoder' => $ia['audio']['codec'] ? $ia['audio']['codec'] : $ia['audio']['encoder'], ); } elseif ($format=='text') { + #print_r($ia); return "fileformat: {$ia['fileformat']}
seconds: {$ia['playtime_seconds']}
- length: ".date('H:i:s', round($s)-date('Z')).substr(number_format($s, 6), strpos(number_format($s, 6), '.'))."
+ length: $extent
channels: {$ia['audio']['channels']}
sample_rate: {$ia['audio']['sample_rate']}
bits_per_sample: {$ia['audio']['bits_per_sample']}
diff --git a/livesupport/modules/htmlUI/var/ui_handler.class.php b/livesupport/modules/htmlUI/var/ui_handler.class.php index 242490864..2856ee3f9 100644 --- a/livesupport/modules/htmlUI/var/ui_handler.class.php +++ b/livesupport/modules/htmlUI/var/ui_handler.class.php @@ -38,12 +38,14 @@ class uiHandler extends uiBase { */ function login(&$formdata, &$mask) { + session_destroy(); + session_start(); if ($this->_validateForm($formdata, $mask)) { $sessid = $this->gb->login($formdata['login'], $formdata['pass']); if($sessid && !PEAR::isError($sessid)){ setcookie($this->config['authCookieName'], $sessid); $id = $this->gb->getObjId($formdata['login'], $this->gb->storId); - if(!PEAR::isError($id)) $this->redirUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close'; + if(!PEAR::isError($id)) $this->redirUrl = UI_BROWSER.'?popup[]=_clear_parent&popup[]=_close'; }else{ $this->_retMsg('Login failed.'); $_SESSION['retransferFormData']['login']=$formdata['login']; @@ -67,8 +69,8 @@ class uiHandler extends uiBase { session_destroy(); if ($trigger_login) - $this->redirUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=login'; - else $this->redirUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close'; + $this->redirUrl = UI_BROWSER.'?popup[]=_clear_parent&popup[]=login'; + else $this->redirUrl = UI_BROWSER.'?popup[]=_clear_parent&popup[]=_close'; } // --- files --- diff --git a/livesupport/modules/htmlUI/var/ui_search.class.php b/livesupport/modules/htmlUI/var/ui_search.class.php index 7c046f982..23fe02ac8 100755 --- a/livesupport/modules/htmlUI/var/ui_search.class.php +++ b/livesupport/modules/htmlUI/var/ui_search.class.php @@ -7,6 +7,7 @@ class uiSearch $this->results =& $_SESSION[UI_SEARCH_SESSNAME]['results']; $this->criteria =& $_SESSION[UI_SEARCH_SESSNAME]['criteria']; $this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close'; + $this->criteria['limit'] = 3; } function setReload() @@ -54,8 +55,9 @@ class uiSearch function newsearch(&$formdata) { - $this->results = NULL; - $this->criteria = NULL; + $this->results = NULL; + $this->criteria['conditions'] = NULL; + $this->criteria['offset'] = NULL; $this->criteria['operator'] = $formdata['operator']; $this->criteria['filetype'] = $formdata['filetype']; @@ -66,10 +68,10 @@ class uiSearch if (is_array($val) && strlen($val[2])) { $this->criteria['conditions'][$key] = array('cat' => $this->Base->_formElementDecode($val[0]), 'op' => $val[1], - 'val' => $val[2]); + 'val' => stripslashes($val[2])); $this->criteria['form'][$key] = array(0 => $this->Base->_formElementDecode($val[0]), 1 => $val[1], - 2 => $val[2]); + 2 => stripslashes($val[2])); } } $this->Base->redirUrl = UI_BROWSER.'?act=SEARCH'; @@ -78,20 +80,29 @@ class uiSearch function searchDB() { + $this->results = NULL; #print_r($this->criteria); $results = $this->Base->gb->localSearch($this->criteria, $this->Base->sessid); foreach ($results['results'] as $rec) { - $this->results[] = $this->Base->_getMetaInfo($this->Base->gb->_idFromGunid($rec)); + $this->results['items'][] = $this->Base->_getMetaInfo($this->Base->gb->_idFromGunid($rec)); + } + $this->results['count'] = $results['cnt']; + $this->results['next'] = $results['cnt'] > $this->criteria['offset'] + $this->criteria['limit'] ? TRUE : FALSE; + $this->results['prev'] = $this->criteria['offset'] > 0 ? TRUE : FALSE; + for ($n = 0; $n < (ceil($results['cnt'] / $this->criteria['limit'])); $n++) { + $this->results['pages'][$n] = $n+1; } } function reOrder($by) { - $this->results = NULL; + $this->criteria['offset'] = NULL; + if ($this->criteria['orderby'] == $by && !$this->criteria['desc']) $this->criteria['desc'] = TRUE; else $this->criteria['desc'] = FALSE; + $this->criteria['orderby'] = $by; $this->setReload(); $this->searchDB(); @@ -101,8 +112,24 @@ class uiSearch function clear() { #$this->results = NULL; - $this->criteria['form'] = NULL; + $this->criteria['form'] = NULL; $this->setReload(); } + + function setOffset($page) + { + $o =& $this->criteria['offset']; + $l =& $this->criteria['limit']; + + if ($page == 'next') { + $o += $l; + } elseif ($page == 'prev') { + $o -= $l; + } elseif (is_numeric($page)) { + $o = $l * $page; + } + $this->setReload(); + $this->searchDB(); + } } ?>