*** empty log message ***

This commit is contained in:
sebastian 2005-02-24 14:00:15 +00:00
parent 5fc8fb9d42
commit 644d80d120
26 changed files with 245 additions and 196 deletions

View File

@ -2979,7 +2979,7 @@
* libs/Smarty.class.php
libs/Smarty_Compiler.class.php:
added CVS $Id: ChangeLog,v 1.2 2005/02/23 22:57:14 sebastian Exp $
added CVS $Id: ChangeLog,v 1.3 2005/02/24 14:00:15 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.2 2005/02/23 22:57:14 sebastian Exp $ */
/* $Id: Config_File.class.php,v 1.3 2005/02/24 14:00:15 sebastian Exp $ */
/**
* Config file reading class

View File

@ -30,7 +30,7 @@
* @version 2.6.6
*/
/* $Id: Smarty.class.php,v 1.2 2005/02/23 22:57:14 sebastian Exp $ */
/* $Id: Smarty.class.php,v 1.3 2005/02/24 14:00:15 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.2 2005/02/23 22:57:14 sebastian Exp $ */
/* $Id: Smarty_Compiler.class.php,v 1.3 2005/02/24 14:00:15 sebastian Exp $ */
/**
* Template compiling class

View File

@ -14,16 +14,17 @@
* Author: Media Development Loan Fund
* -------------------------------------------------------------
*/
function smarty_outputfiler_localizer_tra($matches)
function smarty_postfiler_localizer_tra($matches)
{
foreach ($matches as $match) {
$key = substr($match, 2, strpos(substr($match, 2), '#'));
return tra(preg_replace('/%%/', '', $match));
}
}
function smarty_outputfilter_localizer($compiled, &$smarty)
function smarty_postfilter_localizer($compiled, &$smarty)
{
$pattern = '/##.*##/U';
return preg_replace_callback($pattern, 'smarty_outputfiler_localizer_tra', $compiled);
$pattern = '/%%.*%%/U';
return preg_replace_callback($pattern, 'smarty_postfiler_localizer_tra', $compiled);
}
?>

View File

@ -23,7 +23,7 @@
Author : $Author: sebastian $
Version : $Revision: 1.14 $
Version : $Revision: 1.15 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/htmlUI/var/Attic/conf.php,v $
------------------------------------------------------------------------------*/

View File

