Speedups for HTML interface by only creating the HUBBROWSE object on

demand instead of on every single page load - this object took the
longest to create.  Started to convert code to PHP5 using
public/private/protected/static and __construct() method, got rid
of =& when constructing objects.  Fixed a number of functions that were
marked as private that were actually public.  Fixed names of a couple
functions to be more readable.  Commented out functions that are no
longer in use.
This commit is contained in:
paul 2006-11-14 18:43:57 +00:00
parent bd70c879bc
commit bed878246d
28 changed files with 812 additions and 776 deletions

View file

@ -72,7 +72,7 @@ if (isset($_REQUEST['popup']) && is_array($_REQUEST['popup'])){
$Smarty->assign('filecount', count($_REQUEST['id'])); $Smarty->assign('filecount', count($_REQUEST['id']));
$Smarty->assign('idstr', $idstr); $Smarty->assign('idstr', $idstr);
} else { } else {
$Smarty->assign('filename', $uiBrowser->_getMDataValue($_REQUEST['id'], UI_MDATA_KEY_TITLE)); $Smarty->assign('filename', $uiBrowser->getMetadataValue($_REQUEST['id'], UI_MDATA_KEY_TITLE));
} }
$Smarty->display('popup/deleteItem.tpl'); $Smarty->display('popup/deleteItem.tpl');
break; break;
@ -140,7 +140,7 @@ if (isset($_REQUEST['popup']) && is_array($_REQUEST['popup'])){
break; break;
case "SCHEDULER.removeItem": case "SCHEDULER.removeItem":
$Smarty->assign('playlistName', $uiBrowser->_getMDataValue($_REQUEST['playlistId'], UI_MDATA_KEY_TITLE)); $Smarty->assign('playlistName', $uiBrowser->getMetadataValue($_REQUEST['playlistId'], UI_MDATA_KEY_TITLE));
$Smarty->display('popup/SCHEDULER.removeItem.tpl'); $Smarty->display('popup/SCHEDULER.removeItem.tpl');
break; break;
@ -214,19 +214,21 @@ if (isset($_REQUEST['popup']) && is_array($_REQUEST['popup'])){
break; break;
case 'HUBBROWSE.getResults': case 'HUBBROWSE.getResults':
$HUBBROWSE = new uiHubBrowse($uiBrowser);
if (isset($_REQUEST['trtokid'])) { if (isset($_REQUEST['trtokid'])) {
$Smarty->assign('trtokid',$_REQUEST['trtokid']); $Smarty->assign('trtokid', $_REQUEST['trtokid']);
if ($uiBrowser->HUBBROWSE->getSearchResults($_REQUEST['trtokid'])) { if ($HUBBROWSE->getSearchResults($_REQUEST['trtokid'])) {
$Smarty->assign('results',true); $Smarty->assign('results', true);
} else { } else {
$Smarty->assign('results',false); $Smarty->assign('results', false);
} }
} else { } else {
$Smarty->assign('trtokid',$uiBrowser->HUBBROWSE->searchDB()); $Smarty->assign('trtokid', $HUBBROWSE->searchDB());
$Smarty->assign('results',false); $Smarty->assign('results', false);
} }
$Smarty->assign('polling_frequency',UI_HUB_POLLING_FREQUENCY); $Smarty->assign('polling_frequency', UI_HUB_POLLING_FREQUENCY);
$Smarty->assign('_prefix','HUBBROWSE'); $Smarty->assign('_prefix', 'HUBBROWSE');
$Smarty->display('popup/HUB.getResults.tpl'); $Smarty->display('popup/HUB.getResults.tpl');
break; break;
@ -320,7 +322,8 @@ if ($uiBrowser->userid) {
break; break;
case "HUBBROWSE": case "HUBBROWSE":
$Smarty->assign('hubBrowseForm', $uiBrowser->HUBBROWSE->browseForm($uiBrowser->id, $ui_fmask)); $HUBBROWSE = new uiHubBrowse($uiBrowser);
$Smarty->assign('hubBrowseForm', $HUBBROWSE->browseForm($uiBrowser->id, $ui_fmask));
$Smarty->assign('showLibrary', TRUE); $Smarty->assign('showLibrary', TRUE);
$Smarty->assign('isHub', TRUE); $Smarty->assign('isHub', TRUE);
break; break;
@ -341,7 +344,7 @@ if ($uiBrowser->userid) {
break; break;
case "_analyzeFile": case "_analyzeFile":
$Smarty->assign('_analyzeFile', $uiBrowser->_analyzeFile($uiBrowser->id, 'text')); $Smarty->assign('_analyzeFile', $uiBrowser->analyzeFile($uiBrowser->id, 'text'));
$Smarty->assign('showFile', TRUE); $Smarty->assign('showFile', TRUE);
break; break;

View file

@ -1,6 +1,10 @@
<?php <?php
require(dirname(__FILE__).'/../ui_handler_init.php'); require(dirname(__FILE__).'/../ui_handler_init.php');
if (strstr($_REQUEST['act'], "HUBBROWSE")) {
$HUBBROWSE = new uiHubBrowse($uiHandler);
}
switch ($_REQUEST['act']) { switch ($_REQUEST['act']) {
case "login": case "login":
@ -167,31 +171,31 @@ switch ($_REQUEST['act']) {
break; break;
case "HUBBROWSE.setCategory": case "HUBBROWSE.setCategory":
$uiHandler->HUBBROWSE->setCategory($_REQUEST); $HUBBROWSE->setCategory($_REQUEST);
break; break;
case "HUBBROWSE.setValue": case "HUBBROWSE.setValue":
$uiHandler->HUBBROWSE->setValue($_REQUEST); $HUBBROWSE->setValue($_REQUEST);
break; break;
case "HUBBROWSE.reOrder": case "HUBBROWSE.reOrder":
$uiHandler->HUBBROWSE->reOrder($_REQUEST['by']); $HUBBROWSE->reOrder($_REQUEST['by']);
break; break;
case "HUBBROWSE.setDefaults": case "HUBBROWSE.setDefaults":
$uiHandler->HUBBROWSE->setDefaults(TRUE); $HUBBROWSE->setDefaults(TRUE);
break; break;
case "HUBBROWSE.setOffset": case "HUBBROWSE.setOffset":
$uiHandler->HUBBROWSE->setOffset($_REQUEST['page']); $HUBBROWSE->setOffset($_REQUEST['page']);
break; break;
case "HUBBROWSE.setLimit": case "HUBBROWSE.setLimit":
$uiHandler->HUBBROWSE->setLimit($_REQUEST['limit']); $HUBBROWSE->setLimit($_REQUEST['limit']);
break; break;
case "HUBBROWSE.setFiletype": case "HUBBROWSE.setFiletype":
$uiHandler->HUBBROWSE->setFiletype($_REQUEST['filetype']); $HUBBROWSE->setFiletype($_REQUEST['filetype']);
break; break;
case "HUBSEARCH.newSearch": case "HUBSEARCH.newSearch":

View file

@ -106,7 +106,7 @@ class Localizer {
if ($g_localizerConfig['DEFAULT_FILE_TYPE'] != '') { if ($g_localizerConfig['DEFAULT_FILE_TYPE'] != '') {
return $g_localizerConfig['DEFAULT_FILE_TYPE']; return $g_localizerConfig['DEFAULT_FILE_TYPE'];
} }
$defaultLang =& new LocalizerLanguage('globals', $defaultLang = new LocalizerLanguage('globals',
$g_localizerConfig['DEFAULT_LANGUAGE']); $g_localizerConfig['DEFAULT_LANGUAGE']);
if ($defaultLang->loadGsFile()) { if ($defaultLang->loadGsFile()) {
return 'gs'; return 'gs';
@ -152,7 +152,7 @@ class Localizer {
$key = $p_prefix."_".$g_localizerConfig['DEFAULT_LANGUAGE']; $key = $p_prefix."_".$g_localizerConfig['DEFAULT_LANGUAGE'];
if (!isset($g_localizerConfig['LOADED_FILES'][$key])) { if (!isset($g_localizerConfig['LOADED_FILES'][$key])) {
$defaultLang =& new LocalizerLanguage($p_prefix, $g_localizerConfig['DEFAULT_LANGUAGE']); $defaultLang = new LocalizerLanguage($p_prefix, $g_localizerConfig['DEFAULT_LANGUAGE']);
$defaultLang->loadFile(Localizer::GetMode()); $defaultLang->loadFile(Localizer::GetMode());
$defaultLangStrings = $defaultLang->getTranslationTable(); $defaultLangStrings = $defaultLang->getTranslationTable();
// Merge default language strings into the translation array. // Merge default language strings into the translation array.
@ -162,7 +162,7 @@ class Localizer {
} }
$key = $p_prefix."_".$p_languageCode; $key = $p_prefix."_".$p_languageCode;
if (!isset($g_localizerConfig['LOADED_FILES'][$key])) { if (!isset($g_localizerConfig['LOADED_FILES'][$key])) {
$userLang =& new LocalizerLanguage($p_prefix, $p_languageCode); $userLang = new LocalizerLanguage($p_prefix, $p_languageCode);
$userLang->loadFile(Localizer::GetMode()); $userLang->loadFile(Localizer::GetMode());
$userLangStrings = $userLang->getTranslationTable(); $userLangStrings = $userLang->getTranslationTable();
// Merge user strings into translation array. // Merge user strings into translation array.
@ -205,10 +205,10 @@ class Localizer {
function CompareKeys($p_prefix, $p_data, $p_findExistingKeys = true) function CompareKeys($p_prefix, $p_data, $p_findExistingKeys = true)
{ {
global $g_localizerConfig; global $g_localizerConfig;
$localData =& new LocalizerLanguage($p_prefix, $localData = new LocalizerLanguage($p_prefix,
$g_localizerConfig['DEFAULT_LANGUAGE']); $g_localizerConfig['DEFAULT_LANGUAGE']);
$localData->loadFile(Localizer::GetMode()); $localData->loadFile(Localizer::GetMode());
$globaldata =& new LocalizerLanguage($g_localizerConfig['FILENAME_PREFIX_GLOBAL'], $globaldata = new LocalizerLanguage($g_localizerConfig['FILENAME_PREFIX_GLOBAL'],
$g_localizerConfig['DEFAULT_LANGUAGE']); $g_localizerConfig['DEFAULT_LANGUAGE']);
$globaldata->loadFile(Localizer::GetMode()); $globaldata->loadFile(Localizer::GetMode());
@ -345,7 +345,7 @@ class Localizer {
} }
$existingKeys =& Localizer::FindTranslationStrings($p_prefix); $existingKeys =& Localizer::FindTranslationStrings($p_prefix);
$localData =& new LocalizerLanguage($p_prefix, $g_localizerConfig['DEFAULT_LANGUAGE']); $localData = new LocalizerLanguage($p_prefix, $g_localizerConfig['DEFAULT_LANGUAGE']);
$localData->loadFile(Localizer::GetMode()); $localData->loadFile(Localizer::GetMode());
$localTable = $localData->getTranslationTable(); $localTable = $localData->getTranslationTable();
$unusedKeys = array(); $unusedKeys = array();
@ -377,7 +377,7 @@ class Localizer {
foreach ($languages as $language) { foreach ($languages as $language) {
// Load the language file // Load the language file
$source =& new LocalizerLanguage($p_prefix, $language->getLanguageId()); $source = new LocalizerLanguage($p_prefix, $language->getLanguageId());
$source->loadFile(Localizer::GetMode()); $source->loadFile(Localizer::GetMode());
// For the default language, we set the key & value to be the same. // For the default language, we set the key & value to be the same.
@ -400,7 +400,7 @@ class Localizer {
// We only need to change the values in one file. // We only need to change the values in one file.
else { else {
// Load the language file // Load the language file
$source =& new LocalizerLanguage($p_prefix, $p_languageId); $source = new LocalizerLanguage($p_prefix, $p_languageId);
$source->loadFile(Localizer::GetMode()); $source->loadFile(Localizer::GetMode());
foreach ($p_data as $pair) { foreach ($p_data as $pair) {
$source->updateString($pair['key'], $pair['key'], $pair['value']); $source->updateString($pair['key'], $pair['key'], $pair['value']);
@ -419,14 +419,14 @@ class Localizer {
function FixPositions($p_prefix) function FixPositions($p_prefix)
{ {
global $g_localizerConfig; global $g_localizerConfig;
$defaultLanguage =& new LocalizerLanguage($p_prefix, $g_localizerConfig['DEFAULT_LANGUAGE']); $defaultLanguage = new LocalizerLanguage($p_prefix, $g_localizerConfig['DEFAULT_LANGUAGE']);
$defaultLanguage->loadFile(Localizer::GetMode()); $defaultLanguage->loadFile(Localizer::GetMode());
$defaultTranslationTable = $defaultLanguage->getTranslationTable(); $defaultTranslationTable = $defaultLanguage->getTranslationTable();
$languageIds = Localizer::GetAllLanguages(); $languageIds = Localizer::GetAllLanguages();
foreach ($languageIds as $languageId) { foreach ($languageIds as $languageId) {
// Load the language file // Load the language file
$source =& new LocalizerLanguage($p_prefix, $languageId); $source = new LocalizerLanguage($p_prefix, $languageId);
$source->loadFile(Localizer::GetMode()); $source->loadFile(Localizer::GetMode());
$count = 0; $count = 0;
@ -455,7 +455,7 @@ class Localizer {
global $g_localizerConfig; global $g_localizerConfig;
$languages = Localizer::GetAllLanguages(); $languages = Localizer::GetAllLanguages();
foreach ($languages as $language) { foreach ($languages as $language) {
$source =& new LocalizerLanguage($p_prefix, $language->getLanguageId()); $source = new LocalizerLanguage($p_prefix, $language->getLanguageId());
$source->loadFile(Localizer::GetMode()); $source->loadFile(Localizer::GetMode());
if (is_array($p_newKey)) { if (is_array($p_newKey)) {
foreach (array_reverse($p_newKey) as $key) { foreach (array_reverse($p_newKey) as $key) {
@ -492,7 +492,7 @@ class Localizer {
$languages = Localizer::GetAllLanguages(); $languages = Localizer::GetAllLanguages();
foreach ($languages as $language) { foreach ($languages as $language) {
$target =& new LocalizerLanguage($p_prefix, $language->getLanguageId()); $target = new LocalizerLanguage($p_prefix, $language->getLanguageId());
$target->loadFile(Localizer::GetMode()); $target->loadFile(Localizer::GetMode());
if (is_array($p_key)) { if (is_array($p_key)) {
foreach ($p_key as $key) { foreach ($p_key as $key) {
@ -520,7 +520,7 @@ class Localizer {
{ {
$languages = Localizer::GetAllLanguages(); $languages = Localizer::GetAllLanguages();
foreach ($languages as $language) { foreach ($languages as $language) {
$target =& new LocalizerLanguage($p_prefix, $language->getLanguageId()); $target = new LocalizerLanguage($p_prefix, $language->getLanguageId());
$target->loadFile(Localizer::GetMode()); $target->loadFile(Localizer::GetMode());
$success = $target->moveString($p_pos1, $p_pos2); $success = $target->moveString($p_pos1, $p_pos2);
$target->saveFile(Localizer::GetMode()); $target->saveFile(Localizer::GetMode());
@ -547,7 +547,7 @@ class Localizer {
} }
$className = "LocalizerFileFormat_".strtoupper($p_mode); $className = "LocalizerFileFormat_".strtoupper($p_mode);
if (class_exists($className)) { if (class_exists($className)) {
$object =& new $className(); $object = new $className();
if (method_exists($object, "getLanguages")) { if (method_exists($object, "getLanguages")) {
$languages = $object->getLanguages($p_default, $p_completed_only); $languages = $object->getLanguages($p_default, $p_completed_only);
} }
@ -610,7 +610,7 @@ class Localizer {
// $base = $fileNameParts[0]; // $base = $fileNameParts[0];
// $dir = str_replace($g_localizerConfig['BASE_DIR'], '', dirname($pathname)); // $dir = str_replace($g_localizerConfig['BASE_DIR'], '', dirname($pathname));
// // read the default file // // read the default file
// $defaultLang =& new LocalizerLanguage($base, $g_localizerConfig['DEFAULT_LANGUAGE']); // $defaultLang = new LocalizerLanguage($base, $g_localizerConfig['DEFAULT_LANGUAGE']);
// $defaultLang->loadFile(Localizer::GetMode()); // $defaultLang->loadFile(Localizer::GetMode());
// $defaultLang->clearValues(); // $defaultLang->clearValues();
// $defaultLang->setLanguageId($p_languageId); // $defaultLang->setLanguageId($p_languageId);

View file

@ -128,7 +128,7 @@ class LocalizerFileFormat_GS extends LocalizerFileFormat {
$metadata = array(); $metadata = array();
foreach ($languages as $language) { foreach ($languages as $language) {
$tmpMetadata =& new LanguageMetadata(); $tmpMetadata = new LanguageMetadata();
$tmpMetadata->m_englishName = $language['Name']; $tmpMetadata->m_englishName = $language['Name'];
$tmpMetadata->m_nativeName = $language['NativeName']; $tmpMetadata->m_nativeName = $language['NativeName'];
$tmpMetadata->m_languageCode = $language['LanguageCode']; $tmpMetadata->m_languageCode = $language['LanguageCode'];
@ -195,7 +195,7 @@ class LocalizerFileFormat_XML extends LocalizerFileFormat {
if (file_exists($filePath)) { if (file_exists($filePath)) {
$xml = File::readAll($filePath); $xml = File::readAll($filePath);
File::close($filePath, FILE_MODE_READ); File::close($filePath, FILE_MODE_READ);
$unserializer =& new XML_Unserializer($this->m_unserializeOptions); $unserializer = new XML_Unserializer($this->m_unserializeOptions);
$unserializer->unserialize($xml); $unserializer->unserialize($xml);
$translationArray = $unserializer->getUnserializedData(); $translationArray = $unserializer->getUnserializedData();
@ -233,7 +233,7 @@ class LocalizerFileFormat_XML extends LocalizerFileFormat {
} }
$saveData = array_merge($saveData, $saveTranslationTable); $saveData = array_merge($saveData, $saveTranslationTable);
$serializer =& new XML_Serializer($this->m_serializeOptions); $serializer = new XML_Serializer($this->m_serializeOptions);
$serializer->serialize($saveData); $serializer->serialize($saveData);
$xml = $serializer->getSerializedData(); $xml = $serializer->getSerializedData();
@ -289,7 +289,7 @@ class LocalizerFileFormat_XML extends LocalizerFileFormat {
$xml = File::readAll($fileName); $xml = File::readAll($fileName);
File::rewind($fileName, FILE_MODE_READ); File::rewind($fileName, FILE_MODE_READ);
$handle =& new XML_Unserializer($this->l_unserializeOptions); $handle = new XML_Unserializer($this->l_unserializeOptions);
$handle->unserialize($xml); $handle->unserialize($xml);
$arr = $handle->getUnserializedData(); $arr = $handle->getUnserializedData();
@ -303,7 +303,7 @@ class LocalizerFileFormat_XML extends LocalizerFileFormat {
// just display default language in maintainance mode // just display default language in maintainance mode
if ($p_default || $language['Id'] !== $g_localizerConfig['DEFAULT_LANGUAGE']) { if ($p_default || $language['Id'] !== $g_localizerConfig['DEFAULT_LANGUAGE']) {
list ($langCode, $countryCode) = explode('_', $language['Id']); list ($langCode, $countryCode) = explode('_', $language['Id']);
$languageDef =& new LanguageMetadata(); $languageDef = new LanguageMetadata();
$languageDef->m_languageId = $language['Id']; $languageDef->m_languageId = $language['Id'];
$languageDef->m_languageCode = $langCode; $languageDef->m_languageCode = $langCode;
$languageDef->m_countryCode = $countryCode; $languageDef->m_countryCode = $countryCode;
@ -330,7 +330,7 @@ class LocalizerFileFormat_XML extends LocalizerFileFormat {
$xml = File::readAll($fileName); $xml = File::readAll($fileName);
File::rewind($fileName, FILE_MODE_READ); File::rewind($fileName, FILE_MODE_READ);
$handle =& new XML_Unserializer($this->l_unserializeOptions); $handle = new XML_Unserializer($this->l_unserializeOptions);
$handle->unserialize($xml); $handle->unserialize($xml);
$arr = $handle->getUnserializedData(); $arr = $handle->getUnserializedData();
@ -346,7 +346,7 @@ class LocalizerFileFormat_XML extends LocalizerFileFormat {
'NativeName' => $new['NativeName'] 'NativeName' => $new['NativeName']
); );
$languages = $this->_xSortArray($languages, 'Id'); $languages = $this->_xSortArray($languages, 'Id');
$handle =& new XML_Serializer($this->l_serializeOptions); $handle = new XML_Serializer($this->l_serializeOptions);
$handle->serialize($languages); $handle->serialize($languages);
if (!$xml = $handle->getSerializedData()) { if (!$xml = $handle->getSerializedData()) {

View file

@ -503,7 +503,7 @@ class LocalizerLanguage {
function fixPositions() function fixPositions()
{ {
global $g_localizerConfig; global $g_localizerConfig;
$defaultLanguage =& new LocalizerLanguage($this->m_prefix, $defaultLanguage = new LocalizerLanguage($this->m_prefix,
$g_localizerConfig['DEFAULT_LANGUAGE']); $g_localizerConfig['DEFAULT_LANGUAGE']);
$defaultLanguage->loadFile(Localizer::GetMode()); $defaultLanguage->loadFile(Localizer::GetMode());
$defaultTranslationTable = $defaultLanguage->getTranslationTable(); $defaultTranslationTable = $defaultLanguage->getTranslationTable();
@ -528,7 +528,7 @@ class LocalizerLanguage {
function syncToDefault() function syncToDefault()
{ {
global $g_localizerConfig; global $g_localizerConfig;
$defaultLanguage =& new LocalizerLanguage($this->m_prefix, $defaultLanguage = new LocalizerLanguage($this->m_prefix,
$g_localizerConfig['DEFAULT_LANGUAGE']); $g_localizerConfig['DEFAULT_LANGUAGE']);
$defaultLanguage->loadFile(Localizer::GetMode()); $defaultLanguage->loadFile(Localizer::GetMode());
$defaultTranslationTable = $defaultLanguage->getTranslationTable(); $defaultTranslationTable = $defaultLanguage->getTranslationTable();
@ -597,7 +597,7 @@ class LocalizerLanguage {
} }
$className = 'LocalizerFileFormat_'.strtoupper($p_type); $className = 'LocalizerFileFormat_'.strtoupper($p_type);
if (class_exists($className)) { if (class_exists($className)) {
$object =& new $className(); $object = new $className();
if (method_exists($object, 'load')) { if (method_exists($object, 'load')) {
return $object->load($this); return $object->load($this);
} }
@ -631,7 +631,7 @@ class LocalizerLanguage {
// Save in the requested mode. // Save in the requested mode.
$className = 'LocalizerFileFormat_'.strtoupper($p_type); $className = 'LocalizerFileFormat_'.strtoupper($p_type);
if (class_exists($className)) { if (class_exists($className)) {
$object =& new $className(); $object = new $className();
if (method_exists($object, 'save')) { if (method_exists($object, 'save')) {
return $object->save($this); return $object->save($this);
} }

View file

@ -12,7 +12,7 @@ function login(&$data)
} }
$dbc->setFetchMode(DB_FETCHMODE_ASSOC); $dbc->setFetchMode(DB_FETCHMODE_ASSOC);
$gb =& new GreenBox($dbc, $config); $gb = new GreenBox($dbc, $config);
if (!$data['PHP_AUTH_USER'] || !$data['PHP_AUTH_PW']) { if (!$data['PHP_AUTH_USER'] || !$data['PHP_AUTH_PW']) {
return FALSE; return FALSE;

View file

@ -26,7 +26,7 @@ class Maintenance {
{ {
require_once 'HTML/QuickForm.php'; require_once 'HTML/QuickForm.php';
require_once 'form_function.php'; require_once 'form_function.php';
$form =& new HTML_QuickForm(); $form = new HTML_QuickForm();
parseArr2Form($form, addLanguageFormArr()); parseArr2Form($form, addLanguageFormArr());
if ($validate) { if ($validate) {
@ -51,7 +51,7 @@ class Maintenance {
// store from here // store from here
global $g_localizerConfig; global $g_localizerConfig;
$className = "LocalizerFileFormat_".strtoupper($g_localizerConfig['DEFAULT_FILE_TYPE']); $className = "LocalizerFileFormat_".strtoupper($g_localizerConfig['DEFAULT_FILE_TYPE']);
$storage =& new $className(); $storage = new $className();
if ($storage->addLanguage($values)) { if ($storage->addLanguage($values)) {
return TRUE; return TRUE;

View file

@ -35,7 +35,7 @@ function translationForm($p_request)
$localizerSourceLanguage = Input::Get('localizer_source_language', 'string', $localizerSourceLanguage = Input::Get('localizer_source_language', 'string',
$g_localizerConfig['DEFAULT_LANGUAGE'], true); $g_localizerConfig['DEFAULT_LANGUAGE'], true);
if (empty($localizerSourceLanguage)) { if (empty($localizerSourceLanguage)) {
$tmpLanguage =& new LocalizerLanguage(null, $p_request['TOL_Language']); $tmpLanguage = new LocalizerLanguage(null, $p_request['TOL_Language']);
$localizerSourceLanguage = $tmpLanguage->getLanguageId(); $localizerSourceLanguage = $tmpLanguage->getLanguageId();
} }
@ -44,9 +44,9 @@ function translationForm($p_request)
// Load the language files. // Load the language files.
//echo "Prefix: $prefix<br>"; //echo "Prefix: $prefix<br>";
$sourceLang =& new LocalizerLanguage($prefix, $localizerSourceLanguage); $sourceLang = new LocalizerLanguage($prefix, $localizerSourceLanguage);
$targetLang =& new LocalizerLanguage($prefix, $localizerTargetLanguage); $targetLang = new LocalizerLanguage($prefix, $localizerTargetLanguage);
$defaultLang =& new LocalizerLanguage($prefix, $g_localizerConfig['DEFAULT_LANGUAGE']); $defaultLang = new LocalizerLanguage($prefix, $g_localizerConfig['DEFAULT_LANGUAGE']);
$mode = Localizer::GetMode(); $mode = Localizer::GetMode();
if (!empty($prefix)) { if (!empty($prefix)) {

View file

@ -115,56 +115,48 @@ function _getNumArr($start, $end, $step=1)
*/ */
class uiBase class uiBase
{ {
var $redirUrl; public $gb; // GreenBox
var $alertMsg; public $STATIONPREFS;
var $dbc; public $SCRATCHPAD;
var $gb; // GreenBox public $SEARCH;
var $config; public $BROWSE;
var $sessid; // Note: loading HUBBROWSE on every page load slows things down
var $userid; // a lot. we only load it on demand.
var $login; //public $HUBBROWSE;
var $langid; public $HUBSEARCH;
var $id; public $PLAYLIST;
var $pid; public $SCHEDULER;
var $type; public $SUBJECTS;
var $fid; public $EXCHANGE;
var $homeid; public $TRANSFERS;
var $InputTextStandardAttrib; public $redirUrl;
var $STATIONPREFS; public $dbc;
var $SCRATCHPAD; public $config;
var $SEARCH; public $sessid;
var $BROWSE; public $userid;
var $HUBBROWSE; public $login;
var $HUBSEARCH; public $id;
var $PLAYLIST; public $langid;
var $SCHEDULER; public $pid;
var $SUBJECTS; public $type;
var $EXCHANGE; public $fid;
var $TRANSFERS; public $homeid;
var $_self_; public $alertMsg;
/** /**
* uiBase
*
* Initialize a new Basis Class including:
* - database initialation
* - GreenBox initialation
*
* @param array $config * @param array $config
* configurartion data * configurartion data
*/ */
function uiBase(&$config) public function __construct(&$config)
{ {
$this->dbc = DB::connect($config['dsn'], TRUE); $this->dbc = DB::connect($config['dsn'], TRUE);
if (DB::isError($this->dbc)) { if (DB::isError($this->dbc)) {
die($this->dbc->getMessage()); die($this->dbc->getMessage());
} }
$this->dbc->setFetchMode(DB_FETCHMODE_ASSOC); $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 =& $config;
$this->config['accessRawAudioUrl'] = $config['storageUrlPath'].'/xmlrpc/simpleGet.php'; $this->config['accessRawAudioUrl'] = $config['storageUrlPath'].'/xmlrpc/simpleGet.php';
$this->sessid = isset($_REQUEST[$config['authCookieName']]) ? $this->sessid = isset($_REQUEST[$config['authCookieName']]) ?
$_REQUEST[$config['authCookieName']] : null; $_REQUEST[$config['authCookieName']] : null;
$this->userid = $this->gb->getSessUserId($this->sessid); $this->userid = $this->gb->getSessUserId($this->sessid);
@ -187,21 +179,23 @@ class uiBase
$this->homeid = $this->gb->getObjId($this->login, $this->gb->storId); $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->STATIONPREFS =& $_SESSION[UI_STATIONINFO_SESSNAME];
$this->SCRATCHPAD =& new uiScratchPad($this); $this->SCRATCHPAD = new uiScratchPad($this);
$this->SEARCH =& new uiSearch($this); $this->SEARCH = new uiSearch($this);
$this->BROWSE =& new uiBrowse($this); $this->BROWSE = new uiBrowse($this);
$this->HUBBROWSE =& new uiHubBrowse($this); //$this->HUBBROWSE = new uiHubBrowse($this);
$this->HUBSEARCH =& new uiHubSearch($this); $this->HUBSEARCH = new uiHubSearch($this);
$this->PLAYLIST =& new uiPlaylist($this); $this->PLAYLIST = new uiPlaylist($this);
$this->SCHEDULER =& new uiScheduler($this); $this->SCHEDULER = new uiScheduler($this);
$this->SUBJECTS =& new uiSubjects($this); $this->SUBJECTS = new uiSubjects($this);
$this->EXCHANGE =& new uiExchange($this); $this->EXCHANGE = new uiExchange($this);
$this->TRANSFERS =& new uiTransfers($this); $this->TRANSFERS = new uiTransfers($this);
$this->_self_ =& $this; }
} // fn uiBase
/** /**
@ -210,7 +204,7 @@ class uiBase
* @param array $mask * @param array $mask
* @param boolean $reload * @param boolean $reload
*/ */
function loadStationPrefs(&$mask, $reload=FALSE) public function loadStationPrefs(&$mask, $reload=FALSE)
{ {
if (!is_array($this->STATIONPREFS) || ($reload === TRUE) ) { if (!is_array($this->STATIONPREFS) || ($reload === TRUE) ) {
$this->STATIONPREFS = array(); $this->STATIONPREFS = array();
@ -230,8 +224,6 @@ class uiBase
/** /**
* _parseArr2Form
*
* Add elements/rules/groups to an given HTML_QuickForm object * Add elements/rules/groups to an given HTML_QuickForm object
* *
* @param HTML_Quickform $form * @param HTML_Quickform $form
@ -241,7 +233,7 @@ class uiBase
* @param string $side * @param string $side
* can be 'client' or 'server' - this is where the form validation occurs. * 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) { foreach ($mask as $v) {
$attrs = isset($v['attributes']) ? $v['attributes'] : null; $attrs = isset($v['attributes']) ? $v['attributes'] : null;
@ -347,7 +339,7 @@ class uiBase
reset($mask); reset($mask);
$form->validate(); $form->validate();
} // fn _parseArr2Form } // fn parseArrayToForm
/** /**
@ -356,21 +348,21 @@ class uiBase
* @param array $input * @param array $input
* array of form-elements * array of form-elements
*/ */
function _dateArr2Str(&$input) // function _dateArr2Str(&$input)
{ // {
foreach ($input as $k => $v){ // foreach ($input as $k => $v){
if (is_array($v)) { // if (is_array($v)) {
if ( ( isset($v['d']) ) && ( isset($v['M']) || isset($v['m']) ) && ( isset($v['Y']) || isset($v['y']) ) ) { // 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']); // $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']) ) ) { // 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']); // $input[$k] = sprintf('%02d', $v['H'].$v['h']).':'.sprintf('%02d', $v['i']).':'.sprintf('%02d', $v['s']);
} // }
} // }
} // }
//
return $input; // return $input;
} // fn _dateArr2Str // } // fn _dateArr2Str
/** /**
@ -380,7 +372,7 @@ class uiBase
* local ID of file * local ID of file
* @param string $format * @param string $format
*/ */
function _analyzeFile($id, $format) public function analyzeFile($id, $format)
{ {
$ia = $this->gb->analyzeFile($id, $this->sessid); $ia = $this->gb->analyzeFile($id, $this->sessid);
$s = $ia['playtime_seconds']; $s = $ia['playtime_seconds'];
@ -404,23 +396,23 @@ class uiBase
</audioClip>'; </audioClip>';
} }
return FALSE; return FALSE;
} // fn _analyzeFile } // fn analyzeFile
function _toHex($gunid) public function toHex($gunid)
{ {
$res = $this->dbc->query("SELECT to_hex($gunid)"); $res = $this->dbc->query("SELECT to_hex($gunid)");
$row = $res->fetchRow(); $row = $res->fetchRow();
return $row['to_hex']; return $row['to_hex'];
} // fn _toHex } // fn toHex
function _toInt8($gunid) public function toInt8($gunid)
{ {
$res = $this->dbc->query("SELECT x'$gunid'::bigint"); $res = $this->dbc->query("SELECT x'$gunid'::bigint");
$row = $res->fetchRow(); $row = $res->fetchRow();
return $row['int8']; return $row['int8'];
} // fn _toInt8 } // fn toInt8
/** /**
@ -438,7 +430,7 @@ class uiBase
* @param string $p8 * @param string $p8
* @param string $p9 * @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'])) { if (!isset($_SESSION['alertMsg'])) {
$_SESSION['alertMsg'] = ''; $_SESSION['alertMsg'] = '';
@ -447,22 +439,22 @@ class uiBase
} // fn _retMsg } // fn _retMsg
function _getMetaInfo($id) public function getMetaInfo($id)
{ {
$type = strtolower($this->gb->getFileType($id)); $type = strtolower($this->gb->getFileType($id));
$data = array('id' => $id, $data = array('id' => $id,
'gunid' => $this->gb->_gunidFromId($id), 'gunid' => $this->gb->_gunidFromId($id),
'title' => $this->_getMDataValue($id, UI_MDATA_KEY_TITLE), 'title' => $this->getMetadataValue($id, UI_MDATA_KEY_TITLE),
'creator' => $this->_getMDataValue($id, UI_MDATA_KEY_CREATOR), 'creator' => $this->getMetadataValue($id, UI_MDATA_KEY_CREATOR),
'duration' => $this->_getMDataValue($id, UI_MDATA_KEY_DURATION), 'duration' => $this->getMetadataValue($id, UI_MDATA_KEY_DURATION),
'type' => $type, 'type' => $type,
#'isAvailable' => $type == 'playlist' ? $this->gb->playlistIsAvailable($id, $this->sessid) : NULL, #'isAvailable' => $type == 'playlist' ? $this->gb->playlistIsAvailable($id, $this->sessid) : NULL,
); );
return ($data); 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) { if (!$langid) {
$langid = $_SESSION['langid']; $langid = $_SESSION['langid'];
@ -473,10 +465,10 @@ class uiBase
return $value['value']; return $value['value'];
} }
return FALSE; return FALSE;
} // fn _getMDataValue } // fn getMetadataValue
function _setMDataValue($id, $key, $value, $langid=NULL) public function setMetadataValue($id, $key, $value, $langid=NULL)
{ {
if (!$langid) { if (!$langid) {
$langid = UI_DEFAULT_LANGID; $langid = UI_DEFAULT_LANGID;
@ -489,16 +481,14 @@ class uiBase
return TRUE; return TRUE;
} }
return FALSE; return FALSE;
} // fn _setMDataValue } // fn setMetadataValue
/** /**
* Enter description here...
*
* @param unknown_type $id * @param unknown_type $id
* @return string/FALSE * @return string/FALSE
*/ */
function _getFileTitle($id) private function _getFileTitle($id)
{ {
if (is_array($arr = $this->gb->getPath($id))) { if (is_array($arr = $this->gb->getPath($id))) {
$file = array_pop($arr); $file = array_pop($arr);
@ -508,29 +498,29 @@ class uiBase
} // fn _getFileTitle } // fn _getFileTitle
function _isFolder($id) // function _isFolder($id)
{ // {
if (strtolower($this->gb->getFileType($id)) != 'folder') { // if (strtolower($this->gb->getFileType($id)) != 'folder') {
return FALSE; // return FALSE;
} // }
return TRUE; // return TRUE;
} // fn _isFolder // } // fn _isFolder
function _formElementEncode($str) public static function formElementEncode($str)
{ {
$str = str_replace(':', '__', $str); $str = str_replace(':', '__', $str);
#$str = str_replace('.', '_', $str); #$str = str_replace('.', '_', $str);
return $str; return $str;
} // fn _formElementEncode } // fn formElementEncode
function _formElementDecode($str) public static function formElementDecode($str)
{ {
$str = str_replace('__', ':', $str); $str = str_replace('__', ':', $str);
#$str = str_replace('_', '.', $str); #$str = str_replace('_', '.', $str);
return $str; return $str;
} // fn _formElementDecode } // fn formElementDecode
} // class uiBase } // class uiBase
?> ?>

View file

@ -6,20 +6,20 @@
*/ */
class uiBrowse class uiBrowse
{ {
var $Base; // uiBase object public $Base; // uiBase object
var $prefix; private $prefix;
var $col; private $col;
var $criteria; private $criteria;
var $reloadUrl; private $reloadUrl;
function uiBrowse(&$uiBase) public function __construct(&$uiBase)
{ {
$this->Base =& $uiBase; $this->Base =& $uiBase;
$this->prefix = 'BROWSE'; $this->prefix = 'BROWSE';
$this->col =& $_SESSION[constant('UI_'.$this->prefix.'_SESSNAME')]['col']; $this->col =& $_SESSION[constant('UI_'.$this->prefix.'_SESSNAME')]['col'];
$this->criteria =& $_SESSION[constant('UI_'.$this->prefix.'_SESSNAME')]['criteria']; $this->criteria =& $_SESSION[constant('UI_'.$this->prefix.'_SESSNAME')]['criteria'];
#$this->results =& $_SESSION[constant('UI_'.$this->prefix.'_SESSNAME')]['results']; //$this->results =& $_SESSION[constant('UI_'.$this->prefix.'_SESSNAME')]['results'];
$this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close'; $this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
if (empty($this->criteria['limit'])) { if (empty($this->criteria['limit'])) {
@ -30,7 +30,7 @@ class uiBrowse
} }
if (!is_array($this->col)) { if (!is_array($this->col)) {
## init Categorys // init Categorys
$this->setDefaults(); $this->setDefaults();
} }
} // constructor } // constructor
@ -89,7 +89,7 @@ class uiBrowse
foreach ($mask['pages'] as $key => $val) { foreach ($mask['pages'] as $key => $val) {
foreach ($mask['pages'][$key] as $v){ foreach ($mask['pages'][$key] as $v){
if (isset($v['type']) && $v['type']) { 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']); $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 = new HTML_QuickForm('col'.$n, UI_STANDARD_FORM_METHOD, UI_HANDLER);
$form->setConstants(array('id' => $id, $form->setConstants(array('id' => $id,
'col' => $n, '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']['options'] = $this->options($this->col[$n]['values']['results']);
$mask2['browse_columns']['value']['default'] = $this->col[$n]['form_value']; $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(); $form->validate();
$renderer =& new HTML_QuickForm_Renderer_Array(true, true); $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer); $form->accept($renderer);
$output['col'.$n]['dynform'] = $renderer->toArray(); $output['col'.$n]['dynform'] = $renderer->toArray();
} }
## form to change limit and file-type ## form to change limit and file-type
$form = new HTML_QuickForm('switch', UI_STANDARD_FORM_METHOD, UI_HANDLER); $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'], $form->setDefaults(array('limit' => $this->criteria['limit'],
'filetype' => $this->criteria['filetype'])); 'filetype' => $this->criteria['filetype']));
$renderer =& new HTML_QuickForm_Renderer_Array(true, true); $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer); $form->accept($renderer);
$output['global']['dynform'] = $renderer->toArray(); $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 * @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 * @return void
*/ */
function setCategory($parm) public function setCategory($parm)
{ {
$which = $parm['col']; // $reflect = new ReflectionProperty('uiBrowse', 'Base');
$this->col[$which]['category'] = $this->Base->_formElementDecode($parm['category']); // echo "<pre>";print_r(Reflection::getModifierNames($reflect->getModifiers()));echo "</pre>";
$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); $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->Base->redirUrl = UI_BROWSER.'?act='.$this->prefix;
$this->clearHierarchy($columnNumber);
$this->clearHierarchy($which);
#print_r($this->col); #print_r($this->col);
} // fn setCategory } // fn setCategory
@ -150,7 +162,8 @@ class uiBrowse
$next = $which + 1; $next = $which + 1;
$this->col[$which]['form_value'] = $parm['value'][0]; $this->col[$which]['form_value'] = $parm['value'][0];
if ($parm['value'][0] == '%%all%%') { 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 { } else {
$this->col[$next]['criteria'] = array( $this->col[$next]['criteria'] = array(
'operator' => 'and', 'operator' => 'and',
@ -158,7 +171,7 @@ class uiBrowse
'conditions' => array_merge( 'conditions' => array_merge(
is_array($this->col[$which]['criteria']['conditions']) ? $this->col[$which]['criteria']['conditions'] : array(), is_array($this->col[$which]['criteria']['conditions']) ? $this->col[$which]['criteria']['conditions'] : array(),
array( array(
array('cat' => $this->Base->_formElementDecode($parm['category']), array('cat' => uiBase::formElementDecode($parm['category']),
'op' => '=', 'op' => '=',
'val' => $parm['value'][0] 'val' => $parm['value'][0]
) )
@ -232,7 +245,7 @@ class uiBrowse
$this->results['cnt'] = $results['cnt']; $this->results['cnt'] = $results['cnt'];
foreach ($results['results'] as $rec) { foreach ($results['results'] as $rec) {
$tmpId = $this->Base->gb->_idFromGunid($rec["gunid"]); $tmpId = $this->Base->gb->_idFromGunid($rec["gunid"]);
$this->results['items'][] = $this->Base->_getMetaInfo($tmpId); $this->results['items'][] = $this->Base->getMetaInfo($tmpId);
} }
/* /*

View file

@ -5,7 +5,6 @@
* @version $Revision$ * @version $Revision$
*/ */
class uiBrowser extends uiBase { class uiBrowser extends uiBase {
var $alertMsg;
// --- class constructor --- // --- class constructor ---
/** /**
@ -15,9 +14,9 @@ class uiBrowser extends uiBase {
* @param array $config * @param array $config
* configurartion data * configurartion data
*/ */
function uiBrowser(&$config) public function __construct(&$config)
{ {
$this->uiBase($config); parent::__construct($config);
} // constructor } // constructor
@ -71,12 +70,10 @@ class uiBrowser extends uiBase {
function login($mask) function login($mask)
{ {
$form = new HTML_QuickForm('login', UI_STANDARD_FORM_METHOD, UI_HANDLER); $form = new HTML_QuickForm('login', UI_STANDARD_FORM_METHOD, UI_HANDLER);
$this->_parseArr2Form($form, $mask['languages']); uiBase::parseArrayToForm($form, $mask['languages']);
$this->_parseArr2Form($form, $mask['login']); uiBase::parseArrayToForm($form, $mask['login']);
$renderer = new HTML_QuickForm_Renderer_Array(true, true);
$renderer =& new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer); $form->accept($renderer);
return $renderer->toArray(); return $renderer->toArray();
} // fn login } // fn login
@ -123,7 +120,7 @@ class uiBrowser extends uiBase {
} }
foreach ($data['listdata'] as $key=>$val) { foreach ($data['listdata'] as $key=>$val) {
if ($val['type'] != 'Folder') { 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 { } else {
$data['listdata'][$key]['title'] = $val['name']; $data['listdata'][$key]['title'] = $val['name'];
} }
@ -153,8 +150,8 @@ class uiBrowser extends uiBase {
$form->setConstants(array('folderId' => $folderId, $form->setConstants(array('folderId' => $folderId,
'id' => $id, 'id' => $id,
'act' => $id ? 'editItem' : 'addFileData')); 'act' => $id ? 'editItem' : 'addFileData'));
$this->_parseArr2Form($form, $mask); uiBase::parseArrayToForm($form, $mask);
$renderer =& new HTML_QuickForm_Renderer_Array(true, true); $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer); $form->accept($renderer);
return $renderer->toArray(); return $renderer->toArray();
} // fn fileForm } // fn fileForm
@ -177,12 +174,12 @@ class uiBrowser extends uiBase {
$const = array('folderId' => $folderId, $const = array('folderId' => $folderId,
'id' => $id, 'id' => $id,
'act' => $id ? 'editWebstreamData' : 'addWebstreamData', 'act' => $id ? 'editWebstreamData' : 'addWebstreamData',
'title' => $id ? $this->_getMDataValue($id, UI_MDATA_KEY_TITLE) : NULL, 'title' => $id ? $this->getMetadataValue($id, UI_MDATA_KEY_TITLE) : NULL,
'url' => $id ? $this->_getMDataValue($id, UI_MDATA_KEY_URL) : 'http://', 'url' => $id ? $this->getMetadataValue($id, UI_MDATA_KEY_URL) : 'http://',
'length' => $id ? preg_replace("/\.[0-9]{1,6}/", "", $this->_getMDataValue($id, UI_MDATA_KEY_DURATION)) : NULL 'length' => $id ? preg_replace("/\.[0-9]{1,6}/", "", $this->getMetadataValue($id, UI_MDATA_KEY_DURATION)) : NULL
); );
$form->setConstants($const); $form->setConstants($const);
$this->_parseArr2Form($form, $mask); uiBase::parseArrayToForm($form, $mask);
/* /*
$form->addGroupRule('grp', $form->addGroupRule('grp',
@ -201,7 +198,7 @@ class uiBrowser extends uiBase {
$form->_rules['grp[url]'][1][validation] = 'client'; $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); $form->accept($renderer);
return $renderer->toArray(); return $renderer->toArray();
} // fn webstreamForm } // fn webstreamForm
@ -294,7 +291,7 @@ class uiBrowser extends uiBase {
$arr[tra($key)] = $val; $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); ksort($arr);
return array('metadata' => $arr); return array('metadata' => $arr);
@ -316,14 +313,14 @@ class uiBrowser extends uiBase {
$langid = $langid ? $langid : UI_DEFAULT_LANGID; $langid = $langid ? $langid : UI_DEFAULT_LANGID;
$form = new HTML_QuickForm('langswitch', UI_STANDARD_FORM_METHOD, UI_BROWSER); $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)); $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); $form->accept($renderer);
$output['langswitch'] = $renderer->toArray(); $output['langswitch'] = $renderer->toArray();
$form = new HTML_QuickForm('editMetaData', UI_STANDARD_FORM_METHOD, UI_HANDLER); $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', $form->setConstants(array('act' => 'editMetaData',
'id' => $id, 'id' => $id,
'curr_langid' => $langid, 'curr_langid' => $langid,
@ -338,20 +335,20 @@ class uiBrowser extends uiBase {
if (!is_array($mask['pages'][$key][$k]['attributes'])) { if (!is_array($mask['pages'][$key][$k]['attributes'])) {
$mask['pages'][$key][$k]['attributes'] = array(); $mask['pages'][$key][$k]['attributes'] = array();
} }
$mask['pages'][$key][$k]['element'] = $key.'___'.$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, '".$this->_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 ## 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]['default'] = $getval;
$mask['pages'][$key][$k]['attributes']['onFocus'] = 'MData_confirmChange(this)'; $mask['pages'][$key][$k]['attributes']['onFocus'] = 'MData_confirmChange(this)';
} }
} }
$form->addElement('static', NULL, NULL, "<div id='div_$key'>"); $form->addElement('static', NULL, NULL, "<div id='div_$key'>");
$this->_parseArr2Form($form, $mask['pages'][$key]); uiBase::parseArrayToForm($form, $mask['pages'][$key]);
$this->_parseArr2Form($form, $mask['buttons']); uiBase::parseArrayToForm($form, $mask['buttons']);
$form->addElement('static', NULL, NULL, "</div id='div_$key'>"); $form->addElement('static', NULL, NULL, "</div id='div_$key'>");
} }
$renderer =& new HTML_QuickForm_Renderer_Array(true, true); $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer); $form->accept($renderer);
$output['pages'][] = $renderer->toArray(); $output['pages'][] = $renderer->toArray();
#print_r($output); #print_r($output);
@ -369,8 +366,8 @@ class uiBrowser extends uiBase {
$mask[$key]['default'] = $p; $mask[$key]['default'] = $p;
} }
} }
$this->_parseArr2Form($form, $mask); uiBase::parseArrayToForm($form, $mask);
$renderer =& new HTML_QuickForm_Renderer_Array(true, true); $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer); $form->accept($renderer);
return $renderer->toArray(); return $renderer->toArray();
} // fn changeStationPrefs } // fn changeStationPrefs
@ -456,7 +453,7 @@ class uiBrowser extends uiBase {
if (strtolower($type) === strtolower(UI_FILETYPE_AUDIOCLIP)) { if (strtolower($type) === strtolower(UI_FILETYPE_AUDIOCLIP)) {
$m3u = "http://{$_SERVER['SERVER_NAME']}".$this->config['accessRawAudioUrl']."?sessid={$this->sessid}&id=$clipid\n"; $m3u = "http://{$_SERVER['SERVER_NAME']}".$this->config['accessRawAudioUrl']."?sessid={$this->sessid}&id=$clipid\n";
} else { } else {
$m3u = $this->_getMDataValue($id, UI_MDATA_KEY_URL); $m3u = $this->getMetadataValue($id, UI_MDATA_KEY_URL);
} }
touch(UI_TESTSTREAM_MU3_TMP); touch(UI_TESTSTREAM_MU3_TMP);
$handle = fopen(UI_TESTSTREAM_MU3_TMP, "w"); $handle = fopen(UI_TESTSTREAM_MU3_TMP, "w");

View file

@ -3,24 +3,26 @@ header("Content-type: text/html; charset=utf-8");
session_start(); session_start();
## LS classes/functions ############################################# ## LS classes/functions #############################################
require_once dirname(__FILE__).'/ui_conf.php'; require_once(dirname(__FILE__).'/ui_conf.php');
require_once dirname(__FILE__).'/ui_browser.class.php'; require_once(dirname(__FILE__).'/ui_browser.class.php');
## well known classes ############################################### ## well known classes ###############################################
require_once dirname(__FILE__).'/Smarty/libs/Smarty.class.php'; require_once(dirname(__FILE__).'/Smarty/libs/Smarty.class.php');
require_once 'HTML/QuickForm/Renderer/ArraySmarty.php'; require_once('HTML/QuickForm/Renderer/ArraySmarty.php');
## initialize objects ############################################### ## initialize objects ###############################################
$Smarty =& new Smarty; $Smarty = new Smarty;
$uiBrowser =& new uiBrowser($config); $uiBrowser = new uiBrowser($config);
$uiBrowser->init();
$uiBase =& $uiBrowser; $uiBase =& $uiBrowser;
$jscom =& new jscom(array("jscom_wrapper")); $jscom = new jscom(array("jscom_wrapper"));
$jscom->handler(); $jscom->handler();
## load Smarty+filters ############################################## ## 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('output', 'trimwhitespace');
#$Smarty->load_filter('post', 'template_marker'); #$Smarty->load_filter('post', 'template_marker');
$Smarty->load_filter('output', 'localizer'); $Smarty->load_filter('output', 'localizer');

View file

@ -6,21 +6,23 @@
*/ */
class uiCalendar class uiCalendar
{ {
var $Decade; public $Decade;
var $Year; public $Year;
var $Month; public $Month;
var $Week; public $Week;
var $Day; public $Day;
var $Hour; public $Hour;
function uiCalendar() public function __construct()
{ {
} }
function buildDecade() 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++) { for ($Year = $this->curr['year']-5; $Year<=$this->curr['year']+5; $Year++) {
$this->Decade[] = array( $this->Decade[] = array(
@ -34,10 +36,12 @@ class uiCalendar
function buildYear() function buildYear()
{ {
if (is_array($this->Year)) return; if (is_array($this->Year)) {
return;
}
require_once 'Calendar/Year.php'; require_once('Calendar/Year.php');
require_once 'Calendar/Month.php'; require_once('Calendar/Month.php');
$Year = new Calendar_Year($this->curr['year']); $Year = new Calendar_Year($this->curr['year']);
# mark current month # mark current month
@ -57,16 +61,20 @@ class uiCalendar
function buildMonth() function buildMonth()
{ {
if (is_array($this->Month)) return; if (is_array($this->Month)) {
return;
}
require_once 'Calendar/Month/Weekdays.php'; require_once('Calendar/Month/Weekdays.php');
require_once 'Calendar/Day.php'; require_once('Calendar/Day.php');
$Month = new Calendar_Month_Weekdays($this->curr['year'], $this->curr['month'], UI_SCHEDULER_FIRSTWEEKDAY); $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()) { while ($Day = $Month->fetch()) {
$corrMonth = $Day->thisMonth()<=12 ? sprintf('%02d', $Day->thisMonth()) : '01'; ## due to bug in // Next 2 lines are due to a bug in Calendar_Month_Weekdays
$corrYear = $Day->thisMonth()<=12 ? $Day->thisYear() : $Day->thisYear()+1; ## Calendar_Month_Weekdays $corrMonth = $Day->thisMonth()<=12 ? sprintf('%02d', $Day->thisMonth()) : '01';
$corrYear = $Day->thisMonth()<=12 ? $Day->thisYear() : $Day->thisYear()+1;
$this->Month[] = array( $this->Month[] = array(
'day' => sprintf('%02d', $Day->thisDay()), 'day' => sprintf('%02d', $Day->thisDay()),
'week' => $this->_getWeekNr($Day), 'week' => $this->_getWeekNr($Day),
@ -87,9 +95,11 @@ class uiCalendar
function buildWeek() 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 = new Calendar_Week($this->curr['year'], $this->curr['month'], $this->curr['day'], UI_SCHEDULER_FIRSTWEEKDAY);
$Week->build($this->_scheduledDays('week')); $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 = new Calendar_Day ($this->curr['year'], $this->curr['month'], $this->curr['day']);
$Day->build(); $Day->build();
while ($Hour = $Day->fetch()) { while ($Hour = $Day->fetch()) {
$corrMonth = $Hour->thisMonth()<=12 ? sprintf('%02d', $Hour->thisMonth()) : '01'; ## due to bug in // Next two lines are due to a bug in Calendar_Month_Weekdays
$corrYear = $Hour->thisMonth()<=12 ? $Day->thisYear() : $Hour->thisYear()+1; ## Calendar_Month_Weekdays $corrMonth = $Hour->thisMonth()<=12 ? sprintf('%02d', $Hour->thisMonth()) : '01';
$corrYear = $Hour->thisMonth()<=12 ? $Day->thisYear() : $Hour->thisYear()+1;
$this->Day[] = array( $this->Day[] = array(
'day' => sprintf('%02d', $Hour->thisDay()), 'day' => sprintf('%02d', $Hour->thisDay()),
'week' => $this->_getWeekNr($Hour), 'week' => $this->_getWeekNr($Hour),
@ -141,7 +152,9 @@ class uiCalendar
function buildHour() function buildHour()
{ {
if (is_array($this->Hour)) return; if (is_array($this->Hour)) {
return;
}
require_once('Calendar/Hour.php'); require_once('Calendar/Hour.php');

View file

@ -124,7 +124,9 @@ $config = array_merge($config,
'file_types' => array( 'file_types' => array(
'.mp3', '.mp3',
'.wav', '.wav',
'.ogg' '.ogg',
'.flac',
'.aac'
), ),
'stream_types' => array( 'stream_types' => array(
'application/ogg', 'application/ogg',

View file

@ -6,11 +6,11 @@
*/ */
class uiExchange class uiExchange
{ {
var $Base; private $Base;
var $file; private $file;
var $folder; private $folder;
function uiExchange(&$uiBase) public function __construct(&$uiBase)
{ {
$this->Base =& $uiBase; $this->Base =& $uiBase;
$this->file =& $_SESSION['EXCHANGE']['file']; $this->file =& $_SESSION['EXCHANGE']['file'];
@ -103,8 +103,8 @@ class uiExchange
{ {
include('formmask/exchange.inc.php'); include('formmask/exchange.inc.php');
$form = new HTML_QuickForm('BACKUP_Schedule', UI_STANDARD_FORM_METHOD, UI_HANDLER); $form = new HTML_QuickForm('BACKUP_Schedule', UI_STANDARD_FORM_METHOD, UI_HANDLER);
$this->Base->_parseArr2Form($form, $mask['BACKUP.schedule']); uiBase::parseArrayToForm($form, $mask['BACKUP.schedule']);
$renderer =& new HTML_QuickForm_Renderer_Array(true, true); $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer); $form->accept($renderer);
return $renderer->toArray(); return $renderer->toArray();
} }
@ -113,7 +113,8 @@ class uiExchange
/** /**
* Copy a file or directory. * Copy a file or directory.
* *
* @param string $target - path to file or directory * @param string $target
* path to file or directory
* @return boolean * @return boolean
*/ */
function copy2target($target) function copy2target($target)

View file

@ -9,8 +9,8 @@ define('ACTION_BASE', '/actions' ) ;
* @version $Revision$ * @version $Revision$
*/ */
class uiHandler extends uiBase { class uiHandler extends uiBase {
var $uiBase; public $uiBase;
var $redirUrl; public $redirUrl;
/** /**
* Initialize a new Browser Class * Initialize a new Browser Class
@ -19,9 +19,9 @@ class uiHandler extends uiBase {
* @param array $config * @param array $config
* configurartion data * configurartion data
*/ */
function uiHandler($config) public function __construct($config)
{ {
$this->uiBase($config); parent::__construct($config);
} // constructor } // constructor
@ -152,12 +152,12 @@ class uiHandler extends uiBase {
return FALSE; 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); $this->transMData($r);
// set records in default language too // set records in default language too
if (UI_UPLOAD_LANGID !== UI_DEFAULT_LANGID) { 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); $this->transMData($r, UI_UPLOAD_LANGID);
} }
@ -196,20 +196,20 @@ class uiHandler extends uiBase {
return; return;
} }
$this->_setMdataValue($id, UI_MDATA_KEY_DURATION, $this->gb->_secsToPlTime($ia['playtime_seconds'])); $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 // some data from raw audio
if (isset($ia['audio']['channels'])) { 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'])) { 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'])) { 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'])) { 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 // 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'; $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->setMetadataValue($r, UI_MDATA_KEY_TITLE, $formdata['title']);
$this->_setMDataValue($r, UI_MDATA_KEY_DURATION, $extent); $this->setMetadataValue($r, UI_MDATA_KEY_DURATION, $extent);
$this->_setMDataValue($r, UI_MDATA_KEY_FORMAT, UI_MDATA_VALUE_FORMAT_STREAM); $this->setMetadataValue($r, UI_MDATA_KEY_FORMAT, UI_MDATA_VALUE_FORMAT_STREAM);
$this->redirUrl = UI_BROWSER."?act=addWebstreamMData&id=$r"; $this->redirUrl = UI_BROWSER."?act=addWebstreamMData&id=$r";
if (UI_VERBOSE) { 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'; $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->setMetadataValue($id, UI_MDATA_KEY_TITLE, $formdata['title']);
$this->_setMDataValue($id, UI_MDATA_KEY_URL, $formdata['url']); $this->setMetadataValue($id, UI_MDATA_KEY_URL, $formdata['url']);
$this->_setMDataValue($id, UI_MDATA_KEY_DURATION, $extent); $this->setMetadataValue($id, UI_MDATA_KEY_DURATION, $extent);
$this->redirUrl = UI_BROWSER.'?act=editItem&id='.$formdata['id']; $this->redirUrl = UI_BROWSER.'?act=editItem&id='.$formdata['id'];
if (UI_VERBOSE) { if (UI_VERBOSE) {
@ -302,7 +302,7 @@ class uiHandler extends uiBase {
foreach ($mask['pages'] as $key => $val) { foreach ($mask['pages'] as $key => $val) {
foreach ($mask['pages'][$key] as $k => $v) { 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) { 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)) { if (PEAR::isError($r)) {
$this->_retMsg('Unable to set "$1" to value "$2".', $key, $val); $this->_retMsg('Unable to set "$1" to value "$2".', $key, $val);
} }
@ -542,7 +542,7 @@ class uiHandler extends uiBase {
function _validateForm($formdata, $mask) function _validateForm($formdata, $mask)
{ {
$form = new HTML_QuickForm('validation', UI_STANDARD_FORM_METHOD, UI_HANDLER); $form = new HTML_QuickForm('validation', UI_STANDARD_FORM_METHOD, UI_HANDLER);
$this->_parseArr2Form($form, $mask, 'server'); uiBase::parseArrayToForm($form, $mask, 'server');
if (!$form->validate()) { if (!$form->validate()) {
$_SESSION['retransferFormData'] = $_REQUEST; $_SESSION['retransferFormData'] = $_REQUEST;
return FALSE; return FALSE;

View file

@ -7,7 +7,8 @@ require_once(dirname(__FILE__).'/ui_conf.php');
require_once(dirname(__FILE__).'/ui_handler.class.php'); require_once(dirname(__FILE__).'/ui_handler.class.php');
## initialize objects ############################################### ## initialize objects ###############################################
$uiHandler =& new uiHandler($config); $uiHandler = new uiHandler($config);
$uiHandler->init();
$uiBase =& $uiHandler; $uiBase =& $uiHandler;
include("../templates/loader/index.tpl"); include("../templates/loader/index.tpl");

View file

@ -7,7 +7,7 @@
class uiHubBrowse extends uiBrowse class uiHubBrowse extends uiBrowse
{ {
function uiHubBrowse(&$uiBase) public function __construct(&$uiBase)
{ {
$this->Base =& $uiBase; $this->Base =& $uiBase;
$this->prefix = 'HUBBROWSE'; $this->prefix = 'HUBBROWSE';
@ -53,8 +53,8 @@ class uiHubBrowse extends uiBrowse
} }
$this->results['cnt'] = $results['cnt']; $this->results['cnt'] = $results['cnt'];
foreach ($results['results'] as $rec) { foreach ($results['results'] as $rec) {
// TODO: maybe this _getMetaInfo is not correct for the remote results // TODO: maybe this getMetaInfo is not correct for the remote results
$this->results['items'][] = $this->Base->_getMetaInfo($this->Base->gb->_idFromGunid($rec)); $this->results['items'][] = $this->Base->getMetaInfo($this->Base->gb->_idFromGunid($rec));
} }
$this->pagination($results); $this->pagination($results);
// echo '<XMP>this->results:'; print_r($this->results); echo "</XMP>\n"; // echo '<XMP>this->results:'; print_r($this->results); echo "</XMP>\n";

View file

@ -6,7 +6,7 @@
*/ */
class uiHubSearch extends uiSearch { class uiHubSearch extends uiSearch {
function uiHubSearch(&$uiBase) public function __construct(&$uiBase)
{ {
$this->Base =& $uiBase; $this->Base =& $uiBase;
$this->prefix = 'HUBSEARCH'; $this->prefix = 'HUBSEARCH';
@ -47,10 +47,10 @@ class uiHubSearch extends uiSearch {
$this->criteria['form']['filetype'] = $formdata['filetype']; $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']) { if (is_array($val) && $val['active']) {
$this->criteria['counter']++; $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], 'op' => $val[1],
'val' => stripslashes($val[2]) 'val' => stripslashes($val[2])
); );
@ -83,7 +83,7 @@ class uiHubSearch extends uiSearch {
} }
foreach ($results['results'] as $rec) { foreach ($results['results'] as $rec) {
$tmpId = $this->Base->gb->_idFromGunid($rec["gunid"]); $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']; $this->results['cnt'] = $results['cnt'];
@ -94,16 +94,18 @@ class uiHubSearch extends uiSearch {
} // fn searchDB } // fn searchDB
function getSearchResults($trtokid) { function getSearchResults($trtokid)
{
$this->results = array('page' => $this->criteria['offset']/$this->criteria['limit']); $this->results = array('page' => $this->criteria['offset']/$this->criteria['limit']);
$results = $this->Base->gb->getSearchResults($trtokid); $results = $this->Base->gb->getSearchResults($trtokid);
//echo"<pre><b>RESULTS:</b><br>";print_r($results);echo "</pre>";
if (!is_array($results) || !count($results)) { if (!is_array($results) || !count($results)) {
return false; return false;
} }
$this->results['cnt'] = $results['cnt']; $this->results['cnt'] = $results['cnt'];
foreach ($results['results'] as $rec) { foreach ($results['results'] as $rec) {
// TODO: maybe this _getMetaInfo is not correct for the remote results // TODO: maybe this getMetaInfo is not correct for the remote results
$this->results['items'][] = $this->Base->_getMetaInfo($this->Base->gb->_idFromGunid($rec)); $this->results['items'][] = $this->Base->getMetaInfo($this->Base->gb->_idFromGunid($rec));
} }
$this->pagination($results); $this->pagination($results);
//echo '<XMP>this->results:'; print_r($this->results); echo "</XMP>\n"; //echo '<XMP>this->results:'; print_r($this->results); echo "</XMP>\n";

View file

@ -6,12 +6,12 @@
* @version $Revision$ * @version $Revision$
*/ */
class jscom { class jscom {
var $prefix = 'jsc_'; private $prefix = 'jsc_';
var $callables = array(); private $callables = array();
var $method = 'POST'; private $method = 'POST';
var $uri = ''; private $uri = '';
function jscom($calls = NULL, $pars = NULL) public function __construct($calls = NULL, $pars = NULL)
{ {
$this->uri = $_SERVER['REQUEST_URI']; $this->uri = $_SERVER['REQUEST_URI'];
if (!is_null($calls)) { if (!is_null($calls)) {

View file

@ -6,23 +6,25 @@
*/ */
class uiPlaylist class uiPlaylist
{ {
var $Base; public $activeId;
var $activeId; public $title;
var $changed; public $duration;
var $title; public $changed;
var $duration; public $token;
var $token;
var $reloadUrl;
var $redirectUrl;
var $returnUrl;
function uiPlaylist(&$uiBase) private $Base;
private $reloadUrl;
private $redirectUrl;
private $returnUrl;
private $flat;
public function __construct(&$uiBase)
{ {
$this->Base =& $uiBase; $this->Base =& $uiBase;
$this->activeId =& $_SESSION[UI_PLAYLIST_SESSNAME]['activeId']; $this->activeId =& $_SESSION[UI_PLAYLIST_SESSNAME]['activeId'];
$this->changed =& $_SESSION[UI_PLAYLIST_SESSNAME]['changed']; $this->changed =& $_SESSION[UI_PLAYLIST_SESSNAME]['changed'];
$this->title = $this->Base->_getMDataValue($this->activeId, UI_MDATA_KEY_TITLE); $this->title = $this->Base->getMetadataValue($this->activeId, UI_MDATA_KEY_TITLE);
$this->duration = $this->Base->_getMDataValue($this->activeId, UI_MDATA_KEY_DURATION); $this->duration = $this->Base->getMetadataValue($this->activeId, UI_MDATA_KEY_DURATION);
$this->token =& $_SESSION[UI_PLAYLIST_SESSNAME]['token']; $this->token =& $_SESSION[UI_PLAYLIST_SESSNAME]['token'];
$this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close'; $this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
$this->redirectUrl = UI_BROWSER.'?popup[]=_2PL.simpleManagement&popup[]=_close'; $this->redirectUrl = UI_BROWSER.'?popup[]=_2PL.simpleManagement&popup[]=_close';
@ -100,14 +102,14 @@ class uiPlaylist
if (UI_VERBOSE === TRUE) { if (UI_VERBOSE === TRUE) {
print_r($token); 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; return FALSE;
} }
$this->token = $token; $this->token = $token;
$this->Base->gb->savePref($this->Base->sessid, UI_PL_ACCESSTOKEN_KEY, $plid.':'.$this->token); $this->Base->gb->savePref($this->Base->sessid, UI_PL_ACCESSTOKEN_KEY, $plid.':'.$this->token);
$this->activeId = $plid; $this->activeId = $plid;
if ($msg && UI_VERBOSE) { 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; return TRUE;
@ -137,7 +139,7 @@ class uiPlaylist
return FALSE; return FALSE;
} }
if ($msg && UI_VERBOSE) { 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->activeId = NULL;
$this->token = NULL; $this->token = NULL;
@ -155,7 +157,7 @@ class uiPlaylist
$this->activate($tmpid, FALSE); $this->activate($tmpid, FALSE);
$this->changed = FALSE; $this->changed = FALSE;
if (UI_VERBOSE) { 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; return $this->activeId;
@ -181,7 +183,7 @@ class uiPlaylist
return FALSE; return FALSE;
} }
if (UI_VERBOSE) { 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->activeId = NULL;
$this->token = NULL; $this->token = NULL;
@ -306,8 +308,8 @@ class uiPlaylist
return FALSE; return FALSE;
} }
$this->Base->_setMDataValue($plid, UI_MDATA_KEY_CREATOR, $this->Base->login); $this->Base->setMetadataValue($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_DESCRIPTION, tra('created at $1', $datetime));
if ($this->activate($plid)===FALSE) { if ($this->activate($plid)===FALSE) {
return FALSE; return FALSE;
@ -323,18 +325,16 @@ class uiPlaylist
} // fn create } // fn create
function getFlat($id) public function getFlat($id)
{ {
unset($this->flat);
$this->_plwalk($this->getPLArray($id)); $this->_plwalk($this->getPLArray($id));
if (is_Array($this->flat)) { if (count($this->flat) > 0) {
reset($this->flat); reset($this->flat);
$this->flat[key($this->flat)]['firstInList'] = true; $this->flat[key($this->flat)]['firstInList'] = true;
end($this->flat); end($this->flat);
$this->flat[key($this->flat)]['lastInList'] = true; $this->flat[key($this->flat)]['lastInList'] = true;
reset($this->flat); reset($this->flat);
return $this->flat; return $this->flat;
} else { } else {
return array(); return array();
@ -342,16 +342,17 @@ class uiPlaylist
} // fn getFlat } // 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) { if ($sub['elementname']===UI_PL_ELEM_PLAYLIST) {
$this->_plwalk($sub, $node, $sub['attrs']); $this->_plwalk($sub, $node, $sub['attrs']);
} }
if ($sub['elementname']===UI_FILETYPE_AUDIOCLIP || $sub['elementname']===UI_FILETYPE_PLAYLIST) { if ($sub['elementname']===UI_FILETYPE_AUDIOCLIP || $sub['elementname']===UI_FILETYPE_PLAYLIST) {
#$this->flat["$parent.$node"] = $sub['attrs']; #$this->flat["$parent.$node"] = $sub['attrs'];
#$this->flat["$parent.$node"]['type'] = $sub['elementname']; #$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]['attrs'] = $attrs;
$this->flat[$parent]['playlength'] = $sub['attrs']['playlength']; $this->flat[$parent]['playlength'] = $sub['attrs']['playlength'];
} }
@ -535,9 +536,9 @@ class uiPlaylist
$form->setConstants(array('id' => $id, $form->setConstants(array('id' => $id,
'duration' => $duration) 'duration' => $duration)
); );
$this->Base->_parseArr2Form($form, $mask[$type]); uiBase::parseArrayToForm($form, $mask[$type]);
$this->Base->_parseArr2Form($form, $mask['all']); uiBase::parseArrayToForm($form, $mask['all']);
$renderer =& new HTML_QuickForm_Renderer_Array(true, true); $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer); $form->accept($renderer);
return $renderer->toArray(); return $renderer->toArray();
} // fn changeTransitionForm } // fn changeTransitionForm
@ -546,9 +547,9 @@ class uiPlaylist
function changeAllTransitionsForm($mask) function changeAllTransitionsForm($mask)
{ {
$form = new HTML_QuickForm('PL_changeTransition', UI_STANDARD_FORM_METHOD, UI_HANDLER); $form = new HTML_QuickForm('PL_changeTransition', UI_STANDARD_FORM_METHOD, UI_HANDLER);
$this->Base->_parseArr2Form($form, $mask['transition']); uiBase::parseArrayToForm($form, $mask['transition']);
$this->Base->_parseArr2Form($form, $mask['all']); uiBase::parseArrayToForm($form, $mask['all']);
$renderer =& new HTML_QuickForm_Renderer_Array(true, true); $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer); $form->accept($renderer);
return $renderer->toArray(); return $renderer->toArray();
} // fn changeAllTransitionsForm } // fn changeAllTransitionsForm
@ -565,13 +566,13 @@ class uiPlaylist
} else { } else {
$mask['act']['constant'] = 'PL.addItem'; $mask['act']['constant'] = 'PL.addItem';
$mask['id']['constant'] = $id; $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']; $mask['duration']['constant'] = $mask['playlength']['default'];
} }
$form = new HTML_QuickForm('PL_setItemPlaylengthForm', UI_STANDARD_FORM_METHOD, UI_HANDLER); $form = new HTML_QuickForm('PL_setItemPlaylengthForm', UI_STANDARD_FORM_METHOD, UI_HANDLER);
$this->Base->_parseArr2Form($form, $mask); uiBase::parseArrayToForm($form, $mask);
$renderer =& new HTML_QuickForm_Renderer_Array(true, true); $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer); $form->accept($renderer);
return $renderer->toArray(); return $renderer->toArray();
} // fn setItemPlaylengthForm } // fn setItemPlaylengthForm
@ -584,29 +585,29 @@ class uiPlaylist
$langid = $langid ? $langid : UI_DEFAULT_LANGID; $langid = $langid ? $langid : UI_DEFAULT_LANGID;
foreach ($mask['playlist'] as $k=>$v) { foreach ($mask['playlist'] as $k=>$v) {
$mask['playlist'][$k]['element'] = $this->Base->_formElementEncode($v['element']); $mask['playlist'][$k]['element'] = uiBase::formElementEncode($v['element']);
if ($getval = $this->Base->_getMDataValue($id, $v['element'], $langid)) { if ($getval = $this->Base->getMetadataValue($id, $v['element'], $langid)) {
$mask['playlist'][$k]['default'] = $getval; $mask['playlist'][$k]['default'] = $getval;
$mask['playlist'][$k]['attributes']['onFocus'] = 'MData_confirmChange(this)'; $mask['playlist'][$k]['attributes']['onFocus'] = 'MData_confirmChange(this)';
}; };
} }
$form = new HTML_QuickForm('editMetaData', UI_STANDARD_FORM_METHOD, UI_HANDLER); $form = new HTML_QuickForm('editMetaData', UI_STANDARD_FORM_METHOD, UI_HANDLER);
$this->Base->_parseArr2Form($form, $mask['basics']); uiBase::parseArrayToForm($form, $mask['basics']);
$this->Base->_parseArr2Form($form, $mask['playlist']); uiBase::parseArrayToForm($form, $mask['playlist']);
$this->Base->_parseArr2Form($form, $mask['buttons']); uiBase::parseArrayToForm($form, $mask['buttons']);
$form->setConstants(array('act' => 'PL.editMetaData', $form->setConstants(array('act' => 'PL.editMetaData',
'id' => $id, 'id' => $id,
'curr_langid' => $langid 'curr_langid' => $langid
) )
); );
$renderer =& new HTML_QuickForm_Renderer_Array(true, true); $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer); $form->accept($renderer);
$output['main'] = $renderer->toArray(); $output['main'] = $renderer->toArray();
$form = new HTML_QuickForm('langswitch', UI_STANDARD_FORM_METHOD, UI_BROWSER); $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)); $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); $form->accept($renderer);
$output['langswitch'] = $renderer->toArray(); $output['langswitch'] = $renderer->toArray();
@ -632,7 +633,7 @@ class uiPlaylist
} }
foreach ($mask['playlist'] as $k=>$v) { 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)) { if (!count($mData)) {
@ -699,8 +700,8 @@ class uiPlaylist
$mask['act']['constant'] = 'PL.export'; $mask['act']['constant'] = 'PL.export';
$mask['id']['constant'] = $id; $mask['id']['constant'] = $id;
$form = new HTML_QuickForm('PL_exportForm', UI_STANDARD_FORM_METHOD, UI_HANDLER); $form = new HTML_QuickForm('PL_exportForm', UI_STANDARD_FORM_METHOD, UI_HANDLER);
$this->Base->_parseArr2Form($form, $mask); uiBase::parseArrayToForm($form, $mask);
$renderer =& new HTML_QuickForm_Renderer_Array(true, true); $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer); $form->accept($renderer);
return $renderer->toArray(); return $renderer->toArray();
} // fn exportForm } // fn exportForm
@ -710,8 +711,8 @@ class uiPlaylist
{ {
$form = new HTML_QuickForm('PL_importForm', UI_STANDARD_FORM_METHOD, UI_HANDLER); $form = new HTML_QuickForm('PL_importForm', UI_STANDARD_FORM_METHOD, UI_HANDLER);
//print_r($mask); //print_r($mask);
$this->Base->_parseArr2Form($form, $mask); uiBase::parseArrayToForm($form, $mask);
$renderer =& new HTML_QuickForm_Renderer_Array(true, true); $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer); $form->accept($renderer);
return $renderer->toArray(); return $renderer->toArray();
} // fn importForm } // fn importForm

View file

@ -5,25 +5,24 @@
* @version $Revision$ * @version $Revision$
*/ */
class uiScheduler extends uiCalendar { class uiScheduler extends uiCalendar {
var $curr; public $curr;
var $scheduleAtTime; private $scheduleAtTime;
var $schedulePrev; private $schedulePrev;
var $scheduleNext; private $scheduleNext;
var $error; private $error;
var $Base; private $Base;
var $reloadUrl; private $reloadUrl;
var $closeUrl; private $closeUrl;
var $firstDayOfWeek; 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->scheduleAtTime =& $_SESSION[UI_CALENDAR_SESSNAME]['scheduleAtTime'];
$this->schedulePrev =& $_SESSION[UI_CALENDAR_SESSNAME]['schedulePrev']; $this->schedulePrev =& $_SESSION[UI_CALENDAR_SESSNAME]['schedulePrev'];
$this->scheduleNext =& $_SESSION[UI_CALENDAR_SESSNAME]['scheduleNext']; $this->scheduleNext =& $_SESSION[UI_CALENDAR_SESSNAME]['scheduleNext'];
$this->error =& $_SESSION['SCHEDULER']['error']; $this->error =& $_SESSION['SCHEDULER']['error'];
$this->error =& $_SESSION['SCHEDULER']['error'];
if (!is_array($this->curr)) { if (!is_array($this->curr)) {
$this->curr['view'] = UI_SCHEDULER_DEFAULT_VIEW; $this->curr['view'] = UI_SCHEDULER_DEFAULT_VIEW;
@ -40,10 +39,8 @@ class uiScheduler extends uiCalendar {
$this->Base =& $uiBase; $this->Base =& $uiBase;
$this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close'; $this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
$this->closeUrl = UI_BROWSER.'?popup[]=_close'; $this->closeUrl = UI_BROWSER.'?popup[]=_close';
parent::__construct();
$this->uiCalendar();
$this->initXmlRpc(); $this->initXmlRpc();
//$this->startDaemon(); //$this->startDaemon();
} // constructor } // constructor
@ -298,8 +295,8 @@ class uiScheduler extends uiCalendar {
'end' => substr($val['end'], strpos($val['end'], 'T')+1), 'end' => substr($val['end'], strpos($val['end'], 'T')+1),
'start_stamp' => $this->_datetime2timestamp($val['start']), 'start_stamp' => $this->_datetime2timestamp($val['start']),
'end_stamp' => $this->_datetime2timestamp($val['end']), 'end_stamp' => $this->_datetime2timestamp($val['end']),
'title' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE), 'title' => $this->Base->getMetadataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE),
'creator' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR), 'creator' => $this->Base->getMetadataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR),
'type' => 'Playlist' 'type' => 'Playlist'
); );
} }
@ -338,8 +335,8 @@ class uiScheduler extends uiCalendar {
'scheduleid'=> $val['id'], 'scheduleid'=> $val['id'],
'start' => substr($val['start'], strpos($val['start'], 'T')+1), 'start' => substr($val['start'], strpos($val['start'], 'T')+1),
'end' => substr($val['end'], strpos($val['end'], '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), 'title' => $this->Base->getMetadataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE),
'creator' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR), 'creator' => $this->Base->getMetadataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR),
'type' => 'Playlist', 'type' => 'Playlist',
'endstoday' => strftime('%d', $start) === strftime('%d', $end) ? TRUE : FALSE, 'endstoday' => strftime('%d', $start) === strftime('%d', $end) ? TRUE : FALSE,
'endshere' => strftime('%H', $start) === strftime('%H', $end) ? TRUE : FALSE 'endshere' => strftime('%H', $start) === strftime('%H', $end) ? TRUE : FALSE
@ -360,8 +357,8 @@ class uiScheduler extends uiCalendar {
'scheduleid'=> $val['id'], 'scheduleid'=> $val['id'],
'start' => substr($val['start'], strpos($val['start'], 'T')+1), 'start' => substr($val['start'], strpos($val['start'], 'T')+1),
'end' => substr($val['end'], strpos($val['end'], '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), 'title' => $this->Base->getMetadataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE),
'creator' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR), 'creator' => $this->Base->getMetadataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR),
'type' => 'Playlist', 'type' => 'Playlist',
'startsyesterday' => strftime('%d', $start) === strftime('%d', $end) ? FALSE : TRUE, '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 ( $items[date('H', $this->_datetime2timestamp($val['start']))][]= array (
'start' => substr($val['start'], strpos($val['start'], 'T')+1), 'start' => substr($val['start'], strpos($val['start'], 'T')+1),
'end' => substr($val['end'], strpos($val['end'], '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), 'title' => $this->Base->getMetadataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE),
'creator' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR), 'creator' => $this->Base->getMetadataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR),
); );
} }
#print_r($items); #print_r($items);
@ -403,8 +400,8 @@ class uiScheduler extends uiCalendar {
} }
foreach ($arr as $key => $val) { foreach ($arr as $key => $val) {
$arr[$key]['title'] = $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE); $arr[$key]['title'] = $this->Base->getMetadataValue($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]['creator'] = $this->Base->getMetadataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR);
$arr[$key]['pos'] = $this->_datetime2timestamp($val['start']); $arr[$key]['pos'] = $this->_datetime2timestamp($val['start']);
$arr[$key]['span'] = date('H', $this->_datetime2timestamp($val['end'])) - date('H', $this->_datetime2timestamp($val['start'])) +1; $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']); //print_r($ui_fmask['schedule']);
$form = new HTML_QuickForm('schedule', UI_STANDARD_FORM_METHOD, UI_HANDLER); $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'], $settime = array('H' => $this->scheduleAtTime['hour'],
'i' => $this->scheduleAtTime['minute'], 'i' => $this->scheduleAtTime['minute'],
's' => $this->scheduleAtTime['second'] 's' => $this->scheduleAtTime['second']
@ -459,7 +456,7 @@ class uiScheduler extends uiCalendar {
'date' => $setdate, 'date' => $setdate,
)); ));
$renderer =& new HTML_QuickForm_Renderer_Array(true, true); $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer); $form->accept($renderer);
$output = $renderer->toArray(); $output = $renderer->toArray();
//print_r($output); //print_r($output);
@ -473,8 +470,8 @@ class uiScheduler extends uiCalendar {
$this->Base->SCRATCHPAD->addItem($id); $this->Base->SCRATCHPAD->addItem($id);
$this->availablePlaylists[] = array( $this->availablePlaylists[] = array(
'gunid' => $this->Base->gb->_gunidFromId($id), 'gunid' => $this->Base->gb->_gunidFromId($id),
'title' => $this->Base->_getMDataValue($id, UI_MDATA_KEY_TITLE), 'title' => $this->Base->getMetadataValue($id, UI_MDATA_KEY_TITLE),
'duration' => $this->Base->_getMDataValue($id, UI_MDATA_KEY_DURATION), 'duration' => $this->Base->getMetadataValue($id, UI_MDATA_KEY_DURATION),
); );
return TRUE; return TRUE;
} else { } else {
@ -643,6 +640,7 @@ class uiScheduler extends uiCalendar {
return array(FALSE); return array(FALSE);
} }
$pStampArr = null;
foreach ($pArr as $val) { foreach ($pArr as $val) {
#print_r($val); #print_r($val);
$pStampArr[] = array('start' => $this->_datetime2timestamp($val['start']), $pStampArr[] = array('start' => $this->_datetime2timestamp($val['start']),

View file

@ -172,28 +172,39 @@ $mdefs = array(
class SchedulerPhpClient { class SchedulerPhpClient {
/** /**
* Databases object reference * Databases object reference
* @var DB
*/ */
var $dbc = NULL; private $dbc = NULL;
/** /**
* Array with methods description * Array with methods description
* @var array
*/ */
var $mdefs = array(); private $mdefs = array();
/** /**
* Confiduration array from ../conf.php * Confiduration array from ../conf.php
* @var array
*/ */
var $config = array(); private $config = array();
/** /**
* XMLRPC client object reference * XMLRPC client object reference
* @var XMLRPC_Client
*/ */
var $client = NULL; private $client = NULL;
/** /**
* Verbosity flag * Verbosity flag
* @var boolean
*/ */
var $verbose = FALSE; private $verbose = FALSE;
/** /**
* XMLRPC debug flag * XMLRPC debug flag
* @var boolean
*/ */
var $debug = 0; private $debug = 0;
/** /**
* Constructor - please DON'T CALL IT, use factory method instead * Constructor - please DON'T CALL IT, use factory method instead
@ -208,8 +219,7 @@ class SchedulerPhpClient {
* @param boolean $verbose * @param boolean $verbose
* verbosity flag * verbosity flag
*/ */
function SchedulerPhpClient( public function __construct(&$dbc, $mdefs, $config, $debug=0, $verbose=FALSE)
&$dbc, $mdefs, $config, $debug=0, $verbose=FALSE)
{ {
$this->dbc = $dbc; $this->dbc = $dbc;
$this->mdefs = $mdefs; $this->mdefs = $mdefs;
@ -252,7 +262,7 @@ class SchedulerPhpClient {
* verbosity flag * verbosity flag
* @return object, created object instance * @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 = ''; $f = '';
foreach ($mdefs as $fn => $farr) { foreach ($mdefs as $fn => $farr) {
@ -271,7 +281,7 @@ class SchedulerPhpClient {
if (FALSE === eval($e)) { if (FALSE === eval($e)) {
return $dbc->raiseError("Eval failed"); return $dbc->raiseError("Eval failed");
} }
$spc =& new SchedulerPhpClientCore( $spc = new SchedulerPhpClientCore(
$dbc, $mdefs, $config, $debug, $verbose); $dbc, $mdefs, $config, $debug, $verbose);
return $spc; return $spc;
} // fn factory } // fn factory
@ -288,7 +298,7 @@ class SchedulerPhpClient {
* @return array * @return array
* PHP hash with response * PHP hash with response
*/ */
function callMethod($method, $gettedPars) public function callMethod($method, $gettedPars)
{ {
$parr = array(); $parr = array();
$XML_RPC_val = new XML_RPC_Value; $XML_RPC_val = new XML_RPC_Value;

View file

@ -6,12 +6,12 @@
*/ */
class uiScratchPad class uiScratchPad
{ {
var $Base; private $Base;
var $items; private $items;
var $order; private $order;
var $reloadUrl; private $reloadUrl;
function uiScratchPad(&$uiBase) public function __construct(&$uiBase)
{ {
$this->Base =& $uiBase; $this->Base =& $uiBase;
$this->items =& $_SESSION[UI_SCRATCHPAD_SESSNAME]['content']; $this->items =& $_SESSION[UI_SCRATCHPAD_SESSNAME]['content'];
@ -46,8 +46,8 @@ class uiScratchPad
foreach ($arr as $gunid) { foreach ($arr as $gunid) {
if (preg_match('/[0-9]{1,20}/', $gunid)) { if (preg_match('/[0-9]{1,20}/', $gunid)) {
if ($this->Base->gb->_idFromGunid($this->Base->_toHex($gunid)) != FALSE) { if ($this->Base->gb->_idFromGunid($this->Base->toHex($gunid)) != FALSE) {
if ($i = $this->Base->_getMetaInfo($this->Base->gb->_idFromGunid($this->Base->_toHex($gunid)))) { if ($i = $this->Base->getMetaInfo($this->Base->gb->_idFromGunid($this->Base->toHex($gunid)))) {
$this->items[] = $i; $this->items[] = $i;
} }
} }
@ -61,7 +61,7 @@ class uiScratchPad
{ {
foreach ($this->items as $val) { foreach ($this->items as $val) {
//$str .= $val['gunid'].':'.$val['added'].' '; ## new format ### //$str .= $val['gunid'].':'.$val['added'].' '; ## new format ###
$str .= $this->Base->_toInt8($val['gunid']).' '; ## Akos<6F> old format ### $str .= $this->Base->toInt8($val['gunid']).' '; ## Akos<6F> old format ###
} }
$this->Base->gb->savePref($this->Base->sessid, UI_SCRATCHPAD_KEY, $str); $this->Base->gb->savePref($this->Base->sessid, UI_SCRATCHPAD_KEY, $str);
} // fn save } // fn save
@ -87,7 +87,7 @@ class uiScratchPad
$sp = $this->get(); $sp = $this->get();
foreach ($ids as $id) { foreach ($ids as $id) {
$item = $this->Base->_getMetaInfo($id); $item = $this->Base->getMetaInfo($id);
foreach ($sp as $key=>$val) { foreach ($sp as $key=>$val) {
if ($val['id'] == $item['id']) { if ($val['id'] == $item['id']) {
@ -167,7 +167,7 @@ class uiScratchPad
function reLoadM() function reLoadM()
{ {
foreach($this->items as $key=>$val) { foreach($this->items as $key=>$val) {
$this->items[$key] = $this->Base->_getMetaInfo($val['id']); $this->items[$key] = $this->Base->getMetaInfo($val['id']);
} }
} }
} // class uiScratchPad } // class uiScratchPad

View file

@ -6,13 +6,13 @@
*/ */
class uiSearch class uiSearch
{ {
var $Base; private $Base;
var $prefix; private $prefix;
var $criteria; private $criteria;
var $reloadUrl; private $reloadUrl;
var $results; private $results;
function uiSearch(&$uiBase) public function __construct(&$uiBase)
{ {
$this->Base =& $uiBase; $this->Base =& $uiBase;
$this->prefix = 'SEARCH'; $this->prefix = 'SEARCH';
@ -47,7 +47,7 @@ class uiSearch
function searchForm($id, $mask2) function searchForm($id, $mask2)
{ {
//print_r($this->criteria['form']); //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); $form = new HTML_QuickForm('search', UI_STANDARD_FORM_METHOD, UI_HANDLER);
$counter = isset($this->criteria['counter']) ? $this->criteria['counter'] : 1; $counter = isset($this->criteria['counter']) ? $this->criteria['counter'] : 1;
$form->setConstants(array('id'=>$id, 'counter'=>$counter)); $form->setConstants(array('id'=>$id, 'counter'=>$counter));
@ -55,11 +55,11 @@ class uiSearch
foreach ($mask['pages'] as $key=>$val) { foreach ($mask['pages'] as $key=>$val) {
foreach ($mask['pages'][$key] as $v){ foreach ($mask['pages'][$key] as $v){
if (isset($v['type']) && $v['type']) { 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'])) { if (isset($val['relation'])) {
$col2[$this->Base->_formElementEncode($v['element'])] = $mask2['relations'][$v['relation']]; $col2[uiBase::formElementEncode($v['element'])] = $mask2['relations'][$v['relation']];
} else { } 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, "</div id='searchRow_$n'>"); $form->addElement('static', 's2', NULL, "</div id='searchRow_$n'>");
} }
$this->Base->_parseArr2Form($form, $mask2['search']); uiBase::parseArrayToForm($form, $mask2['search']);
$constants = isset($this->criteria['form']) ? $this->criteria['form'] : null; $constants = isset($this->criteria['form']) ? $this->criteria['form'] : null;
$form->setConstants($constants); $form->setConstants($constants);
$form->validate(); $form->validate();
$renderer =& new HTML_QuickForm_Renderer_Array(true, true); $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer); $form->accept($renderer);
$output['dynform'] = $renderer->toArray(); $output['dynform'] = $renderer->toArray();
//print_r($output); //print_r($output);
@ -134,7 +134,7 @@ class uiSearch
foreach ($formdata as $key=>$val) { foreach ($formdata as $key=>$val) {
if (is_array($val) && $val['active']) { if (is_array($val) && $val['active']) {
$this->criteria['counter']++; $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], 'op' => $val[1],
'val' => stripslashes($val[2]) 'val' => stripslashes($val[2])
); );
@ -152,8 +152,8 @@ class uiSearch
function simpleSearchForm($mask) function simpleSearchForm($mask)
{ {
$form = new HTML_QuickForm('simplesearch', UI_STANDARD_FORM_METHOD, UI_HANDLER); $form = new HTML_QuickForm('simplesearch', UI_STANDARD_FORM_METHOD, UI_HANDLER);
$this->Base->_parseArr2Form($form, $mask); uiBase::parseArrayToForm($form, $mask);
$renderer =& new HTML_QuickForm_Renderer_Array(true, true); $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer); $form->accept($renderer);
$output = $renderer->toArray(); $output = $renderer->toArray();
//print_r($output); //print_r($output);
@ -179,7 +179,7 @@ class uiSearch
'op' => constant('UI_SIMPLESEARCH_OP'.$n), 'op' => constant('UI_SIMPLESEARCH_OP'.$n),
'val' => stripslashes($formdata['criterium']) '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), 1 => constant('UI_SIMPLESEARCH_OP'.$n),
2 => stripslashes($formdata['criterium']) 2 => stripslashes($formdata['criterium'])
); );
@ -206,7 +206,7 @@ class uiSearch
} }
foreach ($results['results'] as $rec) { foreach ($results['results'] as $rec) {
$tmpId = $this->Base->gb->_idFromGunid($rec["gunid"]); $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']; $this->results['cnt'] = $results['cnt'];

View file

@ -1,7 +1,7 @@
<?php <?php
$Smarty->register_object('UIBROWSER', $uiBrowser); $Smarty->register_object('UIBROWSER', $uiBrowser);
$Smarty->register_object('BROWSE', $uiBrowser->BROWSE); $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('SEARCH', $uiBrowser->SEARCH);
$Smarty->register_object('HUBSEARCH', $uiBrowser->HUBSEARCH); $Smarty->register_object('HUBSEARCH', $uiBrowser->HUBSEARCH);
$Smarty->register_object('TRANSFERS', $uiBrowser->TRANSFERS); $Smarty->register_object('TRANSFERS', $uiBrowser->TRANSFERS);

View file

@ -6,13 +6,12 @@
*/ */
class uiSubjects class uiSubjects
{ {
public $Base;
private $reloadUrl;
private $suRedirUrl;
private $redirUrl;
var $Base; public function __construct(&$uiBase)
var $reloadUrl;
var $suRedirUrl;
var $redirUrl;
function uiSubjects(&$uiBase)
{ {
$this->Base =& $uiBase; $this->Base =& $uiBase;
$this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close'; $this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
@ -50,8 +49,8 @@ class uiSubjects
include(dirname(__FILE__). '/formmask/subjects.inc.php'); include(dirname(__FILE__). '/formmask/subjects.inc.php');
$form = new HTML_QuickForm('addSubject', UI_STANDARD_FORM_METHOD, UI_HANDLER); $form = new HTML_QuickForm('addSubject', UI_STANDARD_FORM_METHOD, UI_HANDLER);
$this->Base->_parseArr2Form($form, $mask[$type]); uiBase::parseArrayToForm($form, $mask[$type]);
$renderer =& new HTML_QuickForm_Renderer_Array(true, true); $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer); $form->accept($renderer);
return $renderer->toArray(); return $renderer->toArray();
} }
@ -145,9 +144,9 @@ class uiSubjects
} else { } else {
$mask['chgPasswd']['cancel']['attributes'] = array('onClick' => 'location.href="'.UI_BROWSER.'"'); $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)); $form->setConstants(array('login' => $login));
$renderer =& new HTML_QuickForm_Renderer_Array(true, true); $renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer); $form->accept($renderer);
return $renderer->toArray(); return $renderer->toArray();
} }

View file

@ -7,14 +7,14 @@
*/ */
class uiTransfers class uiTransfers
{ {
var $Base; private $Base;
var $allItems; private $allItems;
var $rows; private $rows;
var $trShowInfo; private $trShowInfo;
var $reloadUrl; private $reloadUrl;
function uiTransfers(&$uiBase) public function __construct(&$uiBase)
{ {
$this->Base =& $uiBase; $this->Base =& $uiBase;
$this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close'; $this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';