diff --git a/livesupport/modules/htmlUI/var/html/ui_browser.php b/livesupport/modules/htmlUI/var/html/ui_browser.php index d746e758c..7f4711f5e 100644 --- a/livesupport/modules/htmlUI/var/html/ui_browser.php +++ b/livesupport/modules/htmlUI/var/html/ui_browser.php @@ -42,8 +42,9 @@ 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('SCRATCHPAD', $uiBrowser->SCRATCHPAD->get()); + $Smarty->assign('PLid', $uiBrowser->PLAYLIST->activeId); + $Smarty->register_object('PL', $uiBrowser->PLAYLIST); switch ($_REQUEST['act']){ case "fileBrowse": @@ -147,8 +148,11 @@ if ($uiBrowser->userid) { $Smarty->assign('changeStationPrefs', TRUE); break; - case "PL.simpleManagement": - $uiBrowser->PLAYLIST->testNew(); + case "PL.simpleManagement": print_r($uiBrowser->PLAYLIST->get()); + if ($_REQUEST['createNew']) { + $uiBrowser->PLAYLIST->testNew(); + #$Smarty->assign('PLAYLIST', $uiBrowser->PLAYLIST->get()); + } $Smarty->assign('PL_simpleManagement', TRUE); break; } diff --git a/livesupport/modules/htmlUI/var/templates/fileBrowse/objects.tpl b/livesupport/modules/htmlUI/var/templates/fileBrowse/objects.tpl index 54fefc009..c8b76f384 100755 --- a/livesupport/modules/htmlUI/var/templates/fileBrowse/objects.tpl +++ b/livesupport/modules/htmlUI/var/templates/fileBrowse/objects.tpl @@ -11,28 +11,17 @@ {if count($structure.listdata)} {foreach from=$structure.listdata item=i} - + {if $i.type eq 'Folder'} [{$i.title|truncate:30}] {else} - {$i.title|truncate:30} + {if $PLid == $i.id} + {$i.title|truncate:30} + {else} + {$i.title|truncate:30} + {/if} {/if} diff --git a/livesupport/modules/htmlUI/var/templates/header.tpl b/livesupport/modules/htmlUI/var/templates/header.tpl index bf2f9f2b2..11d8a9fbe 100755 --- a/livesupport/modules/htmlUI/var/templates/header.tpl +++ b/livesupport/modules/htmlUI/var/templates/header.tpl @@ -5,7 +5,7 @@ {include file="script/basics.js.tpl"} - {include file="script/myKontextMenue.js.tpl"} + {include file="script/contextMenue.js.tpl"} \ 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 index 34c79c6c7..56ab96db7 100755 --- a/livesupport/modules/htmlUI/var/templates/playlist/simpleManagement.tpl +++ b/livesupport/modules/htmlUI/var/templates/playlist/simpleManagement.tpl @@ -6,13 +6,18 @@
Simple Playlist Management

-{if is_array($PLAYLIST) && count($PLAYLIST)} {* already activated Playlist *} - {foreach from=$PLAYLIST item=pl} +{PL->get assign='PL'} +{if is_array($PL)} {* already activated Playlist *} + active Playlist: {$PL.children.0.children.0.content} +
+ {foreach from=$PL item=pl} {$pl}
{/foreach} {else} {* no active Playlist *} - No Playlist + No active Playlist! +
+ {/if} diff --git a/livesupport/modules/htmlUI/var/templates/scratchPad.tpl b/livesupport/modules/htmlUI/var/templates/scratchPad.tpl index 1a18bca68..f04d73a76 100755 --- a/livesupport/modules/htmlUI/var/templates/scratchPad.tpl +++ b/livesupport/modules/htmlUI/var/templates/scratchPad.tpl @@ -1,9 +1,9 @@ {*Smarty template*} {include file="script/scratchPad.js.tpl"} +
%%ScratchPad%% - {if is_array($SCRATCHPAD)}
@@ -17,24 +17,15 @@ {foreach from=$SCRATCHPAD item=i} - + - {$i.title|truncate:10} + + {if $PLid == $i.id} + {$i.title|truncate:30} + {else} + {$i.title|truncate:30} + {/if} + {$i.duration} {$i.type} X diff --git a/livesupport/modules/htmlUI/var/templates/script/contextMenue.js.tpl b/livesupport/modules/htmlUI/var/templates/script/contextMenue.js.tpl new file mode 100755 index 000000000..9d9aae9d3 --- /dev/null +++ b/livesupport/modules/htmlUI/var/templates/script/contextMenue.js.tpl @@ -0,0 +1,110 @@ +{literal} + + + +{/literal} diff --git a/livesupport/modules/htmlUI/var/templates/search/results.tpl b/livesupport/modules/htmlUI/var/templates/search/results.tpl index 9337ab18e..76fafd8c2 100755 --- a/livesupport/modules/htmlUI/var/templates/search/results.tpl +++ b/livesupport/modules/htmlUI/var/templates/search/results.tpl @@ -2,7 +2,6 @@
- {if $searchres.count > 0} @@ -12,23 +11,14 @@ {foreach from=$searchres.items item=i} - - + + @@ -60,7 +50,6 @@ {else} No match found. {/if} - diff --git a/livesupport/modules/htmlUI/var/templates/sub/contextmenu.tpl b/livesupport/modules/htmlUI/var/templates/sub/contextmenu.tpl new file mode 100755 index 000000000..bf5044724 --- /dev/null +++ b/livesupport/modules/htmlUI/var/templates/sub/contextmenu.tpl @@ -0,0 +1,30 @@ +onMouseOver="highlight()" +onMouseOut="darklight()" +onContextmenu="return menu('{$i.id}' + {$moreContextBefore} + {if ($i.type == 'audioclip' || $i.type == 'webstream')} + {if $PLid} + ,'PL.addItem', + {else} + 'PL.newUsingItem', + {/if} + 'delete' + {/if} + + {if ($i.type == 'playlist')} + {if $PLid} + {if $PLid == $i.id} + ,'PL.release' + {else} + ,'PL.addItem', 'delete' + {/if} + {else} + ,'PL.activate', 'PL.newUsingItem', 'delete' + {/if} + {/if} + {$moreContextAfter} +)" + + +{assign var="moreContextBefore" value=""} +{assign var="moreContextAfter" value=""} diff --git a/livesupport/modules/htmlUI/var/ui_base.inc.php b/livesupport/modules/htmlUI/var/ui_base.inc.php index 1e4c5dd53..e211d13c8 100644 --- a/livesupport/modules/htmlUI/var/ui_base.inc.php +++ b/livesupport/modules/htmlUI/var/ui_base.inc.php @@ -358,13 +358,22 @@ class uiBase function _getMDataValue($id, $key) { if (is_array($arr = $this->gb->getMDataValue($id, $key, $this->sessid))) { - $value = array_pop($arr); + $value = current($arr); return $value['value']; } return FALSE; } + function _setMDataValue($id, $key, $value) + { + if ($this->gb->setMDataValue($id, $key, $this->sessid, $value)) { + return TRUE; + } + return FALSE; + } + + function _getFileTitle($id) { if (is_array($arr = $this->gb->getPath($id))) { diff --git a/livesupport/modules/htmlUI/var/ui_browser.class.php b/livesupport/modules/htmlUI/var/ui_browser.class.php index 70698b744..af42d9627 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_browser_init.php b/livesupport/modules/htmlUI/var/ui_browser_init.php index 43dd9af2d..955c3efd5 100644 --- a/livesupport/modules/htmlUI/var/ui_browser_init.php +++ b/livesupport/modules/htmlUI/var/ui_browser_init.php @@ -35,7 +35,7 @@ $uiBase =& $uiBrowser; ## load Smarty+filters ############################################## require_once dirname(__FILE__).'/SmartyExtensions.inc.php'; #$Smarty->load_filter('output', 'trimwhitespace'); -$Smarty->load_filter('post', 'template_marker'); +#$Smarty->load_filter('post', 'template_marker'); $Smarty->load_filter('post', 'localizer'); diff --git a/livesupport/modules/htmlUI/var/ui_playlist.class.php b/livesupport/modules/htmlUI/var/ui_playlist.class.php index d50339363..2119af127 100755 --- a/livesupport/modules/htmlUI/var/ui_playlist.class.php +++ b/livesupport/modules/htmlUI/var/ui_playlist.class.php @@ -3,9 +3,9 @@ class uiPlaylist { function uiPlaylist(&$uiBase) { - $this->Base =& $uiBase; - $this->active =& $_SESSION[UI_PLAYLIST_SESSNAME]['active']; - $this->token =& $_SESSION[UI_PLAYLIST_SESSNAME]['token']; + $this->Base =& $uiBase; + $this->activeId =& $_SESSION[UI_PLAYLIST_SESSNAME]['activeId']; + $this->token =& $_SESSION[UI_PLAYLIST_SESSNAME]['token']; $this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close'; } @@ -16,7 +16,10 @@ class uiPlaylist function get() { - return is_array($this->active) ? $this->active : FALSE; + if (!$this->activeId) { + return FALSE; + } + return $this->Base->gb->getPlaylistArray($this->activeId, $this->Base->sessid); } function activate($plid) @@ -35,8 +38,8 @@ class uiPlaylist } $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->active = $this->Base->gb->getPlaylistArray($plid, $this->Base->sessid); + $this->activeId = $plid; $this->Base->_retMsg('Playlist "$1" activated', $this->Base->_getMDataValue($plid, 'title')); return TRUE; } @@ -53,8 +56,8 @@ class uiPlaylist } $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->activeId = NULL; + $this->token = NULL; $this->Base->gb->delPref($this->Base->sessid, UI_PL_ACCESSTOKEN_KEY); return TRUE; } @@ -104,17 +107,22 @@ class uiPlaylist $this->Base->_retMsg('Cannot create Playlist'); return FALSE; } + $this->Base->_setMDataValue($plid, 'dc:title', 'empty'); return $plid; } function testNew() { - # if not exists -> create new - if (is_array($this->active)) { + # if exists -> return false + # else + # create empty + # activate + + if (is_array($this->activeId)) { return FALSE; } $plid = $this->createEmpty(); - $this->activate($plid); + $this->activate($plid); return TRUE; } }
{tra 0=Type}
{$i.title}
+ {if $PLAYLIST.id == $i.id} + {$i.title|truncate:30} + {else} + {$i.title|truncate:30} + {/if} + {$i.creator} {$i.duration} {$i.type}