*** empty log message ***
This commit is contained in:
parent
0da71b6798
commit
f181ea7515
20 changed files with 137 additions and 58 deletions
|
@ -2979,7 +2979,7 @@
|
||||||
|
|
||||||
* libs/Smarty.class.php
|
* libs/Smarty.class.php
|
||||||
libs/Smarty_Compiler.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 <messju@lammfellpuschen.de>
|
2003-03-31 Messju Mohr <messju@lammfellpuschen.de>
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
* @package Smarty
|
* @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
|
* Config file reading class
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
* @version 2.6.6
|
* @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
|
* DIR_SEP isn't used anymore, but third party apps might
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
* @package Smarty
|
* @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
|
* Template compiling class
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: sebastian $
|
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 $
|
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/htmlUI/var/Attic/conf.php,v $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
|
|
@ -18,12 +18,11 @@ $ui_fmask = array(
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'label' => 'Reduce Upload Filesize<br><small>(must be smaller than ' .ini_get('upload_max_filesize').')</small>',
|
'label' => 'Reduce Upload Filesize<br><small>(must be smaller than ' .ini_get('upload_max_filesize').')</small>',
|
||||||
'rule' => 'numeric',
|
'rule' => 'numeric',
|
||||||
/*
|
|
||||||
'attributes' => array(
|
'attributes' => array(
|
||||||
'onClick' => 'alert ("Note: System Maximum is set to '.
|
'onClick' => 'alert ("Note: System Maximum is set to '.
|
||||||
strtr(ini_get('upload_max_filesize'), array('M'=>'000000', 'k'=>'000'))
|
ini_get('upload_max_filesize')
|
||||||
.' in php.ini\n You cannot override this here.")'
|
.' in php.ini\n You can just reduce this amount this here.")'
|
||||||
) */
|
)
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'rule' => 'nopunctuation',
|
'rule' => 'nopunctuation',
|
||||||
|
@ -62,7 +61,8 @@ $ui_fmask = array(
|
||||||
'isPref' => TRUE,
|
'isPref' => TRUE,
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'label' => 'Station URL',
|
'label' => 'Station URL',
|
||||||
'default' => 'http://'
|
'default' => 'http://',
|
||||||
|
'required' => TRUE
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'rule' => 'regex',
|
'rule' => 'regex',
|
||||||
|
|
|
@ -43,7 +43,7 @@ if (is_array($_REQUEST['popup'])){
|
||||||
if ($uiBrowser->userid) {
|
if ($uiBrowser->userid) {
|
||||||
$Smarty->assign('showMenuTop', TRUE);
|
$Smarty->assign('showMenuTop', TRUE);
|
||||||
$Smarty->assign('SCRATCHPAD', $uiBrowser->SCRATCHPAD->get());
|
$Smarty->assign('SCRATCHPAD', $uiBrowser->SCRATCHPAD->get());
|
||||||
$Smarty->assign('PLAYLIST', $uiBrowser->PLAYLIST->get());
|
$Smarty->assign('PLAYLIST', $uiBrowser->PLAYLIST->get());
|
||||||
|
|
||||||
switch ($_REQUEST['act']){
|
switch ($_REQUEST['act']){
|
||||||
case "fileBrowse":
|
case "fileBrowse":
|
||||||
|
@ -147,8 +147,9 @@ if ($uiBrowser->userid) {
|
||||||
$Smarty->assign('changeStationPrefs', TRUE);
|
$Smarty->assign('changeStationPrefs', TRUE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "PL.display":
|
case "PL.simpleManagement":
|
||||||
$Smarty->assign('playlist', $uiBrowser->PLAYLIST->get());
|
$uiBrowser->PLAYLIST->testNew();
|
||||||
|
$Smarty->assign('PL_simpleManagement', TRUE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,16 +4,20 @@ require dirname(__FILE__).'/../ui_handler_init.php';
|
||||||
switch($_REQUEST['act']){
|
switch($_REQUEST['act']){
|
||||||
|
|
||||||
case "login":
|
case "login":
|
||||||
$uiHandler->login($_REQUEST, $ui_fmask["login"]);
|
if (($ui_tmp_sessid = $uiHandler->login($_REQUEST, $ui_fmask["login"])) !== FALSE) {
|
||||||
|
$uiHandler->PLAYLIST->testForLooked();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "logout":
|
case "logout":
|
||||||
$uiHandler->SCRATCHPAD->save();
|
$uiHandler->SCRATCHPAD->save();
|
||||||
|
$uiHandler->PLAYLIST->testForLooked();
|
||||||
$uiHandler->logout();
|
$uiHandler->logout();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "signover":
|
case "signover":
|
||||||
$uiHandler->SCRATCHPAD->save();
|
$uiHandler->SCRATCHPAD->save();
|
||||||
|
$uiHandler->PLAYLIST->testForLooked();
|
||||||
$uiHandler->logout(TRUE);
|
$uiHandler->logout(TRUE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<!-- $Id: smarty-dynamic-fancygroup.tpl,v 1.4 2005/02/24 19:51:06 sebastian Exp $ -->
|
<!-- $Id: smarty-dynamic-fancygroup.tpl,v 1.5 2005/02/25 16:58:26 sebastian Exp $ -->
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top" align="right">
|
<td valign="top" align="right">
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<!-- $Id: smarty-dynamic-green.tpl,v 1.4 2005/02/24 19:51:06 sebastian Exp $ -->
|
<!-- $Id: smarty-dynamic-green.tpl,v 1.5 2005/02/25 16:58:26 sebastian Exp $ -->
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right" valign="top" class="green"><b>{$element.label}:</b></td>
|
<td align="right" valign="top" class="green"><b>{$element.label}:</b></td>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||||
<!-- $Id: smarty-dynamic.tpl,v 1.4 2005/02/24 19:51:06 sebastian Exp $ -->
|
<!-- $Id: smarty-dynamic.tpl,v 1.5 2005/02/25 16:58:26 sebastian Exp $ -->
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Smarty template for Array renderer</title>
|
<title>Smarty template for Array renderer</title>
|
||||||
|
|
|
@ -40,12 +40,12 @@
|
||||||
{include file="editMetaData.tpl"}
|
{include file="editMetaData.tpl"}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{if $changeStationPrefs}
|
{if $changeStationPrefs}
|
||||||
{include file="changeStationPrefs.tpl"}
|
{include file="changeStationPrefs.tpl"}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{if $playlist}
|
{if $PL_simpleManagement}
|
||||||
{include file="playlist/playlist.tpl"}
|
{include file="playlist/simpleManagement.tpl"}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
<div id="menu_top">
|
<div id="menu_top">
|
||||||
<a href="{$UI_BROWSER}?act=fileBrowse&id={$START.fid}">[File Browser]</a>
|
<a href="{$UI_BROWSER}?act=fileBrowse&id={$START.fid}">[File Browser]</a>
|
||||||
<a href="{$UI_BROWSER}?id={$START.fid}&act=uploadFileM">[UploadM]</a>
|
<!-- <a href="{$UI_BROWSER}?id={$START.fid}&act=uploadFileM">[UploadM]</a> -->
|
||||||
<a href="{$UI_BROWSER}?id={$START.fid}&act=uploadFile">[Upload]</a>
|
<a href="{$UI_BROWSER}?id={$START.fid}&act=uploadFile">[Upload]</a>
|
||||||
<a href="{$UI_BROWSER}?id={$START.fid}&act=addWebstream">[Stream]</a>
|
<a href="{$UI_BROWSER}?id={$START.fid}&act=addWebstream">[Stream]</a>
|
||||||
|
<a href="{$UI_BROWSER}?id={$START.fid}&act=PL.simpleManagement">[PL Editor]</a>
|
||||||
<a href="javascript:newFolder()">[Create new folder]</a>
|
<a href="javascript:newFolder()">[Create new folder]</a>
|
||||||
<a href="{$UI_BROWSER}?id={$START.id}&act=SEARCH">[Search]</a>
|
<a href="{$UI_BROWSER}?id={$START.id}&act=SEARCH">[Search]</a>
|
||||||
<a href="{$UI_BROWSER}?id={$START.id}&act=subjects">{tra 0='[Subjects]'}</a>
|
<a href="{$UI_BROWSER}?id={$START.id}&act=subjects">{tra 0='[User/Groups]'}</a>
|
||||||
<!-- <br>
|
<!-- <a href="{$UI_BROWSER}?act=MetaDataValues&Main=1">[Metadata]</a> -->
|
||||||
<a href="{$UI_BROWSER}?act=MetaDataValues&Main=1">[Metadata]</a> -->
|
|
||||||
<a href="{$UI_BROWSER}?act=changeStationPrefs">[StationPrefs]</a>
|
<a href="{$UI_BROWSER}?act=changeStationPrefs">[StationPrefs]</a>
|
||||||
</div>
|
</div>
|
19
livesupport/modules/htmlUI/var/templates/playlist/simpleManagement.tpl
Executable file
19
livesupport/modules/htmlUI/var/templates/playlist/simpleManagement.tpl
Executable file
|
@ -0,0 +1,19 @@
|
||||||
|
{*Smarty template*}
|
||||||
|
|
||||||
|
<div class="standardFrame">
|
||||||
|
{include file="sub/x.tpl"}
|
||||||
|
|
||||||
|
<div align="center"><b>Simple Playlist Management</b></div>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
{if is_array($PLAYLIST) && count($PLAYLIST)} {* already activated Playlist *}
|
||||||
|
{foreach from=$PLAYLIST item=pl}
|
||||||
|
{$pl}
|
||||||
|
<br>
|
||||||
|
{/foreach}
|
||||||
|
{else} {* no active Playlist *}
|
||||||
|
No Playlist
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
|
@ -14,11 +14,19 @@
|
||||||
{foreach from=$searchres.items item=i}
|
{foreach from=$searchres.items item=i}
|
||||||
<tr style="background-color: {cycle values='#eeeeee, #dadada'}"
|
<tr style="background-color: {cycle values='#eeeeee, #dadada'}"
|
||||||
onMouseOver="highlight()" onMouseOut="darklight()"
|
onMouseOver="highlight()" onMouseOut="darklight()"
|
||||||
onContextmenu="return menu('{$i.id}'
|
onContextmenu="return menu('{$i.id}'
|
||||||
{if $i.type == ('audioclip' || 'webstream')}
|
{if ($i.type == 'audioclip' || $i.type == 'webstream')}
|
||||||
,'PL.addItem', 'PL.newUsingItem', 'SP.addItem'
|
,'PL.addItem', 'PL.newUsingItem', 'SP.addItem', 'delete'
|
||||||
{/if}
|
{/if}
|
||||||
)"
|
{if ($i.type == 'playlist')}
|
||||||
|
,'PL.activate'
|
||||||
|
{if $PLAYLIST.id == $i.id}
|
||||||
|
,'PL.release'
|
||||||
|
{else}
|
||||||
|
,'PL.addItem', 'SP.addItem', 'delete'
|
||||||
|
{/if}
|
||||||
|
{/if}
|
||||||
|
)"
|
||||||
>
|
>
|
||||||
<td align="center">{$i.title}</td>
|
<td align="center">{$i.title}</td>
|
||||||
<td align="center">{$i.creator}</td>
|
<td align="center">{$i.creator}</td>
|
||||||
|
|
|
@ -328,8 +328,7 @@ class uiBase
|
||||||
'duration' => $this->_niceTime($this->_getMDataValue($id, 'dcterms:extent')),
|
'duration' => $this->_niceTime($this->_getMDataValue($id, 'dcterms:extent')),
|
||||||
'type' => $this->gb->getFileType($id),
|
'type' => $this->gb->getFileType($id),
|
||||||
);
|
);
|
||||||
|
return ($data);
|
||||||
return ($data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ class uiBrowser extends uiBase {
|
||||||
|
|
||||||
|
|
||||||
function getAlertMsg()
|
function getAlertMsg()
|
||||||
{
|
{
|
||||||
if ($_SESSION['alertMsg']) {
|
if ($_SESSION['alertMsg']) {
|
||||||
$this->alertMsg = $_SESSION['alertMsg'];
|
$this->alertMsg = $_SESSION['alertMsg'];
|
||||||
unset($_SESSION['alertMsg']);
|
unset($_SESSION['alertMsg']);
|
||||||
|
|
|
@ -40,18 +40,30 @@ class uiHandler extends uiBase {
|
||||||
{
|
{
|
||||||
session_destroy();
|
session_destroy();
|
||||||
session_start();
|
session_start();
|
||||||
if ($this->_validateForm($formdata, $mask)) {
|
|
||||||
$sessid = $this->gb->login($formdata['login'], $formdata['pass']);
|
if (!$this->_validateForm($formdata, $mask)) {
|
||||||
if($sessid && !PEAR::isError($sessid)){
|
$_SESSION['retransferFormData']['login']=$formdata['login'];
|
||||||
setcookie($this->config['authCookieName'], $sessid);
|
$this->redirUrl = UI_BROWSER.'?popup[]=login';
|
||||||
$id = $this->gb->getObjId($formdata['login'], $this->gb->storId);
|
return FALSE;
|
||||||
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';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
$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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -5,6 +5,7 @@ class uiPlaylist
|
||||||
{
|
{
|
||||||
$this->Base =& $uiBase;
|
$this->Base =& $uiBase;
|
||||||
$this->active =& $_SESSION[UI_PLAYLIST_SESSNAME]['active'];
|
$this->active =& $_SESSION[UI_PLAYLIST_SESSNAME]['active'];
|
||||||
|
$this->token =& $_SESSION[UI_PLAYLIST_SESSNAME]['token'];
|
||||||
$this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
|
$this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +15,7 @@ class uiPlaylist
|
||||||
}
|
}
|
||||||
|
|
||||||
function get()
|
function get()
|
||||||
{ #print_r($this->items);
|
{
|
||||||
return is_array($this->active) ? $this->active : FALSE;
|
return is_array($this->active) ? $this->active : FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,21 +23,22 @@ class uiPlaylist
|
||||||
{
|
{
|
||||||
# test if PL available
|
# test if PL available
|
||||||
# look PL
|
# look PL
|
||||||
# store access token to ls_pref
|
# store access token to ls_pref abd session
|
||||||
# load PL into 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');
|
$this->Base->_retMsg('You have an Playlist already activated,\n first close it');
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if($this->Base->gb->playlistIsAvailable($plid, $this->Base->sessid) !== TRUE) {
|
if(($userid = $this->Base->gb->playlistIsAvailable($plid, $this->Base->sessid)) !== TRUE) {
|
||||||
$this->Base->_retMsg('Playlist is looked');
|
$this->Base->_retMsg('Playlist is looked by $1', $this->Base->gb->getSubjName($userid));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
$token = $this->Base->gb->lockPlaylistForEdit($plid, $this->Base->sessid);
|
$this->token = $this->Base->gb->lockPlaylistForEdit($plid, $this->Base->sessid);
|
||||||
$this->Base->gb->savePref($this->Base->sessid, UI_PL_ACCESSTOKEN_KEY, $token);
|
$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 = $this->Base->gb->getPlaylistArray($plid, $this->Base->sessid);
|
||||||
$this->active['id'] = $plid;
|
$this->active['id'] = $plid;
|
||||||
$this->Base->_retMsg('Playlist "$1" activated', $this->Base->_getMDataValue($plid, 'title'));
|
$this->Base->_retMsg('Playlist "$1" activated', $this->Base->_getMDataValue($plid, 'title'));
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
function release()
|
function release()
|
||||||
|
@ -45,20 +47,35 @@ class uiPlaylist
|
||||||
# release PL
|
# release PL
|
||||||
# delete PL from session
|
# delete PL from session
|
||||||
# remove token from ls_pref
|
# 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');
|
$this->Base->_retMsg('No Playlist is looked by You');
|
||||||
return FALSE;
|
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->Base->_retMsg('Playlist "$1" released', $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($plgunid), 'title'));
|
||||||
$this->active = NULL;
|
$this->active = NULL;
|
||||||
|
$this->token = NULL;
|
||||||
$this->Base->gb->delPref($this->Base->sessid, UI_PL_ACCESSTOKEN_KEY);
|
$this->Base->gb->delPref($this->Base->sessid, UI_PL_ACCESSTOKEN_KEY);
|
||||||
return TRUE;
|
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)
|
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
|
# create PL
|
||||||
# activate
|
# activate
|
||||||
# add clip
|
# 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)) {
|
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');
|
$this->Base->_retMsg('Cannot create Playlist');
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
$this->activate($plid);
|
return $plid;
|
||||||
if (!$this->Base->gb->addAudioClipToPlaylist($token, $id, $this->Base->sessid)) {
|
}
|
||||||
$this->Base_retMsg('Cannot add File to Playlist');
|
|
||||||
|
function testNew()
|
||||||
|
{
|
||||||
|
# if not exists -> create new
|
||||||
|
if (is_array($this->active)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
$plid = $this->createEmpty();
|
||||||
|
$this->activate($plid);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,24 +82,27 @@ class uiSearch
|
||||||
function searchDB()
|
function searchDB()
|
||||||
{
|
{
|
||||||
$this->results = NULL;
|
$this->results = NULL;
|
||||||
#print_r($this->criteria);
|
|
||||||
$results = $this->Base->gb->localSearch($this->criteria, $this->Base->sessid);
|
$results = $this->Base->gb->localSearch($this->criteria, $this->Base->sessid);
|
||||||
foreach ($results['results'] as $rec) {
|
foreach ($results['results'] as $rec) {
|
||||||
$this->results['items'][] = $this->Base->_getMetaInfo($this->Base->gb->_idFromGunid($rec));
|
$this->results['items'][] = $this->Base->_getMetaInfo($this->Base->gb->_idFromGunid($rec));
|
||||||
}
|
}
|
||||||
|
#print_r($this->criteria); print_r($this->results);
|
||||||
$this->pagination($results);
|
$this->pagination($results);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function pagination(&$results)
|
function pagination(&$results)
|
||||||
{
|
{
|
||||||
|
if (sizeof($this->results) == 0) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
$this->results['count'] = $results['cnt'];
|
$this->results['count'] = $results['cnt'];
|
||||||
$this->results['next'] = $results['cnt'] > $this->criteria['offset'] + $this->criteria['limit'] ? TRUE : FALSE;
|
$this->results['next'] = $results['cnt'] > $this->criteria['offset'] + $this->criteria['limit'] ? TRUE : FALSE;
|
||||||
$this->results['prev'] = $this->criteria['offset'] > 0 ? TRUE : FALSE;
|
$this->results['prev'] = $this->criteria['offset'] > 0 ? TRUE : FALSE;
|
||||||
|
|
||||||
$p = 1;
|
$p = 1;
|
||||||
for ($n = 1; $n <= ceil($results['cnt'] / $this->criteria['limit']); $n = $n+$p) {
|
for ($n = 1; $n <= ceil($results['cnt'] / $this->criteria['limit']); $n = $n+$p) {
|
||||||
$p = bcpow(10, floor($n/10)); echo "$p<br>";
|
$p = bcpow(10, floor($n/10));
|
||||||
$this->results['pages'][$n-1] = $n;
|
$this->results['pages'][$n-1] = $n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue