+
+
+ server time
+
+
+
+
+
+ local time
+
+
+
+
+
+

+
+
+
+ {$STATIONPREFS.stationName}
+
+ {$STATIONPREFS.frequency}
+
+
+
+ {include file="userinfo.tpl"}
+
+
+
diff --git a/livesupport/modules/htmlUI/var/ui_base.inc.php b/livesupport/modules/htmlUI/var/ui_base.inc.php
index 5a8efea57..d708e78f1 100644
--- a/livesupport/modules/htmlUI/var/ui_base.inc.php
+++ b/livesupport/modules/htmlUI/var/ui_base.inc.php
@@ -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.');
}
}
}
diff --git a/livesupport/modules/htmlUI/var/ui_browser.class.php b/livesupport/modules/htmlUI/var/ui_browser.class.php
index aaf885a7b..af42d9627 100644
--- a/livesupport/modules/htmlUI/var/ui_browser.class.php
+++ b/livesupport/modules/htmlUI/var/ui_browser.class.php
@@ -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']);
diff --git a/livesupport/modules/htmlUI/var/ui_browser_init.php b/livesupport/modules/htmlUI/var/ui_browser_init.php
index 2ebb31f95..43dd9af2d 100644
--- a/livesupport/modules/htmlUI/var/ui_browser_init.php
+++ b/livesupport/modules/htmlUI/var/ui_browser_init.php
@@ -1,66 +1,68 @@
-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']);
-}
-?>
+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']);
+}
+?>
\ No newline at end of file
diff --git a/livesupport/modules/htmlUI/var/ui_handler.class.php b/livesupport/modules/htmlUI/var/ui_handler.class.php
index 2856ee3f9..9fbeacc34 100644
--- a/livesupport/modules/htmlUI/var/ui_handler.class.php
+++ b/livesupport/modules/htmlUI/var/ui_handler.class.php
@@ -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;
}
}
?>
\ No newline at end of file
diff --git a/livesupport/modules/htmlUI/var/ui_scratchpad.class.php b/livesupport/modules/htmlUI/var/ui_scratchpad.class.php
index 6e447a1b3..50be9b375 100755
--- a/livesupport/modules/htmlUI/var/ui_scratchpad.class.php
+++ b/livesupport/modules/htmlUI/var/ui_scratchpad.class.php
@@ -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];
}
}
diff --git a/livesupport/modules/htmlUI/var/ui_search.class.php b/livesupport/modules/htmlUI/var/ui_search.class.php
index 23fe02ac8..e375dd9bd 100755
--- a/livesupport/modules/htmlUI/var/ui_search.class.php
+++ b/livesupport/modules/htmlUI/var/ui_search.class.php
@@ -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