*** empty log message ***

This commit is contained in:
sebastian 2005-02-25 16:58:26 +00:00
parent 0da71b6798
commit f181ea7515
20 changed files with 137 additions and 58 deletions

View File

@ -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 <messju@lammfellpuschen.de>

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 $
------------------------------------------------------------------------------*/

View File

@ -18,12 +18,11 @@ $ui_fmask = array(
'type' => 'text',
'label' => 'Reduce Upload Filesize<br><small>(must be smaller than ' .ini_get('upload_max_filesize').')</small>',
'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',

View File

@ -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;
}
}

View File

@ -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;

View File

@ -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>
<td valign="top" align="right">

View File

@ -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>
<td align="right" valign="top" class="green"><b>{$element.label}:</b></td>

View File

@ -1,5 +1,5 @@
<!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>
<head>
<title>Smarty template for Array renderer</title>

View File

@ -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}

View File

@ -1,12 +1,12 @@
<div id="menu_top">
<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=addWebstream">[Stream]</a>
<a href="{$UI_BROWSER}?id={$START.fid}&act=PL.simpleManagement">[PL Editor]</a>
<a href="javascript:newFolder()">[Create&nbsp;new&nbsp;folder]</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>
<!-- <br>
<a href="{$UI_BROWSER}?act=MetaDataValues&Main=1">[Metadata]</a> -->
<a href="{$UI_BROWSER}?id={$START.id}&act=subjects">{tra 0='[User/Groups]'}</a>
<!-- <a href="{$UI_BROWSER}?act=MetaDataValues&Main=1">[Metadata]</a> -->
<a href="{$UI_BROWSER}?act=changeStationPrefs">[StationPrefs]</a>
</div>

View 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>

View File

@ -14,11 +14,19 @@
{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}
)"
onContextmenu="return menu('{$i.id}'
{if ($i.type == 'audioclip' || $i.type == 'webstream')}
,'PL.addItem', 'PL.newUsingItem', 'SP.addItem', 'delete'
{/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.creator}</td>

View File

@ -328,8 +328,7 @@ class uiBase
'duration' => $this->_niceTime($this->_getMDataValue($id, 'dcterms:extent')),
'type' => $this->gb->getFileType($id),
);
return ($data);
return ($data);
}

View File

@ -50,7 +50,7 @@ class uiBrowser extends uiBase {
function getAlertMsg()
{
{
if ($_SESSION['alertMsg']) {
$this->alertMsg = $_SESSION['alertMsg'];
unset($_SESSION['alertMsg']);

View File

@ -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;
}
/**

View File

@ -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;
}
}

View File

@ -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<br>";
$p = bcpow(10, floor($n/10));
$this->results['pages'][$n-1] = $n;
}