.
*
* @return string
*/
- function getLanguageId()
+ function getLanguageId()
{
return $this->m_languageId;
} // fn getLanguageId
-
-
+
+
/**
* Get the two-letter language code for the translation table.
* @return string
*/
- function getLanguageCode()
+ function getLanguageCode()
{
return $this->m_languageCode;
} // fn getLanguageCode
-
+
/**
* Get the two-letter country code.
* @return string
*/
- function getCountryCode()
+ function getCountryCode()
{
return $this->m_countryCode;
} // fn getCountryCode
-
-
+
+
/**
* Return the file path for the last file loaded.
* @return string
*/
- function getSourceFile()
+ function getSourceFile()
{
return $this->m_filePath;
} // fn getSourceFile
-
-
+
+
/**
* This is only for use by the LocalizerFileFormat functions.
* @access private
*/
- function _setSourceFile($p_value)
+ function _setSourceFile($p_value)
{
$this->m_filePath = $p_value;
} // fn _setSourceFile
-
-
+
+
/**
* Return true if this LocalizerLanguage has the exact same
* translation strings as the given LocalizerLanguage.
@@ -187,7 +187,7 @@ class LocalizerLanguage {
* @param LocalizerLanguage $p_localizerLanguage
* @return boolean
*/
- function equal($p_localizerLanguage)
+ function equal($p_localizerLanguage)
{
if (count($this->m_translationTable) != count($p_localizerLanguage->m_translationTable)) {
return false;
@@ -204,20 +204,20 @@ class LocalizerLanguage {
}
return true;
} // fn equal
-
+
/**
- * Return a table indexed by the english language name, with the value being the
+ * Return a table indexed by the english language name, with the value being the
* target language equivalent.
*
* @return array
*/
- function getTranslationTable()
+ function getTranslationTable()
{
return $this->m_translationTable;
}
-
-
+
+
/**
* Get the full path to the translation file.
*
@@ -225,12 +225,12 @@ class LocalizerLanguage {
* Either 'gs' or 'xml'.
* @return string
*/
- function getFilePath($p_mode = null)
+ function getFilePath($p_mode = null)
{
global $g_localizerConfig;
if (is_null($p_mode)) {
$p_mode = $this->m_mode;
- }
+ }
if ($p_mode == 'xml') {
$relativePath = '/'.$this->m_languageId.'/'.$this->m_prefix.'.xml';
}
@@ -240,7 +240,7 @@ class LocalizerLanguage {
return $g_localizerConfig['TRANSLATION_DIR'].$relativePath;
} // fn getFilePath
-
+
/**
* Return TRUE if the given string exists in the translation table.
*
@@ -248,12 +248,12 @@ class LocalizerLanguage {
*
* @return boolean
*/
- function keyExists($p_string)
+ function keyExists($p_string)
{
return (isset($this->m_translationTable[$p_string]));
} // fn stringExists
-
-
+
+
/**
* Add a string to the translation table.
*
@@ -265,15 +265,15 @@ class LocalizerLanguage {
* value as the key.
*
* @param int $p_position
- * Optional. By default the string will be added to the end of the
+ * Optional. By default the string will be added to the end of the
* translation table.
*
* @return boolean
*/
- function addString($p_key, $p_value = null, $p_position = null)
+ function addString($p_key, $p_value = null, $p_position = null)
{
- if (!is_null($p_position)
- && (!is_numeric($p_position) || ($p_position < 0)
+ if (!is_null($p_position)
+ && (!is_numeric($p_position) || ($p_position < 0)
|| ($p_position > count($this->m_translationTable)))) {
return false;
}
@@ -304,8 +304,8 @@ class LocalizerLanguage {
return true;
}
} // fn addString
-
-
+
+
/**
* Get the position of a key or a value.
* @param string $p_key
@@ -313,7 +313,7 @@ class LocalizerLanguage {
* @return mixed
* The position of the key/value in the array, FALSE if not found.
*/
- function getPosition($p_key = null, $p_value = null)
+ function getPosition($p_key = null, $p_value = null)
{
$position = 0;
if (!is_null($p_key)) {
@@ -330,11 +330,11 @@ class LocalizerLanguage {
return $position;
}
$position++;
- }
+ }
}
return false;
} // fn getPosition
-
+
/**
* Get the string at the given position.
@@ -343,9 +343,9 @@ class LocalizerLanguage {
* An array of two elements, the first is the key, the second is the value.
* They are indexed by 'key' and 'value'.
*/
- function getStringAtPosition($p_position)
+ function getStringAtPosition($p_position)
{
- if (is_null($p_position) || !is_numeric($p_position) || ($p_position < 0)
+ if (is_null($p_position) || !is_numeric($p_position) || ($p_position < 0)
|| ($p_position > count($this->m_translationTable))) {
return false;
}
@@ -355,10 +355,10 @@ class LocalizerLanguage {
$value = array_pop($returnValue);
return array('key' => $key, 'value' => $value);
} // fn getStringAtPosition
-
-
+
+
/**
- * Change the key and optionally the value of the
+ * Change the key and optionally the value of the
* translation string. If the value isnt specified,
* it is not changed. If the key does not exist,
* it will be added. In this case, you can use p_position
@@ -370,7 +370,7 @@ class LocalizerLanguage {
* @param int $p_position
* @return boolean
*/
- function updateString($p_oldKey, $p_newKey, $p_value = null, $p_position = null)
+ function updateString($p_oldKey, $p_newKey, $p_value = null, $p_position = null)
{
if (!is_string($p_oldKey) || !is_string($p_newKey)) {
return false;
@@ -390,7 +390,7 @@ class LocalizerLanguage {
return true;
}
}
-
+
// Updating the key (and possibly the value)
if (is_null($p_value)) {
$p_value = $this->m_translationTable[$p_oldKey];
@@ -400,8 +400,8 @@ class LocalizerLanguage {
$success &= $this->addString($p_newKey, $p_value, $position);
return $success;
} // fn updateString
-
-
+
+
/**
* Move a string to a different position in the translation array.
* This allows similiar strings to be grouped together.
@@ -412,10 +412,10 @@ class LocalizerLanguage {
* @return boolean
* TRUE on success, FALSE on failure.
*/
- function moveString($p_startPositionOrKey, $p_endPosition)
+ function moveString($p_startPositionOrKey, $p_endPosition)
{
// Check parameters
- if (is_numeric($p_startPositionOrKey) && (($p_startPositionOrKey < 0)
+ if (is_numeric($p_startPositionOrKey) && (($p_startPositionOrKey < 0)
|| ($p_startPositionOrKey > count($this->m_translationTable)))) {
return false;
}
@@ -436,11 +436,11 @@ class LocalizerLanguage {
else {
return false;
}
-
+
// Success if we dont have to move the string anywhere
if ($startPosition == $p_endPosition) {
return true;
- }
+ }
// Delete the string in the old position
$result = $this->deleteStringAtPosition($startPosition);
if (!$result) {
@@ -448,7 +448,7 @@ class LocalizerLanguage {
}
$key = $result['key'];
$value = $result['value'];
-
+
// Add the string in the new position
$result = $this->addString($key, $value, $p_endPosition);
if (!$result) {
@@ -456,8 +456,8 @@ class LocalizerLanguage {
}
return true;
} // fn moveString
-
-
+
+
/**
* Delete the string given by $p_key.
* @param string $p_key
@@ -465,7 +465,7 @@ class LocalizerLanguage {
* The deleted string as array('key' => $key, 'value' => $value) on success,
* FALSE if it didnt exist.
*/
- function deleteString($p_key)
+ function deleteString($p_key)
{
if (isset($this->m_translationTable[$p_key])) {
$value = $this->m_translationTable[$p_key];
@@ -474,17 +474,17 @@ class LocalizerLanguage {
}
return false;
} // fn deleteString
-
-
+
+
/**
* Delete a string at a specific position in the array.
* @param int $p_position
* @return mixed
* The deleted string as array($key, $value) on success, FALSE on failure.
*/
- function deleteStringAtPosition($p_position)
+ function deleteStringAtPosition($p_position)
{
- if (!is_numeric($p_position) || ($p_position < 0)
+ if (!is_numeric($p_position) || ($p_position < 0)
|| ($p_position > count($this->m_translationTable))) {
return false;
}
@@ -494,16 +494,16 @@ class LocalizerLanguage {
$value = array_pop($returnValue);
return array('key' => $key, 'value' => $value);
} // fn deleteStringAtPosition
-
-
+
+
/**
* Synchronize the positions of the strings in the translation table
* with the positions of the string in the default language translation table.
*/
- function fixPositions()
+ function fixPositions()
{
global $g_localizerConfig;
- $defaultLanguage =& new LocalizerLanguage($this->m_prefix,
+ $defaultLanguage = new LocalizerLanguage($this->m_prefix,
$g_localizerConfig['DEFAULT_LANGUAGE']);
$defaultLanguage->loadFile(Localizer::GetMode());
$defaultTranslationTable = $defaultLanguage->getTranslationTable();
@@ -518,43 +518,43 @@ class LocalizerLanguage {
}
return $modified;
} // fn fixPositions
-
-
+
+
/**
* Sync with the default language file. This means
- * adding any missing strings and fixing the positions of the strings to
+ * adding any missing strings and fixing the positions of the strings to
* be the same as the default language file.
*/
- function syncToDefault()
+ function syncToDefault()
{
global $g_localizerConfig;
- $defaultLanguage =& new LocalizerLanguage($this->m_prefix,
+ $defaultLanguage = new LocalizerLanguage($this->m_prefix,
$g_localizerConfig['DEFAULT_LANGUAGE']);
$defaultLanguage->loadFile(Localizer::GetMode());
$defaultTranslationTable = $defaultLanguage->getTranslationTable();
$count = 0;
$modified = false;
- foreach ($defaultTranslationTable as $key => $value) {
+ foreach ($defaultTranslationTable as $key => $value) {
if (!isset($this->m_translationTable[$key])) {
$this->addString($key, '', $count);
$modified = true;
}
$count++;
- }
+ }
if ($g_localizerConfig['DELETE_UNUSED_ON_SYNC'] === true) {
- foreach ($this->m_translationTable as $key => $value) {
+ foreach ($this->m_translationTable as $key => $value) {
if (!isset($defaultTranslationTable[$key])) {
$this->deleteString($key, '', $count);
$modified = true;
}
$count++;
- }
+ }
}
-
+
return ($this->fixPositions() || $modified);
} // fn syncToDefault
-
-
+
+
/**
* Find the keys/values that match the given keyword.
*
@@ -562,7 +562,7 @@ class LocalizerLanguage {
*
* @return array
*/
- function search($p_keyword)
+ function search($p_keyword)
{
$matches = array();
foreach ($this->m_translationTable as $key => $value) {
@@ -572,8 +572,8 @@ class LocalizerLanguage {
}
return $matches;
} // fn search
-
-
+
+
/**
* Load a language file of the given type.
*
@@ -582,7 +582,7 @@ class LocalizerLanguage {
*
* @return boolean
*/
- function loadFile($p_type = null)
+ function loadFile($p_type = null)
{
if (is_null($p_type)) {
if (!empty($this->m_mode)) {
@@ -597,15 +597,15 @@ class LocalizerLanguage {
}
$className = 'LocalizerFileFormat_'.strtoupper($p_type);
if (class_exists($className)) {
- $object =& new $className();
+ $object = new $className();
if (method_exists($object, 'load')) {
return $object->load($this);
}
}
return false;
} // fn loadFile
-
-
+
+
/**
* Save the translation table as the given type.
*
@@ -614,7 +614,7 @@ class LocalizerLanguage {
*
* @return boolean
*/
- function saveFile($p_type = null)
+ function saveFile($p_type = null)
{
// Figure out the current mode.
if (is_null($p_type)) {
@@ -631,33 +631,33 @@ class LocalizerLanguage {
// Save in the requested mode.
$className = 'LocalizerFileFormat_'.strtoupper($p_type);
if (class_exists($className)) {
- $object =& new $className();
+ $object = new $className();
if (method_exists($object, 'save')) {
return $object->save($this);
}
}
return false;
} // fn saveFile
-
-
+
+
/**
- * Erase all the values in the translation table, but
+ * Erase all the values in the translation table, but
* keep the keys.
* @return void
*/
- function clearValues()
+ function clearValues()
{
foreach ($this->m_translationTable as $key => $value) {
$this->m_translationTable[$key] = '';
}
} // fn clearValues
-
-
+
+
/**
- * For debugging purposes, displays the the translation table
+ * For debugging purposes, displays the the translation table
* in an HTML table.
*/
- function dumpToHtml()
+ function dumpToHtml()
{
echo "";
if (!empty($this->m_filePath)) {
@@ -671,7 +671,7 @@ class LocalizerLanguage {
echo "";
echo "
";
} // fn dumpToHtml
-
+
} // class LocalizerLanguage
?>
\ No newline at end of file
diff --git a/campcaster/src/modules/htmlUI/var/localizer/auth.inc.php b/campcaster/src/modules/htmlUI/var/localizer/auth.inc.php
index d12c0e41f..fed5cf7e3 100644
--- a/campcaster/src/modules/htmlUI/var/localizer/auth.inc.php
+++ b/campcaster/src/modules/htmlUI/var/localizer/auth.inc.php
@@ -12,7 +12,7 @@ function login(&$data)
}
$dbc->setFetchMode(DB_FETCHMODE_ASSOC);
- $gb =& new GreenBox($dbc, $config);
+ $gb = new GreenBox($dbc, $config);
if (!$data['PHP_AUTH_USER'] || !$data['PHP_AUTH_PW']) {
return FALSE;
diff --git a/campcaster/src/modules/htmlUI/var/localizer/maintenance.php b/campcaster/src/modules/htmlUI/var/localizer/maintenance.php
index 91bf9d92c..153c89232 100644
--- a/campcaster/src/modules/htmlUI/var/localizer/maintenance.php
+++ b/campcaster/src/modules/htmlUI/var/localizer/maintenance.php
@@ -1,10 +1,10 @@
m_languageId); ?> | m_englishName); ?> | m_nativeName); ?> | |
-
-
+ validate()) {
- return $form->getSubmitValues();
+ return $form->getSubmitValues();
} else {
return FALSE;
- }
+ }
}
-
+
?>
Add language |
@@ -44,25 +44,25 @@ class Maintenance {
addLanguage($values)) {
return TRUE;
- }
- }
-
- return FALSE;
+ }
+ }
+
+ return FALSE;
}
}
-if ($g_localizerConfig['MAINTENANCE']) {
+if ($g_localizerConfig['MAINTENANCE']) {
?>
@@ -74,17 +74,17 @@ if ($g_localizerConfig['MAINTENANCE']) {
|
-
+
switch ($action) {
case 'list_languages':
Maintenance::listLanguages();
break;
-
+
case 'add_language':
Maintenance::languageForm();
- break;
-
- case 'do_add_language':
+ break;
+
+ case 'do_add_language':
if (Maintenance::doAddLanguage()) {
Maintenance::listLanguages();
}
diff --git a/campcaster/src/modules/htmlUI/var/localizer/translate.php b/campcaster/src/modules/htmlUI/var/localizer/translate.php
index 0aa9f29b2..ed043ac11 100644
--- a/campcaster/src/modules/htmlUI/var/localizer/translate.php
+++ b/campcaster/src/modules/htmlUI/var/localizer/translate.php
@@ -1,4 +1,4 @@
-.
*/
-function LanguageMenu($p_languageMetadata, $p_selectedValue)
+function LanguageMenu($p_languageMetadata, $p_selectedValue)
{
$options = '';
foreach($p_languageMetadata as $language) {
if ($p_selectedValue == $language->getLanguageId()) {
$selectedString = 'selected';
- }
+ }
else {
$selectedString = '';
}
$options .= '';
}
return $options;
-} // fn LanguageMenu
+} // fn LanguageMenu
/**
* Creates a form for translation.
* @param array $p_request
*/
-function translationForm($p_request)
+function translationForm($p_request)
{
global $g_localizerConfig;
- $localizerTargetLanguage = Input::Get('localizer_target_language', 'string',
+ $localizerTargetLanguage = Input::Get('localizer_target_language', 'string',
'', true);
- $localizerSourceLanguage = Input::Get('localizer_source_language', 'string',
+ $localizerSourceLanguage = Input::Get('localizer_source_language', 'string',
$g_localizerConfig['DEFAULT_LANGUAGE'], true);
if (empty($localizerSourceLanguage)) {
- $tmpLanguage =& new LocalizerLanguage(null, $p_request['TOL_Language']);
+ $tmpLanguage = new LocalizerLanguage(null, $p_request['TOL_Language']);
$localizerSourceLanguage = $tmpLanguage->getLanguageId();
}
-
+
$prefix = Input::Get('prefix', 'string', '', true);
$screenDropDownSelection = $prefix;
-
+
// Load the language files.
//echo "Prefix: $prefix
";
- $sourceLang =& new LocalizerLanguage($prefix, $localizerSourceLanguage);
- $targetLang =& new LocalizerLanguage($prefix, $localizerTargetLanguage);
- $defaultLang =& new LocalizerLanguage($prefix, $g_localizerConfig['DEFAULT_LANGUAGE']);
-
+ $sourceLang = new LocalizerLanguage($prefix, $localizerSourceLanguage);
+ $targetLang = new LocalizerLanguage($prefix, $localizerTargetLanguage);
+ $defaultLang = new LocalizerLanguage($prefix, $g_localizerConfig['DEFAULT_LANGUAGE']);
+
$mode = Localizer::GetMode();
if (!empty($prefix)) {
// If the language files do not exist, create them.
@@ -60,7 +60,7 @@ function translationForm($p_request)
if (!$targetLang->loadFile($mode)) {
$targetLang->saveFile($mode);
}
-
+
// Make sure that the languages have the same strings and are in the same
// order as the default language file.
$modified = $sourceLang->syncToDefault();
@@ -70,10 +70,10 @@ function translationForm($p_request)
$modified = $targetLang->syncToDefault();
if ($modified) {
$targetLang->saveFile($mode);
- }
+ }
}
-
-
+
+
$defaultStrings = $defaultLang->getTranslationTable();
$searchString = Input::Get('search_string', 'string', '', true);
if (!empty($searchString)) {
@@ -88,8 +88,8 @@ function translationForm($p_request)
$missingStrings = Localizer::FindMissingStrings($prefix);
$unusedStrings = Localizer::FindUnusedStrings($prefix);
}
-
-
+
+
// Mapping of language prefixes to human-readable strings.
$mapPrefixToDisplay[] = '';
@@ -99,14 +99,14 @@ function translationForm($p_request)
// Whether to show translated strings or not.
$hideTranslated = '';
- if (isset($p_request['hide_translated'])) {
+ if (isset($p_request['hide_translated'])) {
$hideTranslated = "CHECKED";
- }
+ }
?>
-
+
-
+
-
+ |
|
-
+
-
- 0) && ($screenDropDownSelection != 'globals')) {
?>
0) && ($screenDropDownSelection != 'globals')) {
?>
|
-
+
|
-
|
-
|
-
-
+
@@ -467,7 +467,7 @@ function translationForm($p_request)
|
-
+
diff --git a/campcaster/src/modules/htmlUI/var/ui_base.inc.php b/campcaster/src/modules/htmlUI/var/ui_base.inc.php
index b73877d08..6d37f0042 100644
--- a/campcaster/src/modules/htmlUI/var/ui_base.inc.php
+++ b/campcaster/src/modules/htmlUI/var/ui_base.inc.php
@@ -115,56 +115,48 @@ function _getNumArr($start, $end, $step=1)
*/
class uiBase
{
- var $redirUrl;
- var $alertMsg;
- var $dbc;
- var $gb; // GreenBox
- var $config;
- var $sessid;
- var $userid;
- var $login;
- var $langid;
- var $id;
- var $pid;
- var $type;
- var $fid;
- var $homeid;
- var $InputTextStandardAttrib;
- var $STATIONPREFS;
- var $SCRATCHPAD;
- var $SEARCH;
- var $BROWSE;
- var $HUBBROWSE;
- var $HUBSEARCH;
- var $PLAYLIST;
- var $SCHEDULER;
- var $SUBJECTS;
- var $EXCHANGE;
- var $TRANSFERS;
- var $_self_;
+ public $gb; // GreenBox
+ public $STATIONPREFS;
+ public $SCRATCHPAD;
+ public $SEARCH;
+ public $BROWSE;
+ // Note: loading HUBBROWSE on every page load slows things down
+ // a lot. we only load it on demand.
+ //public $HUBBROWSE;
+ public $HUBSEARCH;
+ public $PLAYLIST;
+ public $SCHEDULER;
+ public $SUBJECTS;
+ public $EXCHANGE;
+ public $TRANSFERS;
+ public $redirUrl;
+ public $dbc;
+ public $config;
+ public $sessid;
+ public $userid;
+ public $login;
+ public $id;
+ public $langid;
+ public $pid;
+ public $type;
+ public $fid;
+ public $homeid;
+ public $alertMsg;
/**
- * uiBase
- *
- * Initialize a new Basis Class including:
- * - database initialation
- * - GreenBox initialation
- *
- * @param array $config
+ * @param array $config
* configurartion data
*/
- function uiBase(&$config)
+ public function __construct(&$config)
{
$this->dbc = DB::connect($config['dsn'], TRUE);
if (DB::isError($this->dbc)) {
die($this->dbc->getMessage());
}
$this->dbc->setFetchMode(DB_FETCHMODE_ASSOC);
- $this->gb =& new GreenBox($this->dbc, $config);
+ $this->gb = new GreenBox($this->dbc, $config);
$this->config =& $config;
-
$this->config['accessRawAudioUrl'] = $config['storageUrlPath'].'/xmlrpc/simpleGet.php';
-
$this->sessid = isset($_REQUEST[$config['authCookieName']]) ?
$_REQUEST[$config['authCookieName']] : null;
$this->userid = $this->gb->getSessUserId($this->sessid);
@@ -187,21 +179,23 @@ class uiBase
$this->homeid = $this->gb->getObjId($this->login, $this->gb->storId);
}
- $this->InputTextStandardAttrib = array('size'=>UI_INPUT_STANDARD_SIZE,
- 'maxlength'=>UI_INPUT_STANDARD_MAXLENGTH);
+ }
+
+
+ public function init()
+ {
$this->STATIONPREFS =& $_SESSION[UI_STATIONINFO_SESSNAME];
- $this->SCRATCHPAD =& new uiScratchPad($this);
- $this->SEARCH =& new uiSearch($this);
- $this->BROWSE =& new uiBrowse($this);
- $this->HUBBROWSE =& new uiHubBrowse($this);
- $this->HUBSEARCH =& new uiHubSearch($this);
- $this->PLAYLIST =& new uiPlaylist($this);
- $this->SCHEDULER =& new uiScheduler($this);
- $this->SUBJECTS =& new uiSubjects($this);
- $this->EXCHANGE =& new uiExchange($this);
- $this->TRANSFERS =& new uiTransfers($this);
- $this->_self_ =& $this;
- } // fn uiBase
+ $this->SCRATCHPAD = new uiScratchPad($this);
+ $this->SEARCH = new uiSearch($this);
+ $this->BROWSE = new uiBrowse($this);
+ //$this->HUBBROWSE = new uiHubBrowse($this);
+ $this->HUBSEARCH = new uiHubSearch($this);
+ $this->PLAYLIST = new uiPlaylist($this);
+ $this->SCHEDULER = new uiScheduler($this);
+ $this->SUBJECTS = new uiSubjects($this);
+ $this->EXCHANGE = new uiExchange($this);
+ $this->TRANSFERS = new uiTransfers($this);
+ }
/**
@@ -210,7 +204,7 @@ class uiBase
* @param array $mask
* @param boolean $reload
*/
- function loadStationPrefs(&$mask, $reload=FALSE)
+ public function loadStationPrefs(&$mask, $reload=FALSE)
{
if (!is_array($this->STATIONPREFS) || ($reload === TRUE) ) {
$this->STATIONPREFS = array();
@@ -230,8 +224,6 @@ class uiBase
/**
- * _parseArr2Form
- *
* Add elements/rules/groups to an given HTML_QuickForm object
*
* @param HTML_Quickform $form
@@ -241,7 +233,7 @@ class uiBase
* @param string $side
* can be 'client' or 'server' - this is where the form validation occurs.
*/
- function _parseArr2Form(&$form, &$mask, $side='client')
+ public static function parseArrayToForm(&$form, &$mask, $side='client')
{
foreach ($mask as $v) {
$attrs = isset($v['attributes']) ? $v['attributes'] : null;
@@ -347,7 +339,7 @@ class uiBase
reset($mask);
$form->validate();
- } // fn _parseArr2Form
+ } // fn parseArrayToForm
/**
@@ -356,21 +348,21 @@ class uiBase
* @param array $input
* array of form-elements
*/
- function _dateArr2Str(&$input)
- {
- foreach ($input as $k => $v){
- if (is_array($v)) {
- if ( ( isset($v['d']) ) && ( isset($v['M']) || isset($v['m']) ) && ( isset($v['Y']) || isset($v['y']) ) ) {
- $input[$k] = $v['Y'].$v['y'].'-'.sprintf('%02d', $v['M'].$v['m']).'-'.sprintf('%02d', $v['d']);
- }
- if ( ( isset($v['H']) ) || isset($v['h'] ) && ( isset($v['i']) ) && ( isset($v['s']) ) ) {
- $input[$k] = sprintf('%02d', $v['H'].$v['h']).':'.sprintf('%02d', $v['i']).':'.sprintf('%02d', $v['s']);
- }
- }
- }
-
- return $input;
- } // fn _dateArr2Str
+// function _dateArr2Str(&$input)
+// {
+// foreach ($input as $k => $v){
+// if (is_array($v)) {
+// if ( ( isset($v['d']) ) && ( isset($v['M']) || isset($v['m']) ) && ( isset($v['Y']) || isset($v['y']) ) ) {
+// $input[$k] = $v['Y'].$v['y'].'-'.sprintf('%02d', $v['M'].$v['m']).'-'.sprintf('%02d', $v['d']);
+// }
+// if ( ( isset($v['H']) ) || isset($v['h'] ) && ( isset($v['i']) ) && ( isset($v['s']) ) ) {
+// $input[$k] = sprintf('%02d', $v['H'].$v['h']).':'.sprintf('%02d', $v['i']).':'.sprintf('%02d', $v['s']);
+// }
+// }
+// }
+//
+// return $input;
+// } // fn _dateArr2Str
/**
@@ -380,7 +372,7 @@ class uiBase
* local ID of file
* @param string $format
*/
- function _analyzeFile($id, $format)
+ public function analyzeFile($id, $format)
{
$ia = $this->gb->analyzeFile($id, $this->sessid);
$s = $ia['playtime_seconds'];
@@ -404,23 +396,23 @@ class uiBase
';
}
return FALSE;
- } // fn _analyzeFile
+ } // fn analyzeFile
- function _toHex($gunid)
+ public function toHex($gunid)
{
$res = $this->dbc->query("SELECT to_hex($gunid)");
$row = $res->fetchRow();
return $row['to_hex'];
- } // fn _toHex
+ } // fn toHex
- function _toInt8($gunid)
+ public function toInt8($gunid)
{
$res = $this->dbc->query("SELECT x'$gunid'::bigint");
$row = $res->fetchRow();
return $row['int8'];
- } // fn _toInt8
+ } // fn toInt8
/**
@@ -438,7 +430,7 @@ class uiBase
* @param string $p8
* @param string $p9
*/
- function _retMsg($msg, $p1=NULL, $p2=NULL, $p3=NULL, $p4=NULL, $p5=NULL, $p6=NULL, $p7=NULL, $p8=NULL, $p9=NULL)
+ public function _retMsg($msg, $p1=NULL, $p2=NULL, $p3=NULL, $p4=NULL, $p5=NULL, $p6=NULL, $p7=NULL, $p8=NULL, $p9=NULL)
{
if (!isset($_SESSION['alertMsg'])) {
$_SESSION['alertMsg'] = '';
@@ -447,22 +439,22 @@ class uiBase
} // fn _retMsg
- function _getMetaInfo($id)
+ public function getMetaInfo($id)
{
$type = strtolower($this->gb->getFileType($id));
$data = array('id' => $id,
'gunid' => $this->gb->_gunidFromId($id),
- 'title' => $this->_getMDataValue($id, UI_MDATA_KEY_TITLE),
- 'creator' => $this->_getMDataValue($id, UI_MDATA_KEY_CREATOR),
- 'duration' => $this->_getMDataValue($id, UI_MDATA_KEY_DURATION),
+ 'title' => $this->getMetadataValue($id, UI_MDATA_KEY_TITLE),
+ 'creator' => $this->getMetadataValue($id, UI_MDATA_KEY_CREATOR),
+ 'duration' => $this->getMetadataValue($id, UI_MDATA_KEY_DURATION),
'type' => $type,
#'isAvailable' => $type == 'playlist' ? $this->gb->playlistIsAvailable($id, $this->sessid) : NULL,
);
return ($data);
- } // fn _getMetaInfo
+ } // fn getMetaInfo
- function _getMDataValue($id, $key, $langid=NULL, $deflangid=UI_DEFAULT_LANGID)
+ public function getMetadataValue($id, $key, $langid=NULL, $deflangid=UI_DEFAULT_LANGID)
{
if (!$langid) {
$langid = $_SESSION['langid'];
@@ -473,10 +465,10 @@ class uiBase
return $value['value'];
}
return FALSE;
- } // fn _getMDataValue
+ } // fn getMetadataValue
- function _setMDataValue($id, $key, $value, $langid=NULL)
+ public function setMetadataValue($id, $key, $value, $langid=NULL)
{
if (!$langid) {
$langid = UI_DEFAULT_LANGID;
@@ -489,16 +481,14 @@ class uiBase
return TRUE;
}
return FALSE;
- } // fn _setMDataValue
+ } // fn setMetadataValue
/**
- * Enter description here...
- *
* @param unknown_type $id
* @return string/FALSE
*/
- function _getFileTitle($id)
+ private function _getFileTitle($id)
{
if (is_array($arr = $this->gb->getPath($id))) {
$file = array_pop($arr);
@@ -508,29 +498,29 @@ class uiBase
} // fn _getFileTitle
- function _isFolder($id)
- {
- if (strtolower($this->gb->getFileType($id)) != 'folder') {
- return FALSE;
- }
- return TRUE;
- } // fn _isFolder
+// function _isFolder($id)
+// {
+// if (strtolower($this->gb->getFileType($id)) != 'folder') {
+// return FALSE;
+// }
+// return TRUE;
+// } // fn _isFolder
- function _formElementEncode($str)
+ public static function formElementEncode($str)
{
$str = str_replace(':', '__', $str);
#$str = str_replace('.', '_', $str);
return $str;
- } // fn _formElementEncode
+ } // fn formElementEncode
- function _formElementDecode($str)
+ public static function formElementDecode($str)
{
$str = str_replace('__', ':', $str);
#$str = str_replace('_', '.', $str);
return $str;
- } // fn _formElementDecode
+ } // fn formElementDecode
} // class uiBase
?>
\ No newline at end of file
diff --git a/campcaster/src/modules/htmlUI/var/ui_browse.class.php b/campcaster/src/modules/htmlUI/var/ui_browse.class.php
index c624d7b3e..b726a81d4 100644
--- a/campcaster/src/modules/htmlUI/var/ui_browse.class.php
+++ b/campcaster/src/modules/htmlUI/var/ui_browse.class.php
@@ -6,31 +6,31 @@
*/
class uiBrowse
{
- var $Base; // uiBase object
- var $prefix;
- var $col;
- var $criteria;
- var $reloadUrl;
+ public $Base; // uiBase object
+ private $prefix;
+ private $col;
+ private $criteria;
+ private $reloadUrl;
- function uiBrowse(&$uiBase)
+ public function __construct(&$uiBase)
{
- $this->Base =& $uiBase;
- $this->prefix = 'BROWSE';
- $this->col =& $_SESSION[constant('UI_'.$this->prefix.'_SESSNAME')]['col'];
- $this->criteria =& $_SESSION[constant('UI_'.$this->prefix.'_SESSNAME')]['criteria'];
- #$this->results =& $_SESSION[constant('UI_'.$this->prefix.'_SESSNAME')]['results'];
- $this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
+ $this->Base =& $uiBase;
+ $this->prefix = 'BROWSE';
+ $this->col =& $_SESSION[constant('UI_'.$this->prefix.'_SESSNAME')]['col'];
+ $this->criteria =& $_SESSION[constant('UI_'.$this->prefix.'_SESSNAME')]['criteria'];
+ //$this->results =& $_SESSION[constant('UI_'.$this->prefix.'_SESSNAME')]['results'];
+ $this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
if (empty($this->criteria['limit'])) {
- $this->criteria['limit'] = UI_BROWSE_DEFAULT_LIMIT;
+ $this->criteria['limit'] = UI_BROWSE_DEFAULT_LIMIT;
}
if (empty($this->criteria['filetype'])) {
$this->criteria['filetype'] = UI_FILETYPE_ANY;
}
if (!is_array($this->col)) {
- ## init Categorys
+ // init Categorys
$this->setDefaults();
}
} // constructor
@@ -89,7 +89,7 @@ class uiBrowse
foreach ($mask['pages'] as $key => $val) {
foreach ($mask['pages'][$key] as $v){
if (isset($v['type']) && $v['type']) {
- $tmp = $this->Base->_formElementEncode($v['element']);
+ $tmp = uiBase::formElementEncode($v['element']);
$mask2['browse_columns']['category']['options'][$tmp] = tra($v['label']);
}
}
@@ -99,22 +99,22 @@ class uiBrowse
$form = new HTML_QuickForm('col'.$n, UI_STANDARD_FORM_METHOD, UI_HANDLER);
$form->setConstants(array('id' => $id,
'col' => $n,
- 'category' => $this->Base->_formElementEncode($this->col[$n]['category'])));
+ 'category' => uiBase::formElementEncode($this->col[$n]['category'])));
$mask2['browse_columns']['value']['options'] = $this->options($this->col[$n]['values']['results']);
$mask2['browse_columns']['value']['default'] = $this->col[$n]['form_value'];
- $this->Base->_parseArr2Form($form, $mask2['browse_columns']);
+ uiBase::parseArrayToForm($form, $mask2['browse_columns']);
$form->validate();
- $renderer =& new HTML_QuickForm_Renderer_Array(true, true);
+ $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer);
$output['col'.$n]['dynform'] = $renderer->toArray();
}
## form to change limit and file-type
$form = new HTML_QuickForm('switch', UI_STANDARD_FORM_METHOD, UI_HANDLER);
- $this->Base->_parseArr2Form($form, $mask2['browse_global']);
+ uiBase::parseArrayToForm($form, $mask2['browse_global']);
$form->setDefaults(array('limit' => $this->criteria['limit'],
'filetype' => $this->criteria['filetype']));
- $renderer =& new HTML_QuickForm_Renderer_Array(true, true);
+ $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer);
$output['global']['dynform'] = $renderer->toArray();
@@ -123,19 +123,31 @@ class uiBrowse
/**
+ * Set the category for audio file browser. There are three columns
+ * you can set the category for.
+ *
* @param array $parm
+ * Has keys:
+ * int 'col' - the column you are setting the category for
+ * string 'category' - the category for the given column
+ * string 'value' - the
* @return void
*/
- function setCategory($parm)
+ public function setCategory($parm)
{
- $which = $parm['col'];
- $this->col[$which]['category'] = $this->Base->_formElementDecode($parm['category']);
- $criteria = isset($this->col[$which]['criteria']) ? $this->col[$which]['criteria'] : null;
- $this->col[$which]['values'] = $this->Base->gb->browseCategory($this->col[$which]['category'], $criteria, $this->Base->sessid);
+// $reflect = new ReflectionProperty('uiBrowse', 'Base');
+// echo "";print_r(Reflection::getModifierNames($reflect->getModifiers()));echo "
";
+
+ $columnNumber = $parm['col'];
+ $category = $parm['category'];
+
+ $this->col[$columnNumber]['category'] = uiBase::formElementDecode($category);
+ $criteria = isset($this->col[$columnNumber]['criteria']) ? $this->col[$columnNumber]['criteria'] : null;
+// print_r($this->Base->gb);
+ $this->col[$columnNumber]['values'] = $this->Base->gb->browseCategory($this->col[$columnNumber]['category'], $criteria, $this->Base->sessid);
$this->Base->redirUrl = UI_BROWSER.'?act='.$this->prefix;
-
- $this->clearHierarchy($which);
+ $this->clearHierarchy($columnNumber);
#print_r($this->col);
} // fn setCategory
@@ -150,7 +162,8 @@ class uiBrowse
$next = $which + 1;
$this->col[$which]['form_value'] = $parm['value'][0];
if ($parm['value'][0] == '%%all%%') {
- $this->col[$next]['criteria'] = array('operator' => 'and', 'filetype' => $this->criteria['filetype']);
+ $this->col[$next]['criteria'] = array('operator' => 'and',
+ 'filetype' => $this->criteria['filetype']);
} else {
$this->col[$next]['criteria'] = array(
'operator' => 'and',
@@ -158,7 +171,7 @@ class uiBrowse
'conditions' => array_merge(
is_array($this->col[$which]['criteria']['conditions']) ? $this->col[$which]['criteria']['conditions'] : array(),
array(
- array('cat' => $this->Base->_formElementDecode($parm['category']),
+ array('cat' => uiBase::formElementDecode($parm['category']),
'op' => '=',
'val' => $parm['value'][0]
)
@@ -232,7 +245,7 @@ class uiBrowse
$this->results['cnt'] = $results['cnt'];
foreach ($results['results'] as $rec) {
$tmpId = $this->Base->gb->_idFromGunid($rec["gunid"]);
- $this->results['items'][] = $this->Base->_getMetaInfo($tmpId);
+ $this->results['items'][] = $this->Base->getMetaInfo($tmpId);
}
/*
diff --git a/campcaster/src/modules/htmlUI/var/ui_browser.class.php b/campcaster/src/modules/htmlUI/var/ui_browser.class.php
index 64e3d9350..5155f280d 100644
--- a/campcaster/src/modules/htmlUI/var/ui_browser.class.php
+++ b/campcaster/src/modules/htmlUI/var/ui_browser.class.php
@@ -5,7 +5,6 @@
* @version $Revision$
*/
class uiBrowser extends uiBase {
- var $alertMsg;
// --- class constructor ---
/**
@@ -15,9 +14,9 @@ class uiBrowser extends uiBase {
* @param array $config
* configurartion data
*/
- function uiBrowser(&$config)
+ public function __construct(&$config)
{
- $this->uiBase($config);
+ parent::__construct($config);
} // constructor
@@ -71,12 +70,10 @@ class uiBrowser extends uiBase {
function login($mask)
{
$form = new HTML_QuickForm('login', UI_STANDARD_FORM_METHOD, UI_HANDLER);
- $this->_parseArr2Form($form, $mask['languages']);
- $this->_parseArr2Form($form, $mask['login']);
-
- $renderer =& new HTML_QuickForm_Renderer_Array(true, true);
+ uiBase::parseArrayToForm($form, $mask['languages']);
+ uiBase::parseArrayToForm($form, $mask['login']);
+ $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer);
-
return $renderer->toArray();
} // fn login
@@ -123,7 +120,7 @@ class uiBrowser extends uiBase {
}
foreach ($data['listdata'] as $key=>$val) {
if ($val['type'] != 'Folder') {
- $data['listdata'][$key]['title'] = $this->_getMDataValue($val['id'], UI_MDATA_KEY_TITLE);
+ $data['listdata'][$key]['title'] = $this->getMetadataValue($val['id'], UI_MDATA_KEY_TITLE);
} else {
$data['listdata'][$key]['title'] = $val['name'];
}
@@ -153,8 +150,8 @@ class uiBrowser extends uiBase {
$form->setConstants(array('folderId' => $folderId,
'id' => $id,
'act' => $id ? 'editItem' : 'addFileData'));
- $this->_parseArr2Form($form, $mask);
- $renderer =& new HTML_QuickForm_Renderer_Array(true, true);
+ uiBase::parseArrayToForm($form, $mask);
+ $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer);
return $renderer->toArray();
} // fn fileForm
@@ -177,12 +174,12 @@ class uiBrowser extends uiBase {
$const = array('folderId' => $folderId,
'id' => $id,
'act' => $id ? 'editWebstreamData' : 'addWebstreamData',
- 'title' => $id ? $this->_getMDataValue($id, UI_MDATA_KEY_TITLE) : NULL,
- 'url' => $id ? $this->_getMDataValue($id, UI_MDATA_KEY_URL) : 'http://',
- 'length' => $id ? preg_replace("/\.[0-9]{1,6}/", "", $this->_getMDataValue($id, UI_MDATA_KEY_DURATION)) : NULL
+ 'title' => $id ? $this->getMetadataValue($id, UI_MDATA_KEY_TITLE) : NULL,
+ 'url' => $id ? $this->getMetadataValue($id, UI_MDATA_KEY_URL) : 'http://',
+ 'length' => $id ? preg_replace("/\.[0-9]{1,6}/", "", $this->getMetadataValue($id, UI_MDATA_KEY_DURATION)) : NULL
);
$form->setConstants($const);
- $this->_parseArr2Form($form, $mask);
+ uiBase::parseArrayToForm($form, $mask);
/*
$form->addGroupRule('grp',
@@ -201,7 +198,7 @@ class uiBrowser extends uiBase {
$form->_rules['grp[url]'][1][validation] = 'client';
*/
- $renderer =& new HTML_QuickForm_Renderer_Array(true, true);
+ $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer);
return $renderer->toArray();
} // fn webstreamForm
@@ -294,7 +291,7 @@ class uiBrowser extends uiBase {
$arr[tra($key)] = $val;
}
}
- $arr[$relations[UI_MDATA_KEY_TITLE]] = $this->_getMDataValue($id, UI_MDATA_KEY_TITLE);
+ $arr[$relations[UI_MDATA_KEY_TITLE]] = $this->getMetadataValue($id, UI_MDATA_KEY_TITLE);
ksort($arr);
return array('metadata' => $arr);
@@ -316,14 +313,14 @@ class uiBrowser extends uiBase {
$langid = $langid ? $langid : UI_DEFAULT_LANGID;
$form = new HTML_QuickForm('langswitch', UI_STANDARD_FORM_METHOD, UI_BROWSER);
- $this->_parseArr2Form($form, $mask['langswitch']);
+ uiBase::parseArrayToForm($form, $mask['langswitch']);
$form->setConstants(array('target_langid' => $langid));
- $renderer =& new HTML_QuickForm_Renderer_Array(true, true);
+ $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer);
$output['langswitch'] = $renderer->toArray();
$form = new HTML_QuickForm('editMetaData', UI_STANDARD_FORM_METHOD, UI_HANDLER);
- $this->_parseArr2Form($form, $mask['basics']);
+ uiBase::parseArrayToForm($form, $mask['basics']);
$form->setConstants(array('act' => 'editMetaData',
'id' => $id,
'curr_langid' => $langid,
@@ -338,20 +335,20 @@ class uiBrowser extends uiBase {
if (!is_array($mask['pages'][$key][$k]['attributes'])) {
$mask['pages'][$key][$k]['attributes'] = array();
}
- $mask['pages'][$key][$k]['element'] = $key.'___'.$this->_formElementEncode($v['element']);
- $mask['pages'][$key][$k]['attributes'] = array_merge($mask['pages'][$key][$k]['attributes'], array('onChange' => "spread(this, '".$this->_formElementEncode($v['element'])."')"));
+ $mask['pages'][$key][$k]['element'] = $key.'___'.uiBase::formElementEncode($v['element']);
+ $mask['pages'][$key][$k]['attributes'] = array_merge($mask['pages'][$key][$k]['attributes'], array('onChange' => "spread(this, '".uiBase::formElementEncode($v['element'])."')"));
## load data from GreenBox
- if ($getval = $this->_getMDataValue($id, $v['element'], $langid, NULL)) {
+ if ($getval = $this->getMetadataValue($id, $v['element'], $langid, NULL)) {
$mask['pages'][$key][$k]['default'] = $getval;
$mask['pages'][$key][$k]['attributes']['onFocus'] = 'MData_confirmChange(this)';
}
}
$form->addElement('static', NULL, NULL, "");
- $this->_parseArr2Form($form, $mask['pages'][$key]);
- $this->_parseArr2Form($form, $mask['buttons']);
+ uiBase::parseArrayToForm($form, $mask['pages'][$key]);
+ uiBase::parseArrayToForm($form, $mask['buttons']);
$form->addElement('static', NULL, NULL, "
");
}
- $renderer =& new HTML_QuickForm_Renderer_Array(true, true);
+ $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer);
$output['pages'][] = $renderer->toArray();
#print_r($output);
@@ -369,8 +366,8 @@ class uiBrowser extends uiBase {
$mask[$key]['default'] = $p;
}
}
- $this->_parseArr2Form($form, $mask);
- $renderer =& new HTML_QuickForm_Renderer_Array(true, true);
+ uiBase::parseArrayToForm($form, $mask);
+ $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer);
return $renderer->toArray();
} // fn changeStationPrefs
@@ -456,7 +453,7 @@ class uiBrowser extends uiBase {
if (strtolower($type) === strtolower(UI_FILETYPE_AUDIOCLIP)) {
$m3u = "http://{$_SERVER['SERVER_NAME']}".$this->config['accessRawAudioUrl']."?sessid={$this->sessid}&id=$clipid\n";
} else {
- $m3u = $this->_getMDataValue($id, UI_MDATA_KEY_URL);
+ $m3u = $this->getMetadataValue($id, UI_MDATA_KEY_URL);
}
touch(UI_TESTSTREAM_MU3_TMP);
$handle = fopen(UI_TESTSTREAM_MU3_TMP, "w");
diff --git a/campcaster/src/modules/htmlUI/var/ui_browser_init.php b/campcaster/src/modules/htmlUI/var/ui_browser_init.php
index e735f34f9..773468af4 100644
--- a/campcaster/src/modules/htmlUI/var/ui_browser_init.php
+++ b/campcaster/src/modules/htmlUI/var/ui_browser_init.php
@@ -3,24 +3,26 @@ header("Content-type: text/html; charset=utf-8");
session_start();
## LS classes/functions #############################################
-require_once dirname(__FILE__).'/ui_conf.php';
-require_once dirname(__FILE__).'/ui_browser.class.php';
+require_once(dirname(__FILE__).'/ui_conf.php');
+require_once(dirname(__FILE__).'/ui_browser.class.php');
## well known classes ###############################################
-require_once dirname(__FILE__).'/Smarty/libs/Smarty.class.php';
-require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+require_once(dirname(__FILE__).'/Smarty/libs/Smarty.class.php');
+require_once('HTML/QuickForm/Renderer/ArraySmarty.php');
## initialize objects ###############################################
-$Smarty =& new Smarty;
-$uiBrowser =& new uiBrowser($config);
-$uiBase =& $uiBrowser;
-$jscom =& new jscom(array("jscom_wrapper"));
+$Smarty = new Smarty;
+$uiBrowser = new uiBrowser($config);
+$uiBrowser->init();
+
+$uiBase =& $uiBrowser;
+$jscom = new jscom(array("jscom_wrapper"));
$jscom->handler();
## load Smarty+filters ##############################################
-require_once dirname(__FILE__).'/ui_smartyExtensions.inc.php';
+require_once(dirname(__FILE__).'/ui_smartyExtensions.inc.php');
#$Smarty->load_filter('output', 'trimwhitespace');
#$Smarty->load_filter('post', 'template_marker');
$Smarty->load_filter('output', 'localizer');
diff --git a/campcaster/src/modules/htmlUI/var/ui_calendar.class.php b/campcaster/src/modules/htmlUI/var/ui_calendar.class.php
index ed932e1be..146986a5e 100644
--- a/campcaster/src/modules/htmlUI/var/ui_calendar.class.php
+++ b/campcaster/src/modules/htmlUI/var/ui_calendar.class.php
@@ -6,21 +6,23 @@
*/
class uiCalendar
{
- var $Decade;
- var $Year;
- var $Month;
- var $Week;
- var $Day;
- var $Hour;
+ public $Decade;
+ public $Year;
+ public $Month;
+ public $Week;
+ public $Day;
+ public $Hour;
- function uiCalendar()
+ public function __construct()
{
}
function buildDecade()
{
- if (is_array($this->Decade)) return;
+ if (is_array($this->Decade)) {
+ return;
+ }
for ($Year = $this->curr['year']-5; $Year<=$this->curr['year']+5; $Year++) {
$this->Decade[] = array(
@@ -34,14 +36,16 @@ class uiCalendar
function buildYear()
{
- if (is_array($this->Year)) return;
+ if (is_array($this->Year)) {
+ return;
+ }
- require_once 'Calendar/Year.php';
- require_once 'Calendar/Month.php';
+ require_once('Calendar/Year.php');
+ require_once('Calendar/Month.php');
$Year = new Calendar_Year($this->curr['year']);
# mark current month
- $sel = new Calendar_Month($this->curr['year'], $this->curr['month']);
+ $sel = new Calendar_Month($this->curr['year'], $this->curr['month']);
$selections = array($sel);
$Year->build($selections, UI_SCHEDULER_FIRSTWEEKDAY);
@@ -57,16 +61,20 @@ class uiCalendar
function buildMonth()
{
- if (is_array($this->Month)) return;
+ if (is_array($this->Month)) {
+ return;
+ }
- require_once 'Calendar/Month/Weekdays.php';
- require_once 'Calendar/Day.php';
+ require_once('Calendar/Month/Weekdays.php');
+ require_once('Calendar/Day.php');
$Month = new Calendar_Month_Weekdays($this->curr['year'], $this->curr['month'], UI_SCHEDULER_FIRSTWEEKDAY);
- $Month->build($this->_scheduledDays('month')); ## scheduled days are selected
+ // scheduled days are selected
+ $Month->build($this->_scheduledDays('month'));
while ($Day = $Month->fetch()) {
- $corrMonth = $Day->thisMonth()<=12 ? sprintf('%02d', $Day->thisMonth()) : '01'; ## due to bug in
- $corrYear = $Day->thisMonth()<=12 ? $Day->thisYear() : $Day->thisYear()+1; ## Calendar_Month_Weekdays
+ // Next 2 lines are due to a bug in Calendar_Month_Weekdays
+ $corrMonth = $Day->thisMonth()<=12 ? sprintf('%02d', $Day->thisMonth()) : '01';
+ $corrYear = $Day->thisMonth()<=12 ? $Day->thisYear() : $Day->thisYear()+1;
$this->Month[] = array(
'day' => sprintf('%02d', $Day->thisDay()),
'week' => $this->_getWeekNr($Day),
@@ -87,9 +95,11 @@ class uiCalendar
function buildWeek()
{
- if (is_array($this->Week)) return;
+ if (is_array($this->Week)) {
+ return;
+ }
- require_once 'Calendar/Week.php';
+ require_once('Calendar/Week.php');
$Week = new Calendar_Week($this->curr['year'], $this->curr['month'], $this->curr['day'], UI_SCHEDULER_FIRSTWEEKDAY);
$Week->build($this->_scheduledDays('week'));
@@ -122,8 +132,9 @@ class uiCalendar
$Day = new Calendar_Day ($this->curr['year'], $this->curr['month'], $this->curr['day']);
$Day->build();
while ($Hour = $Day->fetch()) {
- $corrMonth = $Hour->thisMonth()<=12 ? sprintf('%02d', $Hour->thisMonth()) : '01'; ## due to bug in
- $corrYear = $Hour->thisMonth()<=12 ? $Day->thisYear() : $Hour->thisYear()+1; ## Calendar_Month_Weekdays
+ // Next two lines are due to a bug in Calendar_Month_Weekdays
+ $corrMonth = $Hour->thisMonth()<=12 ? sprintf('%02d', $Hour->thisMonth()) : '01';
+ $corrYear = $Hour->thisMonth()<=12 ? $Day->thisYear() : $Hour->thisYear()+1;
$this->Day[] = array(
'day' => sprintf('%02d', $Hour->thisDay()),
'week' => $this->_getWeekNr($Hour),
@@ -141,7 +152,9 @@ class uiCalendar
function buildHour()
{
- if (is_array($this->Hour)) return;
+ if (is_array($this->Hour)) {
+ return;
+ }
require_once('Calendar/Hour.php');
diff --git a/campcaster/src/modules/htmlUI/var/ui_conf.php b/campcaster/src/modules/htmlUI/var/ui_conf.php
index 680509cdd..00647a827 100644
--- a/campcaster/src/modules/htmlUI/var/ui_conf.php
+++ b/campcaster/src/modules/htmlUI/var/ui_conf.php
@@ -124,7 +124,9 @@ $config = array_merge($config,
'file_types' => array(
'.mp3',
'.wav',
- '.ogg'
+ '.ogg',
+ '.flac',
+ '.aac'
),
'stream_types' => array(
'application/ogg',
diff --git a/campcaster/src/modules/htmlUI/var/ui_exchange.class.php b/campcaster/src/modules/htmlUI/var/ui_exchange.class.php
index 5d0014551..ddca5b8f8 100644
--- a/campcaster/src/modules/htmlUI/var/ui_exchange.class.php
+++ b/campcaster/src/modules/htmlUI/var/ui_exchange.class.php
@@ -6,11 +6,11 @@
*/
class uiExchange
{
- var $Base;
- var $file;
- var $folder;
+ private $Base;
+ private $file;
+ private $folder;
- function uiExchange(&$uiBase)
+ public function __construct(&$uiBase)
{
$this->Base =& $uiBase;
$this->file =& $_SESSION['EXCHANGE']['file'];
@@ -103,8 +103,8 @@ class uiExchange
{
include('formmask/exchange.inc.php');
$form = new HTML_QuickForm('BACKUP_Schedule', UI_STANDARD_FORM_METHOD, UI_HANDLER);
- $this->Base->_parseArr2Form($form, $mask['BACKUP.schedule']);
- $renderer =& new HTML_QuickForm_Renderer_Array(true, true);
+ uiBase::parseArrayToForm($form, $mask['BACKUP.schedule']);
+ $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer);
return $renderer->toArray();
}
@@ -113,7 +113,8 @@ class uiExchange
/**
* Copy a file or directory.
*
- * @param string $target - path to file or directory
+ * @param string $target
+ * path to file or directory
* @return boolean
*/
function copy2target($target)
diff --git a/campcaster/src/modules/htmlUI/var/ui_handler.class.php b/campcaster/src/modules/htmlUI/var/ui_handler.class.php
index 605cb8223..2c6bb2549 100644
--- a/campcaster/src/modules/htmlUI/var/ui_handler.class.php
+++ b/campcaster/src/modules/htmlUI/var/ui_handler.class.php
@@ -9,8 +9,8 @@ define('ACTION_BASE', '/actions' ) ;
* @version $Revision$
*/
class uiHandler extends uiBase {
- var $uiBase;
- var $redirUrl;
+ public $uiBase;
+ public $redirUrl;
/**
* Initialize a new Browser Class
@@ -19,9 +19,9 @@ class uiHandler extends uiBase {
* @param array $config
* configurartion data
*/
- function uiHandler($config)
+ public function __construct($config)
{
- $this->uiBase($config);
+ parent::__construct($config);
} // constructor
@@ -152,12 +152,12 @@ class uiHandler extends uiBase {
return FALSE;
}
- $this->_setMDataValue($r, UI_MDATA_KEY_TITLE, $formdata['mediafile']['name']);
+ $this->setMetadataValue($r, UI_MDATA_KEY_TITLE, $formdata['mediafile']['name']);
$this->transMData($r);
// set records in default language too
if (UI_UPLOAD_LANGID !== UI_DEFAULT_LANGID) {
- $this->_setMDataValue($r, UI_MDATA_KEY_TITLE, $formdata['mediafile']['name'], UI_UPLOAD_LANGID);
+ $this->setMetadataValue($r, UI_MDATA_KEY_TITLE, $formdata['mediafile']['name'], UI_UPLOAD_LANGID);
$this->transMData($r, UI_UPLOAD_LANGID);
}
@@ -196,20 +196,20 @@ class uiHandler extends uiBase {
return;
}
$this->_setMdataValue($id, UI_MDATA_KEY_DURATION, $this->gb->_secsToPlTime($ia['playtime_seconds']));
- $this->_setMDataValue($id, UI_MDATA_KEY_FORMAT, UI_MDATA_VALUE_FORMAT_FILE);
+ $this->setMetadataValue($id, UI_MDATA_KEY_FORMAT, UI_MDATA_VALUE_FORMAT_FILE);
// some data from raw audio
if (isset($ia['audio']['channels'])) {
- $this->_setMDataValue($id, UI_MDATA_KEY_CHANNELS, $ia['audio']['channels']);
+ $this->setMetadataValue($id, UI_MDATA_KEY_CHANNELS, $ia['audio']['channels']);
}
if (isset($ia['audio']['sample_rate'])) {
- $this->_setMDataValue($id, UI_MDATA_KEY_SAMPLERATE, $ia['audio']['sample_rate']);
+ $this->setMetadataValue($id, UI_MDATA_KEY_SAMPLERATE, $ia['audio']['sample_rate']);
}
if (isset($ia['audio']['bitrate'])) {
- $this->_setMDataValue($id, UI_MDATA_KEY_BITRATE, $ia['audio']['bitrate']);
+ $this->setMetadataValue($id, UI_MDATA_KEY_BITRATE, $ia['audio']['bitrate']);
}
if (isset($ia['audio']['codec'])) {
- $this->_setMDataValue($id, UI_MDATA_KEY_ENCODER, $ia['audio']['codec']);
+ $this->setMetadataValue($id, UI_MDATA_KEY_ENCODER, $ia['audio']['codec']);
}
// from id3 Tags
@@ -256,9 +256,9 @@ class uiHandler extends uiBase {
$extent = sprintf('%02d', $formdata['length']['H']).':'.sprintf('%02d', $formdata['length']['i']).':'.sprintf('%02d', $formdata['length']['s']).'.000000';
- $this->_setMDataValue($r, UI_MDATA_KEY_TITLE, $formdata['title']);
- $this->_setMDataValue($r, UI_MDATA_KEY_DURATION, $extent);
- $this->_setMDataValue($r, UI_MDATA_KEY_FORMAT, UI_MDATA_VALUE_FORMAT_STREAM);
+ $this->setMetadataValue($r, UI_MDATA_KEY_TITLE, $formdata['title']);
+ $this->setMetadataValue($r, UI_MDATA_KEY_DURATION, $extent);
+ $this->setMetadataValue($r, UI_MDATA_KEY_FORMAT, UI_MDATA_VALUE_FORMAT_STREAM);
$this->redirUrl = UI_BROWSER."?act=addWebstreamMData&id=$r";
if (UI_VERBOSE) {
@@ -277,9 +277,9 @@ class uiHandler extends uiBase {
}
$extent = sprintf('%02d', $formdata['length']['H']).':'.sprintf('%02d', $formdata['length']['i']).':'.sprintf('%02d', $formdata['length']['s']).'.000000';
- $this->_setMDataValue($id, UI_MDATA_KEY_TITLE, $formdata['title']);
- $this->_setMDataValue($id, UI_MDATA_KEY_URL, $formdata['url']);
- $this->_setMDataValue($id, UI_MDATA_KEY_DURATION, $extent);
+ $this->setMetadataValue($id, UI_MDATA_KEY_TITLE, $formdata['title']);
+ $this->setMetadataValue($id, UI_MDATA_KEY_URL, $formdata['url']);
+ $this->setMetadataValue($id, UI_MDATA_KEY_DURATION, $extent);
$this->redirUrl = UI_BROWSER.'?act=editItem&id='.$formdata['id'];
if (UI_VERBOSE) {
@@ -302,7 +302,7 @@ class uiHandler extends uiBase {
foreach ($mask['pages'] as $key => $val) {
foreach ($mask['pages'][$key] as $k => $v) {
- $formdata[$key.'___'.$this->_formElementEncode($v['element'])] ? $mData[$this->_formElementDecode($v['element'])] = $formdata[$key.'___'.$this->_formElementEncode($v['element'])] : NULL;
+ $formdata[$key.'___'.uiBase::formElementEncode($v['element'])] ? $mData[uiBase::formElementDecode($v['element'])] = $formdata[$key.'___'.uiBase::formElementEncode($v['element'])] : NULL;
}
}
@@ -311,7 +311,7 @@ class uiHandler extends uiBase {
}
foreach ($mData as $key => $val) {
- $r = $this->_setMDataValue($id, $key, $val, $curr_langid);
+ $r = $this->setMetadataValue($id, $key, $val, $curr_langid);
if (PEAR::isError($r)) {
$this->_retMsg('Unable to set "$1" to value "$2".', $key, $val);
}
@@ -542,7 +542,7 @@ class uiHandler extends uiBase {
function _validateForm($formdata, $mask)
{
$form = new HTML_QuickForm('validation', UI_STANDARD_FORM_METHOD, UI_HANDLER);
- $this->_parseArr2Form($form, $mask, 'server');
+ uiBase::parseArrayToForm($form, $mask, 'server');
if (!$form->validate()) {
$_SESSION['retransferFormData'] = $_REQUEST;
return FALSE;
diff --git a/campcaster/src/modules/htmlUI/var/ui_handler_init.php b/campcaster/src/modules/htmlUI/var/ui_handler_init.php
index b7803cc7b..d32134513 100644
--- a/campcaster/src/modules/htmlUI/var/ui_handler_init.php
+++ b/campcaster/src/modules/htmlUI/var/ui_handler_init.php
@@ -7,7 +7,8 @@ require_once(dirname(__FILE__).'/ui_conf.php');
require_once(dirname(__FILE__).'/ui_handler.class.php');
## initialize objects ###############################################
-$uiHandler =& new uiHandler($config);
+$uiHandler = new uiHandler($config);
+$uiHandler->init();
$uiBase =& $uiHandler;
include("../templates/loader/index.tpl");
diff --git a/campcaster/src/modules/htmlUI/var/ui_hubBrowse.class.php b/campcaster/src/modules/htmlUI/var/ui_hubBrowse.class.php
index f764a85dc..8290acf78 100644
--- a/campcaster/src/modules/htmlUI/var/ui_hubBrowse.class.php
+++ b/campcaster/src/modules/htmlUI/var/ui_hubBrowse.class.php
@@ -7,17 +7,17 @@
class uiHubBrowse extends uiBrowse
{
- function uiHubBrowse(&$uiBase)
+ public function __construct(&$uiBase)
{
- $this->Base =& $uiBase;
- $this->prefix = 'HUBBROWSE';
- $this->col =& $_SESSION[UI_HUBBROWSE_SESSNAME]['col'];
- $this->criteria =& $_SESSION[UI_HUBBROWSE_SESSNAME]['criteria'];
- #$this->results =& $_SESSION[UI_HUBBROWSE_SESSNAME]['results'];
- $this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
+ $this->Base =& $uiBase;
+ $this->prefix = 'HUBBROWSE';
+ $this->col =& $_SESSION[UI_HUBBROWSE_SESSNAME]['col'];
+ $this->criteria =& $_SESSION[UI_HUBBROWSE_SESSNAME]['criteria'];
+ #$this->results =& $_SESSION[UI_HUBBROWSE_SESSNAME]['results'];
+ $this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
if (empty($this->criteria['limit'])) {
- $this->criteria['limit'] = UI_BROWSE_DEFAULT_LIMIT;
+ $this->criteria['limit'] = UI_BROWSE_DEFAULT_LIMIT;
}
if (empty($this->criteria['filetype'])) {
$this->criteria['filetype'] = UI_FILETYPE_ANY;
@@ -53,8 +53,8 @@ class uiHubBrowse extends uiBrowse
}
$this->results['cnt'] = $results['cnt'];
foreach ($results['results'] as $rec) {
- // TODO: maybe this _getMetaInfo is not correct for the remote results
- $this->results['items'][] = $this->Base->_getMetaInfo($this->Base->gb->_idFromGunid($rec));
+ // TODO: maybe this getMetaInfo is not correct for the remote results
+ $this->results['items'][] = $this->Base->getMetaInfo($this->Base->gb->_idFromGunid($rec));
}
$this->pagination($results);
// echo 'this->results:'; print_r($this->results); echo "\n";
diff --git a/campcaster/src/modules/htmlUI/var/ui_hubSearch.class.php b/campcaster/src/modules/htmlUI/var/ui_hubSearch.class.php
index 69f85cde9..936c203ff 100644
--- a/campcaster/src/modules/htmlUI/var/ui_hubSearch.class.php
+++ b/campcaster/src/modules/htmlUI/var/ui_hubSearch.class.php
@@ -6,13 +6,13 @@
*/
class uiHubSearch extends uiSearch {
- function uiHubSearch(&$uiBase)
+ public function __construct(&$uiBase)
{
- $this->Base =& $uiBase;
- $this->prefix = 'HUBSEARCH';
- #$this->results =& $_SESSION[UI_HUBSEARCH_SESSNAME]['results'];
- $this->criteria =& $_SESSION[UI_HUBSEARCH_SESSNAME]['criteria'];
- $this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
+ $this->Base =& $uiBase;
+ $this->prefix = 'HUBSEARCH';
+ #$this->results =& $_SESSION[UI_HUBSEARCH_SESSNAME]['results'];
+ $this->criteria =& $_SESSION[UI_HUBSEARCH_SESSNAME]['criteria'];
+ $this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
if (empty($this->criteria['limit'])) {
$this->criteria['limit'] = UI_BROWSE_DEFAULT_LIMIT;
@@ -33,24 +33,24 @@ class uiHubSearch extends uiSearch {
function newSearch(&$formdata)
{
- $this->results = NULL;
- $this->criteria['conditions'] = NULL;
- $this->criteria['offset'] = NULL;
- $this->criteria['form'] = NULL;
- $this->criteria['operator'] = $formdata['operator'];
- $this->criteria['filetype'] = $formdata['filetype'];
- $this->criteria['limit'] = $formdata['limit'];
- $this->criteria['counter'] = 0;
+ $this->results = NULL;
+ $this->criteria['conditions'] = NULL;
+ $this->criteria['offset'] = NULL;
+ $this->criteria['form'] = NULL;
+ $this->criteria['operator'] = $formdata['operator'];
+ $this->criteria['filetype'] = $formdata['filetype'];
+ $this->criteria['limit'] = $formdata['limit'];
+ $this->criteria['counter'] = 0;
// $criteria['form'] is used for retransfer to form
$this->criteria['form']['operator'] = $formdata['operator'];
$this->criteria['form']['filetype'] = $formdata['filetype'];
- $this->criteria['form']['limit'] = $formdata['limit'];
+ $this->criteria['form']['limit'] = $formdata['limit'];
- foreach ($formdata as $key=>$val) {
+ foreach ($formdata as $key => $val) {
if (is_array($val) && $val['active']) {
$this->criteria['counter']++;
- $this->criteria['conditions'][$key] = array('cat' => $this->Base->_formElementDecode($val[0]),
+ $this->criteria['conditions'][$key] = array('cat' => uiBase::formElementDecode($val[0]),
'op' => $val[1],
'val' => stripslashes($val[2])
);
@@ -83,7 +83,7 @@ class uiHubSearch extends uiSearch {
}
foreach ($results['results'] as $rec) {
$tmpId = $this->Base->gb->_idFromGunid($rec["gunid"]);
- $this->results['items'][] = $this->Base->_getMetaInfo($tmpId);
+ $this->results['items'][] = $this->Base->getMetaInfo($tmpId);
}
$this->results['cnt'] = $results['cnt'];
@@ -94,16 +94,18 @@ class uiHubSearch extends uiSearch {
} // fn searchDB
- function getSearchResults($trtokid) {
+ function getSearchResults($trtokid)
+ {
$this->results = array('page' => $this->criteria['offset']/$this->criteria['limit']);
$results = $this->Base->gb->getSearchResults($trtokid);
+ //echo"RESULTS:
";print_r($results);echo "
";
if (!is_array($results) || !count($results)) {
return false;
}
$this->results['cnt'] = $results['cnt'];
foreach ($results['results'] as $rec) {
- // TODO: maybe this _getMetaInfo is not correct for the remote results
- $this->results['items'][] = $this->Base->_getMetaInfo($this->Base->gb->_idFromGunid($rec));
+ // TODO: maybe this getMetaInfo is not correct for the remote results
+ $this->results['items'][] = $this->Base->getMetaInfo($this->Base->gb->_idFromGunid($rec));
}
$this->pagination($results);
//echo 'this->results:'; print_r($this->results); echo "\n";
diff --git a/campcaster/src/modules/htmlUI/var/ui_jscom.php b/campcaster/src/modules/htmlUI/var/ui_jscom.php
index c157fba18..d898fa6ca 100644
--- a/campcaster/src/modules/htmlUI/var/ui_jscom.php
+++ b/campcaster/src/modules/htmlUI/var/ui_jscom.php
@@ -6,12 +6,12 @@
* @version $Revision$
*/
class jscom {
- var $prefix = 'jsc_';
- var $callables = array();
- var $method = 'POST';
- var $uri = '';
+ private $prefix = 'jsc_';
+ private $callables = array();
+ private $method = 'POST';
+ private $uri = '';
- function jscom($calls = NULL, $pars = NULL)
+ public function __construct($calls = NULL, $pars = NULL)
{
$this->uri = $_SERVER['REQUEST_URI'];
if (!is_null($calls)) {
diff --git a/campcaster/src/modules/htmlUI/var/ui_playlist.class.php b/campcaster/src/modules/htmlUI/var/ui_playlist.class.php
index 876ef91d7..6dec9d72c 100644
--- a/campcaster/src/modules/htmlUI/var/ui_playlist.class.php
+++ b/campcaster/src/modules/htmlUI/var/ui_playlist.class.php
@@ -6,23 +6,25 @@
*/
class uiPlaylist
{
- var $Base;
- var $activeId;
- var $changed;
- var $title;
- var $duration;
- var $token;
- var $reloadUrl;
- var $redirectUrl;
- var $returnUrl;
+ public $activeId;
+ public $title;
+ public $duration;
+ public $changed;
+ public $token;
- function uiPlaylist(&$uiBase)
+ private $Base;
+ private $reloadUrl;
+ private $redirectUrl;
+ private $returnUrl;
+ private $flat;
+
+ public function __construct(&$uiBase)
{
$this->Base =& $uiBase;
$this->activeId =& $_SESSION[UI_PLAYLIST_SESSNAME]['activeId'];
$this->changed =& $_SESSION[UI_PLAYLIST_SESSNAME]['changed'];
- $this->title = $this->Base->_getMDataValue($this->activeId, UI_MDATA_KEY_TITLE);
- $this->duration = $this->Base->_getMDataValue($this->activeId, UI_MDATA_KEY_DURATION);
+ $this->title = $this->Base->getMetadataValue($this->activeId, UI_MDATA_KEY_TITLE);
+ $this->duration = $this->Base->getMetadataValue($this->activeId, UI_MDATA_KEY_DURATION);
$this->token =& $_SESSION[UI_PLAYLIST_SESSNAME]['token'];
$this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
$this->redirectUrl = UI_BROWSER.'?popup[]=_2PL.simpleManagement&popup[]=_close';
@@ -100,14 +102,14 @@ class uiPlaylist
if (UI_VERBOSE === TRUE) {
print_r($token);
}
- $this->Base->_retMsg('Unable to open playlist "$1".', $this->Base->_getMDataValue($plid, UI_MDATA_KEY_TITLE));
+ $this->Base->_retMsg('Unable to open playlist "$1".', $this->Base->getMetadataValue($plid, UI_MDATA_KEY_TITLE));
return FALSE;
}
$this->token = $token;
$this->Base->gb->savePref($this->Base->sessid, UI_PL_ACCESSTOKEN_KEY, $plid.':'.$this->token);
$this->activeId = $plid;
if ($msg && UI_VERBOSE) {
- $this->Base->_retMsg('Playlist "$1" opened.', $this->Base->_getMDataValue($plid, UI_MDATA_KEY_TITLE));
+ $this->Base->_retMsg('Playlist "$1" opened.', $this->Base->getMetadataValue($plid, UI_MDATA_KEY_TITLE));
}
return TRUE;
@@ -137,7 +139,7 @@ class uiPlaylist
return FALSE;
}
if ($msg && UI_VERBOSE) {
- $this->Base->_retMsg('Playlist "$1" released.', $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($plgunid), UI_MDATA_KEY_TITLE));
+ $this->Base->_retMsg('Playlist "$1" released.', $this->Base->getMetadataValue($this->Base->gb->_idFromGunid($plgunid), UI_MDATA_KEY_TITLE));
}
$this->activeId = NULL;
$this->token = NULL;
@@ -155,7 +157,7 @@ class uiPlaylist
$this->activate($tmpid, FALSE);
$this->changed = FALSE;
if (UI_VERBOSE) {
- $this->Base->_retMsg('Playlist "$1" saved.', $this->Base->_getMDataValue($tmpid, UI_MDATA_KEY_TITLE));
+ $this->Base->_retMsg('Playlist "$1" saved.', $this->Base->getMetadataValue($tmpid, UI_MDATA_KEY_TITLE));
}
return $this->activeId;
@@ -181,7 +183,7 @@ class uiPlaylist
return FALSE;
}
if (UI_VERBOSE) {
- $this->Base->_retMsg('Playlist "$1" reverted.', $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($plgunid), UI_MDATA_KEY_TITLE));
+ $this->Base->_retMsg('Playlist "$1" reverted.', $this->Base->getMetadataValue($this->Base->gb->_idFromGunid($plgunid), UI_MDATA_KEY_TITLE));
}
$this->activeId = NULL;
$this->token = NULL;
@@ -306,8 +308,8 @@ class uiPlaylist
return FALSE;
}
- $this->Base->_setMDataValue($plid, UI_MDATA_KEY_CREATOR, $this->Base->login);
- $this->Base->_setMDataValue($plid, UI_MDATA_KEY_DESCRIPTION, tra('created at $1', $datetime));
+ $this->Base->setMetadataValue($plid, UI_MDATA_KEY_CREATOR, $this->Base->login);
+ $this->Base->setMetadataValue($plid, UI_MDATA_KEY_DESCRIPTION, tra('created at $1', $datetime));
if ($this->activate($plid)===FALSE) {
return FALSE;
@@ -323,18 +325,16 @@ class uiPlaylist
} // fn create
- function getFlat($id)
+ public function getFlat($id)
{
- unset($this->flat);
$this->_plwalk($this->getPLArray($id));
- if (is_Array($this->flat)) {
+ if (count($this->flat) > 0) {
reset($this->flat);
$this->flat[key($this->flat)]['firstInList'] = true;
end($this->flat);
$this->flat[key($this->flat)]['lastInList'] = true;
reset($this->flat);
-
return $this->flat;
} else {
return array();
@@ -342,16 +342,17 @@ class uiPlaylist
} // fn getFlat
- function _plwalk($arr, $parent=0, $attrs=0)
+ private function _plwalk($arr, $parent=0, $attrs=0)
{
- foreach ($arr['children'] as $node=>$sub) {
+ $this->flat = array();
+ foreach ($arr['children'] as $node => $sub) {
if ($sub['elementname']===UI_PL_ELEM_PLAYLIST) {
$this->_plwalk($sub, $node, $sub['attrs']);
}
if ($sub['elementname']===UI_FILETYPE_AUDIOCLIP || $sub['elementname']===UI_FILETYPE_PLAYLIST) {
#$this->flat["$parent.$node"] = $sub['attrs'];
#$this->flat["$parent.$node"]['type'] = $sub['elementname'];
- $this->flat[$parent] = $this->Base->_getMetaInfo($this->Base->gb->_idFromGunid($sub['attrs']['id']));
+ $this->flat[$parent] = $this->Base->getMetaInfo($this->Base->gb->_idFromGunid($sub['attrs']['id']));
$this->flat[$parent]['attrs'] = $attrs;
$this->flat[$parent]['playlength'] = $sub['attrs']['playlength'];
}
@@ -535,9 +536,9 @@ class uiPlaylist
$form->setConstants(array('id' => $id,
'duration' => $duration)
);
- $this->Base->_parseArr2Form($form, $mask[$type]);
- $this->Base->_parseArr2Form($form, $mask['all']);
- $renderer =& new HTML_QuickForm_Renderer_Array(true, true);
+ uiBase::parseArrayToForm($form, $mask[$type]);
+ uiBase::parseArrayToForm($form, $mask['all']);
+ $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer);
return $renderer->toArray();
} // fn changeTransitionForm
@@ -546,9 +547,9 @@ class uiPlaylist
function changeAllTransitionsForm($mask)
{
$form = new HTML_QuickForm('PL_changeTransition', UI_STANDARD_FORM_METHOD, UI_HANDLER);
- $this->Base->_parseArr2Form($form, $mask['transition']);
- $this->Base->_parseArr2Form($form, $mask['all']);
- $renderer =& new HTML_QuickForm_Renderer_Array(true, true);
+ uiBase::parseArrayToForm($form, $mask['transition']);
+ uiBase::parseArrayToForm($form, $mask['all']);
+ $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer);
return $renderer->toArray();
} // fn changeAllTransitionsForm
@@ -565,13 +566,13 @@ class uiPlaylist
} else {
$mask['act']['constant'] = 'PL.addItem';
$mask['id']['constant'] = $id;
- $mask['playlength']['default'] = substr($this->Base->_getMDataValue($id, UI_MDATA_KEY_DURATION), 0, 8);
+ $mask['playlength']['default'] = substr($this->Base->getMetadataValue($id, UI_MDATA_KEY_DURATION), 0, 8);
$mask['duration']['constant'] = $mask['playlength']['default'];
}
$form = new HTML_QuickForm('PL_setItemPlaylengthForm', UI_STANDARD_FORM_METHOD, UI_HANDLER);
- $this->Base->_parseArr2Form($form, $mask);
- $renderer =& new HTML_QuickForm_Renderer_Array(true, true);
+ uiBase::parseArrayToForm($form, $mask);
+ $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer);
return $renderer->toArray();
} // fn setItemPlaylengthForm
@@ -584,29 +585,29 @@ class uiPlaylist
$langid = $langid ? $langid : UI_DEFAULT_LANGID;
foreach ($mask['playlist'] as $k=>$v) {
- $mask['playlist'][$k]['element'] = $this->Base->_formElementEncode($v['element']);
- if ($getval = $this->Base->_getMDataValue($id, $v['element'], $langid)) {
+ $mask['playlist'][$k]['element'] = uiBase::formElementEncode($v['element']);
+ if ($getval = $this->Base->getMetadataValue($id, $v['element'], $langid)) {
$mask['playlist'][$k]['default'] = $getval;
$mask['playlist'][$k]['attributes']['onFocus'] = 'MData_confirmChange(this)';
};
}
$form = new HTML_QuickForm('editMetaData', UI_STANDARD_FORM_METHOD, UI_HANDLER);
- $this->Base->_parseArr2Form($form, $mask['basics']);
- $this->Base->_parseArr2Form($form, $mask['playlist']);
- $this->Base->_parseArr2Form($form, $mask['buttons']);
+ uiBase::parseArrayToForm($form, $mask['basics']);
+ uiBase::parseArrayToForm($form, $mask['playlist']);
+ uiBase::parseArrayToForm($form, $mask['buttons']);
$form->setConstants(array('act' => 'PL.editMetaData',
'id' => $id,
'curr_langid' => $langid
)
);
- $renderer =& new HTML_QuickForm_Renderer_Array(true, true);
+ $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer);
$output['main'] = $renderer->toArray();
$form = new HTML_QuickForm('langswitch', UI_STANDARD_FORM_METHOD, UI_BROWSER);
- $this->Base->_parseArr2Form($form, $mask['langswitch']);
+ uiBase::parseArrayToForm($form, $mask['langswitch']);
$form->setConstants(array('target_langid' => $langid));
- $renderer =& new HTML_QuickForm_Renderer_Array(true, true);
+ $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer);
$output['langswitch'] = $renderer->toArray();
@@ -632,7 +633,7 @@ class uiPlaylist
}
foreach ($mask['playlist'] as $k=>$v) {
- $formdata[$this->Base->_formElementEncode($v['element'])] ? $mData[$this->Base->_formElementDecode($v['element'])] = $formdata[$this->Base->_formElementEncode($v['element'])] : NULL;
+ $formdata[uiBase::formElementEncode($v['element'])] ? $mData[uiBase::formElementDecode($v['element'])] = $formdata[uiBase::formElementEncode($v['element'])] : NULL;
}
if (!count($mData)) {
@@ -699,8 +700,8 @@ class uiPlaylist
$mask['act']['constant'] = 'PL.export';
$mask['id']['constant'] = $id;
$form = new HTML_QuickForm('PL_exportForm', UI_STANDARD_FORM_METHOD, UI_HANDLER);
- $this->Base->_parseArr2Form($form, $mask);
- $renderer =& new HTML_QuickForm_Renderer_Array(true, true);
+ uiBase::parseArrayToForm($form, $mask);
+ $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer);
return $renderer->toArray();
} // fn exportForm
@@ -710,8 +711,8 @@ class uiPlaylist
{
$form = new HTML_QuickForm('PL_importForm', UI_STANDARD_FORM_METHOD, UI_HANDLER);
//print_r($mask);
- $this->Base->_parseArr2Form($form, $mask);
- $renderer =& new HTML_QuickForm_Renderer_Array(true, true);
+ uiBase::parseArrayToForm($form, $mask);
+ $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer);
return $renderer->toArray();
} // fn importForm
diff --git a/campcaster/src/modules/htmlUI/var/ui_scheduler.class.php b/campcaster/src/modules/htmlUI/var/ui_scheduler.class.php
index 7f301722a..578fb1717 100644
--- a/campcaster/src/modules/htmlUI/var/ui_scheduler.class.php
+++ b/campcaster/src/modules/htmlUI/var/ui_scheduler.class.php
@@ -5,45 +5,42 @@
* @version $Revision$
*/
class uiScheduler extends uiCalendar {
- var $curr;
- var $scheduleAtTime;
- var $schedulePrev;
- var $scheduleNext;
- var $error;
- var $Base;
- var $reloadUrl;
- var $closeUrl;
- var $firstDayOfWeek;
+ public $curr;
+ private $scheduleAtTime;
+ private $schedulePrev;
+ private $scheduleNext;
+ private $error;
+ private $Base;
+ private $reloadUrl;
+ private $closeUrl;
+ private $firstDayOfWeek;
- function uiScheduler(&$uiBase)
+ public function __construct(&$uiBase)
{
- $this->curr =& $_SESSION[UI_CALENDAR_SESSNAME]['current'];
+ $this->curr =& $_SESSION[UI_CALENDAR_SESSNAME]['current'];
$this->scheduleAtTime =& $_SESSION[UI_CALENDAR_SESSNAME]['scheduleAtTime'];
- $this->schedulePrev =& $_SESSION[UI_CALENDAR_SESSNAME]['schedulePrev'];
- $this->scheduleNext =& $_SESSION[UI_CALENDAR_SESSNAME]['scheduleNext'];
- $this->error =& $_SESSION['SCHEDULER']['error'];
- $this->error =& $_SESSION['SCHEDULER']['error'];
+ $this->schedulePrev =& $_SESSION[UI_CALENDAR_SESSNAME]['schedulePrev'];
+ $this->scheduleNext =& $_SESSION[UI_CALENDAR_SESSNAME]['scheduleNext'];
+ $this->error =& $_SESSION['SCHEDULER']['error'];
if (!is_array($this->curr)) {
- $this->curr['view'] = UI_SCHEDULER_DEFAULT_VIEW;
- $this->curr['year'] = strftime("%Y");
- $this->curr['month'] = strftime("%m");
- $this->curr['week'] = strftime("%V");
- $this->curr['day'] = strftime("%d");
- $this->curr['hour'] = strftime("%H");
- $this->curr['dayname'] = strftime("%A");
+ $this->curr['view'] = UI_SCHEDULER_DEFAULT_VIEW;
+ $this->curr['year'] = strftime("%Y");
+ $this->curr['month'] = strftime("%m");
+ $this->curr['week'] = strftime("%V");
+ $this->curr['day'] = strftime("%d");
+ $this->curr['hour'] = strftime("%H");
+ $this->curr['dayname'] = strftime("%A");
$this->curr['monthname'] = strftime("%B");
- $this->curr['isToday'] = TRUE;
+ $this->curr['isToday'] = TRUE;
}
$this->Base =& $uiBase;
$this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
- $this->closeUrl = UI_BROWSER.'?popup[]=_close';
-
- $this->uiCalendar();
+ $this->closeUrl = UI_BROWSER.'?popup[]=_close';
+ parent::__construct();
$this->initXmlRpc();
-
//$this->startDaemon();
} // constructor
@@ -298,8 +295,8 @@ class uiScheduler extends uiCalendar {
'end' => substr($val['end'], strpos($val['end'], 'T')+1),
'start_stamp' => $this->_datetime2timestamp($val['start']),
'end_stamp' => $this->_datetime2timestamp($val['end']),
- 'title' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE),
- 'creator' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR),
+ 'title' => $this->Base->getMetadataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE),
+ 'creator' => $this->Base->getMetadataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR),
'type' => 'Playlist'
);
}
@@ -338,8 +335,8 @@ class uiScheduler extends uiCalendar {
'scheduleid'=> $val['id'],
'start' => substr($val['start'], strpos($val['start'], 'T')+1),
'end' => substr($val['end'], strpos($val['end'], 'T') + 1),
- 'title' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE),
- 'creator' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR),
+ 'title' => $this->Base->getMetadataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE),
+ 'creator' => $this->Base->getMetadataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR),
'type' => 'Playlist',
'endstoday' => strftime('%d', $start) === strftime('%d', $end) ? TRUE : FALSE,
'endshere' => strftime('%H', $start) === strftime('%H', $end) ? TRUE : FALSE
@@ -360,8 +357,8 @@ class uiScheduler extends uiCalendar {
'scheduleid'=> $val['id'],
'start' => substr($val['start'], strpos($val['start'], 'T')+1),
'end' => substr($val['end'], strpos($val['end'], 'T') + 1),
- 'title' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE),
- 'creator' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR),
+ 'title' => $this->Base->getMetadataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE),
+ 'creator' => $this->Base->getMetadataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR),
'type' => 'Playlist',
'startsyesterday' => strftime('%d', $start) === strftime('%d', $end) ? FALSE : TRUE,
);
@@ -383,8 +380,8 @@ class uiScheduler extends uiCalendar {
$items[date('H', $this->_datetime2timestamp($val['start']))][]= array (
'start' => substr($val['start'], strpos($val['start'], 'T')+1),
'end' => substr($val['end'], strpos($val['end'], 'T') + 1),
- 'title' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE),
- 'creator' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR),
+ 'title' => $this->Base->getMetadataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE),
+ 'creator' => $this->Base->getMetadataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR),
);
}
#print_r($items);
@@ -403,8 +400,8 @@ class uiScheduler extends uiCalendar {
}
foreach ($arr as $key => $val) {
- $arr[$key]['title'] = $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE);
- $arr[$key]['creator'] = $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR);
+ $arr[$key]['title'] = $this->Base->getMetadataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE);
+ $arr[$key]['creator'] = $this->Base->getMetadataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR);
$arr[$key]['pos'] = $this->_datetime2timestamp($val['start']);
$arr[$key]['span'] = date('H', $this->_datetime2timestamp($val['end'])) - date('H', $this->_datetime2timestamp($val['start'])) +1;
}
@@ -446,7 +443,7 @@ class uiScheduler extends uiCalendar {
//print_r($ui_fmask['schedule']);
$form = new HTML_QuickForm('schedule', UI_STANDARD_FORM_METHOD, UI_HANDLER);
- $this->Base->_parseArr2Form($form, $ui_fmask['schedule']);
+ uiBase::parseArrayToForm($form, $ui_fmask['schedule']);
$settime = array('H' => $this->scheduleAtTime['hour'],
'i' => $this->scheduleAtTime['minute'],
's' => $this->scheduleAtTime['second']
@@ -459,7 +456,7 @@ class uiScheduler extends uiCalendar {
'date' => $setdate,
));
- $renderer =& new HTML_QuickForm_Renderer_Array(true, true);
+ $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer);
$output = $renderer->toArray();
//print_r($output);
@@ -473,8 +470,8 @@ class uiScheduler extends uiCalendar {
$this->Base->SCRATCHPAD->addItem($id);
$this->availablePlaylists[] = array(
'gunid' => $this->Base->gb->_gunidFromId($id),
- 'title' => $this->Base->_getMDataValue($id, UI_MDATA_KEY_TITLE),
- 'duration' => $this->Base->_getMDataValue($id, UI_MDATA_KEY_DURATION),
+ 'title' => $this->Base->getMetadataValue($id, UI_MDATA_KEY_TITLE),
+ 'duration' => $this->Base->getMetadataValue($id, UI_MDATA_KEY_DURATION),
);
return TRUE;
} else {
@@ -643,6 +640,7 @@ class uiScheduler extends uiCalendar {
return array(FALSE);
}
+ $pStampArr = null;
foreach ($pArr as $val) {
#print_r($val);
$pStampArr[] = array('start' => $this->_datetime2timestamp($val['start']),
diff --git a/campcaster/src/modules/htmlUI/var/ui_schedulerPhpClient.class.php b/campcaster/src/modules/htmlUI/var/ui_schedulerPhpClient.class.php
index 0b0824acc..32f690981 100644
--- a/campcaster/src/modules/htmlUI/var/ui_schedulerPhpClient.class.php
+++ b/campcaster/src/modules/htmlUI/var/ui_schedulerPhpClient.class.php
@@ -171,45 +171,55 @@ $mdefs = array(
class SchedulerPhpClient {
/**
- * Databases object reference
+ * Databases object reference
+ * @var DB
*/
- var $dbc = NULL;
- /**
- * Array with methods description
- */
- var $mdefs = array();
- /**
- * Confiduration array from ../conf.php
- */
- var $config = array();
- /**
- * XMLRPC client object reference
- */
- var $client = NULL;
- /**
- * Verbosity flag
- */
- var $verbose = FALSE;
- /**
- * XMLRPC debug flag
- */
- var $debug = 0;
+ private $dbc = NULL;
/**
- * Constructor - please DON'T CALL IT, use factory method instead
+ * Array with methods description
+ * @var array
+ */
+ private $mdefs = array();
+
+ /**
+ * Confiduration array from ../conf.php
+ * @var array
+ */
+ private $config = array();
+
+ /**
+ * XMLRPC client object reference
+ * @var XMLRPC_Client
+ */
+ private $client = NULL;
+
+ /**
+ * Verbosity flag
+ * @var boolean
+ */
+ private $verbose = FALSE;
+
+ /**
+ * XMLRPC debug flag
+ * @var boolean
+ */
+ private $debug = 0;
+
+ /**
+ * Constructor - please DON'T CALL IT, use factory method instead
*
- * @param DB $dbc
- * @param array $mdefs
- * hash array with methods description
- * @param array $config
- * hash array with configuration
- * @param int $debug
- * XMLRPC debug flag
- * @param boolean $verbose
+ * @param DB $dbc
+ * @param array $mdefs
+ * hash array with methods description
+ * @param array $config
+ * hash array with configuration
+ * @param int $debug
+ * XMLRPC debug flag
+ * @param boolean $verbose
* verbosity flag
*/
- function SchedulerPhpClient(
- &$dbc, $mdefs, $config, $debug=0, $verbose=FALSE)
+ public function __construct(&$dbc, $mdefs, $config, $debug=0, $verbose=FALSE)
{
$this->dbc = $dbc;
$this->mdefs = $mdefs;
@@ -252,7 +262,7 @@ class SchedulerPhpClient {
* verbosity flag
* @return object, created object instance
*/
- function &factory(&$dbc, $mdefs, $config, $debug=0, $verbose=FALSE)
+ public function &factory(&$dbc, $mdefs, $config, $debug=0, $verbose=FALSE)
{
$f = '';
foreach ($mdefs as $fn => $farr) {
@@ -271,7 +281,7 @@ class SchedulerPhpClient {
if (FALSE === eval($e)) {
return $dbc->raiseError("Eval failed");
}
- $spc =& new SchedulerPhpClientCore(
+ $spc = new SchedulerPhpClientCore(
$dbc, $mdefs, $config, $debug, $verbose);
return $spc;
} // fn factory
@@ -288,7 +298,7 @@ class SchedulerPhpClient {
* @return array
* PHP hash with response
*/
- function callMethod($method, $gettedPars)
+ public function callMethod($method, $gettedPars)
{
$parr = array();
$XML_RPC_val = new XML_RPC_Value;
diff --git a/campcaster/src/modules/htmlUI/var/ui_scratchpad.class.php b/campcaster/src/modules/htmlUI/var/ui_scratchpad.class.php
index 63589b2ac..2e0794cdb 100644
--- a/campcaster/src/modules/htmlUI/var/ui_scratchpad.class.php
+++ b/campcaster/src/modules/htmlUI/var/ui_scratchpad.class.php
@@ -6,14 +6,14 @@
*/
class uiScratchPad
{
- var $Base;
- var $items;
- var $order;
- var $reloadUrl;
+ private $Base;
+ private $items;
+ private $order;
+ private $reloadUrl;
- function uiScratchPad(&$uiBase)
+ public function __construct(&$uiBase)
{
- $this->Base =& $uiBase;
+ $this->Base =& $uiBase;
$this->items =& $_SESSION[UI_SCRATCHPAD_SESSNAME]['content'];
$this->order =& $_SESSION[UI_SCRATCHPAD_SESSNAME]['order'];
$this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
@@ -46,8 +46,8 @@ class uiScratchPad
foreach ($arr as $gunid) {
if (preg_match('/[0-9]{1,20}/', $gunid)) {
- if ($this->Base->gb->_idFromGunid($this->Base->_toHex($gunid)) != FALSE) {
- if ($i = $this->Base->_getMetaInfo($this->Base->gb->_idFromGunid($this->Base->_toHex($gunid)))) {
+ if ($this->Base->gb->_idFromGunid($this->Base->toHex($gunid)) != FALSE) {
+ if ($i = $this->Base->getMetaInfo($this->Base->gb->_idFromGunid($this->Base->toHex($gunid)))) {
$this->items[] = $i;
}
}
@@ -61,7 +61,7 @@ class uiScratchPad
{
foreach ($this->items as $val) {
//$str .= $val['gunid'].':'.$val['added'].' '; ## new format ###
- $str .= $this->Base->_toInt8($val['gunid']).' '; ## Akos� old format ###
+ $str .= $this->Base->toInt8($val['gunid']).' '; ## Akos� old format ###
}
$this->Base->gb->savePref($this->Base->sessid, UI_SCRATCHPAD_KEY, $str);
} // fn save
@@ -87,7 +87,7 @@ class uiScratchPad
$sp = $this->get();
foreach ($ids as $id) {
- $item = $this->Base->_getMetaInfo($id);
+ $item = $this->Base->getMetaInfo($id);
foreach ($sp as $key=>$val) {
if ($val['id'] == $item['id']) {
@@ -167,7 +167,7 @@ class uiScratchPad
function reLoadM()
{
foreach($this->items as $key=>$val) {
- $this->items[$key] = $this->Base->_getMetaInfo($val['id']);
+ $this->items[$key] = $this->Base->getMetaInfo($val['id']);
}
}
} // class uiScratchPad
diff --git a/campcaster/src/modules/htmlUI/var/ui_search.class.php b/campcaster/src/modules/htmlUI/var/ui_search.class.php
index d184f135e..ab85fa6b4 100644
--- a/campcaster/src/modules/htmlUI/var/ui_search.class.php
+++ b/campcaster/src/modules/htmlUI/var/ui_search.class.php
@@ -6,21 +6,21 @@
*/
class uiSearch
{
- var $Base;
- var $prefix;
- var $criteria;
- var $reloadUrl;
- var $results;
+ private $Base;
+ private $prefix;
+ private $criteria;
+ private $reloadUrl;
+ private $results;
- function uiSearch(&$uiBase)
+ public function __construct(&$uiBase)
{
- $this->Base =& $uiBase;
- $this->prefix = 'SEARCH';
- //$this->results =& $_SESSION[UI_SEARCH_SESSNAME]['results'];
- $this->criteria =& $_SESSION[UI_SEARCH_SESSNAME]['criteria'];
- $this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
+ $this->Base =& $uiBase;
+ $this->prefix = 'SEARCH';
+ //$this->results =& $_SESSION[UI_SEARCH_SESSNAME]['results'];
+ $this->criteria =& $_SESSION[UI_SEARCH_SESSNAME]['criteria'];
+ $this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
if (empty($this->criteria['limit'])) {
- $this->criteria['limit'] = UI_BROWSE_DEFAULT_LIMIT;
+ $this->criteria['limit'] = UI_BROWSE_DEFAULT_LIMIT;
}
}
@@ -47,7 +47,7 @@ class uiSearch
function searchForm($id, $mask2)
{
//print_r($this->criteria['form']);
- include dirname(__FILE__).'/formmask/metadata.inc.php';
+ include(dirname(__FILE__).'/formmask/metadata.inc.php');
$form = new HTML_QuickForm('search', UI_STANDARD_FORM_METHOD, UI_HANDLER);
$counter = isset($this->criteria['counter']) ? $this->criteria['counter'] : 1;
$form->setConstants(array('id'=>$id, 'counter'=>$counter));
@@ -55,11 +55,11 @@ class uiSearch
foreach ($mask['pages'] as $key=>$val) {
foreach ($mask['pages'][$key] as $v){
if (isset($v['type']) && $v['type']) {
- $col1[$this->Base->_formElementEncode($v['element'])] = tra($v['label']);
+ $col1[uiBase::formElementEncode($v['element'])] = tra($v['label']);
if (isset($val['relation'])) {
- $col2[$this->Base->_formElementEncode($v['element'])] = $mask2['relations'][$v['relation']];
+ $col2[uiBase::formElementEncode($v['element'])] = $mask2['relations'][$v['relation']];
} else {
- $col2[$this->Base->_formElementEncode($v['element'])] = $mask2['relations']['standard'];
+ $col2[uiBase::formElementEncode($v['element'])] = $mask2['relations']['standard'];
}
}
};
@@ -101,11 +101,11 @@ class uiSearch
$form->addElement('static', 's2', NULL, "");
}
- $this->Base->_parseArr2Form($form, $mask2['search']);
+ uiBase::parseArrayToForm($form, $mask2['search']);
$constants = isset($this->criteria['form']) ? $this->criteria['form'] : null;
$form->setConstants($constants);
$form->validate();
- $renderer =& new HTML_QuickForm_Renderer_Array(true, true);
+ $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer);
$output['dynform'] = $renderer->toArray();
//print_r($output);
@@ -134,7 +134,7 @@ class uiSearch
foreach ($formdata as $key=>$val) {
if (is_array($val) && $val['active']) {
$this->criteria['counter']++;
- $this->criteria['conditions'][$key] = array('cat' => $this->Base->_formElementDecode($val[0]),
+ $this->criteria['conditions'][$key] = array('cat' => uiBase::formElementDecode($val[0]),
'op' => $val[1],
'val' => stripslashes($val[2])
);
@@ -152,8 +152,8 @@ class uiSearch
function simpleSearchForm($mask)
{
$form = new HTML_QuickForm('simplesearch', UI_STANDARD_FORM_METHOD, UI_HANDLER);
- $this->Base->_parseArr2Form($form, $mask);
- $renderer =& new HTML_QuickForm_Renderer_Array(true, true);
+ uiBase::parseArrayToForm($form, $mask);
+ $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer);
$output = $renderer->toArray();
//print_r($output);
@@ -179,7 +179,7 @@ class uiSearch
'op' => constant('UI_SIMPLESEARCH_OP'.$n),
'val' => stripslashes($formdata['criterium'])
);
- $this->criteria['form']['row_'.$n]= array(0 => $this->Base->_formElementEncode(constant('UI_SIMPLESEARCH_CAT'.$n)),
+ $this->criteria['form']['row_'.$n]= array(0 => uiBase::formElementEncode(constant('UI_SIMPLESEARCH_CAT'.$n)),
1 => constant('UI_SIMPLESEARCH_OP'.$n),
2 => stripslashes($formdata['criterium'])
);
@@ -206,7 +206,7 @@ class uiSearch
}
foreach ($results['results'] as $rec) {
$tmpId = $this->Base->gb->_idFromGunid($rec["gunid"]);
- $this->results['items'][] = $this->Base->_getMetaInfo($tmpId);
+ $this->results['items'][] = $this->Base->getMetaInfo($tmpId);
}
$this->results['cnt'] = $results['cnt'];
diff --git a/campcaster/src/modules/htmlUI/var/ui_smartyExtensions.inc.php b/campcaster/src/modules/htmlUI/var/ui_smartyExtensions.inc.php
index 51d1e2067..1eaedfd56 100644
--- a/campcaster/src/modules/htmlUI/var/ui_smartyExtensions.inc.php
+++ b/campcaster/src/modules/htmlUI/var/ui_smartyExtensions.inc.php
@@ -1,7 +1,7 @@
register_object('UIBROWSER', $uiBrowser);
$Smarty->register_object('BROWSE', $uiBrowser->BROWSE);
-$Smarty->register_object('HUBBROWSE', $uiBrowser->HUBBROWSE);
+$Smarty->register_object('HUBBROWSE', $HUBBROWSE);
$Smarty->register_object('SEARCH', $uiBrowser->SEARCH);
$Smarty->register_object('HUBSEARCH', $uiBrowser->HUBSEARCH);
$Smarty->register_object('TRANSFERS', $uiBrowser->TRANSFERS);
diff --git a/campcaster/src/modules/htmlUI/var/ui_subjects.class.php b/campcaster/src/modules/htmlUI/var/ui_subjects.class.php
index d3a996f06..086fe3fd9 100644
--- a/campcaster/src/modules/htmlUI/var/ui_subjects.class.php
+++ b/campcaster/src/modules/htmlUI/var/ui_subjects.class.php
@@ -6,18 +6,17 @@
*/
class uiSubjects
{
+ public $Base;
+ private $reloadUrl;
+ private $suRedirUrl;
+ private $redirUrl;
- var $Base;
- var $reloadUrl;
- var $suRedirUrl;
- var $redirUrl;
-
- function uiSubjects(&$uiBase)
+ public function __construct(&$uiBase)
{
- $this->Base =& $uiBase;
- $this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
+ $this->Base =& $uiBase;
+ $this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
$this->suRedirUrl = UI_BROWSER.'?act=SUBJECTS';
- $this->redirUrl = UI_BROWSER.'?act=SUBJECTS';
+ $this->redirUrl = UI_BROWSER.'?act=SUBJECTS';
}
@@ -50,8 +49,8 @@ class uiSubjects
include(dirname(__FILE__). '/formmask/subjects.inc.php');
$form = new HTML_QuickForm('addSubject', UI_STANDARD_FORM_METHOD, UI_HANDLER);
- $this->Base->_parseArr2Form($form, $mask[$type]);
- $renderer =& new HTML_QuickForm_Renderer_Array(true, true);
+ uiBase::parseArrayToForm($form, $mask[$type]);
+ $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer);
return $renderer->toArray();
}
@@ -145,9 +144,9 @@ class uiSubjects
} else {
$mask['chgPasswd']['cancel']['attributes'] = array('onClick' => 'location.href="'.UI_BROWSER.'"');
}
- $this->Base->_parseArr2Form($form, $mask['chgPasswd']);
+ uiBase::parseArrayToForm($form, $mask['chgPasswd']);
$form->setConstants(array('login' => $login));
- $renderer =& new HTML_QuickForm_Renderer_Array(true, true);
+ $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer);
return $renderer->toArray();
}
diff --git a/campcaster/src/modules/htmlUI/var/ui_transfers.class.php b/campcaster/src/modules/htmlUI/var/ui_transfers.class.php
index 2bfc0609d..9d4ef6e50 100644
--- a/campcaster/src/modules/htmlUI/var/ui_transfers.class.php
+++ b/campcaster/src/modules/htmlUI/var/ui_transfers.class.php
@@ -7,14 +7,14 @@
*/
class uiTransfers
{
- var $Base;
- var $allItems;
- var $rows;
- var $trShowInfo;
- var $reloadUrl;
+ private $Base;
+ private $allItems;
+ private $rows;
+ private $trShowInfo;
+ private $reloadUrl;
- function uiTransfers(&$uiBase)
+ public function __construct(&$uiBase)
{
$this->Base =& $uiBase;
$this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';