*** empty log message ***

This commit is contained in:
sebastian 2005-02-08 11:06:17 +00:00
parent fd7d616a61
commit b479e82348
8 changed files with 234 additions and 243 deletions

View File

@ -1,4 +1,4 @@
<?php <?php
require_once dirname(__FILE__).'/var/conf.php'; require_once dirname(__FILE__).'/var/conf.php';
header('LOCATION: var/html/'.UI_BROWSER); header ('LOCATION: var/html/'.UI_BROWSER);
?> ?>

View File

@ -23,7 +23,7 @@
Author : $Author: sebastian $ Author : $Author: sebastian $
Version : $Revision: 1.1 $ Version : $Revision: 1.2 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/htmlUI/var/Attic/conf.php,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/htmlUI/var/Attic/conf.php,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -122,4 +122,5 @@ define('UI_QFORM_REQUIREDNOTE', 'templates/form_parts/requirednote.tpl');
define('UI_QFORM_ERROR', 'templates/form_parts/error.tpl'); define('UI_QFORM_ERROR', 'templates/form_parts/error.tpl');
define('UI_SEARCH_MAX_ROWS', 8); define('UI_SEARCH_MAX_ROWS', 8);
define('UI_SEARCH_MIN_ROWS', 2); define('UI_SEARCH_MIN_ROWS', 2);
define('UI_REGEX_URL', '/^(ht|f)tps?:\/\/[^ ]+$/');
?> ?>

View File

@ -5,7 +5,7 @@
* @author Thomas Schulz <ths@4bconsult.de> * @author Thomas Schulz <ths@4bconsult.de>
* @author Alexey Borzov <borz_off@cs.msu.su> * @author Alexey Borzov <borz_off@cs.msu.su>
* *
* $Id: SmartyDynamic_example.php,v 1.1 2005/02/03 16:55:35 sebastian Exp $ * $Id: SmartyDynamic_example.php,v 1.2 2005/02/08 11:06:17 sebastian Exp $
*/ */
require_once 'HTML/QuickForm.php'; require_once 'HTML/QuickForm.php';

View File

@ -5,7 +5,7 @@
* @author Bertrand Mansion <bmansion@mamasam.com> * @author Bertrand Mansion <bmansion@mamasam.com>
* @author Thomas Schulz <ths@4bconsult.de> * @author Thomas Schulz <ths@4bconsult.de>
* *
* $Id: SmartyStatic_example.php,v 1.1 2005/02/03 16:55:35 sebastian Exp $ * $Id: SmartyStatic_example.php,v 1.2 2005/02/08 11:06:17 sebastian Exp $
*/ */
require_once 'HTML/QuickForm.php'; require_once 'HTML/QuickForm.php';

View File

