diff --git a/livesupport/modules/htmlUI/var/conf.php b/livesupport/modules/htmlUI/var/conf.php
index ec5b37f96..84899adb4 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.18 $
+ Version : $Revision: 1.19 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/htmlUI/var/Attic/conf.php,v $
------------------------------------------------------------------------------*/
@@ -143,6 +143,7 @@ define('UI_SCRATCHPAD_MAXLENGTH_KEY', 'djBagMaxlength');
define('UI_SCRATCHPAD_SESSNAME', 'SCRATCHPAD');
define('UI_STATIONINFO_SESSNAME', 'STATIONINFO');
define('UI_SEARCH_SESSNAME', 'SEARCH');
+define('UI_PLAYLIST_SESSNAME', 'PLAYLIST');
define('UI_MDATA_KEY_TITLE', 'dc:title');
define('UI_MDATA_KEY_ARTIST', 'dc:creator');
diff --git a/livesupport/modules/htmlUI/var/html/ui_browser.php b/livesupport/modules/htmlUI/var/html/ui_browser.php
index 6d766b1e1..b911f5c1f 100644
--- a/livesupport/modules/htmlUI/var/html/ui_browser.php
+++ b/livesupport/modules/htmlUI/var/html/ui_browser.php
@@ -35,6 +35,11 @@ if (is_array($_REQUEST['popup'])){
$Smarty->assign('loginform', $uiBrowser->loginform($Smarty, $ui_fmask));
$Smarty->display('popup/login.tpl');
break;
+
+ case "_2PL.simpleManagement":
+ $Smarty->assign('target', 'PL.simpleManagement');
+ $Smarty->display('popup/_redirector.tpl');
+ break;
}
}
die();
diff --git a/livesupport/modules/htmlUI/var/html/ui_handler.php b/livesupport/modules/htmlUI/var/html/ui_handler.php
index b8bb321d6..bd413bd27 100644
--- a/livesupport/modules/htmlUI/var/html/ui_handler.php
+++ b/livesupport/modules/htmlUI/var/html/ui_handler.php
@@ -4,20 +4,19 @@ require dirname(__FILE__).'/../ui_handler_init.php';
switch($_REQUEST['act']){
case "login":
- if (($ui_tmp_sessid = $uiHandler->login($_REQUEST, $ui_fmask["login"])) !== FALSE) {
- $uiHandler->PLAYLIST->testForLooked();
- }
+ if ($uiHandler->login($_REQUEST, $ui_fmask["login"]) === TRUE)
+ $uiHandler->PLAYLIST->loadLookedFromPref();
break;
case "logout":
$uiHandler->SCRATCHPAD->save();
- $uiHandler->PLAYLIST->testForLooked();
+ $uiHandler->PLAYLIST->release();
$uiHandler->logout();
break;
case "signover":
$uiHandler->SCRATCHPAD->save();
- $uiHandler->PLAYLIST->testForLooked();
+ $uiHandler->PLAYLIST->release();
$uiHandler->logout(TRUE);
break;
diff --git a/livesupport/modules/htmlUI/var/templates/playlist/editor.tpl b/livesupport/modules/htmlUI/var/templates/playlist/editor.tpl
index f930108c4..868c20b5f 100755
--- a/livesupport/modules/htmlUI/var/templates/playlist/editor.tpl
+++ b/livesupport/modules/htmlUI/var/templates/playlist/editor.tpl
@@ -4,8 +4,8 @@
{PL->getFlat assign='FLAT'}
{foreach from=$FLAT item='i'}
{* {uiBrowser->_niceTime p1=$i.playlength assign='nicelength'} *}
-
- |
+
+ |
{$i.title} |
{$i.duration} |
{$i.type} |
diff --git a/livesupport/modules/htmlUI/var/templates/playlist/simpleManagement.tpl b/livesupport/modules/htmlUI/var/templates/playlist/simpleManagement.tpl
index 2c18e12fc..ba85d32a7 100755
--- a/livesupport/modules/htmlUI/var/templates/playlist/simpleManagement.tpl
+++ b/livesupport/modules/htmlUI/var/templates/playlist/simpleManagement.tpl
@@ -13,7 +13,7 @@
{include file="playlist/editor.tpl"}
{else} {* no active Playlist *}
No active Playlist! |
- |
+ |
{/if}
diff --git a/livesupport/modules/htmlUI/var/ui_base.inc.php b/livesupport/modules/htmlUI/var/ui_base.inc.php
index 8db3f968d..a22a1b687 100644
--- a/livesupport/modules/htmlUI/var/ui_base.inc.php
+++ b/livesupport/modules/htmlUI/var/ui_base.inc.php
@@ -279,10 +279,11 @@ class uiBase
function _twoDigits($num)
{
- if (strlen($num)<2)
- return ("0$num");
- else
- return $num;
+ if (strlen($num) == 1)
+ return "0$num";
+ if (strlen($num) == 0)
+ return '00';
+ return $num;
}
diff --git a/livesupport/modules/htmlUI/var/ui_handler.class.php b/livesupport/modules/htmlUI/var/ui_handler.class.php
index a76936aa9..99dece0f2 100644
--- a/livesupport/modules/htmlUI/var/ui_handler.class.php
+++ b/livesupport/modules/htmlUI/var/ui_handler.class.php
@@ -38,8 +38,7 @@ class uiHandler extends uiBase {
*/
function login(&$formdata, &$mask)
{
- session_destroy();
- session_start();
+ #$this->_cleanArray($_SESSION);
if (!$this->_validateForm($formdata, $mask)) {
$_SESSION['retransferFormData']['login']=$formdata['login'];
diff --git a/livesupport/modules/htmlUI/var/ui_playlist.class.php b/livesupport/modules/htmlUI/var/ui_playlist.class.php
index 796520331..2b2d20cf2 100755
--- a/livesupport/modules/htmlUI/var/ui_playlist.class.php
+++ b/livesupport/modules/htmlUI/var/ui_playlist.class.php
@@ -19,7 +19,7 @@ class uiPlaylist
if (!$this->activeId) {
return FALSE;
}
- #print_r( $this->Base->gb->getPlaylistArray($this->activeId, $this->Base->sessid));
+ print_r( $this->Base->gb->getPlaylistArray($this->activeId, $this->Base->sessid));
return $this->Base->gb->getPlaylistArray($this->activeId, $this->Base->sessid);
}
@@ -38,8 +38,7 @@ class uiPlaylist
return FALSE;
}
$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->Base->gb->savePref($this->Base->sessid, UI_PL_ACCESSTOKEN_KEY, $plid.':'.$this->token);
$this->activeId = $plid;
$this->Base->_retMsg('Playlist "$1" activated', $this->Base->_getMDataValue($plid, UI_MDATA_KEY_TITLE));
return TRUE;
@@ -87,11 +86,14 @@ class uiPlaylist
}
- function testForLooked()
+ function loadLookedFromPref()
{
- 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();
+ if(is_string($saved = $this->Base->gb->loadPref($this->Base->sessid, UI_PL_ACCESSTOKEN_KEY))) {
+ $this->Base->_retMsg('Found Playlist looked by you');
+ #$this->release();
+ list ($this->activeId, $this->token) = explode (':', $saved);
+
+ $this->Base->redirUrl = UI_BROWSER.'?popup[]=_2PL.simpleManagement&popup[]=_close';
return TRUE;
}
return FALSE;
@@ -106,17 +108,17 @@ class uiPlaylist
return TRUE;
}
- function removeItem($gunids)
+ function removeItem($elemIds)
{
- if (!$gunids) {
+ if (!$elemIds) {
$this->Base->_retMsg('No Item(s) given');
return FALSE;
}
- if (!is_array($gunids))
- $gunids = array($gunids);
+ if (!is_array($elemIds))
+ $elemIds = array($elemIds);
- foreach ($gunids as $gunid) {
- if ($this->Base->gb->delAudioClipFromPlaylist($this->token, $this->Base->gb->_idFromGunid($gunid), $this->Base->sessid) !== TRUE) {
+ foreach ($elemIds as $elemId) {
+ if ($this->Base->gb->delAudioClipFromPlaylist($this->token, $elemId, $this->Base->sessid) !== TRUE) {
$this->Base->_retMsg('Cannot remove Item from Playlist');
return FALSE;
}
@@ -153,21 +155,23 @@ class uiPlaylist
function getFlat()
{
- $this->plwalk($this->get(), 0);
+ $this->plwalk($this->get());
+ #print_r($this->flat);
return $this->flat;
}
- function plwalk($arr, $parent)
+ function plwalk($arr, $parent=0, $attrs=0)
{
foreach ($arr['children'] as $node=>$sub) {
if ($sub['elementname']=='playlistelement') {
- $this->plwalk($sub, $node);
+ $this->plwalk($sub, $node, $sub['attrs']);
}
- if ($sub['elementname']=='audioclip' || $sub['elementname']=='webstream') {
+ if ($sub['elementname']=='audioclip') {
#$this->flat["$parent.$node"] = $sub['attrs'];
#$this->flat["$parent.$node"]['type'] = $sub['elementname'];
$this->flat["$parent.$node"] = $this->Base->_getMetaInfo($this->Base->gb->_idFromGunid($sub['attrs']['id']));
+ $this->flat["$parent.$node"]['attrs'] = $attrs;
}
}
}
diff --git a/livesupport/modules/htmlUI/var/ui_search.class.php b/livesupport/modules/htmlUI/var/ui_search.class.php
index a52a7856e..3c04701eb 100755
--- a/livesupport/modules/htmlUI/var/ui_search.class.php
+++ b/livesupport/modules/htmlUI/var/ui_search.class.php
@@ -20,8 +20,8 @@ class uiSearch
$form = new HTML_QuickForm('search', UI_STANDARD_FORM_METHOD, UI_HANDLER);
$form->setConstants(array('id'=>$id, 'counter'=>$this->criteria['counter'] ? $this->criteria['counter'] : UI_SEARCH_MIN_ROWS));
- foreach ($mask['tabs']['group']['group'] as $k=>$v) {
- foreach ($mask['pages'][$v] as $val){
+ foreach ($mask['pages'] as $k=>$v) {
+ foreach ($mask['pages'][$k] as $val){
$col1[$this->Base->_formElementEncode($val['element'])] = $val['label'];
if (isset($val['relation']))
$col2[$this->Base->_formElementEncode($val['element'])] = $mask2['relations'][$val['relation']];