@ -1,11 +1,11 @@
<?php
$ui_fmask = array(
/* ===================== list of system preferences which can be adjusted */
'systemPrefs' => array(
'stationPrefs' => array(
array(
'element' => 'act',
'type' => 'hidden',
'constant' => 'editSystemPrefs'
'constant' => 'changeStationPrefs'
),
array(
'element' => 'basics',
@ -18,7 +18,12 @@ $ui_fmask = array(
'type' => 'text',
'label' => 'Maximum File Size for Upload',
'required' => TRUE,
'default' => strtr(ini_get('upload_max_filesize'), array('M'=>'000000', 'k'=>'000'))
'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.")'
)
),
array(
'rule' => 'nopunctuation',
@ -360,6 +365,19 @@ $ui_fmask = array(
'playlist' => 'Playlist'
)
),
array(
'element' => 'limit',
'type' => 'select',
'label' => 'Rows per Page',
'options' => array(
1 => 1,
5 => 5,
10 => 10,
25 => 25,
50 => 50,
100 => 100
)
),
array(
'element' => 'clear',
'type' => 'button',

View File

@ -95,7 +95,7 @@ if ($uiBrowser->userid) {
case "SEARCH":
if (is_array($uiBrowser->SEARCH->criteria) ){
$Smarty->assign('searchres', $uiBrowser->SEARCH->results);
$Smarty->assign('searchres', $uiBrowser->SEARCH->results);
$Smarty->assign('showSearchRes', TRUE);
};
@ -142,9 +142,9 @@ if ($uiBrowser->userid) {
$Smarty->assign('showFile', TRUE);
break;
case "editSystemPrefs":
$Smarty->assign('dynform', $uiBrowser->editSystemPrefs($ui_fmask['systemPrefs']));
$Smarty->assign('editSystemPrefs', TRUE);
case "changeStationPrefs":
$Smarty->assign('dynform', $uiBrowser->changeStationPrefs($ui_fmask['stationPrefs']));
$Smarty->assign('changeStationPrefs', TRUE);
break;
case "PL.display":

View File

@ -1,4 +1,4 @@
<?php
<?php
require dirname(__FILE__).'/../ui_handler_init.php';
switch($_REQUEST['act']){
@ -104,8 +104,8 @@ switch($_REQUEST['act']){
$uiHandler->removeGroupMember($_REQUEST);
break;
case "editSystemPrefs":
$uiHandler->editSystemPrefs(array_merge($_REQUEST, $_FILES), $ui_fmask["systemPrefs"]);
case "changeStationPrefs":
$uiHandler->changeStationPrefs(array_merge($_REQUEST, $_FILES), $ui_fmask["stationPrefs"]);
break;
case "editMetaData":

View File

@ -1,4 +1,4 @@
<!-- $Id: smarty-dynamic-fancygroup.tpl,v 1.2 2005/02/23 22:57:14 sebastian Exp $ -->
<!-- $Id: smarty-dynamic-fancygroup.tpl,v 1.3 2005/02/24 14:00:15 sebastian Exp $ -->
<tr>
<td valign="top" align="right">

View File

@ -1,4 +1,4 @@
<!-- $Id: smarty-dynamic-green.tpl,v 1.2 2005/02/23 22:57:14 sebastian Exp $ -->
<!-- $Id: smarty-dynamic-green.tpl,v 1.3 2005/02/24 14:00:15 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.2 2005/02/23 22:57:14 sebastian Exp $ -->
<!-- $Id: smarty-dynamic.tpl,v 1.3 2005/02/24 14:00:15 sebastian Exp $ -->
<html>
<head>
<title>Smarty template for Array renderer</title>

View File

@ -2,14 +2,14 @@
{include file="sub/x.tpl"}
<table border="0" width="90%" align="center">
{if count($structure.listdata)}
<tr bgcolor="{cycle values='#eeeeee, #dadada"'}">
<tr bgcolor="{cycle values='#eeeeee, #dadada"'}">
<th>Title</th>
<th>Type</th>
<td align="right">
{if $GLOBALS.pid}<a href="{$UI_BROWSER}?act=fileBrowse&id={$GLOBALS.pid}">[go up]</a>{/if}
<td align="right" width='70%'> &nbsp;
{if $START.pid}<a href="{$UI_BROWSER}?act=fileBrowse&id={$GLOBALS.pid}">[go up]</a>{/if}
</td>
</tr>
{if count($structure.listdata)}
{foreach from=$structure.listdata item=i}
<tr bgcolor="{cycle values='#eeeeee, #dadada"'}"
onMouseOver="highlight()" onMouseOut="darklight()"
@ -30,31 +30,30 @@
</td>
<td align="center">{$i.type}</td>
<td>
&nbsp;<a href="javascript:frename('{$i.name}', '{$i.id}')">[rename]</a>
<!-- &nbsp;<a href="javascript:frename('{$i.name}', '{$i.id}')">[rename]</a> -->
&nbsp;<a href="javascript:fmove('{$i.id}', '.')">[move]</a>
&nbsp;<a href="javascript:fcopy('{$i.id}', '.')">[copy]</a>
&nbsp;<a href="{$UI_BROWSER}?act=permissions&id={$i.id}">[permissions]</a>
<br>
&nbsp;
<!--
{if ($delOverride eq $i.id)}
<a href="{$UI_HANDLER}?act=delete&id={$i.id}&delOverride={$i.id}"
onClick="return confirm('Really delete non empty Folder &quot;{$i.name}&quot; now?')">[DEL]</a>
{else}
<a href="{$UI_HANDLER}?act=delete&id={$i.id}"
onClick="return confirm('Delete &quot;{$i.name}&quot;?')">[DEL]</a>
{/if}
{/if} -->
{if $i.type != 'Folder'}
&nbsp;<a href="{$UI_BROWSER}?act=getFile&id={$i.id}">[Access]</a>
&nbsp;<a href="{$UI_BROWSER}?act=getMData&id={$i.id}">[vMData]</a>
&nbsp;<a href="{$UI_BROWSER}?act=_analyzeFile&id={$i.id}">[Analyze]</a>
&nbsp;
<br>
&nbsp;<a href="{$UI_BROWSER}?act=getMData&id={$i.id}">[MDataXML]</a>
&nbsp;<a href="{$UI_BROWSER}?act=editMetaData&id={$i.id}">[MDataForm]</a>
{if $i.type eq 'webstream'}
<a href="{$UI_BROWSER}?act=addWebstream&id={$i.id}&replace=1">[Replace]</a>
&nbsp;<a href="{$UI_BROWSER}?act=addWebstream&id={$i.id}&replace=1">[Replace]</a>
{elseif $i.type eq 'audioclip'}
<a href="{$UI_BROWSER}?act=uploadFile&id={$i.id}&replace=1">[Replace]</a>
&nbsp;<a href="{$UI_BROWSER}?act=uploadFile&id={$i.id}&replace=1">[Replace]</a>
&nbsp;<a href="{$CONFIG.accessRawAudioUrl}?id={$i.gunid}&sessid={$START.sessid}">[Access]</a>
&nbsp;<a href="{$UI_BROWSER}?act=_analyzeFile&id={$i.id}">[RawAnalyze]</a>
{/if}
&nbsp;<a href="{$UI_BROWSER}?act=editMetaData&id={$i.id}">[eMData]</a>
&nbsp;<a href="#" onclick="hpopup('{$UI_HANDLER}?act=SP.addItem&id={$i.id}', '2SP')">[SP]</a>
<!-- &nbsp;<a href="#" onclick="hpopup('{$UI_HANDLER}?act=SP.addItem&id={$i.id}', '2SP')">[SP]</a> -->
{/if}
&nbsp;
</td>

View File

@ -40,8 +40,8 @@
{include file="editMetaData.tpl"}
{/if}
{if $editSystemPrefs}
{include file="systemPrefs.tpl"}
{if $changeStationPrefs}
{include file="changeStationPrefs.tpl"}
{/if}
{if $playlist}

View File

@ -8,5 +8,5 @@
<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}?act=editSystemPrefs">[SystemPrefs]</a>
<a href="{$UI_BROWSER}?act=changeStationPrefs">[StationPrefs]</a>
</div>

View File

@ -1,7 +1,8 @@
{*Smarty template*}
{include file="script/scratchPad.js.tpl"}
<div id="scratchpad">
<center><b>ScratchPad</b>
<center><b>%%ScratchPad%%</b>
{if is_array($SCRATCHPAD)}
<form name="SP">

View File

@ -45,16 +45,19 @@ function work()
{
if (!document.layers && !document.all && !document.getElementById) return;
var runTime = new Date();
var dn = "AM";
var shours = hours;
var sminutes = minutes;
var sseconds = seconds;
if (shours >= 12)
{
dn = "PM";
shours-=12;
}
if (!shours) shours = 12;
//if (shours >= 12)
//{
// dn = "PM"; //change here for 12h format//
// shours-=12;
//}
//if (!shours) shours = 12;
//var dn = "AM";
var dn= ''
sminutes=twoDigit(sminutes);
sseconds=twoDigit(sseconds);
shours =twoDigit(shours );
@ -122,16 +125,19 @@ function lwork()
{
if (!document.layers && !document.all && !document.getElementById) return;
var runTime = new Date();
var dn = "AM";
var shours = lhours;
var sminutes = lminutes;
var sseconds = lseconds;
if (shours >= 12)
{
dn = "PM";
shours-=12;
}
if (!shours) shours = 12;
//if (shours >= 12)
//{
// dn = "PM"; //change here for 12h format//
// shours-=12;
//}
//if (!shours) shours = 12;
//var dn = "AM";
var dn= ''
sminutes=twoDigit(sminutes);
sseconds=twoDigit(sseconds);
shours =twoDigit(shours );

View File

@ -8,7 +8,7 @@ nn6=(document.getElementById && !document.all)?1:0;
menuStatus = 0;
document.onmouseup = hideMenu;
document.write('<div id="menucontainer"></div>');
menuWidth = 0,
menuWidth = 160,
menuHeight = 0;
function menu(id) {

View File

@ -1,30 +1,30 @@
{include file="script/clock.js.tpl"}
<div id="statusbar">
<div class="statusbaritem">
server time
<br>
<span id=servertime style="position:relative;"></span>
</div>
<div class="statusbaritem">
local time
<br>
<span id=localtime style="position:relative;"></span>
</div>
<div class="statusbaritem">
<img src="{$SYSTEMPREFS.stationLogoPath}" width="30" height="50">
</div>
<div class="statusbaritem">
{$SYSTEMPREFS.stationName}
<br>
{$SYSTEMPREFS.frequency}
</div>
<div class="statusbaritem">
{include file="userinfo.tpl"}
</div>
</div>
{include file="script/clock.js.tpl"}
<div id="statusbar">
<div class="statusbaritem">
server time
<br>
<span id=servertime style="position:relative;"></span>
</div>
<div class="statusbaritem">
local time
<br>
<span id=localtime style="position:relative;"></span>
</div>
<div class="statusbaritem">
<img src="{$STATIONPREFS.stationLogoPath}" width="30" height="50">
</div>
<div class="statusbaritem">
{$STATIONPREFS.stationName}
<br>
{$STATIONPREFS.frequency}
</div>
<div class="statusbaritem">
{include file="userinfo.tpl"}
</div>
</div>

View File

@ -82,7 +82,8 @@ class uiBase
}
$this->dbc->setFetchMode(DB_FETCHMODE_ASSOC);
$this->gb =& new GreenBox($this->dbc, $config);
$this->config = $config;
$this->config =& $config;
$this->config['accessRawAudioUrl'] = $config['storageUrlPath'].'/xmlrpc/simpleGet.php';
$this->sessid = $_REQUEST[$config['authCookieName']];
$this->userid = $this->gb->getSessUserId($this->sessid);
$this->login = $this->gb->getSessLogin($this->sessid);
@ -92,20 +93,28 @@ class uiBase
$this->fid = $this->type=='Folder' ? $this->id : $this->pid;
$this->InputTextStandardAttrib = array('size' =>UI_INPUT_STANDARD_SIZE,
'maxlength'=>UI_INPUT_STANDARD_MAXLENGTH);
$this->SYSTEMPREFS =& $_SESSION[UI_STATIONINFO_SESSNAME];
$this->SCRATCHPAD =& new uiScratchPad($this);
$this->SEARCH =& new uiSearch($this);
$this->PLAYLIST =& new uiPlaylist($this);
$this->STATIONPREFS =& $_SESSION[UI_STATIONINFO_SESSNAME];
$this->SCRATCHPAD =& new uiScratchPad($this);
$this->SEARCH =& new uiSearch($this);
$this->PLAYLIST =& new uiPlaylist($this);
}
function loadSystemPrefs(&$mask)
function loadStationPrefs(&$mask)
{
if (!is_array($this->SYSTEMPREFS)) {
if (!is_array($this->STATIONPREFS)) {
foreach ($mask as $key=>$val) {
if ($val['isPref'])
$this->SYSTEMPREFS[$val['element']] = is_string($this->gb->loadGroupPref(NULL, 'StationPrefs', $val['element'])) ? $this->gb->loadGroupPref($this->sessid, 'StationPrefs', $val['element']) : NULL;
if ($val['isPref']) {
if (is_string($setting = $this->gb->loadGroupPref(NULL, 'StationPrefs', $val['element']))) {
$this->STATIONPREFS[$val['element']] = $setting;
} else {
$miss = TRUE;
}
}
}
if ($miss && $this->login) {
$this->_retMsg('Note: Station Preferences not setup.');
}
}
}

View File

@ -154,7 +154,7 @@ class uiBrowser extends uiBase {
function uploadFileM(&$mask, $id)
{
$form = new HTML_QuickForm('uploadFileM', UI_STANDARD_FORM_METHOD, UI_HANDLER);
$form->setMaxFileSize($this->SYSTEMPREFS['stationMaxfilesize']);
$form->setMaxFileSize($this->STATIONPREFS['stationMaxfilesize']);
$form->setConstants(array('id' => $id,
'act' => 'uploadFileM'));
$this->_parseArr2Form($form, $mask);
@ -174,7 +174,7 @@ class uiBrowser extends uiBase {
function uploadFile(&$mask, $id, $replace=FALSE)
{
$form = new HTML_QuickForm('uploadFile', UI_STANDARD_FORM_METHOD, UI_HANDLER);
$form->setMaxFileSize($this->SYSTEMPREFS['stationMaxfilesize']);
$form->setMaxFileSize($this->STATIONPREFS['stationMaxfilesize']);
$form->setConstants(array('id' => $id,
'act' => $replace ? 'replaceFile' : 'uploadFile'));
$this->_parseArr2Form($form, $mask);
@ -403,9 +403,9 @@ class uiBrowser extends uiBase {
function editSystemPrefs(&$mask)
function changeStationPrefs(&$mask)
{
$form = new HTML_QuickForm('systemPrefs', UI_STANDARD_FORM_METHOD, UI_HANDLER);
$form = new HTML_QuickForm('changeStationPrefs', UI_STANDARD_FORM_METHOD, UI_HANDLER);
foreach($mask as $key=>$val) {
$p = $this->gb->loadGroupPref($this->sessid, 'StationPrefs', $val['element']);

View File

@ -1,66 +1,68 @@
<?php
session_start();
## LS classes/functions #############################################
require_once dirname(__FILE__).'/conf.php';
require_once dirname(__FILE__).'/ui_base.inc.php';
require_once dirname(__FILE__).'/ui_browser.class.php';
require_once dirname(__FILE__).'/ui_scratchpad.class.php';
require_once dirname(__FILE__).'/ui_playlist.class.php'; #
require_once dirname(__FILE__).'/ui_search.class.php';
require_once dirname(__FILE__).'/../../storageServer/var/GreenBox.php';
require_once dirname(__FILE__).'/formmask/general.inc.php';
## well known classes ###############################################
require_once dirname(__FILE__).'/Smarty/libs/Smarty.class.php';
require_once 'DB.php';
require_once 'HTML/QuickForm.php';
require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
#PEAR::setErrorHandling(PEAR_ERROR_TRIGGER, E_USER_WARNING);
#PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'errCallBack');
PEAR::setErrorHandling(PEAR_ERROR_RETURN);
#PEAR::setErrorHandling(PEAR_ERROR_PRINT);
## initialize objects ###############################################
$Smarty =& new Smarty;
$uiBrowser =& new uiBrowser($config);
#$uiBase = new uiBase($config);
$uiBase =& $uiBrowser;
#$uiScratchPad = new uiScratchPad(&$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('output', 'localizer');
## some basic things ################################################
$Smarty->assign('UI_BROWSER', UI_BROWSER);
$Smarty->assign('UI_HANDLER', UI_HANDLER);
$Smarty->assign('ACT', $_REQUEST['act']);
$Smarty->assign('START', array(
'id' => &$uiBrowser->id,
'pid' => &$uiBrowser->pid,
'fid' => &$uiBrowser->fid
));
$Smarty->assign('USER', array('sessid' => &$uiBrowser->sessid,
'userid' => &$uiBrowser->userid,
'login' => &$uiBrowser->login
));
$uiBrowser->loadSystemPrefs($ui_fmask['systemPrefs']);
$Smarty->assign('SYSTEMPREFS', $uiBrowser->SYSTEMPREFS);
## retransfer incomplete formdata from SESSION to POST-data #########
if (is_array($_SESSION['retransferFormData'])){
foreach($_SESSION['retransferFormData'] as $k=>$v){
$_POST[$k] = $v;
}
unset($_SESSION['retransferFormData']);
}
?>
<?php
session_start();
## LS classes/functions #############################################
require_once dirname(__FILE__).'/conf.php';
require_once dirname(__FILE__).'/ui_base.inc.php';
require_once dirname(__FILE__).'/ui_browser.class.php';
require_once dirname(__FILE__).'/ui_scratchpad.class.php';
require_once dirname(__FILE__).'/ui_playlist.class.php'; #
require_once dirname(__FILE__).'/ui_search.class.php';
require_once dirname(__FILE__).'/../../storageServer/var/GreenBox.php';
require_once dirname(__FILE__).'/formmask/general.inc.php';
## well known classes ###############################################
require_once dirname(__FILE__).'/Smarty/libs/Smarty.class.php';
require_once 'DB.php';
require_once 'HTML/QuickForm.php';
require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
#PEAR::setErrorHandling(PEAR_ERROR_TRIGGER, E_USER_WARNING);
#PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'errCallBack');
PEAR::setErrorHandling(PEAR_ERROR_RETURN);
#PEAR::setErrorHandling(PEAR_ERROR_PRINT);
## initialize objects ###############################################
$Smarty =& new Smarty;
$uiBrowser =& new uiBrowser($config);
#$uiBase = new uiBase($config);
$uiBase =& $uiBrowser;
#$uiScratchPad = new uiScratchPad(&$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', 'localizer');
## some basic things ################################################
$Smarty->assign('UI_BROWSER', UI_BROWSER);
$Smarty->assign('UI_HANDLER', UI_HANDLER);
$Smarty->assign('ACT', $_REQUEST['act']);
$Smarty->assign('CONFIG', $config);
$Smarty->assign('START', array(
'id' => &$uiBrowser->id,
'pid' => &$uiBrowser->pid,
'fid' => &$uiBrowser->fid,
'sessid' => &$uiBrowser->sessid
));
$Smarty->assign('USER', array('sessid' => &$uiBrowser->sessid,
'userid' => &$uiBrowser->userid,
'login' => &$uiBrowser->login
));
$uiBrowser->loadStationPrefs($ui_fmask['stationPrefs']);
$Smarty->assign('STATIONPREFS', $uiBrowser->STATIONPREFS);
## retransfer incomplete formdata from SESSION to POST-data #########
if (is_array($_SESSION['retransferFormData'])){
foreach($_SESSION['retransferFormData'] as $k=>$v){
$_POST[$k] = $v;
}
unset($_SESSION['retransferFormData']);
}
?>

View File

@ -134,7 +134,7 @@ class uiHandler extends uiBase {
return FALSE;
}
if (!$this->_validateForm($formdata, $mask)) {
$this->redirUrl = UI_BROWSER."?act=addWebstream&id=".$id;
$this->redirUrl = UI_BROWSER."?act=uploadFile&id=".$id;
return FALSE;
}
$tmpgunid = md5(microtime().$_SERVER['SERVER_ADD3R'].rand()."org.mdlf.livesupport");
@ -544,32 +544,31 @@ class uiHandler extends uiBase {
}
function editSystemPrefs(&$formdata, &$mask)
function changeStationPrefs(&$formdata, &$mask)
{
$this->redirUrl = UI_BROWSER;
if ($this->_validateForm($formdata, $mask)) {
foreach($mask as $key=>$val) {
if ($val['isPref']) {
if (strlen($formdata[$val['element']]))
$this->gb->saveGroupPref($this->sessid, 'StationPrefs', $val['element'], $formdata[$val['element']]);
else
$this->gb->delGroupPref($this->sessid, 'StationPrefs', $val['element']);
$this->SYSTEMPREFS[$val['element']] = is_string($this->gb->loadGroupPref(NULL, 'StationPrefs', $val['element'])) ? $this->gb->loadGroupPref($this->sessid, 'StationPrefs', $val['element']) : NULL;
}
if ($val['type'] == 'file' && $formdata[$val['element']]['name']) {
if (FALSE === @move_uploaded_file($formdata[$val['element']]['tmp_name'], $this->gb->loadGroupPref($this->sessid, 'StationPrefs', 'stationLogoPath')))
$this->_retMsg('Error uploading Logo');
return;
}
}
$this->_retMsg('Settings saved');
return TRUE;
} else {
if ($this->_validateForm($formdata, $mask) == FALSE) {
$this->_retMsg('Error saving Settings');
return FALSE;
}
foreach($mask as $key=>$val) {
if ($val['isPref']) {
if (strlen($formdata[$val['element']]))
$this->gb->saveGroupPref($this->sessid, 'StationPrefs', $val['element'], $formdata[$val['element']]);
else
$this->gb->delGroupPref($this->sessid, 'StationPrefs', $val['element']);
$this->STATIONPREFS[$val['element']] = is_string($this->gb->loadGroupPref(NULL, 'StationPrefs', $val['element'])) ? $this->gb->loadGroupPref($this->sessid, 'StationPrefs', $val['element']) : NULL;
}
if ($val['type'] == 'file' && $formdata[$val['element']]['name']) {
if (FALSE === @move_uploaded_file($formdata[$val['element']]['tmp_name'], $this->gb->loadGroupPref($this->sessid, 'StationPrefs', 'stationLogoPath')))
$this->_retMsg('Error uploading Logo');
return;
}
}
$this->_retMsg('Settings saved');
return TRUE;
}
}
?>

View File

@ -65,7 +65,7 @@ class uiScratchPad
function addItem($id)
{
if(!$this->Base->SYSTEMPREFS[UI_SCRATCHPAD_MAXLENGTH_KEY]) {
if(!$this->Base->STATIONPREFS[UI_SCRATCHPAD_MAXLENGTH_KEY]) {
$this->Base->_retMsg('ScratchPad length is not set in System Preferences, so it cannot be used.');
return false;
}
@ -81,7 +81,7 @@ class uiScratchPad
}
}
$sp = array_merge(array($item), is_array($sp) ? $sp : NULL);
for ($n=0; $n<$this->Base->SYSTEMPREFS[UI_SCRATCHPAD_MAXLENGTH_KEY]; $n++) {
for ($n=0; $n<$this->Base->STATIONPREFS[UI_SCRATCHPAD_MAXLENGTH_KEY]; $n++) {
if (is_array($sp[$n])) $this->items[$n] = $sp[$n];
}
}

View File

@ -7,7 +7,6 @@ class uiSearch
$this->results =& $_SESSION[UI_SEARCH_SESSNAME]['results'];
$this->criteria =& $_SESSION[UI_SEARCH_SESSNAME]['criteria'];
$this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
$this->criteria['limit'] = 3;
}
function setReload()
@ -57,12 +56,14 @@ class uiSearch
{
$this->results = NULL;
$this->criteria['conditions'] = NULL;
$this->criteria['offset'] = NULL;
$this->criteria['offset'] = NULL;
$this->criteria['operator'] = $formdata['operator'];
$this->criteria['filetype'] = $formdata['filetype'];
$this->criteria['form']['operator'] = $formdata['operator'];
$this->criteria['operator'] = $formdata['operator'];
$this->criteria['filetype'] = $formdata['filetype'];
$this->criteria['limit'] = $formdata['limit'];
$this->criteria['form']['operator'] = $formdata['operator']; ## $criteria['form'] is used for retransfer to form ##
$this->criteria['form']['filetype'] = $formdata['filetype'];
$this->criteria['form']['limit'] = $formdata['limit'];
foreach ($formdata as $key=>$val) {
if (is_array($val) && strlen($val[2])) {
@ -86,14 +87,27 @@ class uiSearch
foreach ($results['results'] as $rec) {
$this->results['items'][] = $this->Base->_getMetaInfo($this->Base->gb->_idFromGunid($rec));
}
$this->pagination($results);
}
function pagination(&$results)
{
$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;
for ($n = 0; $n < (ceil($results['cnt'] / $this->criteria['limit'])); $n++) {
$this->results['pages'][$n] = $n+1;
$p = 1;
for ($n = 1; $n <= ceil($results['cnt'] / $this->criteria['limit']); $n = $n+$p) {
$p = bcpow(10, floor($n/10)); echo "$p<br>";
$this->results['pages'][$n-1] = $n;
}
array_pop($this->results['pages']);
$this->results['pages'][ceil($results['cnt'] / $this->criteria['limit'])-1] = '>>';
}
function reOrder($by)
{
$this->criteria['offset'] = NULL;