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:
parent
bd70c879bc
commit
bed878246d
campcaster/src/modules/htmlUI/var
html
localizer
ui_base.inc.phpui_browse.class.phpui_browser.class.phpui_browser_init.phpui_calendar.class.phpui_conf.phpui_exchange.class.phpui_handler.class.phpui_handler_init.phpui_hubBrowse.class.phpui_hubSearch.class.phpui_jscom.phpui_playlist.class.phpui_scheduler.class.phpui_schedulerPhpClient.class.phpui_scratchpad.class.phpui_search.class.phpui_smartyExtensions.inc.phpui_subjects.class.phpui_transfers.class.php
|
@ -72,7 +72,7 @@ if (isset($_REQUEST['popup']) && is_array($_REQUEST['popup'])){
|
|||
$Smarty->assign('filecount', count($_REQUEST['id']));
|
||||
$Smarty->assign('idstr', $idstr);
|
||||
} 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');
|
||||
break;
|
||||
|
@ -140,7 +140,7 @@ if (isset($_REQUEST['popup']) && is_array($_REQUEST['popup'])){
|
|||
break;
|
||||
|
||||
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');
|
||||
break;
|
||||
|
||||
|
@ -214,19 +214,21 @@ if (isset($_REQUEST['popup']) && is_array($_REQUEST['popup'])){
|
|||
break;
|
||||
|
||||
case 'HUBBROWSE.getResults':
|
||||
$HUBBROWSE = new uiHubBrowse($uiBrowser);
|
||||
|
||||
if (isset($_REQUEST['trtokid'])) {
|
||||
$Smarty->assign('trtokid',$_REQUEST['trtokid']);
|
||||
if ($uiBrowser->HUBBROWSE->getSearchResults($_REQUEST['trtokid'])) {
|
||||
$Smarty->assign('results',true);
|
||||
$Smarty->assign('trtokid', $_REQUEST['trtokid']);
|
||||
if ($HUBBROWSE->getSearchResults($_REQUEST['trtokid'])) {
|
||||
$Smarty->assign('results', true);
|
||||
} else {
|
||||
$Smarty->assign('results',false);
|
||||
$Smarty->assign('results', false);
|
||||
}
|
||||
} else {
|
||||
$Smarty->assign('trtokid',$uiBrowser->HUBBROWSE->searchDB());
|
||||
$Smarty->assign('results',false);
|
||||
$Smarty->assign('trtokid', $HUBBROWSE->searchDB());
|
||||
$Smarty->assign('results', false);
|
||||
}
|
||||
$Smarty->assign('polling_frequency',UI_HUB_POLLING_FREQUENCY);
|
||||
$Smarty->assign('_prefix','HUBBROWSE');
|
||||
$Smarty->assign('polling_frequency', UI_HUB_POLLING_FREQUENCY);
|
||||
$Smarty->assign('_prefix', 'HUBBROWSE');
|
||||
$Smarty->display('popup/HUB.getResults.tpl');
|
||||
break;
|
||||
|
||||
|
@ -320,7 +322,8 @@ if ($uiBrowser->userid) {
|
|||
break;
|
||||
|
||||
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('isHub', TRUE);
|
||||
break;
|
||||
|
@ -341,7 +344,7 @@ if ($uiBrowser->userid) {
|
|||
break;
|
||||
|
||||
case "_analyzeFile":
|
||||
$Smarty->assign('_analyzeFile', $uiBrowser->_analyzeFile($uiBrowser->id, 'text'));
|
||||
$Smarty->assign('_analyzeFile', $uiBrowser->analyzeFile($uiBrowser->id, 'text'));
|
||||
$Smarty->assign('showFile', TRUE);
|
||||
break;
|
||||
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
<?php
|
||||
require(dirname(__FILE__).'/../ui_handler_init.php');
|
||||
|
||||
if (strstr($_REQUEST['act'], "HUBBROWSE")) {
|
||||
$HUBBROWSE = new uiHubBrowse($uiHandler);
|
||||
|
||||
}
|
||||
switch ($_REQUEST['act']) {
|
||||
|
||||
case "login":
|
||||
|
@ -167,31 +171,31 @@ switch ($_REQUEST['act']) {
|
|||
break;
|
||||
|
||||
case "HUBBROWSE.setCategory":
|
||||
$uiHandler->HUBBROWSE->setCategory($_REQUEST);
|
||||
$HUBBROWSE->setCategory($_REQUEST);
|
||||
break;
|
||||
|
||||
case "HUBBROWSE.setValue":
|
||||
$uiHandler->HUBBROWSE->setValue($_REQUEST);
|
||||
$HUBBROWSE->setValue($_REQUEST);
|
||||
break;
|
||||
|
||||
case "HUBBROWSE.reOrder":
|
||||
$uiHandler->HUBBROWSE->reOrder($_REQUEST['by']);
|
||||
$HUBBROWSE->reOrder($_REQUEST['by']);
|
||||
break;
|
||||
|
||||
case "HUBBROWSE.setDefaults":
|
||||
$uiHandler->HUBBROWSE->setDefaults(TRUE);
|
||||
$HUBBROWSE->setDefaults(TRUE);
|
||||
break;
|
||||
|
||||
case "HUBBROWSE.setOffset":
|
||||
$uiHandler->HUBBROWSE->setOffset($_REQUEST['page']);
|
||||
$HUBBROWSE->setOffset($_REQUEST['page']);
|
||||
break;
|
||||
|
||||
case "HUBBROWSE.setLimit":
|
||||
$uiHandler->HUBBROWSE->setLimit($_REQUEST['limit']);
|
||||
$HUBBROWSE->setLimit($_REQUEST['limit']);
|
||||
break;
|
||||
|
||||
case "HUBBROWSE.setFiletype":
|
||||
$uiHandler->HUBBROWSE->setFiletype($_REQUEST['filetype']);
|
||||
$HUBBROWSE->setFiletype($_REQUEST['filetype']);
|
||||
break;
|
||||
|
||||
case "HUBSEARCH.newSearch":
|
||||
|
|
|
@ -106,7 +106,7 @@ class Localizer {
|
|||
if ($g_localizerConfig['DEFAULT_FILE_TYPE'] != '') {
|
||||
return $g_localizerConfig['DEFAULT_FILE_TYPE'];
|
||||
}
|
||||
$defaultLang =& new LocalizerLanguage('globals',
|
||||
$defaultLang = new LocalizerLanguage('globals',
|
||||
$g_localizerConfig['DEFAULT_LANGUAGE']);
|
||||
if ($defaultLang->loadGsFile()) {
|
||||
return 'gs';
|
||||
|
@ -152,7 +152,7 @@ class Localizer {
|
|||
|
||||
$key = $p_prefix."_".$g_localizerConfig['DEFAULT_LANGUAGE'];
|
||||
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());
|
||||
$defaultLangStrings = $defaultLang->getTranslationTable();
|
||||
// Merge default language strings into the translation array.
|
||||
|
@ -162,7 +162,7 @@ class Localizer {
|
|||
}
|
||||
$key = $p_prefix."_".$p_languageCode;
|
||||
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());
|
||||
$userLangStrings = $userLang->getTranslationTable();
|
||||
// Merge user strings into translation array.
|
||||
|
@ -205,10 +205,10 @@ class Localizer {
|
|||
function CompareKeys($p_prefix, $p_data, $p_findExistingKeys = true)
|
||||
{
|
||||
global $g_localizerConfig;
|
||||
$localData =& new LocalizerLanguage($p_prefix,
|
||||
$localData = new LocalizerLanguage($p_prefix,
|
||||
$g_localizerConfig['DEFAULT_LANGUAGE']);
|
||||
$localData->loadFile(Localizer::GetMode());
|
||||
$globaldata =& new LocalizerLanguage($g_localizerConfig['FILENAME_PREFIX_GLOBAL'],
|
||||
$globaldata = new LocalizerLanguage($g_localizerConfig['FILENAME_PREFIX_GLOBAL'],
|
||||
$g_localizerConfig['DEFAULT_LANGUAGE']);
|
||||
$globaldata->loadFile(Localizer::GetMode());
|
||||
|
||||
|
@ -345,7 +345,7 @@ class Localizer {
|
|||
}
|
||||
|
||||
$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());
|
||||
$localTable = $localData->getTranslationTable();
|
||||
$unusedKeys = array();
|
||||
|
@ -377,7 +377,7 @@ class Localizer {
|
|||
foreach ($languages as $language) {
|
||||
|
||||
// Load the language file
|
||||
$source =& new LocalizerLanguage($p_prefix, $language->getLanguageId());
|
||||
$source = new LocalizerLanguage($p_prefix, $language->getLanguageId());
|
||||
$source->loadFile(Localizer::GetMode());
|
||||
|
||||
// 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.
|
||||
else {
|
||||
// Load the language file
|
||||
$source =& new LocalizerLanguage($p_prefix, $p_languageId);
|
||||
$source = new LocalizerLanguage($p_prefix, $p_languageId);
|
||||
$source->loadFile(Localizer::GetMode());
|
||||
foreach ($p_data as $pair) {
|
||||
$source->updateString($pair['key'], $pair['key'], $pair['value']);
|
||||
|
@ -419,14 +419,14 @@ class Localizer {
|
|||
function FixPositions($p_prefix)
|
||||
{
|
||||
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());
|
||||
$defaultTranslationTable = $defaultLanguage->getTranslationTable();
|
||||
$languageIds = Localizer::GetAllLanguages();
|
||||
foreach ($languageIds as $languageId) {
|
||||
|
||||
// Load the language file
|
||||
$source =& new LocalizerLanguage($p_prefix, $languageId);
|
||||
$source = new LocalizerLanguage($p_prefix, $languageId);
|
||||
$source->loadFile(Localizer::GetMode());
|
||||
|
||||
$count = 0;
|
||||
|
@ -455,7 +455,7 @@ class Localizer {
|
|||
global $g_localizerConfig;
|
||||
$languages = Localizer::GetAllLanguages();
|
||||
foreach ($languages as $language) {
|
||||
$source =& new LocalizerLanguage($p_prefix, $language->getLanguageId());
|
||||
$source = new LocalizerLanguage($p_prefix, $language->getLanguageId());
|
||||
$source->loadFile(Localizer::GetMode());
|
||||
if (is_array($p_newKey)) {
|
||||
foreach (array_reverse($p_newKey) as $key) {
|
||||
|
@ -492,7 +492,7 @@ class Localizer {
|
|||
$languages = Localizer::GetAllLanguages();
|
||||
|
||||
foreach ($languages as $language) {
|
||||
$target =& new LocalizerLanguage($p_prefix, $language->getLanguageId());
|
||||
$target = new LocalizerLanguage($p_prefix, $language->getLanguageId());
|
||||
$target->loadFile(Localizer::GetMode());
|
||||
if (is_array($p_key)) {
|
||||
foreach ($p_key as $key) {
|
||||
|
@ -520,7 +520,7 @@ class Localizer {
|
|||
{
|
||||
$languages = Localizer::GetAllLanguages();
|
||||
foreach ($languages as $language) {
|
||||
$target =& new LocalizerLanguage($p_prefix, $language->getLanguageId());
|
||||
$target = new LocalizerLanguage($p_prefix, $language->getLanguageId());
|
||||
$target->loadFile(Localizer::GetMode());
|
||||
$success = $target->moveString($p_pos1, $p_pos2);
|
||||
$target->saveFile(Localizer::GetMode());
|
||||
|
@ -547,7 +547,7 @@ class Localizer {
|
|||
}
|
||||
$className = "LocalizerFileFormat_".strtoupper($p_mode);
|
||||
if (class_exists($className)) {
|
||||
$object =& new $className();
|
||||
$object = new $className();
|
||||
if (method_exists($object, "getLanguages")) {
|
||||
$languages = $object->getLanguages($p_default, $p_completed_only);
|
||||
}
|
||||
|
@ -610,7 +610,7 @@ class Localizer {
|
|||
// $base = $fileNameParts[0];
|
||||
// $dir = str_replace($g_localizerConfig['BASE_DIR'], '', dirname($pathname));
|
||||
// // 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->clearValues();
|
||||
// $defaultLang->setLanguageId($p_languageId);
|
||||
|
|
|
@ -128,7 +128,7 @@ class LocalizerFileFormat_GS extends LocalizerFileFormat {
|
|||
|
||||
$metadata = array();
|
||||
foreach ($languages as $language) {
|
||||
$tmpMetadata =& new LanguageMetadata();
|
||||
$tmpMetadata = new LanguageMetadata();
|
||||
$tmpMetadata->m_englishName = $language['Name'];
|
||||
$tmpMetadata->m_nativeName = $language['NativeName'];
|
||||
$tmpMetadata->m_languageCode = $language['LanguageCode'];
|
||||
|
@ -195,7 +195,7 @@ class LocalizerFileFormat_XML extends LocalizerFileFormat {
|
|||
if (file_exists($filePath)) {
|
||||
$xml = File::readAll($filePath);
|
||||
File::close($filePath, FILE_MODE_READ);
|
||||
$unserializer =& new XML_Unserializer($this->m_unserializeOptions);
|
||||
$unserializer = new XML_Unserializer($this->m_unserializeOptions);
|
||||
$unserializer->unserialize($xml);
|
||||
$translationArray = $unserializer->getUnserializedData();
|
||||
|
||||
|
@ -233,7 +233,7 @@ class LocalizerFileFormat_XML extends LocalizerFileFormat {
|
|||
}
|
||||
$saveData = array_merge($saveData, $saveTranslationTable);
|
||||
|
||||
$serializer =& new XML_Serializer($this->m_serializeOptions);
|
||||
$serializer = new XML_Serializer($this->m_serializeOptions);
|
||||
$serializer->serialize($saveData);
|
||||
$xml = $serializer->getSerializedData();
|
||||
|
||||
|
@ -289,7 +289,7 @@ class LocalizerFileFormat_XML extends LocalizerFileFormat {
|
|||
|
||||
$xml = File::readAll($fileName);
|
||||
File::rewind($fileName, FILE_MODE_READ);
|
||||
$handle =& new XML_Unserializer($this->l_unserializeOptions);
|
||||
$handle = new XML_Unserializer($this->l_unserializeOptions);
|
||||
$handle->unserialize($xml);
|
||||
$arr = $handle->getUnserializedData();
|
||||
|
||||
|
@ -303,7 +303,7 @@ class LocalizerFileFormat_XML extends LocalizerFileFormat {
|
|||
// just display default language in maintainance mode
|
||||
if ($p_default || $language['Id'] !== $g_localizerConfig['DEFAULT_LANGUAGE']) {
|
||||
list ($langCode, $countryCode) = explode('_', $language['Id']);
|
||||
$languageDef =& new LanguageMetadata();
|
||||
$languageDef = new LanguageMetadata();
|
||||
$languageDef->m_languageId = $language['Id'];
|
||||
$languageDef->m_languageCode = $langCode;
|
||||
$languageDef->m_countryCode = $countryCode;
|
||||
|
@ -330,7 +330,7 @@ class LocalizerFileFormat_XML extends LocalizerFileFormat {
|
|||
|
||||
$xml = File::readAll($fileName);
|
||||
File::rewind($fileName, FILE_MODE_READ);
|
||||
$handle =& new XML_Unserializer($this->l_unserializeOptions);
|
||||
$handle = new XML_Unserializer($this->l_unserializeOptions);
|
||||
$handle->unserialize($xml);
|
||||
$arr = $handle->getUnserializedData();
|
||||
|
||||
|
@ -346,7 +346,7 @@ class LocalizerFileFormat_XML extends LocalizerFileFormat {
|
|||
'NativeName' => $new['NativeName']
|
||||
);
|
||||
$languages = $this->_xSortArray($languages, 'Id');
|
||||
$handle =& new XML_Serializer($this->l_serializeOptions);
|
||||
$handle = new XML_Serializer($this->l_serializeOptions);
|
||||
$handle->serialize($languages);
|
||||
|
||||
if (!$xml = $handle->getSerializedData()) {
|
||||
|
|
|
@ -503,7 +503,7 @@ class LocalizerLanguage {
|
|||
function fixPositions()
|
||||
{
|
||||
global $g_localizerConfig;
|
||||
$defaultLanguage =& new LocalizerLanguage($this->m_prefix,
|
||||
$defaultLanguage = new LocalizerLanguage($this->m_prefix,
|
||||
$g_localizerConfig['DEFAULT_LANGUAGE']);
|
||||
$defaultLanguage->loadFile(Localizer::GetMode());
|
||||
$defaultTranslationTable = $defaultLanguage->getTranslationTable();
|
||||
|
@ -528,7 +528,7 @@ class LocalizerLanguage {
|
|||
function syncToDefault()
|
||||
{
|
||||
global $g_localizerConfig;
|
||||
$defaultLanguage =& new LocalizerLanguage($this->m_prefix,
|
||||
$defaultLanguage = new LocalizerLanguage($this->m_prefix,
|
||||
$g_localizerConfig['DEFAULT_LANGUAGE']);
|
||||
$defaultLanguage->loadFile(Localizer::GetMode());
|
||||
$defaultTranslationTable = $defaultLanguage->getTranslationTable();
|
||||
|
@ -597,7 +597,7 @@ class LocalizerLanguage {
|
|||
}
|
||||
$className = 'LocalizerFileFormat_'.strtoupper($p_type);
|
||||
if (class_exists($className)) {
|
||||
$object =& new $className();
|
||||
$object = new $className();
|
||||
if (method_exists($object, 'load')) {
|
||||
return $object->load($this);
|
||||
}
|
||||
|
@ -631,7 +631,7 @@ class LocalizerLanguage {
|
|||
// Save in the requested mode.
|
||||
$className = 'LocalizerFileFormat_'.strtoupper($p_type);
|
||||
if (class_exists($className)) {
|
||||
$object =& new $className();
|
||||
$object = new $className();
|
||||
if (method_exists($object, 'save')) {
|
||||
return $object->save($this);
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ function login(&$data)
|
|||
}
|
||||
|
||||
$dbc->setFetchMode(DB_FETCHMODE_ASSOC);
|
||||
$gb =& new GreenBox($dbc, $config);
|
||||
$gb = new GreenBox($dbc, $config);
|
||||
|
||||
if (!$data['PHP_AUTH_USER'] || !$data['PHP_AUTH_PW']) {
|
||||
return FALSE;
|
||||
|
|
|
@ -26,7 +26,7 @@ class Maintenance {
|
|||
{
|
||||
require_once 'HTML/QuickForm.php';
|
||||
require_once 'form_function.php';
|
||||
$form =& new HTML_QuickForm();
|
||||
$form = new HTML_QuickForm();
|
||||
parseArr2Form($form, addLanguageFormArr());
|
||||
|
||||
if ($validate) {
|
||||
|
@ -51,7 +51,7 @@ class Maintenance {
|
|||
// store from here
|
||||
global $g_localizerConfig;
|
||||
$className = "LocalizerFileFormat_".strtoupper($g_localizerConfig['DEFAULT_FILE_TYPE']);
|
||||
$storage =& new $className();
|
||||
$storage = new $className();
|
||||
|
||||
if ($storage->addLanguage($values)) {
|
||||
return TRUE;
|
||||
|
|
|
@ -35,7 +35,7 @@ function translationForm($p_request)
|
|||
$localizerSourceLanguage = Input::Get('localizer_source_language', 'string',
|
||||
$g_localizerConfig['DEFAULT_LANGUAGE'], true);
|
||||
if (empty($localizerSourceLanguage)) {
|
||||
$tmpLanguage =& new LocalizerLanguage(null, $p_request['TOL_Language']);
|
||||
$tmpLanguage = new LocalizerLanguage(null, $p_request['TOL_Language']);
|
||||
$localizerSourceLanguage = $tmpLanguage->getLanguageId();
|
||||
}
|
||||
|
||||
|
@ -44,9 +44,9 @@ function translationForm($p_request)
|
|||
|
||||
// Load the language files.
|
||||
//echo "Prefix: $prefix<br>";
|
||||
$sourceLang =& new LocalizerLanguage($prefix, $localizerSourceLanguage);
|
||||
$targetLang =& new LocalizerLanguage($prefix, $localizerTargetLanguage);
|
||||
$defaultLang =& new LocalizerLanguage($prefix, $g_localizerConfig['DEFAULT_LANGUAGE']);
|
||||
$sourceLang = new LocalizerLanguage($prefix, $localizerSourceLanguage);
|
||||
$targetLang = new LocalizerLanguage($prefix, $localizerTargetLanguage);
|
||||
$defaultLang = new LocalizerLanguage($prefix, $g_localizerConfig['DEFAULT_LANGUAGE']);
|
||||
|
||||
$mode = Localizer::GetMode();
|
||||
if (!empty($prefix)) {
|
||||
|
|
|
@ -115,56 +115,48 @@ function _getNumArr($start, $end, $step=1)
|
|||
*/
|
||||
class uiBase
|
||||
{
|
||||
var $redirUrl;
|
||||
var $alertMsg;
|
||||
var $dbc;
|
||||
var $gb; // GreenBox
|
||||
var $config;
|
||||
var $sessid;
|
||||
var $userid;
|
||||
var $login;
|
||||
var $langid;
|
||||
var $id;
|
||||
var $pid;
|
||||
var $type;
|
||||
var $fid;
|
||||
var $homeid;
|
||||
var $InputTextStandardAttrib;
|
||||
var $STATIONPREFS;
|
||||
var $SCRATCHPAD;
|
||||
var $SEARCH;
|
||||
var $BROWSE;
|
||||
var $HUBBROWSE;
|
||||
var $HUBSEARCH;
|
||||
var $PLAYLIST;
|
||||
var $SCHEDULER;
|
||||
var $SUBJECTS;
|
||||
var $EXCHANGE;
|
||||
var $TRANSFERS;
|
||||
var $_self_;
|
||||
public $gb; // GreenBox
|
||||
public $STATIONPREFS;
|
||||
public $SCRATCHPAD;
|
||||
public $SEARCH;
|
||||
public $BROWSE;
|
||||
// Note: loading HUBBROWSE on every page load slows things down
|
||||
// a lot. we only load it on demand.
|
||||
//public $HUBBROWSE;
|
||||
public $HUBSEARCH;
|
||||
public $PLAYLIST;
|
||||
public $SCHEDULER;
|
||||
public $SUBJECTS;
|
||||
public $EXCHANGE;
|
||||
public $TRANSFERS;
|
||||
public $redirUrl;
|
||||
public $dbc;
|
||||
public $config;
|
||||
public $sessid;
|
||||
public $userid;
|
||||
public $login;
|
||||
public $id;
|
||||
public $langid;
|
||||
public $pid;
|
||||
public $type;
|
||||
public $fid;
|
||||
public $homeid;
|
||||
public $alertMsg;
|
||||
|
||||
/**
|
||||
* uiBase
|
||||
*
|
||||
* Initialize a new Basis Class including:
|
||||
* - database initialation
|
||||
* - GreenBox initialation
|
||||
*
|
||||
* @param array $config
|
||||
* @param array $config
|
||||
* configurartion data
|
||||
*/
|
||||
function uiBase(&$config)
|
||||
public function __construct(&$config)
|
||||
{
|
||||
$this->dbc = DB::connect($config['dsn'], TRUE);
|
||||
if (DB::isError($this->dbc)) {
|
||||
die($this->dbc->getMessage());
|
||||
}
|
||||
$this->dbc->setFetchMode(DB_FETCHMODE_ASSOC);
|
||||
$this->gb =& new GreenBox($this->dbc, $config);
|
||||
$this->gb = new GreenBox($this->dbc, $config);
|
||||
$this->config =& $config;
|
||||
|
||||
$this->config['accessRawAudioUrl'] = $config['storageUrlPath'].'/xmlrpc/simpleGet.php';
|
||||
|
||||
$this->sessid = isset($_REQUEST[$config['authCookieName']]) ?
|
||||
$_REQUEST[$config['authCookieName']] : null;
|
||||
$this->userid = $this->gb->getSessUserId($this->sessid);
|
||||
|
@ -187,21 +179,23 @@ class uiBase
|
|||
$this->homeid = $this->gb->getObjId($this->login, $this->gb->storId);
|
||||
}
|
||||
|
||||
$this->InputTextStandardAttrib = array('size'=>UI_INPUT_STANDARD_SIZE,
|
||||
'maxlength'=>UI_INPUT_STANDARD_MAXLENGTH);
|
||||
}
|
||||
|
||||
|
||||
public function init()
|
||||
{
|
||||
$this->STATIONPREFS =& $_SESSION[UI_STATIONINFO_SESSNAME];
|
||||
$this->SCRATCHPAD =& new uiScratchPad($this);
|
||||
$this->SEARCH =& new uiSearch($this);
|
||||
$this->BROWSE =& new uiBrowse($this);
|
||||
$this->HUBBROWSE =& new uiHubBrowse($this);
|
||||
$this->HUBSEARCH =& new uiHubSearch($this);
|
||||
$this->PLAYLIST =& new uiPlaylist($this);
|
||||
$this->SCHEDULER =& new uiScheduler($this);
|
||||
$this->SUBJECTS =& new uiSubjects($this);
|
||||
$this->EXCHANGE =& new uiExchange($this);
|
||||
$this->TRANSFERS =& new uiTransfers($this);
|
||||
$this->_self_ =& $this;
|
||||
} // fn uiBase
|
||||
$this->SCRATCHPAD = new uiScratchPad($this);
|
||||
$this->SEARCH = new uiSearch($this);
|
||||
$this->BROWSE = new uiBrowse($this);
|
||||
//$this->HUBBROWSE = new uiHubBrowse($this);
|
||||
$this->HUBSEARCH = new uiHubSearch($this);
|
||||
$this->PLAYLIST = new uiPlaylist($this);
|
||||
$this->SCHEDULER = new uiScheduler($this);
|
||||
$this->SUBJECTS = new uiSubjects($this);
|
||||
$this->EXCHANGE = new uiExchange($this);
|
||||
$this->TRANSFERS = new uiTransfers($this);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
@ -210,7 +204,7 @@ class uiBase
|
|||
* @param array $mask
|
||||
* @param boolean $reload
|
||||
*/
|
||||
function loadStationPrefs(&$mask, $reload=FALSE)
|
||||
public function loadStationPrefs(&$mask, $reload=FALSE)
|
||||
{
|
||||
if (!is_array($this->STATIONPREFS) || ($reload === TRUE) ) {
|
||||
$this->STATIONPREFS = array();
|
||||
|
@ -230,8 +224,6 @@ class uiBase
|
|||
|
||||
|
||||
/**
|
||||
* _parseArr2Form
|
||||
*
|
||||
* Add elements/rules/groups to an given HTML_QuickForm object
|
||||
*
|
||||
* @param HTML_Quickform $form
|
||||
|
@ -241,7 +233,7 @@ class uiBase
|
|||
* @param string $side
|
||||
* can be 'client' or 'server' - this is where the form validation occurs.
|
||||
*/
|
||||
function _parseArr2Form(&$form, &$mask, $side='client')
|
||||
public static function parseArrayToForm(&$form, &$mask, $side='client')
|
||||
{
|
||||
foreach ($mask as $v) {
|
||||
$attrs = isset($v['attributes']) ? $v['attributes'] : null;
|
||||
|
@ -347,7 +339,7 @@ class uiBase
|
|||
|
||||
reset($mask);
|
||||
$form->validate();
|
||||
} // fn _parseArr2Form
|
||||
} // fn parseArrayToForm
|
||||
|
||||
|
||||
/**
|
||||
|
@ -356,21 +348,21 @@ class uiBase
|
|||
* @param array $input
|
||||
* array of form-elements
|
||||
*/
|
||||
function _dateArr2Str(&$input)
|
||||
{
|
||||
foreach ($input as $k => $v){
|
||||
if (is_array($v)) {
|
||||
if ( ( isset($v['d']) ) && ( isset($v['M']) || isset($v['m']) ) && ( isset($v['Y']) || isset($v['y']) ) ) {
|
||||
$input[$k] = $v['Y'].$v['y'].'-'.sprintf('%02d', $v['M'].$v['m']).'-'.sprintf('%02d', $v['d']);
|
||||
}
|
||||
if ( ( isset($v['H']) ) || isset($v['h'] ) && ( isset($v['i']) ) && ( isset($v['s']) ) ) {
|
||||
$input[$k] = sprintf('%02d', $v['H'].$v['h']).':'.sprintf('%02d', $v['i']).':'.sprintf('%02d', $v['s']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $input;
|
||||
} // fn _dateArr2Str
|
||||
// function _dateArr2Str(&$input)
|
||||
// {
|
||||
// foreach ($input as $k => $v){
|
||||
// if (is_array($v)) {
|
||||
// if ( ( isset($v['d']) ) && ( isset($v['M']) || isset($v['m']) ) && ( isset($v['Y']) || isset($v['y']) ) ) {
|
||||
// $input[$k] = $v['Y'].$v['y'].'-'.sprintf('%02d', $v['M'].$v['m']).'-'.sprintf('%02d', $v['d']);
|
||||
// }
|
||||
// if ( ( isset($v['H']) ) || isset($v['h'] ) && ( isset($v['i']) ) && ( isset($v['s']) ) ) {
|
||||
// $input[$k] = sprintf('%02d', $v['H'].$v['h']).':'.sprintf('%02d', $v['i']).':'.sprintf('%02d', $v['s']);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return $input;
|
||||
// } // fn _dateArr2Str
|
||||
|
||||
|
||||
/**
|
||||
|
@ -380,7 +372,7 @@ class uiBase
|
|||
* local ID of file
|
||||
* @param string $format
|
||||
*/
|
||||
function _analyzeFile($id, $format)
|
||||
public function analyzeFile($id, $format)
|
||||
{
|
||||
$ia = $this->gb->analyzeFile($id, $this->sessid);
|
||||
$s = $ia['playtime_seconds'];
|
||||
|
@ -404,23 +396,23 @@ class uiBase
|
|||
</audioClip>';
|
||||
}
|
||||
return FALSE;
|
||||
} // fn _analyzeFile
|
||||
} // fn analyzeFile
|
||||
|
||||
|
||||
function _toHex($gunid)
|
||||
public function toHex($gunid)
|
||||
{
|
||||
$res = $this->dbc->query("SELECT to_hex($gunid)");
|
||||
$row = $res->fetchRow();
|
||||
return $row['to_hex'];
|
||||
} // fn _toHex
|
||||
} // fn toHex
|
||||
|
||||
|
||||
function _toInt8($gunid)
|
||||
public function toInt8($gunid)
|
||||
{
|
||||
$res = $this->dbc->query("SELECT x'$gunid'::bigint");
|
||||
$row = $res->fetchRow();
|
||||
return $row['int8'];
|
||||
} // fn _toInt8
|
||||
} // fn toInt8
|
||||
|
||||
|
||||
/**
|
||||
|
@ -438,7 +430,7 @@ class uiBase
|
|||
* @param string $p8
|
||||
* @param string $p9
|
||||
*/
|
||||
function _retMsg($msg, $p1=NULL, $p2=NULL, $p3=NULL, $p4=NULL, $p5=NULL, $p6=NULL, $p7=NULL, $p8=NULL, $p9=NULL)
|
||||
public function _retMsg($msg, $p1=NULL, $p2=NULL, $p3=NULL, $p4=NULL, $p5=NULL, $p6=NULL, $p7=NULL, $p8=NULL, $p9=NULL)
|
||||
{
|
||||
if (!isset($_SESSION['alertMsg'])) {
|
||||
$_SESSION['alertMsg'] = '';
|
||||
|
@ -447,22 +439,22 @@ class uiBase
|
|||
} // fn _retMsg
|
||||
|
||||
|
||||
function _getMetaInfo($id)
|
||||
public function getMetaInfo($id)
|
||||
{
|
||||
$type = strtolower($this->gb->getFileType($id));
|
||||
$data = array('id' => $id,
|
||||
'gunid' => $this->gb->_gunidFromId($id),
|
||||
'title' => $this->_getMDataValue($id, UI_MDATA_KEY_TITLE),
|
||||
'creator' => $this->_getMDataValue($id, UI_MDATA_KEY_CREATOR),
|
||||
'duration' => $this->_getMDataValue($id, UI_MDATA_KEY_DURATION),
|
||||
'title' => $this->getMetadataValue($id, UI_MDATA_KEY_TITLE),
|
||||
'creator' => $this->getMetadataValue($id, UI_MDATA_KEY_CREATOR),
|
||||
'duration' => $this->getMetadataValue($id, UI_MDATA_KEY_DURATION),
|
||||
'type' => $type,
|
||||
#'isAvailable' => $type == 'playlist' ? $this->gb->playlistIsAvailable($id, $this->sessid) : NULL,
|
||||
);
|
||||
return ($data);
|
||||
} // fn _getMetaInfo
|
||||
} // fn getMetaInfo
|
||||
|
||||
|
||||
function _getMDataValue($id, $key, $langid=NULL, $deflangid=UI_DEFAULT_LANGID)
|
||||
public function getMetadataValue($id, $key, $langid=NULL, $deflangid=UI_DEFAULT_LANGID)
|
||||
{
|
||||
if (!$langid) {
|
||||
$langid = $_SESSION['langid'];
|
||||
|
@ -473,10 +465,10 @@ class uiBase
|
|||
return $value['value'];
|
||||
}
|
||||
return FALSE;
|
||||
} // fn _getMDataValue
|
||||
} // fn getMetadataValue
|
||||
|
||||
|
||||
function _setMDataValue($id, $key, $value, $langid=NULL)
|
||||
public function setMetadataValue($id, $key, $value, $langid=NULL)
|
||||
{
|
||||
if (!$langid) {
|
||||
$langid = UI_DEFAULT_LANGID;
|
||||
|
@ -489,16 +481,14 @@ class uiBase
|
|||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
} // fn _setMDataValue
|
||||
} // fn setMetadataValue
|
||||
|
||||
|
||||
/**
|
||||
* Enter description here...
|
||||
*
|
||||
* @param unknown_type $id
|
||||
* @return string/FALSE
|
||||
*/
|
||||
function _getFileTitle($id)
|
||||
private function _getFileTitle($id)
|
||||
{
|
||||
if (is_array($arr = $this->gb->getPath($id))) {
|
||||
$file = array_pop($arr);
|
||||
|
@ -508,29 +498,29 @@ class uiBase
|
|||
} // fn _getFileTitle
|
||||
|
||||
|
||||
function _isFolder($id)
|
||||
{
|
||||
if (strtolower($this->gb->getFileType($id)) != 'folder') {
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
} // fn _isFolder
|
||||
// function _isFolder($id)
|
||||
// {
|
||||
// if (strtolower($this->gb->getFileType($id)) != 'folder') {
|
||||
// return FALSE;
|
||||
// }
|
||||
// return TRUE;
|
||||
// } // fn _isFolder
|
||||
|
||||
|
||||
function _formElementEncode($str)
|
||||
public static function formElementEncode($str)
|
||||
{
|
||||
$str = str_replace(':', '__', $str);
|
||||
#$str = str_replace('.', '_', $str);
|
||||
return $str;
|
||||
} // fn _formElementEncode
|
||||
} // fn formElementEncode
|
||||
|
||||
|
||||
function _formElementDecode($str)
|
||||
public static function formElementDecode($str)
|
||||
{
|
||||
$str = str_replace('__', ':', $str);
|
||||
#$str = str_replace('_', '.', $str);
|
||||
return $str;
|
||||
} // fn _formElementDecode
|
||||
} // fn formElementDecode
|
||||
|
||||
} // class uiBase
|
||||
?>
|
|
@ -6,31 +6,31 @@
|
|||
*/
|
||||
class uiBrowse
|
||||
{
|
||||
var $Base; // uiBase object
|
||||
var $prefix;
|
||||
var $col;
|
||||
var $criteria;
|
||||
var $reloadUrl;
|
||||
public $Base; // uiBase object
|
||||
private $prefix;
|
||||
private $col;
|
||||
private $criteria;
|
||||
private $reloadUrl;
|
||||
|
||||
|
||||
function uiBrowse(&$uiBase)
|
||||
public function __construct(&$uiBase)
|
||||
{
|
||||
$this->Base =& $uiBase;
|
||||
$this->prefix = 'BROWSE';
|
||||
$this->col =& $_SESSION[constant('UI_'.$this->prefix.'_SESSNAME')]['col'];
|
||||
$this->criteria =& $_SESSION[constant('UI_'.$this->prefix.'_SESSNAME')]['criteria'];
|
||||
#$this->results =& $_SESSION[constant('UI_'.$this->prefix.'_SESSNAME')]['results'];
|
||||
$this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
|
||||
$this->Base =& $uiBase;
|
||||
$this->prefix = 'BROWSE';
|
||||
$this->col =& $_SESSION[constant('UI_'.$this->prefix.'_SESSNAME')]['col'];
|
||||
$this->criteria =& $_SESSION[constant('UI_'.$this->prefix.'_SESSNAME')]['criteria'];
|
||||
//$this->results =& $_SESSION[constant('UI_'.$this->prefix.'_SESSNAME')]['results'];
|
||||
$this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
|
||||
|
||||
if (empty($this->criteria['limit'])) {
|
||||
$this->criteria['limit'] = UI_BROWSE_DEFAULT_LIMIT;
|
||||
$this->criteria['limit'] = UI_BROWSE_DEFAULT_LIMIT;
|
||||
}
|
||||
if (empty($this->criteria['filetype'])) {
|
||||
$this->criteria['filetype'] = UI_FILETYPE_ANY;
|
||||
}
|
||||
|
||||
if (!is_array($this->col)) {
|
||||
## init Categorys
|
||||
// init Categorys
|
||||
$this->setDefaults();
|
||||
}
|
||||
} // constructor
|
||||
|
@ -89,7 +89,7 @@ class uiBrowse
|
|||
foreach ($mask['pages'] as $key => $val) {
|
||||
foreach ($mask['pages'][$key] as $v){
|
||||
if (isset($v['type']) && $v['type']) {
|
||||
$tmp = $this->Base->_formElementEncode($v['element']);
|
||||
$tmp = uiBase::formElementEncode($v['element']);
|
||||
$mask2['browse_columns']['category']['options'][$tmp] = tra($v['label']);
|
||||
}
|
||||
}
|
||||
|
@ -99,22 +99,22 @@ class uiBrowse
|
|||
$form = new HTML_QuickForm('col'.$n, UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
||||
$form->setConstants(array('id' => $id,
|
||||
'col' => $n,
|
||||
'category' => $this->Base->_formElementEncode($this->col[$n]['category'])));
|
||||
'category' => uiBase::formElementEncode($this->col[$n]['category'])));
|
||||
$mask2['browse_columns']['value']['options'] = $this->options($this->col[$n]['values']['results']);
|
||||
$mask2['browse_columns']['value']['default'] = $this->col[$n]['form_value'];
|
||||
$this->Base->_parseArr2Form($form, $mask2['browse_columns']);
|
||||
uiBase::parseArrayToForm($form, $mask2['browse_columns']);
|
||||
$form->validate();
|
||||
$renderer =& new HTML_QuickForm_Renderer_Array(true, true);
|
||||
$renderer = new HTML_QuickForm_Renderer_Array(true, true);
|
||||
$form->accept($renderer);
|
||||
$output['col'.$n]['dynform'] = $renderer->toArray();
|
||||
}
|
||||
|
||||
## form to change limit and file-type
|
||||
$form = new HTML_QuickForm('switch', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
||||
$this->Base->_parseArr2Form($form, $mask2['browse_global']);
|
||||
uiBase::parseArrayToForm($form, $mask2['browse_global']);
|
||||
$form->setDefaults(array('limit' => $this->criteria['limit'],
|
||||
'filetype' => $this->criteria['filetype']));
|
||||
$renderer =& new HTML_QuickForm_Renderer_Array(true, true);
|
||||
$renderer = new HTML_QuickForm_Renderer_Array(true, true);
|
||||
$form->accept($renderer);
|
||||
$output['global']['dynform'] = $renderer->toArray();
|
||||
|
||||
|
@ -123,19 +123,31 @@ class uiBrowse
|
|||
|
||||
|
||||
/**
|
||||
* Set the category for audio file browser. There are three columns
|
||||
* you can set the category for.
|
||||
*
|
||||
* @param array $parm
|
||||
* Has keys:
|
||||
* int 'col' - the column you are setting the category for
|
||||
* string 'category' - the category for the given column
|
||||
* string 'value' - the
|
||||
* @return void
|
||||
*/
|
||||
function setCategory($parm)
|
||||
public function setCategory($parm)
|
||||
{
|
||||
$which = $parm['col'];
|
||||
$this->col[$which]['category'] = $this->Base->_formElementDecode($parm['category']);
|
||||
$criteria = isset($this->col[$which]['criteria']) ? $this->col[$which]['criteria'] : null;
|
||||
$this->col[$which]['values'] = $this->Base->gb->browseCategory($this->col[$which]['category'], $criteria, $this->Base->sessid);
|
||||
// $reflect = new ReflectionProperty('uiBrowse', 'Base');
|
||||
// echo "<pre>";print_r(Reflection::getModifierNames($reflect->getModifiers()));echo "</pre>";
|
||||
|
||||
$columnNumber = $parm['col'];
|
||||
$category = $parm['category'];
|
||||
|
||||
$this->col[$columnNumber]['category'] = uiBase::formElementDecode($category);
|
||||
$criteria = isset($this->col[$columnNumber]['criteria']) ? $this->col[$columnNumber]['criteria'] : null;
|
||||
// print_r($this->Base->gb);
|
||||
$this->col[$columnNumber]['values'] = $this->Base->gb->browseCategory($this->col[$columnNumber]['category'], $criteria, $this->Base->sessid);
|
||||
|
||||
$this->Base->redirUrl = UI_BROWSER.'?act='.$this->prefix;
|
||||
|
||||
$this->clearHierarchy($which);
|
||||
$this->clearHierarchy($columnNumber);
|
||||
#print_r($this->col);
|
||||
} // fn setCategory
|
||||
|
||||
|
@ -150,7 +162,8 @@ class uiBrowse
|
|||
$next = $which + 1;
|
||||
$this->col[$which]['form_value'] = $parm['value'][0];
|
||||
if ($parm['value'][0] == '%%all%%') {
|
||||
$this->col[$next]['criteria'] = array('operator' => 'and', 'filetype' => $this->criteria['filetype']);
|
||||
$this->col[$next]['criteria'] = array('operator' => 'and',
|
||||
'filetype' => $this->criteria['filetype']);
|
||||
} else {
|
||||
$this->col[$next]['criteria'] = array(
|
||||
'operator' => 'and',
|
||||
|
@ -158,7 +171,7 @@ class uiBrowse
|
|||
'conditions' => array_merge(
|
||||
is_array($this->col[$which]['criteria']['conditions']) ? $this->col[$which]['criteria']['conditions'] : array(),
|
||||
array(
|
||||
array('cat' => $this->Base->_formElementDecode($parm['category']),
|
||||
array('cat' => uiBase::formElementDecode($parm['category']),
|
||||
'op' => '=',
|
||||
'val' => $parm['value'][0]
|
||||
)
|
||||
|
@ -232,7 +245,7 @@ class uiBrowse
|
|||
$this->results['cnt'] = $results['cnt'];
|
||||
foreach ($results['results'] as $rec) {
|
||||
$tmpId = $this->Base->gb->_idFromGunid($rec["gunid"]);
|
||||
$this->results['items'][] = $this->Base->_getMetaInfo($tmpId);
|
||||
$this->results['items'][] = $this->Base->getMetaInfo($tmpId);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
* @version $Revision$
|
||||
*/
|
||||
class uiBrowser extends uiBase {
|
||||
var $alertMsg;
|
||||
|
||||
// --- class constructor ---
|
||||
/**
|
||||
|
@ -15,9 +14,9 @@ class uiBrowser extends uiBase {
|
|||
* @param array $config
|
||||
* configurartion data
|
||||
*/
|
||||
function uiBrowser(&$config)
|
||||
public function __construct(&$config)
|
||||
{
|
||||
$this->uiBase($config);
|
||||
parent::__construct($config);
|
||||
} // constructor
|
||||
|
||||
|
||||
|
@ -71,12 +70,10 @@ class uiBrowser extends uiBase {
|
|||
function login($mask)
|
||||
{
|
||||
$form = new HTML_QuickForm('login', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
||||
$this->_parseArr2Form($form, $mask['languages']);
|
||||
$this->_parseArr2Form($form, $mask['login']);
|
||||
|
||||
$renderer =& new HTML_QuickForm_Renderer_Array(true, true);
|
||||
uiBase::parseArrayToForm($form, $mask['languages']);
|
||||
uiBase::parseArrayToForm($form, $mask['login']);
|
||||
$renderer = new HTML_QuickForm_Renderer_Array(true, true);
|
||||
$form->accept($renderer);
|
||||
|
||||
return $renderer->toArray();
|
||||
} // fn login
|
||||
|
||||
|
@ -123,7 +120,7 @@ class uiBrowser extends uiBase {
|
|||
}
|
||||
foreach ($data['listdata'] as $key=>$val) {
|
||||
if ($val['type'] != 'Folder') {
|
||||
$data['listdata'][$key]['title'] = $this->_getMDataValue($val['id'], UI_MDATA_KEY_TITLE);
|
||||
$data['listdata'][$key]['title'] = $this->getMetadataValue($val['id'], UI_MDATA_KEY_TITLE);
|
||||
} else {
|
||||
$data['listdata'][$key]['title'] = $val['name'];
|
||||
}
|
||||
|
@ -153,8 +150,8 @@ class uiBrowser extends uiBase {
|
|||
$form->setConstants(array('folderId' => $folderId,
|
||||
'id' => $id,
|
||||
'act' => $id ? 'editItem' : 'addFileData'));
|
||||
$this->_parseArr2Form($form, $mask);
|
||||
$renderer =& new HTML_QuickForm_Renderer_Array(true, true);
|
||||
uiBase::parseArrayToForm($form, $mask);
|
||||
$renderer = new HTML_QuickForm_Renderer_Array(true, true);
|
||||
$form->accept($renderer);
|
||||
return $renderer->toArray();
|
||||
} // fn fileForm
|
||||
|
@ -177,12 +174,12 @@ class uiBrowser extends uiBase {
|
|||
$const = array('folderId' => $folderId,
|
||||
'id' => $id,
|
||||
'act' => $id ? 'editWebstreamData' : 'addWebstreamData',
|
||||
'title' => $id ? $this->_getMDataValue($id, UI_MDATA_KEY_TITLE) : NULL,
|
||||
'url' => $id ? $this->_getMDataValue($id, UI_MDATA_KEY_URL) : 'http://',
|
||||
'length' => $id ? preg_replace("/\.[0-9]{1,6}/", "", $this->_getMDataValue($id, UI_MDATA_KEY_DURATION)) : NULL
|
||||
'title' => $id ? $this->getMetadataValue($id, UI_MDATA_KEY_TITLE) : NULL,
|
||||
'url' => $id ? $this->getMetadataValue($id, UI_MDATA_KEY_URL) : 'http://',
|
||||
'length' => $id ? preg_replace("/\.[0-9]{1,6}/", "", $this->getMetadataValue($id, UI_MDATA_KEY_DURATION)) : NULL
|
||||
);
|
||||
$form->setConstants($const);
|
||||
$this->_parseArr2Form($form, $mask);
|
||||
uiBase::parseArrayToForm($form, $mask);
|
||||
|
||||
/*
|
||||
$form->addGroupRule('grp',
|
||||
|
@ -201,7 +198,7 @@ class uiBrowser extends uiBase {
|
|||
$form->_rules['grp[url]'][1][validation] = 'client';
|
||||
*/
|
||||
|
||||
$renderer =& new HTML_QuickForm_Renderer_Array(true, true);
|
||||
$renderer = new HTML_QuickForm_Renderer_Array(true, true);
|
||||
$form->accept($renderer);
|
||||
return $renderer->toArray();
|
||||
} // fn webstreamForm
|
||||
|
@ -294,7 +291,7 @@ class uiBrowser extends uiBase {
|
|||
$arr[tra($key)] = $val;
|
||||
}
|
||||
}
|
||||
$arr[$relations[UI_MDATA_KEY_TITLE]] = $this->_getMDataValue($id, UI_MDATA_KEY_TITLE);
|
||||
$arr[$relations[UI_MDATA_KEY_TITLE]] = $this->getMetadataValue($id, UI_MDATA_KEY_TITLE);
|
||||
ksort($arr);
|
||||
|
||||
return array('metadata' => $arr);
|
||||
|
@ -316,14 +313,14 @@ class uiBrowser extends uiBase {
|
|||
$langid = $langid ? $langid : UI_DEFAULT_LANGID;
|
||||
|
||||
$form = new HTML_QuickForm('langswitch', UI_STANDARD_FORM_METHOD, UI_BROWSER);
|
||||
$this->_parseArr2Form($form, $mask['langswitch']);
|
||||
uiBase::parseArrayToForm($form, $mask['langswitch']);
|
||||
$form->setConstants(array('target_langid' => $langid));
|
||||
$renderer =& new HTML_QuickForm_Renderer_Array(true, true);
|
||||
$renderer = new HTML_QuickForm_Renderer_Array(true, true);
|
||||
$form->accept($renderer);
|
||||
$output['langswitch'] = $renderer->toArray();
|
||||
|
||||
$form = new HTML_QuickForm('editMetaData', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
||||
$this->_parseArr2Form($form, $mask['basics']);
|
||||
uiBase::parseArrayToForm($form, $mask['basics']);
|
||||
$form->setConstants(array('act' => 'editMetaData',
|
||||
'id' => $id,
|
||||
'curr_langid' => $langid,
|
||||
|
@ -338,20 +335,20 @@ class uiBrowser extends uiBase {
|
|||
if (!is_array($mask['pages'][$key][$k]['attributes'])) {
|
||||
$mask['pages'][$key][$k]['attributes'] = array();
|
||||
}
|
||||
$mask['pages'][$key][$k]['element'] = $key.'___'.$this->_formElementEncode($v['element']);
|
||||
$mask['pages'][$key][$k]['attributes'] = array_merge($mask['pages'][$key][$k]['attributes'], array('onChange' => "spread(this, '".$this->_formElementEncode($v['element'])."')"));
|
||||
$mask['pages'][$key][$k]['element'] = $key.'___'.uiBase::formElementEncode($v['element']);
|
||||
$mask['pages'][$key][$k]['attributes'] = array_merge($mask['pages'][$key][$k]['attributes'], array('onChange' => "spread(this, '".uiBase::formElementEncode($v['element'])."')"));
|
||||
## load data from GreenBox
|
||||
if ($getval = $this->_getMDataValue($id, $v['element'], $langid, NULL)) {
|
||||
if ($getval = $this->getMetadataValue($id, $v['element'], $langid, NULL)) {
|
||||
$mask['pages'][$key][$k]['default'] = $getval;
|
||||
$mask['pages'][$key][$k]['attributes']['onFocus'] = 'MData_confirmChange(this)';
|
||||
}
|
||||
}
|
||||
$form->addElement('static', NULL, NULL, "<div id='div_$key'>");
|
||||
$this->_parseArr2Form($form, $mask['pages'][$key]);
|
||||
$this->_parseArr2Form($form, $mask['buttons']);
|
||||
uiBase::parseArrayToForm($form, $mask['pages'][$key]);
|
||||
uiBase::parseArrayToForm($form, $mask['buttons']);
|
||||
$form->addElement('static', NULL, NULL, "</div id='div_$key'>");
|
||||
}
|
||||
$renderer =& new HTML_QuickForm_Renderer_Array(true, true);
|
||||
$renderer = new HTML_QuickForm_Renderer_Array(true, true);
|
||||
$form->accept($renderer);
|
||||
$output['pages'][] = $renderer->toArray();
|
||||
#print_r($output);
|
||||
|
@ -369,8 +366,8 @@ class uiBrowser extends uiBase {
|
|||
$mask[$key]['default'] = $p;
|
||||
}
|
||||
}
|
||||
$this->_parseArr2Form($form, $mask);
|
||||
$renderer =& new HTML_QuickForm_Renderer_Array(true, true);
|
||||
uiBase::parseArrayToForm($form, $mask);
|
||||
$renderer = new HTML_QuickForm_Renderer_Array(true, true);
|
||||
$form->accept($renderer);
|
||||
return $renderer->toArray();
|
||||
} // fn changeStationPrefs
|
||||
|
@ -456,7 +453,7 @@ class uiBrowser extends uiBase {
|
|||
if (strtolower($type) === strtolower(UI_FILETYPE_AUDIOCLIP)) {
|
||||
$m3u = "http://{$_SERVER['SERVER_NAME']}".$this->config['accessRawAudioUrl']."?sessid={$this->sessid}&id=$clipid\n";
|
||||
} else {
|
||||
$m3u = $this->_getMDataValue($id, UI_MDATA_KEY_URL);
|
||||
$m3u = $this->getMetadataValue($id, UI_MDATA_KEY_URL);
|
||||
}
|
||||
touch(UI_TESTSTREAM_MU3_TMP);
|
||||
$handle = fopen(UI_TESTSTREAM_MU3_TMP, "w");
|
||||
|
|
|
@ -3,24 +3,26 @@ header("Content-type: text/html; charset=utf-8");
|
|||
session_start();
|
||||
|
||||
## LS classes/functions #############################################
|
||||
require_once dirname(__FILE__).'/ui_conf.php';
|
||||
require_once dirname(__FILE__).'/ui_browser.class.php';
|
||||
require_once(dirname(__FILE__).'/ui_conf.php');
|
||||
require_once(dirname(__FILE__).'/ui_browser.class.php');
|
||||
|
||||
|
||||
## well known classes ###############################################
|
||||
require_once dirname(__FILE__).'/Smarty/libs/Smarty.class.php';
|
||||
require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
|
||||
require_once(dirname(__FILE__).'/Smarty/libs/Smarty.class.php');
|
||||
require_once('HTML/QuickForm/Renderer/ArraySmarty.php');
|
||||
|
||||
## initialize objects ###############################################
|
||||
$Smarty =& new Smarty;
|
||||
$uiBrowser =& new uiBrowser($config);
|
||||
$uiBase =& $uiBrowser;
|
||||
$jscom =& new jscom(array("jscom_wrapper"));
|
||||
$Smarty = new Smarty;
|
||||
$uiBrowser = new uiBrowser($config);
|
||||
$uiBrowser->init();
|
||||
|
||||
$uiBase =& $uiBrowser;
|
||||
$jscom = new jscom(array("jscom_wrapper"));
|
||||
$jscom->handler();
|
||||
|
||||
|
||||
## load Smarty+filters ##############################################
|
||||
require_once dirname(__FILE__).'/ui_smartyExtensions.inc.php';
|
||||
require_once(dirname(__FILE__).'/ui_smartyExtensions.inc.php');
|
||||
#$Smarty->load_filter('output', 'trimwhitespace');
|
||||
#$Smarty->load_filter('post', 'template_marker');
|
||||
$Smarty->load_filter('output', 'localizer');
|
||||
|
|
|
@ -6,21 +6,23 @@
|
|||
*/
|
||||
class uiCalendar
|
||||
{
|
||||
var $Decade;
|
||||
var $Year;
|
||||
var $Month;
|
||||
var $Week;
|
||||
var $Day;
|
||||
var $Hour;
|
||||
public $Decade;
|
||||
public $Year;
|
||||
public $Month;
|
||||
public $Week;
|
||||
public $Day;
|
||||
public $Hour;
|
||||
|
||||
function uiCalendar()
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function buildDecade()
|
||||
{
|
||||
if (is_array($this->Decade)) return;
|
||||
if (is_array($this->Decade)) {
|
||||
return;
|
||||
}
|
||||
|
||||
for ($Year = $this->curr['year']-5; $Year<=$this->curr['year']+5; $Year++) {
|
||||
$this->Decade[] = array(
|
||||
|
@ -34,14 +36,16 @@ class uiCalendar
|
|||
|
||||
function buildYear()
|
||||
{
|
||||
if (is_array($this->Year)) return;
|
||||
if (is_array($this->Year)) {
|
||||
return;
|
||||
}
|
||||
|
||||
require_once 'Calendar/Year.php';
|
||||
require_once 'Calendar/Month.php';
|
||||
require_once('Calendar/Year.php');
|
||||
require_once('Calendar/Month.php');
|
||||
|
||||
$Year = new Calendar_Year($this->curr['year']);
|
||||
# mark current month
|
||||
$sel = new Calendar_Month($this->curr['year'], $this->curr['month']);
|
||||
$sel = new Calendar_Month($this->curr['year'], $this->curr['month']);
|
||||
$selections = array($sel);
|
||||
|
||||
$Year->build($selections, UI_SCHEDULER_FIRSTWEEKDAY);
|
||||
|
@ -57,16 +61,20 @@ class uiCalendar
|
|||
|
||||
function buildMonth()
|
||||
{
|
||||
if (is_array($this->Month)) return;
|
||||
if (is_array($this->Month)) {
|
||||
return;
|
||||
}
|
||||
|
||||
require_once 'Calendar/Month/Weekdays.php';
|
||||
require_once 'Calendar/Day.php';
|
||||
require_once('Calendar/Month/Weekdays.php');
|
||||
require_once('Calendar/Day.php');
|
||||
|
||||
$Month = new Calendar_Month_Weekdays($this->curr['year'], $this->curr['month'], UI_SCHEDULER_FIRSTWEEKDAY);
|
||||
$Month->build($this->_scheduledDays('month')); ## scheduled days are selected
|
||||
// scheduled days are selected
|
||||
$Month->build($this->_scheduledDays('month'));
|
||||
while ($Day = $Month->fetch()) {
|
||||
$corrMonth = $Day->thisMonth()<=12 ? sprintf('%02d', $Day->thisMonth()) : '01'; ## due to bug in
|
||||
$corrYear = $Day->thisMonth()<=12 ? $Day->thisYear() : $Day->thisYear()+1; ## Calendar_Month_Weekdays
|
||||
// Next 2 lines are due to a bug in Calendar_Month_Weekdays
|
||||
$corrMonth = $Day->thisMonth()<=12 ? sprintf('%02d', $Day->thisMonth()) : '01';
|
||||
$corrYear = $Day->thisMonth()<=12 ? $Day->thisYear() : $Day->thisYear()+1;
|
||||
$this->Month[] = array(
|
||||
'day' => sprintf('%02d', $Day->thisDay()),
|
||||
'week' => $this->_getWeekNr($Day),
|
||||
|
@ -87,9 +95,11 @@ class uiCalendar
|
|||
|
||||
function buildWeek()
|
||||
{
|
||||
if (is_array($this->Week)) return;
|
||||
if (is_array($this->Week)) {
|
||||
return;
|
||||
}
|
||||
|
||||
require_once 'Calendar/Week.php';
|
||||
require_once('Calendar/Week.php');
|
||||
|
||||
$Week = new Calendar_Week($this->curr['year'], $this->curr['month'], $this->curr['day'], UI_SCHEDULER_FIRSTWEEKDAY);
|
||||
$Week->build($this->_scheduledDays('week'));
|
||||
|
@ -122,8 +132,9 @@ class uiCalendar
|
|||
$Day = new Calendar_Day ($this->curr['year'], $this->curr['month'], $this->curr['day']);
|
||||
$Day->build();
|
||||
while ($Hour = $Day->fetch()) {
|
||||
$corrMonth = $Hour->thisMonth()<=12 ? sprintf('%02d', $Hour->thisMonth()) : '01'; ## due to bug in
|
||||
$corrYear = $Hour->thisMonth()<=12 ? $Day->thisYear() : $Hour->thisYear()+1; ## Calendar_Month_Weekdays
|
||||
// Next two lines are due to a bug in Calendar_Month_Weekdays
|
||||
$corrMonth = $Hour->thisMonth()<=12 ? sprintf('%02d', $Hour->thisMonth()) : '01';
|
||||
$corrYear = $Hour->thisMonth()<=12 ? $Day->thisYear() : $Hour->thisYear()+1;
|
||||
$this->Day[] = array(
|
||||
'day' => sprintf('%02d', $Hour->thisDay()),
|
||||
'week' => $this->_getWeekNr($Hour),
|
||||
|
@ -141,7 +152,9 @@ class uiCalendar
|
|||
|
||||
function buildHour()
|
||||
{
|
||||
if (is_array($this->Hour)) return;
|
||||
if (is_array($this->Hour)) {
|
||||
return;
|
||||
}
|
||||
|
||||
require_once('Calendar/Hour.php');
|
||||
|
||||
|
|
|
@ -124,7 +124,9 @@ $config = array_merge($config,
|
|||
'file_types' => array(
|
||||
'.mp3',
|
||||
'.wav',
|
||||
'.ogg'
|
||||
'.ogg',
|
||||
'.flac',
|
||||
'.aac'
|
||||
),
|
||||
'stream_types' => array(
|
||||
'application/ogg',
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
*/
|
||||
class uiExchange
|
||||
{
|
||||
var $Base;
|
||||
var $file;
|
||||
var $folder;
|
||||
private $Base;
|
||||
private $file;
|
||||
private $folder;
|
||||
|
||||
function uiExchange(&$uiBase)
|
||||
public function __construct(&$uiBase)
|
||||
{
|
||||
$this->Base =& $uiBase;
|
||||
$this->file =& $_SESSION['EXCHANGE']['file'];
|
||||
|
@ -103,8 +103,8 @@ class uiExchange
|
|||
{
|
||||
include('formmask/exchange.inc.php');
|
||||
$form = new HTML_QuickForm('BACKUP_Schedule', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
||||
$this->Base->_parseArr2Form($form, $mask['BACKUP.schedule']);
|
||||
$renderer =& new HTML_QuickForm_Renderer_Array(true, true);
|
||||
uiBase::parseArrayToForm($form, $mask['BACKUP.schedule']);
|
||||
$renderer = new HTML_QuickForm_Renderer_Array(true, true);
|
||||
$form->accept($renderer);
|
||||
return $renderer->toArray();
|
||||
}
|
||||
|
@ -113,7 +113,8 @@ class uiExchange
|
|||
/**
|
||||
* Copy a file or directory.
|
||||
*
|
||||
* @param string $target - path to file or directory
|
||||
* @param string $target
|
||||
* path to file or directory
|
||||
* @return boolean
|
||||
*/
|
||||
function copy2target($target)
|
||||
|
|
|
@ -9,8 +9,8 @@ define('ACTION_BASE', '/actions' ) ;
|
|||
* @version $Revision$
|
||||
*/
|
||||
class uiHandler extends uiBase {
|
||||
var $uiBase;
|
||||
var $redirUrl;
|
||||
public $uiBase;
|
||||
public $redirUrl;
|
||||
|
||||
/**
|
||||
* Initialize a new Browser Class
|
||||
|
@ -19,9 +19,9 @@ class uiHandler extends uiBase {
|
|||
* @param array $config
|
||||
* configurartion data
|
||||
*/
|
||||
function uiHandler($config)
|
||||
public function __construct($config)
|
||||
{
|
||||
$this->uiBase($config);
|
||||
parent::__construct($config);
|
||||
} // constructor
|
||||
|
||||
|
||||
|
@ -152,12 +152,12 @@ class uiHandler extends uiBase {
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
$this->_setMDataValue($r, UI_MDATA_KEY_TITLE, $formdata['mediafile']['name']);
|
||||
$this->setMetadataValue($r, UI_MDATA_KEY_TITLE, $formdata['mediafile']['name']);
|
||||
$this->transMData($r);
|
||||
|
||||
// set records in default language too
|
||||
if (UI_UPLOAD_LANGID !== UI_DEFAULT_LANGID) {
|
||||
$this->_setMDataValue($r, UI_MDATA_KEY_TITLE, $formdata['mediafile']['name'], UI_UPLOAD_LANGID);
|
||||
$this->setMetadataValue($r, UI_MDATA_KEY_TITLE, $formdata['mediafile']['name'], UI_UPLOAD_LANGID);
|
||||
$this->transMData($r, UI_UPLOAD_LANGID);
|
||||
}
|
||||
|
||||
|
@ -196,20 +196,20 @@ class uiHandler extends uiBase {
|
|||
return;
|
||||
}
|
||||
$this->_setMdataValue($id, UI_MDATA_KEY_DURATION, $this->gb->_secsToPlTime($ia['playtime_seconds']));
|
||||
$this->_setMDataValue($id, UI_MDATA_KEY_FORMAT, UI_MDATA_VALUE_FORMAT_FILE);
|
||||
$this->setMetadataValue($id, UI_MDATA_KEY_FORMAT, UI_MDATA_VALUE_FORMAT_FILE);
|
||||
|
||||
// some data from raw audio
|
||||
if (isset($ia['audio']['channels'])) {
|
||||
$this->_setMDataValue($id, UI_MDATA_KEY_CHANNELS, $ia['audio']['channels']);
|
||||
$this->setMetadataValue($id, UI_MDATA_KEY_CHANNELS, $ia['audio']['channels']);
|
||||
}
|
||||
if (isset($ia['audio']['sample_rate'])) {
|
||||
$this->_setMDataValue($id, UI_MDATA_KEY_SAMPLERATE, $ia['audio']['sample_rate']);
|
||||
$this->setMetadataValue($id, UI_MDATA_KEY_SAMPLERATE, $ia['audio']['sample_rate']);
|
||||
}
|
||||
if (isset($ia['audio']['bitrate'])) {
|
||||
$this->_setMDataValue($id, UI_MDATA_KEY_BITRATE, $ia['audio']['bitrate']);
|
||||
$this->setMetadataValue($id, UI_MDATA_KEY_BITRATE, $ia['audio']['bitrate']);
|
||||
}
|
||||
if (isset($ia['audio']['codec'])) {
|
||||
$this->_setMDataValue($id, UI_MDATA_KEY_ENCODER, $ia['audio']['codec']);
|
||||
$this->setMetadataValue($id, UI_MDATA_KEY_ENCODER, $ia['audio']['codec']);
|
||||
}
|
||||
|
||||
// from id3 Tags
|
||||
|
@ -256,9 +256,9 @@ class uiHandler extends uiBase {
|
|||
|
||||
$extent = sprintf('%02d', $formdata['length']['H']).':'.sprintf('%02d', $formdata['length']['i']).':'.sprintf('%02d', $formdata['length']['s']).'.000000';
|
||||
|
||||
$this->_setMDataValue($r, UI_MDATA_KEY_TITLE, $formdata['title']);
|
||||
$this->_setMDataValue($r, UI_MDATA_KEY_DURATION, $extent);
|
||||
$this->_setMDataValue($r, UI_MDATA_KEY_FORMAT, UI_MDATA_VALUE_FORMAT_STREAM);
|
||||
$this->setMetadataValue($r, UI_MDATA_KEY_TITLE, $formdata['title']);
|
||||
$this->setMetadataValue($r, UI_MDATA_KEY_DURATION, $extent);
|
||||
$this->setMetadataValue($r, UI_MDATA_KEY_FORMAT, UI_MDATA_VALUE_FORMAT_STREAM);
|
||||
|
||||
$this->redirUrl = UI_BROWSER."?act=addWebstreamMData&id=$r";
|
||||
if (UI_VERBOSE) {
|
||||
|
@ -277,9 +277,9 @@ class uiHandler extends uiBase {
|
|||
}
|
||||
$extent = sprintf('%02d', $formdata['length']['H']).':'.sprintf('%02d', $formdata['length']['i']).':'.sprintf('%02d', $formdata['length']['s']).'.000000';
|
||||
|
||||
$this->_setMDataValue($id, UI_MDATA_KEY_TITLE, $formdata['title']);
|
||||
$this->_setMDataValue($id, UI_MDATA_KEY_URL, $formdata['url']);
|
||||
$this->_setMDataValue($id, UI_MDATA_KEY_DURATION, $extent);
|
||||
$this->setMetadataValue($id, UI_MDATA_KEY_TITLE, $formdata['title']);
|
||||
$this->setMetadataValue($id, UI_MDATA_KEY_URL, $formdata['url']);
|
||||
$this->setMetadataValue($id, UI_MDATA_KEY_DURATION, $extent);
|
||||
|
||||
$this->redirUrl = UI_BROWSER.'?act=editItem&id='.$formdata['id'];
|
||||
if (UI_VERBOSE) {
|
||||
|
@ -302,7 +302,7 @@ class uiHandler extends uiBase {
|
|||
|
||||
foreach ($mask['pages'] as $key => $val) {
|
||||
foreach ($mask['pages'][$key] as $k => $v) {
|
||||
$formdata[$key.'___'.$this->_formElementEncode($v['element'])] ? $mData[$this->_formElementDecode($v['element'])] = $formdata[$key.'___'.$this->_formElementEncode($v['element'])] : NULL;
|
||||
$formdata[$key.'___'.uiBase::formElementEncode($v['element'])] ? $mData[uiBase::formElementDecode($v['element'])] = $formdata[$key.'___'.uiBase::formElementEncode($v['element'])] : NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -311,7 +311,7 @@ class uiHandler extends uiBase {
|
|||
}
|
||||
|
||||
foreach ($mData as $key => $val) {
|
||||
$r = $this->_setMDataValue($id, $key, $val, $curr_langid);
|
||||
$r = $this->setMetadataValue($id, $key, $val, $curr_langid);
|
||||
if (PEAR::isError($r)) {
|
||||
$this->_retMsg('Unable to set "$1" to value "$2".', $key, $val);
|
||||
}
|
||||
|
@ -542,7 +542,7 @@ class uiHandler extends uiBase {
|
|||
function _validateForm($formdata, $mask)
|
||||
{
|
||||
$form = new HTML_QuickForm('validation', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
||||
$this->_parseArr2Form($form, $mask, 'server');
|
||||
uiBase::parseArrayToForm($form, $mask, 'server');
|
||||
if (!$form->validate()) {
|
||||
$_SESSION['retransferFormData'] = $_REQUEST;
|
||||
return FALSE;
|
||||
|
|
|
@ -7,7 +7,8 @@ require_once(dirname(__FILE__).'/ui_conf.php');
|
|||
require_once(dirname(__FILE__).'/ui_handler.class.php');
|
||||
|
||||
## initialize objects ###############################################
|
||||
$uiHandler =& new uiHandler($config);
|
||||
$uiHandler = new uiHandler($config);
|
||||
$uiHandler->init();
|
||||
$uiBase =& $uiHandler;
|
||||
|
||||
include("../templates/loader/index.tpl");
|
||||
|
|
|
@ -7,17 +7,17 @@
|
|||
class uiHubBrowse extends uiBrowse
|
||||
{
|
||||
|
||||
function uiHubBrowse(&$uiBase)
|
||||
public function __construct(&$uiBase)
|
||||
{
|
||||
$this->Base =& $uiBase;
|
||||
$this->prefix = 'HUBBROWSE';
|
||||
$this->col =& $_SESSION[UI_HUBBROWSE_SESSNAME]['col'];
|
||||
$this->criteria =& $_SESSION[UI_HUBBROWSE_SESSNAME]['criteria'];
|
||||
#$this->results =& $_SESSION[UI_HUBBROWSE_SESSNAME]['results'];
|
||||
$this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
|
||||
$this->Base =& $uiBase;
|
||||
$this->prefix = 'HUBBROWSE';
|
||||
$this->col =& $_SESSION[UI_HUBBROWSE_SESSNAME]['col'];
|
||||
$this->criteria =& $_SESSION[UI_HUBBROWSE_SESSNAME]['criteria'];
|
||||
#$this->results =& $_SESSION[UI_HUBBROWSE_SESSNAME]['results'];
|
||||
$this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
|
||||
|
||||
if (empty($this->criteria['limit'])) {
|
||||
$this->criteria['limit'] = UI_BROWSE_DEFAULT_LIMIT;
|
||||
$this->criteria['limit'] = UI_BROWSE_DEFAULT_LIMIT;
|
||||
}
|
||||
if (empty($this->criteria['filetype'])) {
|
||||
$this->criteria['filetype'] = UI_FILETYPE_ANY;
|
||||
|
@ -53,8 +53,8 @@ class uiHubBrowse extends uiBrowse
|
|||
}
|
||||
$this->results['cnt'] = $results['cnt'];
|
||||
foreach ($results['results'] as $rec) {
|
||||
// TODO: maybe this _getMetaInfo is not correct for the remote results
|
||||
$this->results['items'][] = $this->Base->_getMetaInfo($this->Base->gb->_idFromGunid($rec));
|
||||
// TODO: maybe this getMetaInfo is not correct for the remote results
|
||||
$this->results['items'][] = $this->Base->getMetaInfo($this->Base->gb->_idFromGunid($rec));
|
||||
}
|
||||
$this->pagination($results);
|
||||
// echo '<XMP>this->results:'; print_r($this->results); echo "</XMP>\n";
|
||||
|
|
|
@ -6,13 +6,13 @@
|
|||
*/
|
||||
class uiHubSearch extends uiSearch {
|
||||
|
||||
function uiHubSearch(&$uiBase)
|
||||
public function __construct(&$uiBase)
|
||||
{
|
||||
$this->Base =& $uiBase;
|
||||
$this->prefix = 'HUBSEARCH';
|
||||
#$this->results =& $_SESSION[UI_HUBSEARCH_SESSNAME]['results'];
|
||||
$this->criteria =& $_SESSION[UI_HUBSEARCH_SESSNAME]['criteria'];
|
||||
$this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
|
||||
$this->Base =& $uiBase;
|
||||
$this->prefix = 'HUBSEARCH';
|
||||
#$this->results =& $_SESSION[UI_HUBSEARCH_SESSNAME]['results'];
|
||||
$this->criteria =& $_SESSION[UI_HUBSEARCH_SESSNAME]['criteria'];
|
||||
$this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
|
||||
|
||||
if (empty($this->criteria['limit'])) {
|
||||
$this->criteria['limit'] = UI_BROWSE_DEFAULT_LIMIT;
|
||||
|
@ -33,24 +33,24 @@ class uiHubSearch extends uiSearch {
|
|||
|
||||
function newSearch(&$formdata)
|
||||
{
|
||||
$this->results = NULL;
|
||||
$this->criteria['conditions'] = NULL;
|
||||
$this->criteria['offset'] = NULL;
|
||||
$this->criteria['form'] = NULL;
|
||||
$this->criteria['operator'] = $formdata['operator'];
|
||||
$this->criteria['filetype'] = $formdata['filetype'];
|
||||
$this->criteria['limit'] = $formdata['limit'];
|
||||
$this->criteria['counter'] = 0;
|
||||
$this->results = NULL;
|
||||
$this->criteria['conditions'] = NULL;
|
||||
$this->criteria['offset'] = NULL;
|
||||
$this->criteria['form'] = NULL;
|
||||
$this->criteria['operator'] = $formdata['operator'];
|
||||
$this->criteria['filetype'] = $formdata['filetype'];
|
||||
$this->criteria['limit'] = $formdata['limit'];
|
||||
$this->criteria['counter'] = 0;
|
||||
|
||||
// $criteria['form'] is used for retransfer to form
|
||||
$this->criteria['form']['operator'] = $formdata['operator'];
|
||||
$this->criteria['form']['filetype'] = $formdata['filetype'];
|
||||
$this->criteria['form']['limit'] = $formdata['limit'];
|
||||
$this->criteria['form']['limit'] = $formdata['limit'];
|
||||
|
||||
foreach ($formdata as $key=>$val) {
|
||||
foreach ($formdata as $key => $val) {
|
||||
if (is_array($val) && $val['active']) {
|
||||
$this->criteria['counter']++;
|
||||
$this->criteria['conditions'][$key] = array('cat' => $this->Base->_formElementDecode($val[0]),
|
||||
$this->criteria['conditions'][$key] = array('cat' => uiBase::formElementDecode($val[0]),
|
||||
'op' => $val[1],
|
||||
'val' => stripslashes($val[2])
|
||||
);
|
||||
|
@ -83,7 +83,7 @@ class uiHubSearch extends uiSearch {
|
|||
}
|
||||
foreach ($results['results'] as $rec) {
|
||||
$tmpId = $this->Base->gb->_idFromGunid($rec["gunid"]);
|
||||
$this->results['items'][] = $this->Base->_getMetaInfo($tmpId);
|
||||
$this->results['items'][] = $this->Base->getMetaInfo($tmpId);
|
||||
}
|
||||
$this->results['cnt'] = $results['cnt'];
|
||||
|
||||
|
@ -94,16 +94,18 @@ class uiHubSearch extends uiSearch {
|
|||
} // fn searchDB
|
||||
|
||||
|
||||
function getSearchResults($trtokid) {
|
||||
function getSearchResults($trtokid)
|
||||
{
|
||||
$this->results = array('page' => $this->criteria['offset']/$this->criteria['limit']);
|
||||
$results = $this->Base->gb->getSearchResults($trtokid);
|
||||
//echo"<pre><b>RESULTS:</b><br>";print_r($results);echo "</pre>";
|
||||
if (!is_array($results) || !count($results)) {
|
||||
return false;
|
||||
}
|
||||
$this->results['cnt'] = $results['cnt'];
|
||||
foreach ($results['results'] as $rec) {
|
||||
// TODO: maybe this _getMetaInfo is not correct for the remote results
|
||||
$this->results['items'][] = $this->Base->_getMetaInfo($this->Base->gb->_idFromGunid($rec));
|
||||
// TODO: maybe this getMetaInfo is not correct for the remote results
|
||||
$this->results['items'][] = $this->Base->getMetaInfo($this->Base->gb->_idFromGunid($rec));
|
||||
}
|
||||
$this->pagination($results);
|
||||
//echo '<XMP>this->results:'; print_r($this->results); echo "</XMP>\n";
|
||||
|
|
|
@ -6,12 +6,12 @@
|
|||
* @version $Revision$
|
||||
*/
|
||||
class jscom {
|
||||
var $prefix = 'jsc_';
|
||||
var $callables = array();
|
||||
var $method = 'POST';
|
||||
var $uri = '';
|
||||
private $prefix = 'jsc_';
|
||||
private $callables = array();
|
||||
private $method = 'POST';
|
||||
private $uri = '';
|
||||
|
||||
function jscom($calls = NULL, $pars = NULL)
|
||||
public function __construct($calls = NULL, $pars = NULL)
|
||||
{
|
||||
$this->uri = $_SERVER['REQUEST_URI'];
|
||||
if (!is_null($calls)) {
|
||||
|
|
|
@ -6,23 +6,25 @@
|
|||
*/
|
||||
class uiPlaylist
|
||||
{
|
||||
var $Base;
|
||||
var $activeId;
|
||||
var $changed;
|
||||
var $title;
|
||||
var $duration;
|
||||
var $token;
|
||||
var $reloadUrl;
|
||||
var $redirectUrl;
|
||||
var $returnUrl;
|
||||
public $activeId;
|
||||
public $title;
|
||||
public $duration;
|
||||
public $changed;
|
||||
public $token;
|
||||
|
||||
function uiPlaylist(&$uiBase)
|
||||
private $Base;
|
||||
private $reloadUrl;
|
||||
private $redirectUrl;
|
||||
private $returnUrl;
|
||||
private $flat;
|
||||
|
||||
public function __construct(&$uiBase)
|
||||
{
|
||||
$this->Base =& $uiBase;
|
||||
$this->activeId =& $_SESSION[UI_PLAYLIST_SESSNAME]['activeId'];
|
||||
$this->changed =& $_SESSION[UI_PLAYLIST_SESSNAME]['changed'];
|
||||
$this->title = $this->Base->_getMDataValue($this->activeId, UI_MDATA_KEY_TITLE);
|
||||
$this->duration = $this->Base->_getMDataValue($this->activeId, UI_MDATA_KEY_DURATION);
|
||||
$this->title = $this->Base->getMetadataValue($this->activeId, UI_MDATA_KEY_TITLE);
|
||||
$this->duration = $this->Base->getMetadataValue($this->activeId, UI_MDATA_KEY_DURATION);
|
||||
$this->token =& $_SESSION[UI_PLAYLIST_SESSNAME]['token'];
|
||||
$this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
|
||||
$this->redirectUrl = UI_BROWSER.'?popup[]=_2PL.simpleManagement&popup[]=_close';
|
||||
|
@ -100,14 +102,14 @@ class uiPlaylist
|
|||
if (UI_VERBOSE === TRUE) {
|
||||
print_r($token);
|
||||
}
|
||||
$this->Base->_retMsg('Unable to open playlist "$1".', $this->Base->_getMDataValue($plid, UI_MDATA_KEY_TITLE));
|
||||
$this->Base->_retMsg('Unable to open playlist "$1".', $this->Base->getMetadataValue($plid, UI_MDATA_KEY_TITLE));
|
||||
return FALSE;
|
||||
}
|
||||
$this->token = $token;
|
||||
$this->Base->gb->savePref($this->Base->sessid, UI_PL_ACCESSTOKEN_KEY, $plid.':'.$this->token);
|
||||
$this->activeId = $plid;
|
||||
if ($msg && UI_VERBOSE) {
|
||||
$this->Base->_retMsg('Playlist "$1" opened.', $this->Base->_getMDataValue($plid, UI_MDATA_KEY_TITLE));
|
||||
$this->Base->_retMsg('Playlist "$1" opened.', $this->Base->getMetadataValue($plid, UI_MDATA_KEY_TITLE));
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
@ -137,7 +139,7 @@ class uiPlaylist
|
|||
return FALSE;
|
||||
}
|
||||
if ($msg && UI_VERBOSE) {
|
||||
$this->Base->_retMsg('Playlist "$1" released.', $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($plgunid), UI_MDATA_KEY_TITLE));
|
||||
$this->Base->_retMsg('Playlist "$1" released.', $this->Base->getMetadataValue($this->Base->gb->_idFromGunid($plgunid), UI_MDATA_KEY_TITLE));
|
||||
}
|
||||
$this->activeId = NULL;
|
||||
$this->token = NULL;
|
||||
|
@ -155,7 +157,7 @@ class uiPlaylist
|
|||
$this->activate($tmpid, FALSE);
|
||||
$this->changed = FALSE;
|
||||
if (UI_VERBOSE) {
|
||||
$this->Base->_retMsg('Playlist "$1" saved.', $this->Base->_getMDataValue($tmpid, UI_MDATA_KEY_TITLE));
|
||||
$this->Base->_retMsg('Playlist "$1" saved.', $this->Base->getMetadataValue($tmpid, UI_MDATA_KEY_TITLE));
|
||||
}
|
||||
|
||||
return $this->activeId;
|
||||
|
@ -181,7 +183,7 @@ class uiPlaylist
|
|||
return FALSE;
|
||||
}
|
||||
if (UI_VERBOSE) {
|
||||
$this->Base->_retMsg('Playlist "$1" reverted.', $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($plgunid), UI_MDATA_KEY_TITLE));
|
||||
$this->Base->_retMsg('Playlist "$1" reverted.', $this->Base->getMetadataValue($this->Base->gb->_idFromGunid($plgunid), UI_MDATA_KEY_TITLE));
|
||||
}
|
||||
$this->activeId = NULL;
|
||||
$this->token = NULL;
|
||||
|
@ -306,8 +308,8 @@ class uiPlaylist
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
$this->Base->_setMDataValue($plid, UI_MDATA_KEY_CREATOR, $this->Base->login);
|
||||
$this->Base->_setMDataValue($plid, UI_MDATA_KEY_DESCRIPTION, tra('created at $1', $datetime));
|
||||
$this->Base->setMetadataValue($plid, UI_MDATA_KEY_CREATOR, $this->Base->login);
|
||||
$this->Base->setMetadataValue($plid, UI_MDATA_KEY_DESCRIPTION, tra('created at $1', $datetime));
|
||||
|
||||
if ($this->activate($plid)===FALSE) {
|
||||
return FALSE;
|
||||
|
@ -323,18 +325,16 @@ class uiPlaylist
|
|||
} // fn create
|
||||
|
||||
|
||||
function getFlat($id)
|
||||
public function getFlat($id)
|
||||
{
|
||||
unset($this->flat);
|
||||
$this->_plwalk($this->getPLArray($id));
|
||||
|
||||
if (is_Array($this->flat)) {
|
||||
if (count($this->flat) > 0) {
|
||||
reset($this->flat);
|
||||
$this->flat[key($this->flat)]['firstInList'] = true;
|
||||
end($this->flat);
|
||||
$this->flat[key($this->flat)]['lastInList'] = true;
|
||||
reset($this->flat);
|
||||
|
||||
return $this->flat;
|
||||
} else {
|
||||
return array();
|
||||
|
@ -342,16 +342,17 @@ class uiPlaylist
|
|||
} // fn getFlat
|
||||
|
||||
|
||||
function _plwalk($arr, $parent=0, $attrs=0)
|
||||
private function _plwalk($arr, $parent=0, $attrs=0)
|
||||
{
|
||||
foreach ($arr['children'] as $node=>$sub) {
|
||||
$this->flat = array();
|
||||
foreach ($arr['children'] as $node => $sub) {
|
||||
if ($sub['elementname']===UI_PL_ELEM_PLAYLIST) {
|
||||
$this->_plwalk($sub, $node, $sub['attrs']);
|
||||
}
|
||||
if ($sub['elementname']===UI_FILETYPE_AUDIOCLIP || $sub['elementname']===UI_FILETYPE_PLAYLIST) {
|
||||
#$this->flat["$parent.$node"] = $sub['attrs'];
|
||||
#$this->flat["$parent.$node"]['type'] = $sub['elementname'];
|
||||
$this->flat[$parent] = $this->Base->_getMetaInfo($this->Base->gb->_idFromGunid($sub['attrs']['id']));
|
||||
$this->flat[$parent] = $this->Base->getMetaInfo($this->Base->gb->_idFromGunid($sub['attrs']['id']));
|
||||
$this->flat[$parent]['attrs'] = $attrs;
|
||||
$this->flat[$parent]['playlength'] = $sub['attrs']['playlength'];
|
||||
}
|
||||
|
@ -535,9 +536,9 @@ class uiPlaylist
|
|||
$form->setConstants(array('id' => $id,
|
||||
'duration' => $duration)
|
||||
);
|
||||
$this->Base->_parseArr2Form($form, $mask[$type]);
|
||||
$this->Base->_parseArr2Form($form, $mask['all']);
|
||||
$renderer =& new HTML_QuickForm_Renderer_Array(true, true);
|
||||
uiBase::parseArrayToForm($form, $mask[$type]);
|
||||
uiBase::parseArrayToForm($form, $mask['all']);
|
||||
$renderer = new HTML_QuickForm_Renderer_Array(true, true);
|
||||
$form->accept($renderer);
|
||||
return $renderer->toArray();
|
||||
} // fn changeTransitionForm
|
||||
|
@ -546,9 +547,9 @@ class uiPlaylist
|
|||
function changeAllTransitionsForm($mask)
|
||||
{
|
||||
$form = new HTML_QuickForm('PL_changeTransition', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
||||
$this->Base->_parseArr2Form($form, $mask['transition']);
|
||||
$this->Base->_parseArr2Form($form, $mask['all']);
|
||||
$renderer =& new HTML_QuickForm_Renderer_Array(true, true);
|
||||
uiBase::parseArrayToForm($form, $mask['transition']);
|
||||
uiBase::parseArrayToForm($form, $mask['all']);
|
||||
$renderer = new HTML_QuickForm_Renderer_Array(true, true);
|
||||
$form->accept($renderer);
|
||||
return $renderer->toArray();
|
||||
} // fn changeAllTransitionsForm
|
||||
|
@ -565,13 +566,13 @@ class uiPlaylist
|
|||
} else {
|
||||
$mask['act']['constant'] = 'PL.addItem';
|
||||
$mask['id']['constant'] = $id;
|
||||
$mask['playlength']['default'] = substr($this->Base->_getMDataValue($id, UI_MDATA_KEY_DURATION), 0, 8);
|
||||
$mask['playlength']['default'] = substr($this->Base->getMetadataValue($id, UI_MDATA_KEY_DURATION), 0, 8);
|
||||
$mask['duration']['constant'] = $mask['playlength']['default'];
|
||||
}
|
||||
|
||||
$form = new HTML_QuickForm('PL_setItemPlaylengthForm', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
||||
$this->Base->_parseArr2Form($form, $mask);
|
||||
$renderer =& new HTML_QuickForm_Renderer_Array(true, true);
|
||||
uiBase::parseArrayToForm($form, $mask);
|
||||
$renderer = new HTML_QuickForm_Renderer_Array(true, true);
|
||||
$form->accept($renderer);
|
||||
return $renderer->toArray();
|
||||
} // fn setItemPlaylengthForm
|
||||
|
@ -584,29 +585,29 @@ class uiPlaylist
|
|||
$langid = $langid ? $langid : UI_DEFAULT_LANGID;
|
||||
|
||||
foreach ($mask['playlist'] as $k=>$v) {
|
||||
$mask['playlist'][$k]['element'] = $this->Base->_formElementEncode($v['element']);
|
||||
if ($getval = $this->Base->_getMDataValue($id, $v['element'], $langid)) {
|
||||
$mask['playlist'][$k]['element'] = uiBase::formElementEncode($v['element']);
|
||||
if ($getval = $this->Base->getMetadataValue($id, $v['element'], $langid)) {
|
||||
$mask['playlist'][$k]['default'] = $getval;
|
||||
$mask['playlist'][$k]['attributes']['onFocus'] = 'MData_confirmChange(this)';
|
||||
};
|
||||
}
|
||||
$form = new HTML_QuickForm('editMetaData', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
||||
$this->Base->_parseArr2Form($form, $mask['basics']);
|
||||
$this->Base->_parseArr2Form($form, $mask['playlist']);
|
||||
$this->Base->_parseArr2Form($form, $mask['buttons']);
|
||||
uiBase::parseArrayToForm($form, $mask['basics']);
|
||||
uiBase::parseArrayToForm($form, $mask['playlist']);
|
||||
uiBase::parseArrayToForm($form, $mask['buttons']);
|
||||
$form->setConstants(array('act' => 'PL.editMetaData',
|
||||
'id' => $id,
|
||||
'curr_langid' => $langid
|
||||
)
|
||||
);
|
||||
$renderer =& new HTML_QuickForm_Renderer_Array(true, true);
|
||||
$renderer = new HTML_QuickForm_Renderer_Array(true, true);
|
||||
$form->accept($renderer);
|
||||
$output['main'] = $renderer->toArray();
|
||||
|
||||
$form = new HTML_QuickForm('langswitch', UI_STANDARD_FORM_METHOD, UI_BROWSER);
|
||||
$this->Base->_parseArr2Form($form, $mask['langswitch']);
|
||||
uiBase::parseArrayToForm($form, $mask['langswitch']);
|
||||
$form->setConstants(array('target_langid' => $langid));
|
||||
$renderer =& new HTML_QuickForm_Renderer_Array(true, true);
|
||||
$renderer = new HTML_QuickForm_Renderer_Array(true, true);
|
||||
$form->accept($renderer);
|
||||
$output['langswitch'] = $renderer->toArray();
|
||||
|
||||
|
@ -632,7 +633,7 @@ class uiPlaylist
|
|||
}
|
||||
|
||||
foreach ($mask['playlist'] as $k=>$v) {
|
||||
$formdata[$this->Base->_formElementEncode($v['element'])] ? $mData[$this->Base->_formElementDecode($v['element'])] = $formdata[$this->Base->_formElementEncode($v['element'])] : NULL;
|
||||
$formdata[uiBase::formElementEncode($v['element'])] ? $mData[uiBase::formElementDecode($v['element'])] = $formdata[uiBase::formElementEncode($v['element'])] : NULL;
|
||||
}
|
||||
|
||||
if (!count($mData)) {
|
||||
|
@ -699,8 +700,8 @@ class uiPlaylist
|
|||
$mask['act']['constant'] = 'PL.export';
|
||||
$mask['id']['constant'] = $id;
|
||||
$form = new HTML_QuickForm('PL_exportForm', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
||||
$this->Base->_parseArr2Form($form, $mask);
|
||||
$renderer =& new HTML_QuickForm_Renderer_Array(true, true);
|
||||
uiBase::parseArrayToForm($form, $mask);
|
||||
$renderer = new HTML_QuickForm_Renderer_Array(true, true);
|
||||
$form->accept($renderer);
|
||||
return $renderer->toArray();
|
||||
} // fn exportForm
|
||||
|
@ -710,8 +711,8 @@ class uiPlaylist
|
|||
{
|
||||
$form = new HTML_QuickForm('PL_importForm', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
||||
//print_r($mask);
|
||||
$this->Base->_parseArr2Form($form, $mask);
|
||||
$renderer =& new HTML_QuickForm_Renderer_Array(true, true);
|
||||
uiBase::parseArrayToForm($form, $mask);
|
||||
$renderer = new HTML_QuickForm_Renderer_Array(true, true);
|
||||
$form->accept($renderer);
|
||||
return $renderer->toArray();
|
||||
} // fn importForm
|
||||
|
|
|
@ -5,45 +5,42 @@
|
|||
* @version $Revision$
|
||||
*/
|
||||
class uiScheduler extends uiCalendar {
|
||||
var $curr;
|
||||
var $scheduleAtTime;
|
||||
var $schedulePrev;
|
||||
var $scheduleNext;
|
||||
var $error;
|
||||
var $Base;
|
||||
var $reloadUrl;
|
||||
var $closeUrl;
|
||||
var $firstDayOfWeek;
|
||||
public $curr;
|
||||
private $scheduleAtTime;
|
||||
private $schedulePrev;
|
||||
private $scheduleNext;
|
||||
private $error;
|
||||
private $Base;
|
||||
private $reloadUrl;
|
||||
private $closeUrl;
|
||||
private $firstDayOfWeek;
|
||||
|
||||
|
||||
function uiScheduler(&$uiBase)
|
||||
public function __construct(&$uiBase)
|
||||
{
|
||||
$this->curr =& $_SESSION[UI_CALENDAR_SESSNAME]['current'];
|
||||
$this->curr =& $_SESSION[UI_CALENDAR_SESSNAME]['current'];
|
||||
$this->scheduleAtTime =& $_SESSION[UI_CALENDAR_SESSNAME]['scheduleAtTime'];
|
||||
$this->schedulePrev =& $_SESSION[UI_CALENDAR_SESSNAME]['schedulePrev'];
|
||||
$this->scheduleNext =& $_SESSION[UI_CALENDAR_SESSNAME]['scheduleNext'];
|
||||
$this->error =& $_SESSION['SCHEDULER']['error'];
|
||||
$this->error =& $_SESSION['SCHEDULER']['error'];
|
||||
$this->schedulePrev =& $_SESSION[UI_CALENDAR_SESSNAME]['schedulePrev'];
|
||||
$this->scheduleNext =& $_SESSION[UI_CALENDAR_SESSNAME]['scheduleNext'];
|
||||
$this->error =& $_SESSION['SCHEDULER']['error'];
|
||||
|
||||
if (!is_array($this->curr)) {
|
||||
$this->curr['view'] = UI_SCHEDULER_DEFAULT_VIEW;
|
||||
$this->curr['year'] = strftime("%Y");
|
||||
$this->curr['month'] = strftime("%m");
|
||||
$this->curr['week'] = strftime("%V");
|
||||
$this->curr['day'] = strftime("%d");
|
||||
$this->curr['hour'] = strftime("%H");
|
||||
$this->curr['dayname'] = strftime("%A");
|
||||
$this->curr['view'] = UI_SCHEDULER_DEFAULT_VIEW;
|
||||
$this->curr['year'] = strftime("%Y");
|
||||
$this->curr['month'] = strftime("%m");
|
||||
$this->curr['week'] = strftime("%V");
|
||||
$this->curr['day'] = strftime("%d");
|
||||
$this->curr['hour'] = strftime("%H");
|
||||
$this->curr['dayname'] = strftime("%A");
|
||||
$this->curr['monthname'] = strftime("%B");
|
||||
$this->curr['isToday'] = TRUE;
|
||||
$this->curr['isToday'] = TRUE;
|
||||
}
|
||||
|
||||
$this->Base =& $uiBase;
|
||||
$this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
|
||||
$this->closeUrl = UI_BROWSER.'?popup[]=_close';
|
||||
|
||||
$this->uiCalendar();
|
||||
$this->closeUrl = UI_BROWSER.'?popup[]=_close';
|
||||
parent::__construct();
|
||||
$this->initXmlRpc();
|
||||
|
||||
//$this->startDaemon();
|
||||
} // constructor
|
||||
|
||||
|
@ -298,8 +295,8 @@ class uiScheduler extends uiCalendar {
|
|||
'end' => substr($val['end'], strpos($val['end'], 'T')+1),
|
||||
'start_stamp' => $this->_datetime2timestamp($val['start']),
|
||||
'end_stamp' => $this->_datetime2timestamp($val['end']),
|
||||
'title' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE),
|
||||
'creator' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR),
|
||||
'title' => $this->Base->getMetadataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE),
|
||||
'creator' => $this->Base->getMetadataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR),
|
||||
'type' => 'Playlist'
|
||||
);
|
||||
}
|
||||
|
@ -338,8 +335,8 @@ class uiScheduler extends uiCalendar {
|
|||
'scheduleid'=> $val['id'],
|
||||
'start' => substr($val['start'], strpos($val['start'], 'T')+1),
|
||||
'end' => substr($val['end'], strpos($val['end'], 'T') + 1),
|
||||
'title' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE),
|
||||
'creator' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR),
|
||||
'title' => $this->Base->getMetadataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE),
|
||||
'creator' => $this->Base->getMetadataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR),
|
||||
'type' => 'Playlist',
|
||||
'endstoday' => strftime('%d', $start) === strftime('%d', $end) ? TRUE : FALSE,
|
||||
'endshere' => strftime('%H', $start) === strftime('%H', $end) ? TRUE : FALSE
|
||||
|
@ -360,8 +357,8 @@ class uiScheduler extends uiCalendar {
|
|||
'scheduleid'=> $val['id'],
|
||||
'start' => substr($val['start'], strpos($val['start'], 'T')+1),
|
||||
'end' => substr($val['end'], strpos($val['end'], 'T') + 1),
|
||||
'title' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE),
|
||||
'creator' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR),
|
||||
'title' => $this->Base->getMetadataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE),
|
||||
'creator' => $this->Base->getMetadataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR),
|
||||
'type' => 'Playlist',
|
||||
'startsyesterday' => strftime('%d', $start) === strftime('%d', $end) ? FALSE : TRUE,
|
||||
);
|
||||
|
@ -383,8 +380,8 @@ class uiScheduler extends uiCalendar {
|
|||
$items[date('H', $this->_datetime2timestamp($val['start']))][]= array (
|
||||
'start' => substr($val['start'], strpos($val['start'], 'T')+1),
|
||||
'end' => substr($val['end'], strpos($val['end'], 'T') + 1),
|
||||
'title' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE),
|
||||
'creator' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR),
|
||||
'title' => $this->Base->getMetadataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE),
|
||||
'creator' => $this->Base->getMetadataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR),
|
||||
);
|
||||
}
|
||||
#print_r($items);
|
||||
|
@ -403,8 +400,8 @@ class uiScheduler extends uiCalendar {
|
|||
}
|
||||
|
||||
foreach ($arr as $key => $val) {
|
||||
$arr[$key]['title'] = $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE);
|
||||
$arr[$key]['creator'] = $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR);
|
||||
$arr[$key]['title'] = $this->Base->getMetadataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE);
|
||||
$arr[$key]['creator'] = $this->Base->getMetadataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR);
|
||||
$arr[$key]['pos'] = $this->_datetime2timestamp($val['start']);
|
||||
$arr[$key]['span'] = date('H', $this->_datetime2timestamp($val['end'])) - date('H', $this->_datetime2timestamp($val['start'])) +1;
|
||||
}
|
||||
|
@ -446,7 +443,7 @@ class uiScheduler extends uiCalendar {
|
|||
//print_r($ui_fmask['schedule']);
|
||||
|
||||
$form = new HTML_QuickForm('schedule', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
||||
$this->Base->_parseArr2Form($form, $ui_fmask['schedule']);
|
||||
uiBase::parseArrayToForm($form, $ui_fmask['schedule']);
|
||||
$settime = array('H' => $this->scheduleAtTime['hour'],
|
||||
'i' => $this->scheduleAtTime['minute'],
|
||||
's' => $this->scheduleAtTime['second']
|
||||
|
@ -459,7 +456,7 @@ class uiScheduler extends uiCalendar {
|
|||
'date' => $setdate,
|
||||
));
|
||||
|
||||
$renderer =& new HTML_QuickForm_Renderer_Array(true, true);
|
||||
$renderer = new HTML_QuickForm_Renderer_Array(true, true);
|
||||
$form->accept($renderer);
|
||||
$output = $renderer->toArray();
|
||||
//print_r($output);
|
||||
|
@ -473,8 +470,8 @@ class uiScheduler extends uiCalendar {
|
|||
$this->Base->SCRATCHPAD->addItem($id);
|
||||
$this->availablePlaylists[] = array(
|
||||
'gunid' => $this->Base->gb->_gunidFromId($id),
|
||||
'title' => $this->Base->_getMDataValue($id, UI_MDATA_KEY_TITLE),
|
||||
'duration' => $this->Base->_getMDataValue($id, UI_MDATA_KEY_DURATION),
|
||||
'title' => $this->Base->getMetadataValue($id, UI_MDATA_KEY_TITLE),
|
||||
'duration' => $this->Base->getMetadataValue($id, UI_MDATA_KEY_DURATION),
|
||||
);
|
||||
return TRUE;
|
||||
} else {
|
||||
|
@ -643,6 +640,7 @@ class uiScheduler extends uiCalendar {
|
|||
return array(FALSE);
|
||||
}
|
||||
|
||||
$pStampArr = null;
|
||||
foreach ($pArr as $val) {
|
||||
#print_r($val);
|
||||
$pStampArr[] = array('start' => $this->_datetime2timestamp($val['start']),
|
||||
|
|
|
@ -171,45 +171,55 @@ $mdefs = array(
|
|||
|
||||
class SchedulerPhpClient {
|
||||
/**
|
||||
* Databases object reference
|
||||
* Databases object reference
|
||||
* @var DB
|
||||
*/
|
||||
var $dbc = NULL;
|
||||
/**
|
||||
* Array with methods description
|
||||
*/
|
||||
var $mdefs = array();
|
||||
/**
|
||||
* Confiduration array from ../conf.php
|
||||
*/
|
||||
var $config = array();
|
||||
/**
|
||||
* XMLRPC client object reference
|
||||
*/
|
||||
var $client = NULL;
|
||||
/**
|
||||
* Verbosity flag
|
||||
*/
|
||||
var $verbose = FALSE;
|
||||
/**
|
||||
* XMLRPC debug flag
|
||||
*/
|
||||
var $debug = 0;
|
||||
private $dbc = NULL;
|
||||
|
||||
/**
|
||||
* Constructor - please DON'T CALL IT, use factory method instead
|
||||
* Array with methods description
|
||||
* @var array
|
||||
*/
|
||||
private $mdefs = array();
|
||||
|
||||
/**
|
||||
* Confiduration array from ../conf.php
|
||||
* @var array
|
||||
*/
|
||||
private $config = array();
|
||||
|
||||
/**
|
||||
* XMLRPC client object reference
|
||||
* @var XMLRPC_Client
|
||||
*/
|
||||
private $client = NULL;
|
||||
|
||||
/**
|
||||
* Verbosity flag
|
||||
* @var boolean
|
||||
*/
|
||||
private $verbose = FALSE;
|
||||
|
||||
/**
|
||||
* XMLRPC debug flag
|
||||
* @var boolean
|
||||
*/
|
||||
private $debug = 0;
|
||||
|
||||
/**
|
||||
* Constructor - please DON'T CALL IT, use factory method instead
|
||||
*
|
||||
* @param DB $dbc
|
||||
* @param array $mdefs
|
||||
* hash array with methods description
|
||||
* @param array $config
|
||||
* hash array with configuration
|
||||
* @param int $debug
|
||||
* XMLRPC debug flag
|
||||
* @param boolean $verbose
|
||||
* @param DB $dbc
|
||||
* @param array $mdefs
|
||||
* hash array with methods description
|
||||
* @param array $config
|
||||
* hash array with configuration
|
||||
* @param int $debug
|
||||
* XMLRPC debug flag
|
||||
* @param boolean $verbose
|
||||
* verbosity flag
|
||||
*/
|
||||
function SchedulerPhpClient(
|
||||
&$dbc, $mdefs, $config, $debug=0, $verbose=FALSE)
|
||||
public function __construct(&$dbc, $mdefs, $config, $debug=0, $verbose=FALSE)
|
||||
{
|
||||
$this->dbc = $dbc;
|
||||
$this->mdefs = $mdefs;
|
||||
|
@ -252,7 +262,7 @@ class SchedulerPhpClient {
|
|||
* verbosity flag
|
||||
* @return object, created object instance
|
||||
*/
|
||||
function &factory(&$dbc, $mdefs, $config, $debug=0, $verbose=FALSE)
|
||||
public function &factory(&$dbc, $mdefs, $config, $debug=0, $verbose=FALSE)
|
||||
{
|
||||
$f = '';
|
||||
foreach ($mdefs as $fn => $farr) {
|
||||
|
@ -271,7 +281,7 @@ class SchedulerPhpClient {
|
|||
if (FALSE === eval($e)) {
|
||||
return $dbc->raiseError("Eval failed");
|
||||
}
|
||||
$spc =& new SchedulerPhpClientCore(
|
||||
$spc = new SchedulerPhpClientCore(
|
||||
$dbc, $mdefs, $config, $debug, $verbose);
|
||||
return $spc;
|
||||
} // fn factory
|
||||
|
@ -288,7 +298,7 @@ class SchedulerPhpClient {
|
|||
* @return array
|
||||
* PHP hash with response
|
||||
*/
|
||||
function callMethod($method, $gettedPars)
|
||||
public function callMethod($method, $gettedPars)
|
||||
{
|
||||
$parr = array();
|
||||
$XML_RPC_val = new XML_RPC_Value;
|
||||
|
|
|
@ -6,14 +6,14 @@
|
|||
*/
|
||||
class uiScratchPad
|
||||
{
|
||||
var $Base;
|
||||
var $items;
|
||||
var $order;
|
||||
var $reloadUrl;
|
||||
private $Base;
|
||||
private $items;
|
||||
private $order;
|
||||
private $reloadUrl;
|
||||
|
||||
function uiScratchPad(&$uiBase)
|
||||
public function __construct(&$uiBase)
|
||||
{
|
||||
$this->Base =& $uiBase;
|
||||
$this->Base =& $uiBase;
|
||||
$this->items =& $_SESSION[UI_SCRATCHPAD_SESSNAME]['content'];
|
||||
$this->order =& $_SESSION[UI_SCRATCHPAD_SESSNAME]['order'];
|
||||
$this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
|
||||
|
@ -46,8 +46,8 @@ class uiScratchPad
|
|||
|
||||
foreach ($arr as $gunid) {
|
||||
if (preg_match('/[0-9]{1,20}/', $gunid)) {
|
||||
if ($this->Base->gb->_idFromGunid($this->Base->_toHex($gunid)) != FALSE) {
|
||||
if ($i = $this->Base->_getMetaInfo($this->Base->gb->_idFromGunid($this->Base->_toHex($gunid)))) {
|
||||
if ($this->Base->gb->_idFromGunid($this->Base->toHex($gunid)) != FALSE) {
|
||||
if ($i = $this->Base->getMetaInfo($this->Base->gb->_idFromGunid($this->Base->toHex($gunid)))) {
|
||||
$this->items[] = $i;
|
||||
}
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ class uiScratchPad
|
|||
{
|
||||
foreach ($this->items as $val) {
|
||||
//$str .= $val['gunid'].':'.$val['added'].' '; ## new format ###
|
||||
$str .= $this->Base->_toInt8($val['gunid']).' '; ## Akos<6F> old format ###
|
||||
$str .= $this->Base->toInt8($val['gunid']).' '; ## Akos<6F> old format ###
|
||||
}
|
||||
$this->Base->gb->savePref($this->Base->sessid, UI_SCRATCHPAD_KEY, $str);
|
||||
} // fn save
|
||||
|
@ -87,7 +87,7 @@ class uiScratchPad
|
|||
|
||||
$sp = $this->get();
|
||||
foreach ($ids as $id) {
|
||||
$item = $this->Base->_getMetaInfo($id);
|
||||
$item = $this->Base->getMetaInfo($id);
|
||||
|
||||
foreach ($sp as $key=>$val) {
|
||||
if ($val['id'] == $item['id']) {
|
||||
|
@ -167,7 +167,7 @@ class uiScratchPad
|
|||
function reLoadM()
|
||||
{
|
||||
foreach($this->items as $key=>$val) {
|
||||
$this->items[$key] = $this->Base->_getMetaInfo($val['id']);
|
||||
$this->items[$key] = $this->Base->getMetaInfo($val['id']);
|
||||
}
|
||||
}
|
||||
} // class uiScratchPad
|
||||
|
|
|
@ -6,21 +6,21 @@
|
|||
*/
|
||||
class uiSearch
|
||||
{
|
||||
var $Base;
|
||||
var $prefix;
|
||||
var $criteria;
|
||||
var $reloadUrl;
|
||||
var $results;
|
||||
private $Base;
|
||||
private $prefix;
|
||||
private $criteria;
|
||||
private $reloadUrl;
|
||||
private $results;
|
||||
|
||||
function uiSearch(&$uiBase)
|
||||
public function __construct(&$uiBase)
|
||||
{
|
||||
$this->Base =& $uiBase;
|
||||
$this->prefix = 'SEARCH';
|
||||
//$this->results =& $_SESSION[UI_SEARCH_SESSNAME]['results'];
|
||||
$this->criteria =& $_SESSION[UI_SEARCH_SESSNAME]['criteria'];
|
||||
$this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
|
||||
$this->Base =& $uiBase;
|
||||
$this->prefix = 'SEARCH';
|
||||
//$this->results =& $_SESSION[UI_SEARCH_SESSNAME]['results'];
|
||||
$this->criteria =& $_SESSION[UI_SEARCH_SESSNAME]['criteria'];
|
||||
$this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
|
||||
if (empty($this->criteria['limit'])) {
|
||||
$this->criteria['limit'] = UI_BROWSE_DEFAULT_LIMIT;
|
||||
$this->criteria['limit'] = UI_BROWSE_DEFAULT_LIMIT;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ class uiSearch
|
|||
function searchForm($id, $mask2)
|
||||
{
|
||||
//print_r($this->criteria['form']);
|
||||
include dirname(__FILE__).'/formmask/metadata.inc.php';
|
||||
include(dirname(__FILE__).'/formmask/metadata.inc.php');
|
||||
$form = new HTML_QuickForm('search', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
||||
$counter = isset($this->criteria['counter']) ? $this->criteria['counter'] : 1;
|
||||
$form->setConstants(array('id'=>$id, 'counter'=>$counter));
|
||||
|
@ -55,11 +55,11 @@ class uiSearch
|
|||
foreach ($mask['pages'] as $key=>$val) {
|
||||
foreach ($mask['pages'][$key] as $v){
|
||||
if (isset($v['type']) && $v['type']) {
|
||||
$col1[$this->Base->_formElementEncode($v['element'])] = tra($v['label']);
|
||||
$col1[uiBase::formElementEncode($v['element'])] = tra($v['label']);
|
||||
if (isset($val['relation'])) {
|
||||
$col2[$this->Base->_formElementEncode($v['element'])] = $mask2['relations'][$v['relation']];
|
||||
$col2[uiBase::formElementEncode($v['element'])] = $mask2['relations'][$v['relation']];
|
||||
} else {
|
||||
$col2[$this->Base->_formElementEncode($v['element'])] = $mask2['relations']['standard'];
|
||||
$col2[uiBase::formElementEncode($v['element'])] = $mask2['relations']['standard'];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -101,11 +101,11 @@ class uiSearch
|
|||
$form->addElement('static', 's2', NULL, "</div id='searchRow_$n'>");
|
||||
}
|
||||
|
||||
$this->Base->_parseArr2Form($form, $mask2['search']);
|
||||
uiBase::parseArrayToForm($form, $mask2['search']);
|
||||
$constants = isset($this->criteria['form']) ? $this->criteria['form'] : null;
|
||||
$form->setConstants($constants);
|
||||
$form->validate();
|
||||
$renderer =& new HTML_QuickForm_Renderer_Array(true, true);
|
||||
$renderer = new HTML_QuickForm_Renderer_Array(true, true);
|
||||
$form->accept($renderer);
|
||||
$output['dynform'] = $renderer->toArray();
|
||||
//print_r($output);
|
||||
|
@ -134,7 +134,7 @@ class uiSearch
|
|||
foreach ($formdata as $key=>$val) {
|
||||
if (is_array($val) && $val['active']) {
|
||||
$this->criteria['counter']++;
|
||||
$this->criteria['conditions'][$key] = array('cat' => $this->Base->_formElementDecode($val[0]),
|
||||
$this->criteria['conditions'][$key] = array('cat' => uiBase::formElementDecode($val[0]),
|
||||
'op' => $val[1],
|
||||
'val' => stripslashes($val[2])
|
||||
);
|
||||
|
@ -152,8 +152,8 @@ class uiSearch
|
|||
function simpleSearchForm($mask)
|
||||
{
|
||||
$form = new HTML_QuickForm('simplesearch', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
||||
$this->Base->_parseArr2Form($form, $mask);
|
||||
$renderer =& new HTML_QuickForm_Renderer_Array(true, true);
|
||||
uiBase::parseArrayToForm($form, $mask);
|
||||
$renderer = new HTML_QuickForm_Renderer_Array(true, true);
|
||||
$form->accept($renderer);
|
||||
$output = $renderer->toArray();
|
||||
//print_r($output);
|
||||
|
@ -179,7 +179,7 @@ class uiSearch
|
|||
'op' => constant('UI_SIMPLESEARCH_OP'.$n),
|
||||
'val' => stripslashes($formdata['criterium'])
|
||||
);
|
||||
$this->criteria['form']['row_'.$n]= array(0 => $this->Base->_formElementEncode(constant('UI_SIMPLESEARCH_CAT'.$n)),
|
||||
$this->criteria['form']['row_'.$n]= array(0 => uiBase::formElementEncode(constant('UI_SIMPLESEARCH_CAT'.$n)),
|
||||
1 => constant('UI_SIMPLESEARCH_OP'.$n),
|
||||
2 => stripslashes($formdata['criterium'])
|
||||
);
|
||||
|
@ -206,7 +206,7 @@ class uiSearch
|
|||
}
|
||||
foreach ($results['results'] as $rec) {
|
||||
$tmpId = $this->Base->gb->_idFromGunid($rec["gunid"]);
|
||||
$this->results['items'][] = $this->Base->_getMetaInfo($tmpId);
|
||||
$this->results['items'][] = $this->Base->getMetaInfo($tmpId);
|
||||
}
|
||||
$this->results['cnt'] = $results['cnt'];
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
$Smarty->register_object('UIBROWSER', $uiBrowser);
|
||||
$Smarty->register_object('BROWSE', $uiBrowser->BROWSE);
|
||||
$Smarty->register_object('HUBBROWSE', $uiBrowser->HUBBROWSE);
|
||||
$Smarty->register_object('HUBBROWSE', $HUBBROWSE);
|
||||
$Smarty->register_object('SEARCH', $uiBrowser->SEARCH);
|
||||
$Smarty->register_object('HUBSEARCH', $uiBrowser->HUBSEARCH);
|
||||
$Smarty->register_object('TRANSFERS', $uiBrowser->TRANSFERS);
|
||||
|
|
|
@ -6,18 +6,17 @@
|
|||
*/
|
||||
class uiSubjects
|
||||
{
|
||||
public $Base;
|
||||
private $reloadUrl;
|
||||
private $suRedirUrl;
|
||||
private $redirUrl;
|
||||
|
||||
var $Base;
|
||||
var $reloadUrl;
|
||||
var $suRedirUrl;
|
||||
var $redirUrl;
|
||||
|
||||
function uiSubjects(&$uiBase)
|
||||
public function __construct(&$uiBase)
|
||||
{
|
||||
$this->Base =& $uiBase;
|
||||
$this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
|
||||
$this->Base =& $uiBase;
|
||||
$this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
|
||||
$this->suRedirUrl = UI_BROWSER.'?act=SUBJECTS';
|
||||
$this->redirUrl = UI_BROWSER.'?act=SUBJECTS';
|
||||
$this->redirUrl = UI_BROWSER.'?act=SUBJECTS';
|
||||
}
|
||||
|
||||
|
||||
|
@ -50,8 +49,8 @@ class uiSubjects
|
|||
include(dirname(__FILE__). '/formmask/subjects.inc.php');
|
||||
|
||||
$form = new HTML_QuickForm('addSubject', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
||||
$this->Base->_parseArr2Form($form, $mask[$type]);
|
||||
$renderer =& new HTML_QuickForm_Renderer_Array(true, true);
|
||||
uiBase::parseArrayToForm($form, $mask[$type]);
|
||||
$renderer = new HTML_QuickForm_Renderer_Array(true, true);
|
||||
$form->accept($renderer);
|
||||
return $renderer->toArray();
|
||||
}
|
||||
|
@ -145,9 +144,9 @@ class uiSubjects
|
|||
} else {
|
||||
$mask['chgPasswd']['cancel']['attributes'] = array('onClick' => 'location.href="'.UI_BROWSER.'"');
|
||||
}
|
||||
$this->Base->_parseArr2Form($form, $mask['chgPasswd']);
|
||||
uiBase::parseArrayToForm($form, $mask['chgPasswd']);
|
||||
$form->setConstants(array('login' => $login));
|
||||
$renderer =& new HTML_QuickForm_Renderer_Array(true, true);
|
||||
$renderer = new HTML_QuickForm_Renderer_Array(true, true);
|
||||
$form->accept($renderer);
|
||||
return $renderer->toArray();
|
||||
}
|
||||
|
|
|
@ -7,14 +7,14 @@
|
|||
*/
|
||||
class uiTransfers
|
||||
{
|
||||
var $Base;
|
||||
var $allItems;
|
||||
var $rows;
|
||||
var $trShowInfo;
|
||||
var $reloadUrl;
|
||||
private $Base;
|
||||
private $allItems;
|
||||
private $rows;
|
||||
private $trShowInfo;
|
||||
private $reloadUrl;
|
||||
|
||||
|
||||
function uiTransfers(&$uiBase)
|
||||
public function __construct(&$uiBase)
|
||||
{
|
||||
$this->Base =& $uiBase;
|
||||
$this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
|
||||
|
|
Loading…
Reference in New Issue