diff --git a/livesupport/modules/htmlUI/var/conf.php b/livesupport/modules/htmlUI/var/conf.php index 38e75fafb..3823a44b1 100644 --- a/livesupport/modules/htmlUI/var/conf.php +++ b/livesupport/modules/htmlUI/var/conf.php @@ -23,7 +23,7 @@ Author : $Author: sebastian $ - Version : $Revision: 1.4 $ + Version : $Revision: 1.5 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/htmlUI/var/Attic/conf.php,v $ ------------------------------------------------------------------------------*/ diff --git a/livesupport/modules/htmlUI/var/elements.txt b/livesupport/modules/htmlUI/var/elements.txt deleted file mode 100644 index 9c2af78ec..000000000 --- a/livesupport/modules/htmlUI/var/elements.txt +++ /dev/null @@ -1,14 +0,0 @@ - \ No newline at end of file diff --git a/livesupport/modules/htmlUI/var/html/Smarty/ChangeLog b/livesupport/modules/htmlUI/var/html/Smarty/ChangeLog index f70bb2fa4..39a239636 100644 --- a/livesupport/modules/htmlUI/var/html/Smarty/ChangeLog +++ b/livesupport/modules/htmlUI/var/html/Smarty/ChangeLog @@ -2979,7 +2979,7 @@ * libs/Smarty.class.php libs/Smarty_Compiler.class.php: - added CVS $Id: ChangeLog,v 1.3 2005/02/08 15:09:25 sebastian Exp $ + added CVS $Id: ChangeLog,v 1.4 2005/02/09 16:50:18 sebastian Exp $ 2003-03-31 Messju Mohr diff --git a/livesupport/modules/htmlUI/var/html/Smarty/libs/Config_File.class.php b/livesupport/modules/htmlUI/var/html/Smarty/libs/Config_File.class.php index b329daecd..9713a239c 100644 --- a/livesupport/modules/htmlUI/var/html/Smarty/libs/Config_File.class.php +++ b/livesupport/modules/htmlUI/var/html/Smarty/libs/Config_File.class.php @@ -25,7 +25,7 @@ * @package Smarty */ -/* $Id: Config_File.class.php,v 1.3 2005/02/08 15:09:25 sebastian Exp $ */ +/* $Id: Config_File.class.php,v 1.4 2005/02/09 16:50:18 sebastian Exp $ */ /** * Config file reading class diff --git a/livesupport/modules/htmlUI/var/html/Smarty/libs/Smarty.class.php b/livesupport/modules/htmlUI/var/html/Smarty/libs/Smarty.class.php index d3fc94a8a..77a37c5b1 100644 --- a/livesupport/modules/htmlUI/var/html/Smarty/libs/Smarty.class.php +++ b/livesupport/modules/htmlUI/var/html/Smarty/libs/Smarty.class.php @@ -30,7 +30,7 @@ * @version 2.6.6 */ -/* $Id: Smarty.class.php,v 1.3 2005/02/08 15:09:25 sebastian Exp $ */ +/* $Id: Smarty.class.php,v 1.4 2005/02/09 16:50:18 sebastian Exp $ */ /** * DIR_SEP isn't used anymore, but third party apps might diff --git a/livesupport/modules/htmlUI/var/html/Smarty/libs/Smarty_Compiler.class.php b/livesupport/modules/htmlUI/var/html/Smarty/libs/Smarty_Compiler.class.php index ebd81fe59..137a4a64a 100644 --- a/livesupport/modules/htmlUI/var/html/Smarty/libs/Smarty_Compiler.class.php +++ b/livesupport/modules/htmlUI/var/html/Smarty/libs/Smarty_Compiler.class.php @@ -26,7 +26,7 @@ * @package Smarty */ -/* $Id: Smarty_Compiler.class.php,v 1.3 2005/02/08 15:09:25 sebastian Exp $ */ +/* $Id: Smarty_Compiler.class.php,v 1.4 2005/02/09 16:50:18 sebastian Exp $ */ /** * Template compiling class diff --git a/livesupport/modules/htmlUI/var/html/clock.php b/livesupport/modules/htmlUI/var/html/clock.php deleted file mode 100644 index 99a2fa4f6..000000000 --- a/livesupport/modules/htmlUI/var/html/clock.php +++ /dev/null @@ -1,178 +0,0 @@ - date('H'), - 'minute'=> date('m'), - 'second'=> date('s') -); - -?> - - - - - - - -server time is: -
-local time is:    - diff --git a/livesupport/modules/htmlUI/var/html/rightmouseclick.html b/livesupport/modules/htmlUI/var/html/rightmouseclick.html deleted file mode 100644 index a6fe8ac79..000000000 --- a/livesupport/modules/htmlUI/var/html/rightmouseclick.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - Untitled - - - - - - -xxxxx - - \ No newline at end of file diff --git a/livesupport/modules/htmlUI/var/html/templates/examples/smarty-dynamic-fancygroup.tpl b/livesupport/modules/htmlUI/var/html/templates/examples/smarty-dynamic-fancygroup.tpl index c33353bf2..e52e96f6c 100644 --- a/livesupport/modules/htmlUI/var/html/templates/examples/smarty-dynamic-fancygroup.tpl +++ b/livesupport/modules/htmlUI/var/html/templates/examples/smarty-dynamic-fancygroup.tpl @@ -1,4 +1,4 @@ - + diff --git a/livesupport/modules/htmlUI/var/html/templates/examples/smarty-dynamic-green.tpl b/livesupport/modules/htmlUI/var/html/templates/examples/smarty-dynamic-green.tpl index bac39ae55..973641baa 100644 --- a/livesupport/modules/htmlUI/var/html/templates/examples/smarty-dynamic-green.tpl +++ b/livesupport/modules/htmlUI/var/html/templates/examples/smarty-dynamic-green.tpl @@ -1,4 +1,4 @@ - + {$element.label}: diff --git a/livesupport/modules/htmlUI/var/html/templates/examples/smarty-dynamic.tpl b/livesupport/modules/htmlUI/var/html/templates/examples/smarty-dynamic.tpl index ac899e3b3..182c5ff54 100644 --- a/livesupport/modules/htmlUI/var/html/templates/examples/smarty-dynamic.tpl +++ b/livesupport/modules/htmlUI/var/html/templates/examples/smarty-dynamic.tpl @@ -1,5 +1,5 @@ - + Smarty template for Array renderer diff --git a/livesupport/modules/htmlUI/var/html/templates/form_parts/dynForm_plain.tpl b/livesupport/modules/htmlUI/var/html/templates/form_parts/dynForm_plain.tpl index e2e75d377..84cf3582e 100644 --- a/livesupport/modules/htmlUI/var/html/templates/form_parts/dynForm_plain.tpl +++ b/livesupport/modules/htmlUI/var/html/templates/form_parts/dynForm_plain.tpl @@ -29,11 +29,7 @@ {if $element.error}{$element.error}
{/if} {if $element.type eq "group"} - {foreach key=gkey item=gitem from=$element.elements} - {$gitem.label} - {$gitem.html}{if $gitem.required}*{/if} - {if $element.separator}{cycle values=$element.separator}{/if} - {/foreach} + {foreach key=gkey item=gitem from=$element.elements}{$gitem.label}{$gitem.html}{if $gitem.required}*{/if}{if $element.separator}{cycle values=$element.separator}{/if}{/foreach} {else} {$element.html} {/if} diff --git a/livesupport/modules/htmlUI/var/html/templates/metadataform.tpl b/livesupport/modules/htmlUI/var/html/templates/metadataform.tpl index f8c8d424f..e5978494e 100644 --- a/livesupport/modules/htmlUI/var/html/templates/metadataform.tpl +++ b/livesupport/modules/htmlUI/var/html/templates/metadataform.tpl @@ -38,11 +38,11 @@ function switchMDataLang() function spread(element, name) { - if (document.forms['metadata'].elements['Main-' + name]) document.forms['metadata'].elements['Main-' + name].value = element.value; - if (document.forms['metadata'].elements['Music_Basic-' + name]) document.forms['metadata'].elements['Music_Basic-' + name].value = element.value; - if (document.forms['metadata'].elements['Music_Advanced-' + name]) document.forms['metadata'].elements['Music_Advanced-' + name].value = element.value; - if (document.forms['metadata'].elements['Talk_Basic-' + name]) document.forms['metadata'].elements['Talk_Basic-' + name].value = element.value; - if (document.forms['metadata'].elements['Talk_Advanced-' + name]) document.forms['metadata'].elements['Talk_Advanced-' + name].value = element.value; + if (document.forms['metadata'].elements['Main__' + name]) document.forms['metadata'].elements['Main__' + name].value = element.value; + if (document.forms['metadata'].elements['Music_Basic__' + name]) document.forms['metadata'].elements['Music_Basic__' + name].value = element.value; + if (document.forms['metadata'].elements['Music_Advanced__' + name]) document.forms['metadata'].elements['Music_Advanced__' + name].value = element.value; + if (document.forms['metadata'].elements['Talk_Basic__' + name]) document.forms['metadata'].elements['Talk_Basic__' + name].value = element.value; + if (document.forms['metadata'].elements['Talk_Advanced__' + name]) document.forms['metadata'].elements['Talk_Advanced__' + name].value = element.value; } function showMain() diff --git a/livesupport/modules/htmlUI/var/html/templates/script/clock.js.tpl b/livesupport/modules/htmlUI/var/html/templates/script/clock.js.tpl index 994a5d669..54cec28c6 100644 --- a/livesupport/modules/htmlUI/var/html/templates/script/clock.js.tpl +++ b/livesupport/modules/htmlUI/var/html/templates/script/clock.js.tpl @@ -4,6 +4,12 @@ +function twoDigit(_v) +{ + _v = Math.round(_v); + if(_v<10) _v="0"+_v; + return _v; +} function MakeArrayday(size) { this.length = size; @@ -25,23 +31,16 @@ var seconds; var timer=null; function sClock() { - sinterval = 100; + sinterval = 100; // milliseconds {/literal} - hours= {$smarty.now|date_format:"%H"}; - minutes={$smarty.now|date_format:"%M"}; - seconds={$smarty.now|date_format:"%S"}; + hours = {$smarty.now|date_format:"%H"}; + minutes = {$smarty.now|date_format:"%M"}; + seconds = {$smarty.now|date_format:"%S"}; {literal} if(timer){clearInterval(timer);timer=null;} timer=setInterval("work();", sinterval); } -function twoDigit(_v) -{ - _v = Math.round(_v); - if(_v<10) _v="0"+_v; - return _v; -} - function work() { if (!document.layers && !document.all && !document.getElementById) return; @@ -110,7 +109,7 @@ var lseconds; var ltimer=null; function lClock() { - linterval = 100; + linterval = 100; // milliseconds var tDate = new Date(); lhours = tDate.getHours(); lminutes = tDate.getMinutes(); diff --git a/livesupport/modules/htmlUI/var/html/templates/script/search.js.tpl b/livesupport/modules/htmlUI/var/html/templates/script/search.js.tpl index 3cb77758a..7497dceb1 100644 --- a/livesupport/modules/htmlUI/var/html/templates/script/search.js.tpl +++ b/livesupport/modules/htmlUI/var/html/templates/script/search.js.tpl @@ -24,8 +24,8 @@ function hideRow(row) { document.getElementById('searchRow_' + row).style.visibility = 'hidden'; document.getElementById('searchRow_' + row).style.height = '0px'; - document.forms['search'].elements['row_' + Number(row) + '[0]'].value = ''; - document.forms['search'].elements['row_' + Number(row) + '[1]'].value = ''; + document.forms['search'].elements['row_' + Number(row) + '[0]'].options[0].selected=true; + document.forms['search'].elements['row_' + Number(row) + '[1]'].options[0].selected=true; document.forms['search'].elements['row_' + Number(row) + '[2]'].value = ''; } diff --git a/livesupport/modules/htmlUI/var/html/templates/smarty-static.tpl b/livesupport/modules/htmlUI/var/html/templates/smarty-static.tpl index da0682f58..125d8bdcc 100644 --- a/livesupport/modules/htmlUI/var/html/templates/smarty-static.tpl +++ b/livesupport/modules/htmlUI/var/html/templates/smarty-static.tpl @@ -1,5 +1,5 @@ - + Smarty template for ArraySmarty renderer: 2 column layout example diff --git a/livesupport/modules/htmlUI/var/html/ui_browser.php b/livesupport/modules/htmlUI/var/html/ui_browser.php index c8e7d6975..fdcd80e11 100644 --- a/livesupport/modules/htmlUI/var/html/ui_browser.php +++ b/livesupport/modules/htmlUI/var/html/ui_browser.php @@ -150,6 +150,6 @@ if ($uiBrowser->userid) { break; } } - + $Smarty->display('main.tpl'); ?> diff --git a/livesupport/modules/htmlUI/var/rules.html b/livesupport/modules/htmlUI/var/rules.html deleted file mode 100644 index 884a685b6..000000000 --- a/livesupport/modules/htmlUI/var/rules.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - -
-

 

-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Rule NameArgumentRule Description
requiredSome input is required in the field.
maxlength$lengthThe input can be at most $length characters.
minlength$lengthThe input must be at least $length - characters.
rangelength$min,$maxThe input must be between $min and $max characters - (inclusive).
regex$rxThe input must match the regular expression - $rx.
emailThe input must be a likely syntactically valid e-mail - address.*
emailorblankThe input must be blank or satisfy the email rule. -
lettersonlyThe input must contain only alphabetic - characters.
alphanumericThe input must contain only letters and numbers. -
numericThe input must contain a valid positive or negative - integer or decimal number.
nopunctuationThe input must not contain any of these characters: ( ) . - / * ^ ? # ! @ $ % + = , " ' > < ~ [ ] { }.
nonzeroThe input must not begin with zero.
uploadedfileThe element must contain a successfully uploaded - file.
maxfilesize$sizeThe uploaded file must be no more than $size - bytes.
mimetype$mimeThe uploaded file must have a MIME type of $mime. If - $mime is an array of MIME types, the uploaded file must have a MIME type - equal to one of the elements in $mime.
filename$file_rxThe uploaded file must have a filename that matches the - regular expression -$file_rx.

diff --git a/livesupport/modules/htmlUI/var/ui_base.inc.php b/livesupport/modules/htmlUI/var/ui_base.inc.php index 845cc7bf2..b491a3953 100644 --- a/livesupport/modules/htmlUI/var/ui_base.inc.php +++ b/livesupport/modules/htmlUI/var/ui_base.inc.php @@ -102,6 +102,12 @@ class uiBase $groupthose[] =& $elem[$val]; } $form->addGroup($groupthose, $v['name'], $this->tra($v['label']), $v['seperator'], $v['appendName']); + if ($v['rule']) { + $form->addRule($v['name'], isset($v['rulemsg']) ? $this->tra($v['rulemsg']) : $this->tra('$1 must be $2', $this->tra($v['name'])), $v['rule'], $v['format'], $side); + } + if ($v['grouprule']) { + $form->addGroupRule($v['name'], $v['arg1'], $v['grouprule'], $v['format'], $v['howmany'], $side, $v['reset']); + } unset($groupthose); } ## check error on type file ########## @@ -182,5 +188,36 @@ class uiBase } } + + + function _twoDigits($num) + { + if ($num < 10) + return ("0$num"); + else + return $num; + } + + + function _getDArr($format) + { + #$arr[''] = '00'; + switch($format) { + case 'h': + for($n=0; $n<=23; $n++) { + $arr[$this->_twoDigits($n)] = $this->_twoDigits($n); + } + break; + + case 'm': + case 's': + for($n=0; $n<=59; $n++) { + $arr[$this->_twoDigits($n)] = $this->_twoDigits($n); + } + break; + } + + return $arr; + } } ?> diff --git a/livesupport/modules/htmlUI/var/ui_browser.class.php b/livesupport/modules/htmlUI/var/ui_browser.class.php index eeeacff3a..3dcc28ffa 100644 --- a/livesupport/modules/htmlUI/var/ui_browser.class.php +++ b/livesupport/modules/htmlUI/var/ui_browser.class.php @@ -446,30 +446,19 @@ class uiBrowser extends uiBase { $form = new HTML_QuickForm('langswitch', UI_STANDARD_FORM_METHOD, UI_BROWSER); $this->_parseArr2Form($form, $mask['langswitch']); $output['langswitch'] = $form->toHTML(); - /* - ## multiple forms - $parts = array ('Main', 'Music_Basic', 'Music_Advanced', 'Talk_Basic', 'Talk_Advanced'); - foreach ($parts as $key) { - unset ($form); - $form = new HTML_QuickForm($key, UI_STANDARD_FORM_METHOD, UI_BROWSER); - $this->_parseArr2Form($form, $mask['pages'][$key]); - $this->_parseArr2Form($form, $mask['basics']); - $output['pages'][$key] = $form->toHTML(); - } */ - ## single form $form = new HTML_QuickForm('metadata', UI_STANDARD_FORM_METHOD, UI_HANDLER); $this->_parseArr2Form($form, $mask['basics']); $form->setConstants( array('id' => $id, - #!!!!!'langid' => array_pop($this->gb->getMDataValue($id, 'langid', $this->sessid)) - 'langid' => 'en' + #!!!!!'langid' => array_pop($this->gb->getMDataValue($id, 'langid', $this->sessid)) + 'langid' => 'en' ) ); ## convert element names to be unique over different forms-parts, add javascript to spread values over parts, add existing values from database foreach ($mask['tabs']['group']['group'] as $key) { foreach ($mask['pages'][$key] as $k=>$v) { - $mask['pages'][$key][$k]['element'] = $key.'-'.$v['element']; + $mask['pages'][$key][$k]['element'] = $key.'__'.$v['element']; $mask['pages'][$key][$k]['attributes'] = array ('onChange' => "spread(this, '".$v['element']."')"); ## recive data from GreenBox @@ -482,21 +471,11 @@ class uiBrowser extends uiBase { $mask['pages'][$key][$k]['default'] = $data[strtr($v['element'], '_', '.')]; } } - #$form->addElement('html', "
"); $form->addElement('static', NULL, NULL, "
"); $this->_parseArr2Form($form, $mask['pages'][$key]); $this->_parseArr2Form($form, $mask['buttons']); - #$form->addElement('html', "
"); $form->addElement('static', NULL, NULL, "
"); } - /* - $renderer = new HTML_QuickForm_Renderer_Default; - $renderer->setFormTemplate("\n\n
\n{content}\n
\n"); - #$renderer->setElementTemplate("\n\t
*{label}{error}
\t
{element}
\n\t"); - $renderer->setElementTemplate("\n\t
*{label}{error}
\t
{element}
\n\t"); - $form->accept($renderer); - $output['pages'][] = $renderer->toHTML(); - */ ## using Dynamic Smarty Renderer $renderer =& new HTML_QuickForm_Renderer_Array(true, true); diff --git a/livesupport/modules/htmlUI/var/ui_browser_init.php b/livesupport/modules/htmlUI/var/ui_browser_init.php index 80a732499..3ec3244ac 100644 --- a/livesupport/modules/htmlUI/var/ui_browser_init.php +++ b/livesupport/modules/htmlUI/var/ui_browser_init.php @@ -1,7 +1,6 @@ diff --git a/livesupport/modules/htmlUI/var/ui_fmask.inc.php b/livesupport/modules/htmlUI/var/ui_fmask.inc.php index afd155713..308ff4726 100644 --- a/livesupport/modules/htmlUI/var/ui_fmask.inc.php +++ b/livesupport/modules/htmlUI/var/ui_fmask.inc.php @@ -190,17 +190,50 @@ $ui_fmask = array( 'label' => 'Format', 'required' => TRUE, 'options' => array( + '' => '', 'File' => 'File', 'live stream' => 'Live Stream', 'networked file'=> 'Networked File', 'audio/mpeg' => 'audio/mpeg' ) ), + /* array( 'element' => 'Format_Extent', - 'type' => 'text', + 'type' => 'date', + 'options' => array( + 'format' => 'His' + ), 'label' => 'Format_Extent', - 'required' => TRUE, + 'required' => TRUE + ), */ + array( + 'element' => 'Format_Extent_h', + 'type' => 'select', + 'options' => $uiBase->_getDArr('h'), + 'groupit' => TRUE + ), + array( + 'element' => 'Format_Extent_m', + 'type' => 'select', + 'options' => $uiBase->_getDArr('m'), + 'groupit' => TRUE + ), + array( + 'element' => 'Format_Extent_s', + 'type' => 'select', + 'options' => $uiBase->_getDArr('h'), + 'groupit' => TRUE + ), + array( + 'group' => array('Main__Format_Extent_h', 'Main__Format_Extent_m', 'Main__Format_Extent_s'), + #'name' => 'gr_Format_Extent', + 'label' => 'Format_Extent', + 'rule' => 'required', + #'grouprule' => 'regex', + #'format' => '/([1-9]0)|([1-9]{2})|(0[1-9])/', + #'arg1' => 'Please enter Format_Extent', + #'howmany' => 1 ), ), 'Music_Basic' => array( @@ -263,9 +296,36 @@ $ui_fmask = array( 'label' => 'Description_Rating', 'rule' => 'numeric', ), + /* array( 'element' => 'Format_Extent', - 'type' => 'text', + 'type' => 'date', + 'options' => array( + 'format' => 'His' + ), + 'label' => 'Format_Extent' + ), */ + array( + 'element' => 'Format_Extent_h', + 'type' => 'select', + 'options' => $uiBase->_getDArr('h'), + 'groupit' => TRUE + ), + array( + 'element' => 'Format_Extent_m', + 'type' => 'select', + 'options' => $uiBase->_getDArr('m'), + 'groupit' => TRUE + ), + array( + 'element' => 'Format_Extent_s', + 'type' => 'select', + 'options' => $uiBase->_getDArr('h'), + 'groupit' => TRUE + ), + array( + 'group' => array('Music_Basic__Format_Extent_h', 'Music_Basic__Format_Extent_m', 'Music_Basic__Format_Extent_s'), + #'name' => 'gr_Format_Extent', 'label' => 'Format_Extent', ), ), @@ -743,4 +803,4 @@ $ui_fmask = array( ) ) ) -); +); diff --git a/livesupport/modules/htmlUI/var/ui_handler.class.php b/livesupport/modules/htmlUI/var/ui_handler.class.php index 1b1bd8879..7582bf707 100644 --- a/livesupport/modules/htmlUI/var/ui_handler.class.php +++ b/livesupport/modules/htmlUI/var/ui_handler.class.php @@ -444,7 +444,7 @@ class uiHandler extends uiBase { $this->redirUrl = UI_BROWSER.'?act=editMetaDataValues&id='.$formdata['id']; foreach ($mask['tabs']['group']['group'] as $key) { foreach ($mask['pages'][$key] as $k=>$v) { - $formdata[$key.'-'.$v['element']] ? $mData[strtr($v['element'], '_', '.')] = $formdata[$key.'-'.$v['element']] : NULL; + $formdata[$key.'__'.$v['element']] ? $mData[strtr($v['element'], '_', '.')] = $formdata[$key.'__'.$v['element']] : NULL; } } diff --git a/livesupport/modules/htmlUI/var/ui_handler_init.php b/livesupport/modules/htmlUI/var/ui_handler_init.php index 2b8a4be61..9262cba57 100644 --- a/livesupport/modules/htmlUI/var/ui_handler_init.php +++ b/livesupport/modules/htmlUI/var/ui_handler_init.php @@ -1,7 +1,6 @@