diff --git a/livesupport/modules/htmlUI/var/Smarty/ChangeLog b/livesupport/modules/htmlUI/var/Smarty/ChangeLog index d78d5f972..28e9578d6 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.4 2005/02/24 19:51:06 sebastian Exp $ + added CVS $Id: ChangeLog,v 1.5 2005/02/25 16:58:26 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 74161a3f7..87e7d5df3 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.4 2005/02/24 19:51:06 sebastian Exp $ */ +/* $Id: Config_File.class.php,v 1.5 2005/02/25 16:58:26 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 c9d47df7e..b42f598a2 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.4 2005/02/24 19:51:06 sebastian Exp $ */ +/* $Id: Smarty.class.php,v 1.5 2005/02/25 16:58:26 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 3185250bf..961522444 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.4 2005/02/24 19:51:06 sebastian Exp $ */ +/* $Id: Smarty_Compiler.class.php,v 1.5 2005/02/25 16:58:26 sebastian Exp $ */ /** * Template compiling class diff --git a/livesupport/modules/htmlUI/var/conf.php b/livesupport/modules/htmlUI/var/conf.php index 87f438386..a973eb28d 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.16 $ + Version : $Revision: 1.17 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/htmlUI/var/Attic/conf.php,v $ ------------------------------------------------------------------------------*/ diff --git a/livesupport/modules/htmlUI/var/formmask/general.inc.php b/livesupport/modules/htmlUI/var/formmask/general.inc.php index 0c83feed6..468625bea 100755 --- a/livesupport/modules/htmlUI/var/formmask/general.inc.php +++ b/livesupport/modules/htmlUI/var/formmask/general.inc.php @@ -18,12 +18,11 @@ $ui_fmask = array( 'type' => 'text', 'label' => 'Reduce Upload Filesize
(must be smaller than ' .ini_get('upload_max_filesize').')', 'rule' => 'numeric', - /* 'attributes' => array( 'onClick' => 'alert ("Note: System Maximum is set to '. - strtr(ini_get('upload_max_filesize'), array('M'=>'000000', 'k'=>'000')) - .' in php.ini\n You cannot override this here.")' - ) */ + ini_get('upload_max_filesize') + .' in php.ini\n You can just reduce this amount this here.")' + ) ), array( 'rule' => 'nopunctuation', @@ -62,7 +61,8 @@ $ui_fmask = array( 'isPref' => TRUE, 'type' => 'text', 'label' => 'Station URL', - 'default' => 'http://' + 'default' => 'http://', + 'required' => TRUE ), array( 'rule' => 'regex', diff --git a/livesupport/modules/htmlUI/var/html/ui_browser.php b/livesupport/modules/htmlUI/var/html/ui_browser.php index c03bc787f..d746e758c 100644 --- a/livesupport/modules/htmlUI/var/html/ui_browser.php +++ b/livesupport/modules/htmlUI/var/html/ui_browser.php @@ -43,7 +43,7 @@ if (is_array($_REQUEST['popup'])){ if ($uiBrowser->userid) { $Smarty->assign('showMenuTop', TRUE); $Smarty->assign('SCRATCHPAD', $uiBrowser->SCRATCHPAD->get()); - $Smarty->assign('PLAYLIST', $uiBrowser->PLAYLIST->get()); + $Smarty->assign('PLAYLIST', $uiBrowser->PLAYLIST->get()); switch ($_REQUEST['act']){ case "fileBrowse": @@ -147,8 +147,9 @@ if ($uiBrowser->userid) { $Smarty->assign('changeStationPrefs', TRUE); break; - case "PL.display": - $Smarty->assign('playlist', $uiBrowser->PLAYLIST->get()); + case "PL.simpleManagement": + $uiBrowser->PLAYLIST->testNew(); + $Smarty->assign('PL_simpleManagement', TRUE); break; } } diff --git a/livesupport/modules/htmlUI/var/html/ui_handler.php b/livesupport/modules/htmlUI/var/html/ui_handler.php index cca91ed0c..f6a90ff88 100644 --- a/livesupport/modules/htmlUI/var/html/ui_handler.php +++ b/livesupport/modules/htmlUI/var/html/ui_handler.php @@ -4,16 +4,20 @@ require dirname(__FILE__).'/../ui_handler_init.php'; switch($_REQUEST['act']){ case "login": - $uiHandler->login($_REQUEST, $ui_fmask["login"]); + if (($ui_tmp_sessid = $uiHandler->login($_REQUEST, $ui_fmask["login"])) !== FALSE) { + $uiHandler->PLAYLIST->testForLooked(); + } break; case "logout": $uiHandler->SCRATCHPAD->save(); + $uiHandler->PLAYLIST->testForLooked(); $uiHandler->logout(); break; case "signover": $uiHandler->SCRATCHPAD->save(); + $uiHandler->PLAYLIST->testForLooked(); $uiHandler->logout(TRUE); break; 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 66d608704..e30d3490b 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 2552c3c1b..3ef607fe9 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 2ee8762fc..a176be3e6 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/masterpanel.tpl b/livesupport/modules/htmlUI/var/templates/masterpanel.tpl index b0a0ef60f..30e479682 100755 --- a/livesupport/modules/htmlUI/var/templates/masterpanel.tpl +++ b/livesupport/modules/htmlUI/var/templates/masterpanel.tpl @@ -40,12 +40,12 @@ {include file="editMetaData.tpl"} {/if} -{if $changeStationPrefs} +{if $changeStationPrefs} {include file="changeStationPrefs.tpl"} {/if} -{if $playlist} - {include file="playlist/playlist.tpl"} +{if $PL_simpleManagement} + {include file="playlist/simpleManagement.tpl"} {/if} diff --git a/livesupport/modules/htmlUI/var/templates/menu_top.tpl b/livesupport/modules/htmlUI/var/templates/menu_top.tpl index a390edbd1..2e0536e27 100755 --- a/livesupport/modules/htmlUI/var/templates/menu_top.tpl +++ b/livesupport/modules/htmlUI/var/templates/menu_top.tpl @@ -1,12 +1,12 @@ \ No newline at end of file diff --git a/livesupport/modules/htmlUI/var/templates/playlist/simpleManagement.tpl b/livesupport/modules/htmlUI/var/templates/playlist/simpleManagement.tpl new file mode 100755 index 000000000..34c79c6c7 --- /dev/null +++ b/livesupport/modules/htmlUI/var/templates/playlist/simpleManagement.tpl @@ -0,0 +1,19 @@ +{*Smarty template*} + +
+{include file="sub/x.tpl"} + +
Simple Playlist Management
+
+ +{if is_array($PLAYLIST) && count($PLAYLIST)} {* already activated Playlist *} + {foreach from=$PLAYLIST item=pl} + {$pl} +
+ {/foreach} +{else} {* no active Playlist *} + No Playlist +{/if} + + +
diff --git a/livesupport/modules/htmlUI/var/templates/search/results.tpl b/livesupport/modules/htmlUI/var/templates/search/results.tpl index e587b5273..9337ab18e 100755 --- a/livesupport/modules/htmlUI/var/templates/search/results.tpl +++ b/livesupport/modules/htmlUI/var/templates/search/results.tpl @@ -14,11 +14,19 @@ {foreach from=$searchres.items item=i} {$i.title} {$i.creator} diff --git a/livesupport/modules/htmlUI/var/ui_base.inc.php b/livesupport/modules/htmlUI/var/ui_base.inc.php index 397e9a70f..1e4c5dd53 100644 --- a/livesupport/modules/htmlUI/var/ui_base.inc.php +++ b/livesupport/modules/htmlUI/var/ui_base.inc.php @@ -328,8 +328,7 @@ class uiBase 'duration' => $this->_niceTime($this->_getMDataValue($id, 'dcterms:extent')), 'type' => $this->gb->getFileType($id), ); - - return ($data); + return ($data); } diff --git a/livesupport/modules/htmlUI/var/ui_browser.class.php b/livesupport/modules/htmlUI/var/ui_browser.class.php index af42d9627..70698b744 100644 --- a/livesupport/modules/htmlUI/var/ui_browser.class.php +++ b/livesupport/modules/htmlUI/var/ui_browser.class.php @@ -50,7 +50,7 @@ class uiBrowser extends uiBase { function getAlertMsg() - { + { if ($_SESSION['alertMsg']) { $this->alertMsg = $_SESSION['alertMsg']; unset($_SESSION['alertMsg']); diff --git a/livesupport/modules/htmlUI/var/ui_handler.class.php b/livesupport/modules/htmlUI/var/ui_handler.class.php index 692187f49..2f8c0f2d7 100644 --- a/livesupport/modules/htmlUI/var/ui_handler.class.php +++ b/livesupport/modules/htmlUI/var/ui_handler.class.php @@ -40,18 +40,30 @@ class uiHandler extends uiBase { { 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[]=_clear_parent&popup[]=_close'; - }else{ - $this->_retMsg('Login failed.'); - $_SESSION['retransferFormData']['login']=$formdata['login']; - $this->redirUrl = UI_BROWSER.'?popup[]=login'; - } + + if (!$this->_validateForm($formdata, $mask)) { + $_SESSION['retransferFormData']['login']=$formdata['login']; + $this->redirUrl = UI_BROWSER.'?popup[]=login'; + return FALSE; } + $sessid = $this->gb->login($formdata['login'], $formdata['pass']); + if(!$sessid || PEAR::isError($sessid)){ + $this->_retMsg('Login failed'); + $_SESSION['retransferFormData']['login']=$formdata['login']; + $this->redirUrl = UI_BROWSER.'?popup[]=login'; + return FALSE; + } + setcookie($this->config['authCookieName'], $sessid); + $id = $this->gb->getObjId($formdata['login'], $this->gb->storId); + if(PEAR::isError($id)) { + $this->_retMsg('Login failed'); + $_SESSION['retransferFormData']['login']=$formdata['login']; + $this->redirUrl = UI_BROWSER.'?popup[]=login'; + return FALSE; + } + $this->sessid = $sessid; + $this->redirUrl = UI_BROWSER.'?popup[]=_clear_parent&popup[]=_close'; + return TRUE; } /** diff --git a/livesupport/modules/htmlUI/var/ui_playlist.class.php b/livesupport/modules/htmlUI/var/ui_playlist.class.php index 79d31a3e2..d50339363 100755 --- a/livesupport/modules/htmlUI/var/ui_playlist.class.php +++ b/livesupport/modules/htmlUI/var/ui_playlist.class.php @@ -5,6 +5,7 @@ class uiPlaylist { $this->Base =& $uiBase; $this->active =& $_SESSION[UI_PLAYLIST_SESSNAME]['active']; + $this->token =& $_SESSION[UI_PLAYLIST_SESSNAME]['token']; $this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close'; } @@ -14,7 +15,7 @@ class uiPlaylist } function get() - { #print_r($this->items); + { return is_array($this->active) ? $this->active : FALSE; } @@ -22,21 +23,22 @@ class uiPlaylist { # test if PL available # look PL - # store access token to ls_pref + # store access token to ls_pref abd session # load PL into session - if(is_string($this->Base->gb->loadPref($this->Base->sessid, UI_PL_ACCESSTOKEN_KEY))) { + if($this->token) { $this->Base->_retMsg('You have an Playlist already activated,\n first close it'); return FALSE; } - if($this->Base->gb->playlistIsAvailable($plid, $this->Base->sessid) !== TRUE) { - $this->Base->_retMsg('Playlist is looked'); + if(($userid = $this->Base->gb->playlistIsAvailable($plid, $this->Base->sessid)) !== TRUE) { + $this->Base->_retMsg('Playlist is looked by $1', $this->Base->gb->getSubjName($userid)); return FALSE; } - $token = $this->Base->gb->lockPlaylistForEdit($plid, $this->Base->sessid); - $this->Base->gb->savePref($this->Base->sessid, UI_PL_ACCESSTOKEN_KEY, $token); + $this->token = $this->Base->gb->lockPlaylistForEdit($plid, $this->Base->sessid); + $this->Base->gb->savePref($this->Base->sessid, UI_PL_ACCESSTOKEN_KEY, $this->token); $this->active = $this->Base->gb->getPlaylistArray($plid, $this->Base->sessid); $this->active['id'] = $plid; $this->Base->_retMsg('Playlist "$1" activated', $this->Base->_getMDataValue($plid, 'title')); + return TRUE; } function release() @@ -45,20 +47,35 @@ class uiPlaylist # release PL # delete PL from session # remove token from ls_pref - if(!is_string($token = $this->Base->gb->loadPref($this->Base->sessid, UI_PL_ACCESSTOKEN_KEY))) { + if(!$this->token) { $this->Base->_retMsg('No Playlist is looked by You'); return FALSE; } - $plgunid = $this->Base->gb->releaseLockedPlaylist($token, $this->Base->sessid); + $plgunid = $this->Base->gb->releaseLockedPlaylist($this->token, $this->Base->sessid); $this->Base->_retMsg('Playlist "$1" released', $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($plgunid), 'title')); $this->active = NULL; + $this->token = NULL; $this->Base->gb->delPref($this->Base->sessid, UI_PL_ACCESSTOKEN_KEY); return TRUE; } + function testForLooked() + { + if(is_string($this->token = $this->Base->gb->loadPref($this->Base->sessid, UI_PL_ACCESSTOKEN_KEY))) { + $this->Base->_retMsg('Playlist looked by You was released'); + $this->release(); + return TRUE; + } + return FALSE; + } + function addItem($id) { - + if (!$this->Base->gb->addAudioClipToPlaylist($this->token, $id, $this->Base->sessid)) { + $this->Base_retMsg('Cannot add File to Playlist'); + return FALSE; + } + return TRUE; } @@ -73,15 +90,31 @@ class uiPlaylist # create PL # activate # add clip + if ($this->testNew() === FALSE) { + $this->Base->_retMsg('Already active Playlist'); + return FALSE; + } + $this->addItem($id); + return TRUE; + } + + function createEmpty() + { if (!$plid = $this->Base->gb->createPlaylist($this->Base->homeid, date('Y-M-D H-i-s'), $this->Base->sessid)) { $this->Base->_retMsg('Cannot create Playlist'); return FALSE; } - $this->activate($plid); - if (!$this->Base->gb->addAudioClipToPlaylist($token, $id, $this->Base->sessid)) { - $this->Base_retMsg('Cannot add File to Playlist'); + return $plid; + } + + function testNew() + { + # if not exists -> create new + if (is_array($this->active)) { return FALSE; } + $plid = $this->createEmpty(); + $this->activate($plid); return TRUE; } } diff --git a/livesupport/modules/htmlUI/var/ui_search.class.php b/livesupport/modules/htmlUI/var/ui_search.class.php index e375dd9bd..b79bb8afc 100755 --- a/livesupport/modules/htmlUI/var/ui_search.class.php +++ b/livesupport/modules/htmlUI/var/ui_search.class.php @@ -82,24 +82,27 @@ 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['items'][] = $this->Base->_getMetaInfo($this->Base->gb->_idFromGunid($rec)); } + #print_r($this->criteria); print_r($this->results); $this->pagination($results); } function pagination(&$results) { + if (sizeof($this->results) == 0) { + return FALSE; + } $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; $p = 1; for ($n = 1; $n <= ceil($results['cnt'] / $this->criteria['limit']); $n = $n+$p) { - $p = bcpow(10, floor($n/10)); echo "$p
"; + $p = bcpow(10, floor($n/10)); $this->results['pages'][$n-1] = $n; }