@ -38,7 +38,7 @@ if (is_array($_REQUEST['popup'])){
}; };
$Smarty->assign('statusbar', $uiBrowser->getStationInfo()); $Smarty->assign('statusbar', $uiBrowser->getStationInfo($ui_fmask['systemPrefs']));
if ($uiBrowser->userid) { if ($uiBrowser->userid) {
$Smarty->assign('showMenuTop', TRUE); $Smarty->assign('showMenuTop', TRUE);
@ -85,7 +85,7 @@ if ($uiBrowser->userid) {
case "upload_2": case "upload_2":
$Smarty->assign('structure', $uiBrowser->getStructure($uiBrowser->id, $_REQUEST['act']=='getHomeDir' ? TRUE : FALSE)); $Smarty->assign('structure', $uiBrowser->getStructure($uiBrowser->id, $_REQUEST['act']=='getHomeDir' ? TRUE : FALSE));
$Smarty->assign('showPath', FALSE); $Smarty->assign('showPath', FALSE);
$Smarty->assign('mDataForm', $uiBrowser->getMetaDataForm($uiBrowser->id, $ui_fmask['mData'], FALSE, $uiBrowser->getInfo($id, 'array'))); $Smarty->assign('mDataForm', $uiBrowser->getMetaDataForm($uiBrowser->id, $ui_fmask['mData'], FALSE, $uiBrowser->getInfo($id, 'array')));
$Smarty->assign('showMetaDataForm', TRUE); $Smarty->assign('showMetaDataForm', TRUE);
break; break;
@ -140,7 +140,7 @@ if ($uiBrowser->userid) {
break; break;
case "getInfo": case "getInfo":
$Smarty->assign('fInfo', $uiBrowser->getInfo($uiBrowser->id)); $Smarty->assign('fInfo', $uiBrowser->getInfo($uiBrowser->id, 'text'));
$Smarty->assign('showFile', TRUE); $Smarty->assign('showFile', TRUE);
break; break;

View File

@ -51,11 +51,12 @@ class uiBrowser extends uiBase {
} }
function getStationInfo() function getStationInfo(&$mask)
{ {
$a['frequency'] = $this->gb->loadGroupPref($this->sessid, 'StationPrefs', 'frequency'); foreach ($mask as $key=>$val) {
$a['stationName'] = $this->gb->loadGroupPref($this->sessid, 'StationPrefs', 'stationName'); if ($val['type']=='text')
$a['stationLogoPath'] = $this->gb->loadGroupPref($this->sessid, 'StationPrefs', 'stationLogoPath'); $a[$val['element']] = is_string($this->gb->loadGroupPref($this->sessid, 'StationPrefs', $val['element'])) ? $this->gb->loadGroupPref($this->sessid, 'StationPrefs', $val['element']) : NULL;
}
return $a; return $a;
} }
@ -75,7 +76,7 @@ class uiBrowser extends uiBase {
$form->setRequiredNote(file_get_contents(UI_QFORM_REQUIREDNOTE)); $form->setRequiredNote(file_get_contents(UI_QFORM_REQUIREDNOTE));
$this->_parseArr2Form($form, $mask['loginform']); $this->_parseArr2Form($form, $mask['loginform']);
$this->_parseArr2Form($form, $mask['languages']); $this->_parseArr2Form($form, $mask['languages']);
## using Static Smarty Renderer ## using Static Smarty Renderer
$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($Smarty, true); $renderer =& new HTML_QuickForm_Renderer_ArraySmarty($Smarty, true);
$renderer->setRequiredTemplate(file_get_contents(UI_QFORM_REQUIRED)); $renderer->setRequiredTemplate(file_get_contents(UI_QFORM_REQUIRED));
@ -313,54 +314,29 @@ class uiBrowser extends uiBase {
foreach ($mask['mData']['tabs']['group']['group'] as $k=>$v) { foreach ($mask['mData']['tabs']['group']['group'] as $k=>$v) {
foreach ($mask['mData']['pages'][$v] as $val){ foreach ($mask['mData']['pages'][$v] as $val){
$options[$val['element']] = $val['element']; $options[$val['element']] = $val['element'];
if (isset($val['relation']))
$col2[$val['element']] = $mask['relations'][$val['relation']];
else
$col2[$val['element']] = $mask['relations']['standard'];
}; };
}; };
$col1 = $options;
for($n=1; $n<=UI_SEARCH_MAX_ROWS; $n++) { for($n=1; $n<=UI_SEARCH_MAX_ROWS; $n++) {
$advRow = array( unset ($group);
array(
'element' => 's1', $form->addElement('static', 's1', NULL, "<div id='searchRow_$n'>");
'type' => 'static',
'text' => "<div id='searchRow_$n'>" if ($n>$rowsBegin) $form->addElement('static', 's1_style', NULL, "<style type='text/css'>#searchRow_$n {visibility : hidden; height : 0px;}</style>");
), $sel = &$form->createElement('hierselect', "row_$n", NULL);
$n>$rowsBegin ? array( $sel->setOptions(array($col1, $col2));
'element' => 's1_style', $group[] = &$sel;
'type' => 'static', $group[] = &$form->createElement('text', 'criteria['.$n.']', NULL);
'text' => "<style type='text/css'>#searchRow_$n {visibility : hidden; height : 0px;}</style>" $group[] = &$form->createElement('button', "dropRow_$n", 'Drop', array('onClick' => "document.getElementById('searchRow_$n').style.visibility = 'hidden'; document.getElementById('searchRow_$n').style.height = '0px'"));
) : NULL, $form->addGroup($group);
array(
'element' => 'searchBy['.$n.']', $form->addElement('static', 's2', NULL, "</div id='searchRow_$n'>");
'type' => 'select',
'label' => 'Search by',
'groupit' => TRUE,
'options' => $options,
),
array(
'element' => 'relation['.$n.']',
'type' => 'select',
'groupit' => TRUE,
'options' => $mask['searchform.relations'],
'selected' => '=',
),
array(
'element' => 'criteria['.$n.']',
'type' => 'text',
'groupit' => TRUE
),
array(
'group' => array('searchBy['.$n.']', 'relation['.$n.']', 'criteria['.$n.']'),
'name' => NULL,
'label' => NULL,
'seperator' => '&nbsp;&nbsp;',
'appendName'=> NULL
),
$n>$rowsBegin ? array(
'element' => 's2',
'type' => 'static',
'text' => "</div id='searchRow_$n'>"
) : NULL,
);
$this->_parseArr2Form($form, $advRow);
} }

View File

@ -52,7 +52,7 @@ $ui_fmask = array(
array( array(
'rule' => 'regex', 'rule' => 'regex',
'element' => 'stationURL', 'element' => 'stationURL',
'format' => '/^[0-9]{5}$/', 'format' => UI_REGEX_URL,
'rulemsg' => 'URL seems not to be valid' 'rulemsg' => 'URL seems not to be valid'
), ),
array( array(
@ -167,29 +167,29 @@ $ui_fmask = array(
'pages' => array( 'pages' => array(
'Main' => array( 'Main' => array(
array( array(
'element' => 'Title', 'element' => 'Title',
'type' => 'text', 'type' => 'text',
'label' => 'Title', 'label' => 'Title',
'required'=> TRUE, 'required' => TRUE
), ),
array( array(
'element' => 'Creator', 'element' => 'Creator',
'type' => 'text', 'type' => 'text',
'label' => 'Creator', 'label' => 'Creator',
'required'=> TRUE, 'required' => TRUE
), ),
array( array(
'element' => 'Type_Genre', 'element' => 'Type_Genre',
'type' => 'text', 'type' => 'text',
'label' => 'Type_Genre', 'label' => 'Type_Genre',
'required'=> TRUE, 'required' => TRUE,
), ),
array( array(
'element' => 'Format', 'element' => 'Format',
'type' => 'select', 'type' => 'select',
'label' => 'Format', 'label' => 'Format',
'required'=> TRUE, 'required' => TRUE,
'options' => array( 'options' => array(
'File' => 'File', 'File' => 'File',
'live stream' => 'Live Stream', 'live stream' => 'Live Stream',
'networked file'=> 'Networked File', 'networked file'=> 'Networked File',
@ -197,33 +197,33 @@ $ui_fmask = array(
) )
), ),
array( array(
'element' => 'Format_Extent', 'element' => 'Format_Extent',
'type' => 'text', 'type' => 'text',
'label' => 'Format_Extent', 'label' => 'Format_Extent',
'required'=> TRUE, 'required' => TRUE,
), ),
), ),
'Music_Basic' => array( 'Music_Basic' => array(
array( array(
'element' => 'Title', 'element' => 'Title',
'type' => 'text', 'type' => 'text',
'label' => 'Title', 'label' => 'Title',
), ),
array( array(
'element' => 'Creator', 'element' => 'Creator',
'type' => 'text', 'type' => 'text',
'label' => 'Creator', 'label' => 'Creator',
), ),
array( array(
'element' => 'Source_Album', 'element' => 'Source_Album',
'type' => 'text', 'type' => 'text',
'label' => 'Source_Album', 'label' => 'Source_Album',
), ),
array( array(
'element' => 'Source_Year', 'element' => 'Source_Year',
'type' => 'date', 'type' => 'date',
'label' => 'Source_Year', 'label' => 'Source_Year',
'options' => array( 'options' => array(
'language' => 'en', 'language' => 'en',
'format' => 'dMY', 'format' => 'dMY',
'addEmptyOption'=> TRUE, 'addEmptyOption'=> TRUE,
@ -231,20 +231,20 @@ $ui_fmask = array(
) )
), ),
array( array(
'element' => 'Type_Genre', 'element' => 'Type_Genre',
'type' => 'text', 'type' => 'text',
'label' => 'Type_Genre', 'label' => 'Type_Genre',
), ),
array( array(
'element' => 'Description', 'element' => 'Description',
'type' => 'textarea', 'type' => 'textarea',
'label' => 'Description', 'label' => 'Description',
), ),
array( array(
'element' => 'Format', 'element' => 'Format',
'type' => 'select', 'type' => 'select',
'label' => 'Format', 'label' => 'Format',
'options' => array( 'options' => array(
'File' => 'File', 'File' => 'File',
'live stream' => 'Live Stream', 'live stream' => 'Live Stream',
'networked file'=> 'Networked File', 'networked file'=> 'Networked File',
@ -252,203 +252,204 @@ $ui_fmask = array(
) )
), ),
array( array(
'element' => 'Type_BPM', 'element' => 'Type_BPM',
'type' => 'text', 'type' => 'text',
'label' => 'Type_BPM', 'label' => 'Type_BPM',
'rule' => 'numeric', 'rule' => 'numeric',
), ),
array( array(
'element' => 'Description_Rating', 'element' => 'Description_Rating',
'type' => 'text', 'type' => 'text',
'label' => 'Description_Rating', 'label' => 'Description_Rating',
'rule' => 'numeric', 'rule' => 'numeric',
), ),
array( array(
'element' => 'Format_Extent', 'element' => 'Format_Extent',
'type' => 'text', 'type' => 'text',
'label' => 'Format_Extent', 'label' => 'Format_Extent',
), ),
), ),
'Music_Advanced'=> array( 'Music_Advanced'=> array(
array( array(
'element' => 'Creator_Role_Encoder', 'element' => 'Creator_Role_Encoder',
'type' => 'text', 'type' => 'text',
'label' => 'Creator_Role_Encoder', 'label' => 'Creator_Role_Encoder',
), ),
array( array(
'element' => 'Source_Album_TrackNumber', 'element' => 'Source_Album_TrackNumber',
'type' => '', 'type' => '',
'label' => 'Source_Album_TrackNumber', 'label' => 'Source_Album_TrackNumber',
'rule' => 'numeric', 'rule' => 'numeric',
), ),
array( array(
'element' => 'Source_Album_DiscNumber', 'element' => 'Source_Album_DiscNumber',
'type' => 'text', 'type' => 'text',
'label' => 'Source_Album_DiscNumber', 'label' => 'Source_Album_DiscNumber',
'rule' => 'numeric', 'rule' => 'numeric',
), ),
array( array(
'element' => 'Description_Mood', 'element' => 'Description_Mood',
'type' => 'text', 'type' => 'text',
'label' => 'Description_Mood', 'label' => 'Description_Mood',
), ),
array( array(
'element' => 'Publisher', 'element' => 'Publisher',
'type' => 'text', 'type' => 'text',
'label' => 'Publisher', 'label' => 'Publisher',
), ),
array( array(
'element' => 'Creator_Role_Composer', 'element' => 'Creator_Role_Composer',
'type' => 'text', 'type' => 'text',
'label' => 'Creator_Role_Composer', 'label' => 'Creator_Role_Composer',
), ),
array( array(
'element' => 'Format_Medium_Bitrate', 'element' => 'Format_Medium_Bitrate',
'type' => 'text', 'type' => 'text',
'label' => 'Format_Medium_Bitrate', 'label' => 'Format_Medium_Bitrate',
'rule' => 'numeric' 'rule' => 'numeric'
), ),
array( array(
'element' => 'Format_Medium_Channels', 'element' => 'Format_Medium_Channels',
'type' => 'select', 'type' => 'select',
'label' => 'Format_Medium_Channels', 'label' => 'Format_Medium_Channels',
'options' => array( 'options' => array(
'mono' => 'Mono', 'mono' => 'Mono',
'stereo' => 'Stereo', 'stereo' => 'Stereo',
'5.1' => '5.1' '5.1' => '5.1'
) )
), ),
array( array(
'element' => 'Format_Medium_Samplerate', 'element' => 'Format_Medium_Samplerate',
'type' => 'text', 'type' => 'text',
'label' => 'Format_Medium_Samplerate', 'label' => 'Format_Medium_Samplerate',
'rule' => 'numeric' 'rule' => 'numeric'
), ),
array( array(
'element' => 'Format_Medium_Encoder', 'element' => 'Format_Medium_Encoder',
'type' => 'text', 'type' => 'text',
'label' => 'Format_Medium_Encoder', 'label' => 'Format_Medium_Encoder',
), ),
array( array(
'element' => 'Format_CRC', 'element' => 'Format_CRC',
'type' => 'text', 'type' => 'text',
'label' => 'Format_CRC', 'label' => 'Format_CRC',
'rule' => 'numeric' 'rule' => 'numeric'
), ),
array( array(
'element' => 'Description_Lyrics', 'element' => 'Description_Lyrics',
'type' => 'textarea', 'type' => 'textarea',
'label' => 'Description_Lyrics', 'label' => 'Description_Lyrics',
), ),
array( array(
'element' => 'Creator_Role_Orchestra', 'element' => 'Creator_Role_Orchestra',
'type' => 'text', 'type' => 'text',
'label' => 'Creator_Role_Orchestra', 'label' => 'Creator_Role_Orchestra',
), ),
array( array(
'element' => 'Creator_Role_Conductor', 'element' => 'Creator_Role_Conductor',
'type' => 'text', 'type' => 'text',
'label' => 'Creator_Role_Conductor', 'label' => 'Creator_Role_Conductor',
), ),
array( array(
'element' => 'Creator_Role_Lyricist', 'element' => 'Creator_Role_Lyricist',
'type' => 'text', 'type' => 'text',
'label' => 'Creator_Role_Lyricist', 'label' => 'Creator_Role_Lyricist',
), ),
array( array(
'element' => 'Creator_Role_OriginalLyricist', 'element' => 'Creator_Role_OriginalLyricist',
'type' => 'text', 'type' => 'text',
'label' => 'Creator_Role_OriginalLyricist', 'label' => 'Creator_Role_OriginalLyricist',
), ),
array( array(
'element' => 'Creator_Role_RadioStationName', 'element' => 'Creator_Role_RadioStationName',
'type' => 'text', 'type' => 'text',
'label' => 'Creator_Role_RadioStationName', 'label' => 'Creator_Role_RadioStationName',
), ),
array( array(
'element' => 'Description_AudioFileInfoURL', 'element' => 'Description_AudioFileInfoURL',
'type' => 'text', 'type' => 'text',
'label' => 'Description_AudioFileInfoURL', 'label' => 'Description_AudioFileInfoURL',
), ),
array( array(
'element' => 'Description_ArtistURL', 'element' => 'Description_ArtistURL',
'type' => 'text', 'type' => 'text',
'label' => 'Description_ArtistURL', 'label' => 'Description_ArtistURL',
), ),
array( array(
'element' => 'Description_AudioSourceURL', 'element' => 'Description_AudioSourceURL',
'type' => 'text', 'type' => 'text',
'label' => 'Description_AudioSourceURL', 'label' => 'Description_AudioSourceURL',
), ),
array( array(
'element' => 'Description_RadioStationURL', 'element' => 'Description_RadioStationURL',
'type' => 'text', 'type' => 'text',
'label' => 'Description_RadioStationURL', 'label' => 'Description_RadioStationURL',
), ),
array( array(
'element' => 'Description_BuyCDURL', 'element' => 'Description_BuyCDURL',
'type' => 'text', 'type' => 'text',
'label' => 'Description_BuyCDURL', 'label' => 'Description_BuyCDURL',
), ),
array( array(
'element' => 'Identifier_ISRCNumber', 'element' => 'Identifier_ISRCNumber',
'type' => 'text', 'type' => 'text',
'label' => 'Identifier_ISRCNumber', 'label' => 'Identifier_ISRCNumber',
'rule' => 'numeric' 'rule' => 'numeric'
), ),
array( array(
'element' => 'Identifier_CatalogNumber', 'element' => 'Identifier_CatalogNumber',
'type' => 'text', 'type' => 'text',
'label' => 'Identifier_CatalogNumber', 'label' => 'Identifier_CatalogNumber',
'rule' => 'numeric' 'rule' => 'numeric'
), ),
array( array(
'element' => 'Creator_Role_OriginalArtist', 'element' => 'Creator_Role_OriginalArtist',
'type' => 'text', 'type' => 'text',
'label' => 'Creator_Role_OriginalArtist', 'label' => 'Creator_Role_OriginalArtist',
), ),
array( array(
'element' => 'Rights_Copyright', 'element' => 'Rights_Copyright',
'type' => 'text', 'type' => 'text',
'label' => 'Rights_Copyright', 'label' => 'Rights_Copyright',
), ),
), ),
'Talk_Basic' => array( 'Talk_Basic' => array(
array( array(
'element' => 'Title', 'element' => 'Title',
'type' => 'text', 'type' => 'text',
'label' => 'Title', 'label' => 'Title',
'relation' => 1
), ),
array( array(
'element' => 'Coverage', 'element' => 'Coverage',
'type' => 'text', 'type' => 'text',
'label' => 'Coverage', 'label' => 'Coverage',
), ),
array( array(
'element' => 'Description', 'element' => 'Description',
'type' => 'textarea', 'type' => 'textarea',
'label' => 'Description', 'label' => 'Description',
), ),
array( array(
'element' => 'Creator', 'element' => 'Creator',
'type' => 'text', 'type' => 'text',
'label' => 'Creator', 'label' => 'Creator',
), ),
array( array(
'element' => 'Subject', 'element' => 'Subject',
'type' => 'text', 'type' => 'text',
'label' => 'Subject', 'label' => 'Subject',
), ),
array( array(
'element' => 'Type_Genre', 'element' => 'Type_Genre',
'type' => 'text', 'type' => 'text',
'label' => 'Type_Genre', 'label' => 'Type_Genre',
), ),
array( array(
'element' => 'Format', 'element' => 'Format',
'type' => 'select', 'type' => 'select',
'label' => 'Format', 'label' => 'Format',
'options' => array( 'options' => array(
'File' => 'File', 'File' => 'File',
'live stream' => 'Live Stream', 'live stream' => 'Live Stream',
'networked file'=> 'Networked File', 'networked file'=> 'Networked File',
@ -458,19 +459,19 @@ $ui_fmask = array(
), ),
'Talk_Advanced' => array( 'Talk_Advanced' => array(
array( array(
'element' => 'Contributor', 'element' => 'Contributor',
'type' => 'text', 'type' => 'text',
'label' => 'Contributor', 'label' => 'Contributor',
), ),
array( array(
'element' => 'Language', 'element' => 'Language',
'type' => 'text', 'type' => 'text',
'label' => 'Language', 'label' => 'Language',
), ),
array( array(
'element' => 'Rights', 'element' => 'Rights',
'type' => 'text', 'type' => 'text',
'label' => 'Rights', 'label' => 'Rights',
), ),
) )
) )
@ -717,16 +718,23 @@ $ui_fmask = array(
array('group' => array('addRow', 'doSearch') array('group' => array('addRow', 'doSearch')
), ),
), ),
'searchform.relations' => 'relations' => array(
array( 'standard' => array(
'full' => 'full', 'full' => 'full',
'partial' => 'partial', 'partial' => 'partial',
'prefix' => 'prefix', 'prefix' => 'prefix',
'=' => '=' , '=' => '=' ,
'<' => '<', '<' => '<',
'<=' => '<=', '<=' => '<=',
'>' => '>', '>' => '>',
'>=' => '>=' '>=' => '>='
),
1 => array(
'full' => 'full',
'partial' => 'partial',
'prefix' => 'prefix',
'=' => '='
),
), ),
'languages' => array( 'languages' => array(
array( array(

View File

@ -463,18 +463,19 @@ class uiHandler extends uiBase {
$form = new HTML_QuickForm('validation', UI_STANDARD_FORM_METHOD, UI_HANDLER); $form = new HTML_QuickForm('validation', UI_STANDARD_FORM_METHOD, UI_HANDLER);
$this->_parseArr2Form($form, $mask, 'server'); $this->_parseArr2Form($form, $mask, 'server');
if (!$form->validate()) { if (!$form->validate()) {
$_SESSION['retransferFormData'] = $formdata; $_SESSION['retransferFormData'] = $_REQUEST;
return FALSE; return FALSE;
} }
## test for uploadet files bacause HTMLQuickForm::validate() ignores them #### ## test for uploadet files bacause HTMLQuickForm::validate() ignores them ####
foreach($mask as $k) { foreach($mask as $k) {
if ($k['type']=='file' && $k['required']==TRUE) { if ($k['type']=='file' && $k['required']==TRUE) {
if ($formdata[$k['element']]['error']) { if ($_FILES[$k['element']]['error']) {
$_SESSION['retransferFormData'] = $formdata; $_SESSION['retransferFormData'] = array_merge($_REQUEST, $_FILES);
return FALSE; return FALSE;
} }
} }
} }
reset($mask); reset($mask);
return TRUE; return TRUE;
} }
@ -488,7 +489,12 @@ class uiHandler extends uiBase {
if ($this->_validateForm($formdata, $mask)) { if ($this->_validateForm($formdata, $mask)) {
foreach($mask as $key=>$val) { foreach($mask as $key=>$val) {
if ($this->_isTextInput ($val['type'], $mask)) $this->gb->saveGroupPref($this->sessid, 'StationPrefs', $val['element'], $formdata[$val['element']]); if ($this->_isTextInput ($val['type'], $mask)) {
if (strlen($formdata[$val['element']]))
$this->gb->saveGroupPref($this->sessid, 'StationPrefs', $val['element'], $formdata[$val['element']]);
else
$this->gb->delGroupPref($this->sessid, 'StationPrefs', $val['element']);
}
if ($val['type'] == 'file' && $formdata[$val['element']]['name']) { if ($val['type'] == 'file' && $formdata[$val['element']]['name']) {
if (FALSE === @move_uploaded_file($formdata[$val['element']]['tmp_name'], $this->gb->loadGroupPref($this->sessid, 'StationPrefs', 'stationLogoPath'))) if (FALSE === @move_uploaded_file($formdata[$val['element']]['tmp_name'], $this->gb->loadGroupPref($this->sessid, 'StationPrefs', 'stationLogoPath')))
$this->alertMsg = $this->tra('Error uploading Logo'); $this->alertMsg = $this->tra('Error uploading Logo');