From 5fc8fb9d42c7a6720dca3618027e77352ab31599 Mon Sep 17 00:00:00 2001 From: sebastian <sebastian@cfc7b370-4200-0410-a6e3-cb6bdb053afe> 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 <messju@lammfellpuschen.de> 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: + * * <dl> * <dt>dsn<dd> datasource setting * <dt>tblNamePrefix <dd>prefix for table names in the database @@ -38,6 +44,7 @@ * <dt>bufferDir <dd>directory for temporary files * <dt>transDir <dd>directory for incomplete transferred files * <dt>accessDir <dd>directory for symlinks to accessed files + * <dt>isArchive <dd>local/central flag * <dt>storageUrlPath<dd>path-URL-part of storageServer base dir * <dt>storageXMLRPC<dd>XMLRPC server script address relative to storageUrlPath * <dt>storageUrlHost, storageUrlPort<dd>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 @@ -<?php +<?php require dirname(__FILE__).'/../ui_handler_init.php'; switch($_REQUEST['act']){ @@ -137,7 +137,11 @@ switch($_REQUEST['act']){ break; case "SEARCH.clear": - $uiHandler->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 @@ -<!-- $Id: smarty-dynamic-fancygroup.tpl,v 1.1 2005/02/23 13:07:34 sebastian Exp $ --> +<!-- $Id: smarty-dynamic-fancygroup.tpl,v 1.2 2005/02/23 22:57:14 sebastian Exp $ --> <tr> <td valign="top" align="right"> 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 @@ -<!-- $Id: smarty-dynamic-green.tpl,v 1.1 2005/02/23 13:07:34 sebastian Exp $ --> +<!-- $Id: smarty-dynamic-green.tpl,v 1.2 2005/02/23 22:57:14 sebastian Exp $ --> <tr> <td align="right" valign="top" class="green"><b>{$element.label}:</b></td> 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 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> -<!-- $Id: smarty-dynamic.tpl,v 1.1 2005/02/23 13:07:34 sebastian Exp $ --> +<!-- $Id: smarty-dynamic.tpl,v 1.2 2005/02/23 22:57:14 sebastian Exp $ --> <html> <head> <title>Smarty template for Array renderer</title> 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}<a href="{$UI_BROWSER}?act=fileBrowse&id={$GLOBALS.pid}">[go up]</a>{/if} </td> </tr> - {foreach from=$structure.listdata item=o} - <tr bgcolor="{cycle values='#eeeeee, #dadada"'}"> + {foreach from=$structure.listdata item=i} + <tr bgcolor="{cycle values='#eeeeee, #dadada"'}" + onMouseOver="highlight()" onMouseOut="darklight()" + onContextmenu="return menu('{$i.id}' + {if $i.type == ('audioclip' || 'webstream')} + ,'PL.addItem', 'PL.newUsingItem', 'SP.addItem', 'delete' + {/if} + )" + > <td align="center"> - <span id="ID{$o.id}"> - {if $o.type eq 'Folder'} - <a href="{$UI_BROWSER}?act=fileBrowse&id={$o.id}" >[{$o.title}]</b> + <span id="ID{$i.id}"> + {if $i.type eq 'Folder'} + <a href="{$UI_BROWSER}?act=fileBrowse&id={$i.id}" >[{$i.title}]</b> {else} - {$o.title} + {$i.title} {/if} </span> </td> - <td align="center">{$o.type}</td> + <td align="center">{$i.type}</td> <td> - <a href="javascript:frename('{$o.name}', '{$o.id}')">[rename]</a> - <a href="javascript:fmove('{$o.id}', '.')">[move]</a> - <a href="javascript:fcopy('{$o.id}', '.')">[copy]</a> - <a href="{$UI_BROWSER}?act=permissions&id={$o.id}">[permissions]</a> + <a href="javascript:frename('{$i.name}', '{$i.id}')">[rename]</a> + <a href="javascript:fmove('{$i.id}', '.')">[move]</a> + <a href="javascript:fcopy('{$i.id}', '.')">[copy]</a> + <a href="{$UI_BROWSER}?act=permissions&id={$i.id}">[permissions]</a> <br> - {if ($delOverride eq $o.id)} - <a href="{$UI_HANDLER}?act=delete&id={$o.id}&delOverride={$o.id}" - onClick="return confirm('Really delete non empty Folder "{$o.name}" now?')">[DEL]</a> + {if ($delOverride eq $i.id)} + <a href="{$UI_HANDLER}?act=delete&id={$i.id}&delOverride={$i.id}" + onClick="return confirm('Really delete non empty Folder "{$i.name}" now?')">[DEL]</a> {else} - <a href="{$UI_HANDLER}?act=delete&id={$o.id}" - onClick="return confirm('Delete "{$o.name}"?')">[DEL]</a> + <a href="{$UI_HANDLER}?act=delete&id={$i.id}" + onClick="return confirm('Delete "{$i.name}"?')">[DEL]</a> {/if} - {if $o.type != 'Folder'} - <a href="{$UI_BROWSER}?act=getFile&id={$o.id}">[Access]</a> - <a href="{$UI_BROWSER}?act=getMData&id={$o.id}">[vMData]</a> - <a href="{$UI_BROWSER}?act=_analyzeFile&id={$o.id}">[Analyze]</a> + {if $i.type != 'Folder'} + <a href="{$UI_BROWSER}?act=getFile&id={$i.id}">[Access]</a> + <a href="{$UI_BROWSER}?act=getMData&id={$i.id}">[vMData]</a> + <a href="{$UI_BROWSER}?act=_analyzeFile&id={$i.id}">[Analyze]</a> - {if $o.type eq 'webstream'} - <a href="{$UI_BROWSER}?act=addWebstream&id={$o.id}&replace=1">[Replace]</a> - {elseif $o.type eq 'audioclip'} - <a href="{$UI_BROWSER}?act=uploadFile&id={$o.id}&replace=1">[Replace]</a> + {if $i.type eq 'webstream'} + <a href="{$UI_BROWSER}?act=addWebstream&id={$i.id}&replace=1">[Replace]</a> + {elseif $i.type eq 'audioclip'} + <a href="{$UI_BROWSER}?act=uploadFile&id={$i.id}&replace=1">[Replace]</a> {/if} - <a href="{$UI_BROWSER}?act=editMetaData&id={$o.id}">[eMData]</a> - <a href="#" onclick="hpopup('{$UI_HANDLER}?act=SP.addItem&id={$o.id}', '2SP')">[SP]</a> + <a href="{$UI_BROWSER}?act=editMetaData&id={$i.id}">[eMData]</a> + <a href="#" onclick="hpopup('{$UI_HANDLER}?act=SP.addItem&id={$i.id}', '2SP')">[SP]</a> {/if} </td> 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"} - </head> <body> \ 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 @@ <script type="text/javascript"> opener.location.reload(); - //opener.location.href="{$UI_BROWSER}"; </script> 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 = - "<div id='menu' style='position:absolute;top:-250;left:0;z-index:100'>"+ - "<table cellpadding='5' cellspacing='0' width='"+menuWidth+"' height='"+menuHeight+"' style='border-style:outset;border-width:1;border-color:#3a6c96;background-color:#4682B4'>"+ - "<tr><td><a class='menu' href=\"{/literal}javascript: hpopup('{$UI_HANDLER}?act=activatePL&id="+id+"', 'activatePL'){literal}\""+oF+"> Activate this Playlist </a></td></tr>"+ - "<tr><td><a class='menu' href=\"{/literal}{$UI_BROWSER}?act=PL.display&id="+id+"{literal}\""+oF+"> Display this Playlist </a></td></tr>"+ - "</table></div>"; - else - document.getElementById('menucontainer').innerHTML = - "<div id='menu' style='position:absolute;top:-250;left:0;z-index:100'>"+ - "<table cellpadding='5' cellspacing='0' width='"+menuWidth+"' height='"+menuHeight+"' style='border-style:outset;border-width:1;border-color:#3a6c96;background-color:#4682B4'>"+ - "<tr><td><a class='menu' href='#'"+oF+"> Add to Playlist </a></td></tr>"+ - "</table></div>"; - } -} - - menuStatus = 0; -document.onmousedown = hideMenu; +document.onmouseup = hideMenu; +document.write('<div id="menucontainer"></div>'); +menuWidth = 0, +menuHeight = 0; + +function menu(id) { + var menuHeader = "<div id='menu' style='position:absolute;top:-250;left:0;z-index:100'>"+ + "<table cellpadding='5' cellspacing='0' width='"+menuWidth+"' height='"+menuHeight+"' style='border-style:outset;border-width:1;border-color:#3a6c96;background-color:#4682B4'>"; + var menuFooter = "</table></div>"; + 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 + "<tr><td><a class='menu' href=\"{/literal}javascript: hpopup('{$UI_HANDLER}?act=activatePL&id="+id+"', 'activatePL'){literal}\""+oF+"> Activate this Playlist </a></td></tr>"; + break; + case "PL.display": + menuHtml = menuHtml + "<tr><td><a class='menu' href=\"{/literal}{$UI_BROWSER}?act=PL.display&id="+id+"{literal}\""+oF+"> Display this Playlist </a></td></tr>"; + break; + case "PL.addItem": + menuHtml = menuHtml + "<tr><td><a class='menu' href='#' onClick=\"hpopup('{/literal}{$UI_HANDLER}{literal}?act=PL.addItem&id="+id+"', '2SP')\""+oF+"> Add File to Playlist </a></td></tr>"; + break; + case "PL.newUsingItem": + menuHtml = menuHtml + "<tr><td><a class='menu' href='#'"+oF+"> New Playlist using File </a></td></tr>"; + break; + case "SP.addItem": + menuHtml = menuHtml + "<tr><td><a class='menu' href='#' onClick=\"hpopup('{/literal}{$UI_HANDLER}{literal}?act=SP.addItem&id="+id+"', '2SP')\""+oF+"> Add File to ScratchPad </a></td></tr>"; + break; + case "SP.removeItem": + menuHtml = menuHtml + "<tr><td><a class='menu' href='#' onClick=\"hpopup('{/literal}{$UI_HANDLER}{literal}?act=SP.removeItem&id="+id+"', '2SP')\""+oF+"> Remove </a></td></tr>"; + break; + case "delete": + menuHtml = menuHtml + "<tr><td><a class='menu' href='{/literal}{$UI_HANDLER}{literal}?act=delete&id="+id+"'"+oF+"> !Delete File! </a></td></tr>"; + 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() +{ + +} </script> -<style type='text/css'> +<style type="text/css"> a.menu {text-decoration:none;font-family:Verdana,Arial;font-size:80%} a.menu:link,a.menu:visited {text-decoration:none;color:#F0F8FF} a.menu:hover,a.menu:active {text-decoration:none;background-color:#F0F8FF;color:#000040} hr.menu {border:0px;height:1px;background-color:#B0C4DE;color:#B0C4DE} </style> - -<div id="menucontainer"></div> {/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 @@ <div id="searchres"> <center> -{if is_array($searchres)} +{if $searchres.count > 0} <table border="0" width="50%"> <tr style="background-color: {cycle values='#eeeeee, #dadada'}"> <td align="center"><a href="#" onClick="hpopup('{$UI_HANDLER}?act=SEARCH.reOrder&by=title', 'order');">{tra 0=Title}</a></td> @@ -11,20 +11,43 @@ <td align="center"><a href="#" onClick="hpopup('{$UI_HANDLER}?act=SEARCH.reOrder&by=extent', 'order');">{tra 0=Duration}</a></td> <td align="center"><a href="#" onClick="hpopup('{$UI_HANDLER}?act=SEARCH.reOrder&by=type', 'order');">{tra 0=Type}</a></td> </tr> - {foreach from=$searchres item=s} - <tr style="background-color: {cycle values='#eeeeee, #dadada'}"> - <td align="center">{$s.title}</td> - <td align="center">{$s.creator}</td> - <td align="center">{$s.duration}</td> - <td align="center">{$s.type}</td> + {foreach from=$searchres.items item=i} + <tr style="background-color: {cycle values='#eeeeee, #dadada'}" + onMouseOver="highlight()" onMouseOut="darklight()" + onContextmenu="return menu('{$i.id}' + {if $i.type == ('audioclip' || 'webstream')} + ,'PL.addItem', 'PL.newUsingItem', 'SP.addItem' + {/if} + )" + > + <td align="center">{$i.title}</td> + <td align="center">{$i.creator}</td> + <td align="center">{$i.duration}</td> + <td align="center">{$i.type}</td> <!-- <td> - <a href="#" onClick="hpopup('{$UI_HANDLER}?act=PL.addItem&id={$s.id}', '2PL')">[PL]</a> - <a href="#" onClick="hpopup('{$UI_HANDLER}?act=SP.addItem&id={$s.id}', '2SP')">[SP]</a> + <a href="#" onClick="hpopup('{$UI_HANDLER}?act=PL.addItem&id={$i.id}', '2PL')">[PL]</a> + <a href="#" onClick="hpopup('{$UI_HANDLER}?act=SP.addItem&id={$i.id}', '2SP')">[SP]</a> </td> --> </tr> {/foreach} + <tr> + <td> + {if $searchres.prev}<a href="#" onClick="hpopup('{$UI_HANDLER}?act=SEARCH.setOffset&page=prev', 'pager')">back</a>{/if} + </td> + <td>count: {$searchres.count}</td> + <td> + go: + {foreach from=$searchres.pages item=p key=k} + <a href="#" onClick="hpopup('{$UI_HANDLER}?act=SEARCH.setOffset&page={$k}', 'pager')">{$p}</a> + {/foreach} + </td> + <td align="right"> + {if $searchres.next}<a href="#" onClick="hpopup('{$UI_HANDLER}?act=SEARCH.setOffset&page=next', 'pager')">forward</a>{/if} + </td> + </tr> + <tr><td colspan="4"> </table> {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']}<br> seconds: {$ia['playtime_seconds']}<br> - length: ".date('H:i:s', round($s)-date('Z')).substr(number_format($s, 6), strpos(number_format($s, 6), '.'))."<br> + length: $extent<br> channels: {$ia['audio']['channels']}<br> sample_rate: {$ia['audio']['sample_rate']}<br> bits_per_sample: {$ia['audio']['bits_per_sample']}<br> 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(); + } } ?>