From: <ma...@us...> - 2012-04-29 16:58:49
|
Revision: 9405 http://xoops.svn.sourceforge.net/xoops/?rev=9405&view=rev Author: mageg Date: 2012-04-29 16:58:43 +0000 (Sun, 29 Apr 2012) Log Message: ----------- Correction in the new forms Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formelementtray.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formhidden.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formlabel.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/themeform.php XoopsCore/branches/2.6.x/2.6.0/htdocs/media/xoops/css/form.css XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_form.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/testform.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formelementtray.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formelementtray.php 2012-04-29 16:36:18 UTC (rev 9404) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formelementtray.php 2012-04-29 16:58:43 UTC (rev 9405) @@ -56,7 +56,7 @@ * @param string $delimiter * @param string $name */ - public function __construct($caption, $delimiter = " ", $name = "") + public function __construct($caption, $delimiter = " ", $name = "") { $this->setName($name); $this->setCaption($caption); @@ -158,21 +158,19 @@ { $count = 0; $ret = ""; - //$ret = "<div class='inline'>"; foreach ($this->getElements() as $ele) { /* @var XoopsFormElement $ele */ if ($count > 0) { $ret .= $this->getDelimiter(); } if ($ele->getCaption() != '') { - $ret .= $ele->getCaption() . " "; + $ret .= $ele->getCaption() . " "; } $ret .= $ele->render() . NWLINE; if (!$ele->isHidden()) { $count++; } } - //$ret .= "</div>"; return $ret; } } \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formhidden.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formhidden.php 2012-04-29 16:36:18 UTC (rev 9404) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formhidden.php 2012-04-29 16:58:43 UTC (rev 9405) @@ -50,6 +50,6 @@ */ public function render() { - return '<input type="hidden" name="' . $this->getName() . '" id="' . $this->getName() . '" value="' . $this->getValue() . '" >' . NWLINE; + return '<input type="hidden" name="' . $this->getName() . '" id="' . $this->getName() . rand(1,99) . '" value="' . $this->getValue() . '" >' . NWLINE; } } \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formlabel.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formlabel.php 2012-04-29 16:36:18 UTC (rev 9404) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formlabel.php 2012-04-29 16:58:43 UTC (rev 9405) @@ -50,6 +50,6 @@ */ public function render() { - return "<label class='text_label'>" . $this->getValue() . "</label>"; + return "<span>" . $this->getValue() . "</span>"; } } \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/themeform.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/themeform.php 2012-04-29 16:36:18 UTC (rev 9404) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/themeform.php 2012-04-29 16:58:43 UTC (rev 9405) @@ -86,25 +86,23 @@ $hidden = ''; foreach ($this->getElements() as $ele) { if (!$ele->isHidden()) { - if (!$ele instanceof XoopsFormRaw) { - $input['name'] = $ele->getName(); - $input['caption'] = $ele->getCaption(); - $input['description'] = $ele->getDescription(); - $input['ele'] = $ele->render(); - $input['required'] = $ele->isRequired(); - $input['pattern_description'] = $ele->getPatternDescription(); - $input['datalist'] = $ele->getDatalist(); - } else { - $ret .= $ele->render(); - } - $xoops->tpl->append_by_ref('input', $input); + $input['name'] = $ele->getName(); + $input['caption'] = $ele->getCaption(); + $input['description'] = $ele->getDescription(); + $input['ele'] = $ele->render(); + $input['required'] = $ele->isRequired(); + $input['pattern_description'] = $ele->getPatternDescription(); + $input['datalist'] = $ele->getDatalist(); + $xoops->tpl->append_by_ref('xo_input', $input); unset($input); } else { $hidden .= $ele->render(). NWLINE; } + } $xoops->tpl->assign('hidden', $hidden); $xoops->tpl->assign('validationJS', $this->renderValidationJS(true)); $xoops->tpl->display('module:system|system_form.html'); + $xoops->tpl->clear_assign('xo_input'); } } \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/media/xoops/css/form.css =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/media/xoops/css/form.css 2012-04-29 16:36:18 UTC (rev 9404) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/media/xoops/css/form.css 2012-04-29 16:58:43 UTC (rev 9405) @@ -19,6 +19,4 @@ color: #b94a48; } -.text_label{margin-top: 5px;} - .caption-required{color: #b94a48;} Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_form.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_form.html 2012-04-29 16:36:18 UTC (rev 9404) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_form.html 2012-04-29 16:58:43 UTC (rev 9405) @@ -2,12 +2,12 @@ <form class="form-horizontal" name="<{$name}>" id="<{$name}>" action="<{$action}>" method="<{$method}>" onsubmit="return xoopsFormValidate_<{$name}>();"<{$extra}>> <fieldset> <legend><{$title}></legend> - <{foreach item=input from=$input}> + <{foreach item=input from=$xo_input}> <{if $input.datalist != ''}> <{$input.datalist}> <{/if}> <div class="control-group"> - <label class="control-label" for="<{$input.name}>"><{$input.caption}><{if $input.required}><span class="caption-required">*</span><{/if}></label> + <label class="control-label"><{$input.caption}><{if $input.required}><span class="caption-required">*</span><{/if}></label> <div class="controls"> <{$input.ele}> <span class="dsc_pattern_horizontal"><{$input.pattern_description}></span> @@ -29,7 +29,7 @@ <{if $input.datalist != ''}> <{$input.datalist}> <{/if}> - <label for="<{$input.name}>"><{$input.caption}><{if $input.required}><span class="caption-required">*</span><{/if}></label> + <label><{$input.caption}><{if $input.required}><span class="caption-required">*</span><{/if}></label> <{$input.ele}> <{if $input.description != ''}> <span class="help-inline"><{$input.description}></span> @@ -49,7 +49,7 @@ <{if $input.datalist != ''}> <{$input.datalist}> <{/if}> - <label for="<{$input.name}>"><{$input.caption}><{if $input.required}><span class="caption-required">*</span><{/if}></label> + <label><{$input.caption}><{if $input.required}><span class="caption-required">*</span><{/if}></label> <{$input.ele}> <{if $input.description != ''}> <span class="help-inline"><{$input.description}></span> Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/testform.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/testform.php 2012-04-29 16:36:18 UTC (rev 9404) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/testform.php 2012-04-29 16:58:43 UTC (rev 9405) @@ -117,9 +117,18 @@ $form->addElement(new XoopsFormCaptcha('Captcha', 'captcha', false), true); -$testtray = new XoopsFormElementTray('Test tray', '<br>' ); -$testtray ->addElement($password); -$testtray ->addElement($code); +$testtray = new XoopsFormElementTray('Test tray'); +$select_tray = new XoopsFormSelect('Select_tray', 'select_tray', '', 4, true); +$select_tray->addOption(1, 'Select_tray 1'); +$select_tray->addOption(2, 'Select_tray 2'); +$select_tray->addOption(3, 'Select_tray 3'); +$select_tray->addOption(4, 'Select_tray 4'); +$select_tray->addOption(5, 'Select_tray 5'); +$select_tray->addOption(6, 'Select_tray 6'); +$select_tray->setDescription('Description Select_tray'); +$select_tray->setClass('span2'); +$testtray ->addElement($select_tray); +$testtray ->addElement($select_tray); $form->addElement($testtray); $button = new XoopsFormButton('', 'submit', _SUBMIT, 'submit'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |