Minahito
minah****@users*****
2006年 9月 22日 (金) 18:18:16 JST
Index: xoops2jp/html/class/xoopsform/grouppermform.php diff -u xoops2jp/html/class/xoopsform/grouppermform.php:1.2.8.1 xoops2jp/html/class/xoopsform/grouppermform.php:1.2.8.2 --- xoops2jp/html/class/xoopsform/grouppermform.php:1.2.8.1 Wed Aug 9 18:48:10 2006 +++ xoops2jp/html/class/xoopsform/grouppermform.php Fri Sep 22 18:18:14 2006 @@ -1,5 +1,5 @@ <?php -// $Id: grouppermform.php,v 1.2.8.1 2006/08/09 09:48:10 minahito Exp $ +// $Id: grouppermform.php,v 1.2.8.2 2006/09/22 09:18:14 minahito Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000-2003 XOOPS.org // @@ -55,7 +55,7 @@ * * @var array */ - var $_itemTree; + var $_itemTree = array(); /** * Name of permission * @@ -151,24 +151,18 @@ $tray->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); $tray->addElement(new XoopsFormButton('', 'reset', _CANCEL, 'reset')); $this->addElement($tray); - $ret = '<h4>' . $this->getTitle() . '</h4>' . $this->_permDesc . '<br />'; - $ret .= "<form name='" . $this->getName() . "' id='" . $this->getName() . "' action='" . $this->getAction() . "' method='" . $this->getMethod() . "'" . $this->getExtra() . ">\n<table width='100%' class='outer' cellspacing='1'>\n"; - $elements =& $this->getElements(); - foreach (array_keys($elements) as $i) { - if (!is_object($elements[$i])) { - $ret .= $elements[$i]; - } elseif (!$elements[$i]->isHidden()) { - $ret .= "<tr valign='top' align='left'><td class='head'>" . $elements[$i]->getCaption(); - if ($elements[$i]->getDescription() != '') { - $ret .= '<br /><br /><span style="font-weight: normal;">' . $elements[$i]->getDescription() . '</span>'; - } - $ret .= "</td>\n<td class='even'>\n" . $elements[$i]->render() . "\n</td></tr>\n"; - } else { - $ret .= $elements[$i]->render(); - } - } - $ret .= '</table></form>'; - return $ret; + + $root =& XCube_Root::getSingleton(); + $renderTarget =& new Legacy_RenderTargetMain(); + + $renderTarget->setModuleName("base"); + $renderTarget->setTemplateName("legacy_xoopsform_grouppermform.html"); + $renderTarget->setAttribute("form", $this); + + $renderer =& $root->getRenderSystem(LEGACY_DEPENDENCE_RENDERER); + $renderer->renderWithTarget($renderTarget); + + return $renderTarget->getResult(); } } @@ -199,7 +193,7 @@ * * @var array */ - var $_optionTree; + var $_optionTree = array(); /** * Constructor @@ -241,7 +235,7 @@ { $this->_optionTree =& $optionTree; } - + /** * Renders checkbox options for this group * @@ -252,6 +246,8 @@ { $ret = '<table class="outer"><tr><td class="odd"><table><tr>'; $cols = 1; + + if ($this->_hasChildren()) foreach ($this->_optionTree[0]['children'] as $topitem) { if ($cols > 4) { $ret .= '</tr><tr>'; @@ -264,6 +260,7 @@ $cols++; } $ret .= '</tr></table></td><td class="even">'; + $option_ids = array(); foreach (array_keys($this->_optionTree) as $id) { if (!empty($id)) { $option_ids[] = "'".$this->getName().'[groups]['.$this->_groupId.']['.$id.']'."'"; @@ -315,5 +312,14 @@ } } } + + /** + * Gets a value indicating whether this object has children. + * @return bool + */ + function _hasChildren() + { + return isset($this->_optionTree[0]) && is_array($this->_optionTree[0]['children']); + } } ?> \ No newline at end of file Index: xoops2jp/html/class/xoopsform/formlabel.php diff -u xoops2jp/html/class/xoopsform/formlabel.php:1.2 xoops2jp/html/class/xoopsform/formlabel.php:1.2.8.1 --- xoops2jp/html/class/xoopsform/formlabel.php:1.2 Fri Mar 18 21:51:55 2005 +++ xoops2jp/html/class/xoopsform/formlabel.php Fri Sep 22 18:18:15 2006 @@ -1,5 +1,5 @@ <?php -// $Id: formlabel.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $ +// $Id: formlabel.php,v 1.2.8.1 2006/09/22 09:18:15 minahito Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -79,7 +79,17 @@ * @return string */ function render(){ - return $this->getValue(); + $root =& XCube_Root::getSingleton(); + $renderTarget =& new Legacy_RenderTargetMain(); + + $renderTarget->setModuleName("base"); + $renderTarget->setTemplateName("legacy_xoopsform_label.html"); + $renderTarget->setAttribute("element", $this); + + $renderer =& $root->getRenderSystem(LEGACY_DEPENDENCE_RENDERER); + $renderer->renderWithTarget($renderTarget); + + return $renderTarget->getResult(); } } ?> \ No newline at end of file Index: xoops2jp/html/class/xoopsform/formradio.php diff -u xoops2jp/html/class/xoopsform/formradio.php:1.2 xoops2jp/html/class/xoopsform/formradio.php:1.2.8.1 --- xoops2jp/html/class/xoopsform/formradio.php:1.2 Fri Mar 18 21:51:55 2005 +++ xoops2jp/html/class/xoopsform/formradio.php Fri Sep 22 18:18:15 2006 @@ -1,5 +1,5 @@ <?php -// $Id: formradio.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $ +// $Id: formradio.php,v 1.2.8.1 2006/09/22 09:18:15 minahito Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -60,7 +60,7 @@ * @var string * @access private */ - var $_value; + var $_value = null; /** * Constructor @@ -137,16 +137,17 @@ * @return string HTML */ function render(){ - $ret = ""; - foreach ( $this->getOptions() as $value => $name ) { - $ret .= "<input type='radio' name='".$this->getName()."' value='".$value."'"; - $selected = $this->getValue(); - if ( isset($selected) && ($value == $selected) ) { - $ret .= " checked='checked'"; - } - $ret .= $this->getExtra()." />".$name."\n"; - } - return $ret; + $root =& XCube_Root::getSingleton(); + $renderTarget =& new Legacy_RenderTargetMain(); + + $renderTarget->setModuleName("base"); + $renderTarget->setTemplateName("legacy_xoopsform_radio.html"); + $renderTarget->setAttribute("element", $this); + + $renderer =& $root->getRenderSystem(LEGACY_DEPENDENCE_RENDERER); + $renderer->renderWithTarget($renderTarget); + + return $renderTarget->getResult(); } } ?> \ No newline at end of file Index: xoops2jp/html/class/xoopsform/formtextarea.php diff -u xoops2jp/html/class/xoopsform/formtextarea.php:1.2 xoops2jp/html/class/xoopsform/formtextarea.php:1.2.8.1 --- xoops2jp/html/class/xoopsform/formtextarea.php:1.2 Fri Mar 18 21:51:55 2005 +++ xoops2jp/html/class/xoopsform/formtextarea.php Fri Sep 22 18:18:16 2006 @@ -1,5 +1,5 @@ <?php -// $Id: formtextarea.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $ +// $Id: formtextarea.php,v 1.2.8.1 2006/09/22 09:18:16 minahito Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -127,7 +127,17 @@ * @return sting HTML */ function render(){ - return "<textarea name='".$this->getName()."' id='".$this->getName()."' rows='".$this->getRows()."' cols='".$this->getCols()."'".$this->getExtra().">".$this->getValue()."</textarea>"; + $root =& XCube_Root::getSingleton(); + $renderTarget =& new Legacy_RenderTargetMain(); + + $renderTarget->setModuleName("base"); + $renderTarget->setTemplateName("legacy_xoopsform_textarea.html"); + $renderTarget->setAttribute("element", $this); + + $renderer =& $root->getRenderSystem(LEGACY_DEPENDENCE_RENDERER); + $renderer->renderWithTarget($renderTarget); + + return $renderTarget->getResult(); } } ?> \ No newline at end of file Index: xoops2jp/html/class/xoopsform/simpleform.php diff -u xoops2jp/html/class/xoopsform/simpleform.php:1.2 xoops2jp/html/class/xoopsform/simpleform.php:1.2.8.1 --- xoops2jp/html/class/xoopsform/simpleform.php:1.2 Fri Mar 18 21:51:55 2005 +++ xoops2jp/html/class/xoopsform/simpleform.php Fri Sep 22 18:18:16 2006 @@ -1,5 +1,5 @@ <?php -// $Id: simpleform.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $ +// $Id: simpleform.php,v 1.2.8.1 2006/09/22 09:18:16 minahito Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -61,16 +61,17 @@ */ function render() { - $ret = $this->getTitle()."\n<form name='".$this->getName()."' id='".$this->getName()."' action='".$this->getAction()."' method='".$this->getMethod()."'".$this->getExtra().">\n"; - foreach ( $this->getElements() as $ele ) { - if ( !$ele->isHidden() ) { - $ret .= "<b>".$ele->getCaption()."</b><br />".$ele->render()."<br />\n"; - } else { - $ret .= $ele->render()."\n"; - } - } - $ret .= "</form>\n"; - return $ret; + $root =& XCube_Root::getSingleton(); + $renderTarget =& new Legacy_RenderTargetMain(); + + $renderTarget->setModuleName("base"); + $renderTarget->setTemplateName("legacy_xoopsform_simpleform.html"); + $renderTarget->setAttribute("form", $this); + + $renderer =& $root->getRenderSystem(LEGACY_DEPENDENCE_RENDERER); + $renderer->renderWithTarget($renderTarget); + + return $renderTarget->getResult(); } } ?> \ No newline at end of file Index: xoops2jp/html/class/xoopsform/tableform.php diff -u xoops2jp/html/class/xoopsform/tableform.php:1.2 xoops2jp/html/class/xoopsform/tableform.php:1.2.8.1 --- xoops2jp/html/class/xoopsform/tableform.php:1.2 Fri Mar 18 21:51:55 2005 +++ xoops2jp/html/class/xoopsform/tableform.php Fri Sep 22 18:18:16 2006 @@ -1,5 +1,5 @@ <?php -// $Id: tableform.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $ +// $Id: tableform.php,v 1.2.8.1 2006/09/22 09:18:16 minahito Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -63,20 +63,17 @@ */ function render() { - $ret = $this->getTitle()."\n<form name='".$this->getName()."' id='".$this->getName()."' action='".$this->getAction()."' method='".$this->getMethod()."'".$this->getExtra().">\n<table border='0' width='100%'>\n"; - foreach ( $this->getElements() as $ele ) { - if ( !$ele->isHidden() ) { - $ret .= "<tr valign='top' align='left'><td>".$ele->getCaption(); - if ($ele->getDescription() != '') { - $ret .= '<br /><br /><span style="font-weight: normal;">'.$ele->getDescription().'</span>'; - } - $ret .= "</td><td>".$ele->render()."</td></tr>"; - } else { - $ret .= $ele->render()."\n"; - } - } - $ret .= "</table>\n</form>\n"; - return $ret; + $root =& XCube_Root::getSingleton(); + $renderTarget =& new Legacy_RenderTargetMain(); + + $renderTarget->setModuleName("base"); + $renderTarget->setTemplateName("legacy_xoopsform_tableform.html"); + $renderTarget->setAttribute("form", $this); + + $renderer =& $root->getRenderSystem(LEGACY_DEPENDENCE_RENDERER); + $renderer->renderWithTarget($renderTarget); + + return $renderTarget->getResult(); } } ?> \ No newline at end of file Index: xoops2jp/html/class/xoopsform/formelement.php diff -u xoops2jp/html/class/xoopsform/formelement.php:1.2.8.2 xoops2jp/html/class/xoopsform/formelement.php:1.2.8.3 --- xoops2jp/html/class/xoopsform/formelement.php:1.2.8.2 Sat Jul 1 13:18:46 2006 +++ xoops2jp/html/class/xoopsform/formelement.php Fri Sep 22 18:18:16 2006 @@ -1,5 +1,5 @@ <?php -// $Id: formelement.php,v 1.2.8.2 2006/07/01 04:18:46 minahito Exp $ +// $Id: formelement.php,v 1.2.8.3 2006/09/22 09:18:16 minahito Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -307,5 +307,17 @@ */ function render(){ } + + /** + * Gets a message for javascript in the specific member function of XoopsForm class. + */ + function getMessageForJS() + { + $eltcaption = trim( $this->getCaption() ); + $eltmsg = empty($eltcaption) ? sprintf( _FORM_ENTER, $eltname ) : sprintf( _FORM_ENTER, $eltcaption ); + $eltmsg = str_replace('"', '\"', stripslashes($eltmsg)); + + return $eltmsg; + } } ?> \ No newline at end of file Index: xoops2jp/html/class/xoopsform/formfile.php diff -u xoops2jp/html/class/xoopsform/formfile.php:1.2 xoops2jp/html/class/xoopsform/formfile.php:1.2.8.1 --- xoops2jp/html/class/xoopsform/formfile.php:1.2 Fri Mar 18 21:51:55 2005 +++ xoops2jp/html/class/xoopsform/formfile.php Fri Sep 22 18:18:16 2006 @@ -1,5 +1,5 @@ <?php -// $Id: formfile.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $ +// $Id: formfile.php,v 1.2.8.1 2006/09/22 09:18:16 minahito Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -83,7 +83,17 @@ * @return string HTML */ function render(){ - return "<input type='hidden' name='MAX_FILE_SIZE' value='".$this->getMaxFileSize()."' /><input type='file' name='".$this->getName()."' id='".$this->getName()."'".$this->getExtra()." /><input type='hidden' name='xoops_upload_file[]' id='xoops_upload_file[]' value='".$this->getName()."' />"; + $root =& XCube_Root::getSingleton(); + $renderTarget =& new Legacy_RenderTargetMain(); + + $renderTarget->setModuleName("base"); + $renderTarget->setTemplateName("legacy_xoopsform_file.html"); + $renderTarget->setAttribute("element", $this); + + $renderer =& $root->getRenderSystem(LEGACY_DEPENDENCE_RENDERER); + $renderer->renderWithTarget($renderTarget); + + return $renderTarget->getResult(); } } ?> \ No newline at end of file Index: xoops2jp/html/class/xoopsform/formcheckbox.php diff -u xoops2jp/html/class/xoopsform/formcheckbox.php:1.2 xoops2jp/html/class/xoopsform/formcheckbox.php:1.2.8.1 --- xoops2jp/html/class/xoopsform/formcheckbox.php:1.2 Fri Mar 18 21:51:55 2005 +++ xoops2jp/html/class/xoopsform/formcheckbox.php Fri Sep 22 18:18:16 2006 @@ -1,5 +1,5 @@ <?php -// $Id: formcheckbox.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $ +// $Id: formcheckbox.php,v 1.2.8.1 2006/09/22 09:18:16 minahito Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -141,20 +141,24 @@ * * @return string */ - function render(){ - $ret = ""; + function render() + { + $root =& XCube_Root::getSingleton(); + $renderTarget =& new Legacy_RenderTargetMain(); + if ( count($this->getOptions()) > 1 && substr($this->getName(), -2, 2) != "[]" ) { $newname = $this->getName()."[]"; $this->setName($newname); } - foreach ( $this->getOptions() as $value => $name ) { - $ret .= "<input type='checkbox' name='".$this->getName()."' value='".$value."'"; - if (count($this->getValue()) > 0 && in_array($value, $this->getValue())) { - $ret .= " checked='checked'"; - } - $ret .= $this->getExtra()." />".$name."\n"; - } - return $ret; + + $renderTarget->setModuleName("base"); + $renderTarget->setTemplateName("legacy_xoopsform_checkbox.html"); + $renderTarget->setAttribute("element", $this); + + $renderer =& $root->getRenderSystem(LEGACY_DEPENDENCE_RENDERER); + $renderer->renderWithTarget($renderTarget); + + return $renderTarget->getResult(); } } ?> \ No newline at end of file Index: xoops2jp/html/class/xoopsform/formhidden.php diff -u xoops2jp/html/class/xoopsform/formhidden.php:1.2 xoops2jp/html/class/xoopsform/formhidden.php:1.2.8.1 --- xoops2jp/html/class/xoopsform/formhidden.php:1.2 Fri Mar 18 21:51:55 2005 +++ xoops2jp/html/class/xoopsform/formhidden.php Fri Sep 22 18:18:16 2006 @@ -1,5 +1,5 @@ <?php -// $Id: formhidden.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $ +// $Id: formhidden.php,v 1.2.8.1 2006/09/22 09:18:16 minahito Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -90,7 +90,17 @@ * @return string HTML */ function render(){ - return "<input type='hidden' name='".$this->getName()."' id='".$this->getName()."' value='".$this->getValue()."' />"; + $root =& XCube_Root::getSingleton(); + $renderTarget =& new Legacy_RenderTargetMain(); + + $renderTarget->setModuleName("base"); + $renderTarget->setTemplateName("legacy_xoopsform_hidden.html"); + $renderTarget->setAttribute("element", $this); + + $renderer =& $root->getRenderSystem(LEGACY_DEPENDENCE_RENDERER); + $renderer->renderWithTarget($renderTarget); + + return $renderTarget->getResult(); } } ?> \ No newline at end of file Index: xoops2jp/html/class/xoopsform/formselect.php diff -u xoops2jp/html/class/xoopsform/formselect.php:1.2 xoops2jp/html/class/xoopsform/formselect.php:1.2.8.1 --- xoops2jp/html/class/xoopsform/formselect.php:1.2 Fri Mar 18 21:51:55 2005 +++ xoops2jp/html/class/xoopsform/formselect.php Fri Sep 22 18:18:16 2006 @@ -1,5 +1,5 @@ <?php -// $Id: formselect.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $ +// $Id: formselect.php,v 1.2.8.1 2006/09/22 09:18:16 minahito Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -178,21 +178,17 @@ * @return string HTML */ function render(){ - $ret = "<select size='".$this->getSize()."'".$this->getExtra().""; - if ($this->isMultiple() != false) { - $ret .= " name='".$this->getName()."[]' id='".$this->getName()."[]' multiple='multiple'>\n"; - } else { - $ret .= " name='".$this->getName()."' id='".$this->getName()."'>\n"; - } - foreach ( $this->getOptions() as $value => $name ) { - $ret .= "<option value='".htmlspecialchars($value, ENT_QUOTES)."'"; - if (count($this->getValue()) > 0 && in_array($value, $this->getValue())) { - $ret .= " selected='selected'"; - } - $ret .= ">".$name."</option>\n"; - } - $ret .= "</select>"; - return $ret; + $root =& XCube_Root::getSingleton(); + $renderTarget =& new Legacy_RenderTargetMain(); + + $renderTarget->setModuleName("base"); + $renderTarget->setTemplateName("legacy_xoopsform_file.html"); + $renderTarget->setAttribute("element", $this); + + $renderer =& $root->getRenderSystem(LEGACY_DEPENDENCE_RENDERER); + $renderer->renderWithTarget($renderTarget); + + return $renderTarget->getResult(); } } ?> \ No newline at end of file Index: xoops2jp/html/class/xoopsform/formpassword.php diff -u xoops2jp/html/class/xoopsform/formpassword.php:1.2 xoops2jp/html/class/xoopsform/formpassword.php:1.2.8.1 --- xoops2jp/html/class/xoopsform/formpassword.php:1.2 Fri Mar 18 21:51:55 2005 +++ xoops2jp/html/class/xoopsform/formpassword.php Fri Sep 22 18:18:16 2006 @@ -1,5 +1,5 @@ <?php -// $Id: formpassword.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $ +// $Id: formpassword.php,v 1.2.8.1 2006/09/22 09:18:16 minahito Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -129,7 +129,17 @@ * @return string HTML */ function render(){ - return "<input type='password' name='".$this->getName()."' id='".$this->getName()."' size='".$this->getSize()."' maxlength='".$this->getMaxlength()."' value='".$this->getValue()."'".$this->getExtra()." />"; + $root =& XCube_Root::getSingleton(); + $renderTarget =& new Legacy_RenderTargetMain(); + + $renderTarget->setModuleName("base"); + $renderTarget->setTemplateName("legacy_xoopsform_password.html"); + $renderTarget->setAttribute("element", $this); + + $renderer =& $root->getRenderSystem(LEGACY_DEPENDENCE_RENDERER); + $renderer->renderWithTarget($renderTarget); + + return $renderTarget->getResult(); } } ?> \ No newline at end of file Index: xoops2jp/html/class/xoopsform/formdhtmltextarea.php diff -u xoops2jp/html/class/xoopsform/formdhtmltextarea.php:1.2.8.3 xoops2jp/html/class/xoopsform/formdhtmltextarea.php:1.2.8.4 --- xoops2jp/html/class/xoopsform/formdhtmltextarea.php:1.2.8.3 Tue Aug 1 17:27:05 2006 +++ xoops2jp/html/class/xoopsform/formdhtmltextarea.php Fri Sep 22 18:18:16 2006 @@ -1,5 +1,5 @@ <?php -// $Id: formdhtmltextarea.php,v 1.2.8.3 2006/08/01 08:27:05 nobunobu Exp $ +// $Id: formdhtmltextarea.php,v 1.2.8.4 2006/09/22 09:18:16 minahito Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -85,37 +85,20 @@ */ function render() { - $ret = "<a name='moresmiley'></a><img onmouseover='style.cursor=\"hand\"' src='".XOOPS_URL."/images/url.gif' alt='url' onclick='xoopsCodeUrl(\"".$this->getId()."\", \"".htmlspecialchars(_ENTERURL, ENT_QUOTES)."\", \"".htmlspecialchars(_ENTERWEBTITLE, ENT_QUOTES)."\");' /> <img onmouseover='style.cursor=\"hand\"' src='".XOOPS_URL."/images/email.gif' alt='email' onclick='javascript:xoopsCodeEmail(\"".$this->getId()."\", \"".htmlspecialchars(_ENTEREMAIL, ENT_QUOTES)."\");' /> <img onclick='javascript:xoopsCodeImg(\"".$this->getId()."\", \"".htmlspecialchars(_ENTERIMGURL, ENT_QUOTES)."\", \"".htmlspecialchars(_ENTERIMGPOS, ENT_QUOTES)."\", \"".htmlspecialchars(_IMGPOSRORL, ENT_QUOTES)."\", \"".htmlspecialchars(_ERRORIMGPOS, ENT_QUOTES)."\");' onmouseover='style.cursor=\"hand\"' src='".XOOPS_URL."/images/imgsrc.gif' alt='imgsrc' /> <img onmouseover='style.cursor=\"hand\"' onclick='javascript:openWithSelfMain(\"".XOOPS_URL."/imagemanager.php?target=".$this->getId()."\",\"imgmanager\",400,430);' src='".XOOPS_URL."/images/image.gif' alt='image' /> <img src='".XOOPS_URL."/images/code.gif' onmouseover='style.cursor=\"hand\"' alt='code' onclick='javascript:xoopsCodeCode(\"".$this->getId()."\", \"".htmlspecialchars(_ENTERCODE, ENT_QUOTES)."\");' /> <img onclick='javascript:xoopsCodeQuote(\"".$this->getId()."\", \"".htmlspecialchars(_ENTERQUOTE, ENT_QUOTES)."\");' onmouseover='style.cursor=\"hand\"' src='".XOOPS_URL."/images/quote.gif' alt='quote' /><br />\n"; - - $sizearray = array("xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large"); - $ret .= "<select id='".$this->getId()."Size' onchange='setVisible(\"".$this->_hiddenText."\");setElementSize(\"".$this->_hiddenText."\",this.options[this.selectedIndex].value);'>\n"; - $ret .= "<option value='SIZE'>"._SIZE."</option>\n"; - foreach ( $sizearray as $size ) { - $ret .= "<option value='$size'>$size</option>\n"; - } - $ret .= "</select>\n"; - $fontarray = array("Arial", "Courier", "Georgia", "Helvetica", "Impact", "Verdana"); - $ret .= "<select id='".$this->getId()."Font' onchange='setVisible(\"".$this->_hiddenText."\");setElementFont(\"".$this->_hiddenText."\",this.options[this.selectedIndex].value);'>\n"; - $ret .= "<option value='FONT'>"._FONT."</option>\n"; - foreach ( $fontarray as $font ) { - $ret .= "<option value='$font'>$font</option>\n"; - } - $ret .= "</select>\n"; - $colorarray = array("00", "33", "66", "99", "CC", "FF"); - $ret .= "<select id='".$this->getId()."Color' onchange='setVisible(\"".$this->_hiddenText."\");setElementColor(\"".$this->_hiddenText."\",this.options[this.selectedIndex].value);'>\n"; - $ret .= "<option value='COLOR'>"._COLOR."</option>\n"; - foreach ( $colorarray as $color1 ) { - foreach ( $colorarray as $color2 ) { - foreach ( $colorarray as $color3 ) { - $ret .= "<option value='".$color1.$color2.$color3."' style='background-color:#".$color1.$color2.$color3.";color:#".$color1.$color2.$color3.";'>#".$color1.$color2.$color3."</option>\n"; - } - } - } - $ret .= "</select><span id='".$this->_hiddenText."'>"._EXAMPLE."</span>\n"; - $ret .= "<br />\n"; - $ret .= "<img onclick='javascript:setVisible(\"".$this->_hiddenText."\");makeBold(\"".$this->_hiddenText."\");' onmouseover='style.cursor=\"hand\"' src='".XOOPS_URL."/images/bold.gif' alt='bold' /> <img onclick='javascript:setVisible(\"".$this->_hiddenText."\");makeItalic(\"".$this->_hiddenText."\");' onmouseover='style.cursor=\"hand\"' src='".XOOPS_URL."/images/italic.gif' alt='italic' /> <img onclick='javascript:setVisible(\"".$this->_hiddenText."\");makeUnderline(\"".$this->_hiddenText."\");' onmouseover='style.cursor=\"hand\"' src='".XOOPS_URL."/images/underline.gif' alt='underline' /> <img onclick='javascript:setVisible(\"".$this->_hiddenText."\");makeLineThrough(\"".$this->_hiddenText."\");' src='".XOOPS_URL."/images/linethrough.gif' alt='linethrough' onmouseover='style.cursor=\"hand\"' /> <input type='text' id='".$this->getId()."Addtext' size='20' /> <input type='button' onclick='xoopsCodeText(\"".$this->getId()."\", \"".$this->_hiddenText."\", \"".htmlspecialchars(_ENTERTEXTBOX, ENT_QUOTES)."\")' class='formButton' value='"._ADD."' /><br /><br /><textarea id='".$this->getId()."' name='".$this->getName()."' onselect=\"xoopsSavePosition('".$this->getId()."');\" onclick=\"xoopsSavePosition('".$this->getId()."');\" onkeyup=\"xoopsSavePosition('".$this->getId()."');\" cols='".$this->getCols()."' rows='".$this->getRows()."'".$this->getExtra().">".$this->getValue()."</textarea><br />\n"; + $root =& XCube_Root::getSingleton(); + $renderTarget =& new Legacy_RenderTargetMain(); + + $renderTarget->setModuleName("base"); + $renderTarget->setTemplateName("legacy_xoopsform_dhtmltextarea.html"); + $renderTarget->setAttribute("element", $this); + + $renderer =& $root->getRenderSystem(LEGACY_DEPENDENCE_RENDERER); + $renderer->renderWithTarget($renderTarget); + + $ret = $renderTarget->getResult(); $ret .= $this->_renderSmileys(); - return $ret; + + return $ret; } /** @@ -125,26 +108,21 @@ */ function _renderSmileys() { - $myts =& MyTextSanitizer::getInstance(); - $smiles = $myts->getSmileys(); - $ret = ''; - if (empty($smiles)) { - $db =& Database::getInstance(); - if ($result = $db->query('SELECT * FROM '.$db->prefix('smiles').' WHERE display=1')) { - while ($smiles = $db->fetchArray($result)) { - $ret .= "<img onclick='xoopsCodeSmilie(\"".$this->getId()."\", \" ".$smiles['code']." \");' onmouseover='style.cursor=\"hand\"' src='".XOOPS_UPLOAD_URL."/".htmlspecialchars($smiles['smile_url'], ENT_QUOTES)."' alt='' />"; - } - } - } else { - $count = count($smiles); - for ($i = 0; $i < $count; $i++) { - if ($smiles[$i]['display'] == 1) { - $ret .= "<img onclick='xoopsCodeSmilie(\"".$this->getId()."\", \" ".$smiles[$i]['code']." \");' onmouseover='style.cursor=\"hand\"' src='".XOOPS_UPLOAD_URL."/".$myts->oopsHtmlSpecialChars($smiles[$i]['smile_url'])."' border='0' alt='' />"; - } - } - } - $ret .= " [<a href='#moresmiley' onclick='javascript:openWithSelfMain(\"".XOOPS_URL."/misc.php?action=showpopups&type=smilies&target=".$this->getId()."\",\"smilies\",300,475);'>"._MORE."</a>]"; - return $ret; + $handler =& xoops_getmodulehandler('smiles', 'base'); + $smilesArr =& $handler->getObjects(new Criteria('display', 1)); + + $root =& XCube_Root::getSingleton(); + $renderTarget =& new Legacy_RenderTargetMain(); + + $renderTarget->setModuleName("base"); + $renderTarget->setTemplateName("legacy_xoopsform_opt_smileys.html"); + $renderTarget->setAttribute("element", $this); + $renderTarget->setAttribute("smilesArr", $smilesArr); + + $renderer =& $root->getRenderSystem(LEGACY_DEPENDENCE_RENDERER); + $renderer->renderWithTarget($renderTarget); + + return $renderTarget->getResult(); } } ?> Index: xoops2jp/html/class/xoopsform/formbutton.php diff -u xoops2jp/html/class/xoopsform/formbutton.php:1.2 xoops2jp/html/class/xoopsform/formbutton.php:1.2.8.1 --- xoops2jp/html/class/xoopsform/formbutton.php:1.2 Fri Mar 18 21:51:55 2005 +++ xoops2jp/html/class/xoopsform/formbutton.php Fri Sep 22 18:18:16 2006 @@ -1,5 +1,5 @@ <?php -// $Id: formbutton.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $ +// $Id: formbutton.php,v 1.2.8.1 2006/09/22 09:18:16 minahito Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -111,7 +111,17 @@ * @return string */ function render(){ - return "<input type='".$this->getType()."' class='formButton' name='".$this->getName()."' id='".$this->getName()."' value='".$this->getValue()."'".$this->getExtra()." />"; + $root =& XCube_Root::getSingleton(); + $renderTarget =& new Legacy_RenderTargetMain(); + + $renderTarget->setModuleName("base"); + $renderTarget->setTemplateName("legacy_xoopsform_button.html"); + $renderTarget->setAttribute("element", $this); + + $renderer =& $root->getRenderSystem(LEGACY_DEPENDENCE_RENDERER); + $renderer->renderWithTarget($renderTarget); + + return $renderTarget->getResult(); } } ?> \ No newline at end of file Index: xoops2jp/html/class/xoopsform/themeform.php diff -u xoops2jp/html/class/xoopsform/themeform.php:1.2 xoops2jp/html/class/xoopsform/themeform.php:1.2.8.1 --- xoops2jp/html/class/xoopsform/themeform.php:1.2 Fri Mar 18 21:51:55 2005 +++ xoops2jp/html/class/xoopsform/themeform.php Fri Sep 22 18:18:16 2006 @@ -1,5 +1,5 @@ <?php -// $Id: themeform.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $ +// $Id: themeform.php,v 1.2.8.1 2006/09/22 09:18:16 minahito Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -81,30 +81,19 @@ */ function render() { - $required =& $this->getRequired(); - $ret = "<form name='".$this->getName()."' id='".$this->getName()."' action='".$this->getAction()."' method='".$this->getMethod()."' onsubmit='return xoopsFormValidate_".$this->getName()."();'".$this->getExtra().">\n<table width='100%' class='outer' cellspacing='1'><tr><th colspan='2'>".$this->getTitle()."</th></tr>"; - //$count = 0; - foreach ( $this->getElements() as $ele ) { - if (!is_object($ele)) { - $ret .= $ele; - } elseif (!$ele->isHidden()) { - //if ($count % 2 == 0) { - $class = 'even'; - //} else { - // $class = 'odd'; - //} - $ret .= "<tr valign='top' align='left'><td class='head'>".$ele->getCaption(); - if ($ele->getDescription() != '') { - $ret .= '<br /><br /><span style="font-weight: normal;">'.$ele->getDescription().'</span>'; - } - $ret .= "</td><td class='$class'>".$ele->render()."</td></tr>"; - //$count++; - } else { - $ret .= $ele->render(); - } - } - $ret .= "</table></form>\n"; + $root =& XCube_Root::getSingleton(); + $renderTarget =& new Legacy_RenderTargetMain(); + + $renderTarget->setModuleName("base"); + $renderTarget->setTemplateName("legacy_xoopsform_themeform.html"); + $renderTarget->setAttribute("form", $this); + + $renderer =& $root->getRenderSystem(LEGACY_DEPENDENCE_RENDERER); + $renderer->renderWithTarget($renderTarget); + + $ret = $renderTarget->getResult(); $ret .= $this->renderValidationJS( true ); + return $ret; } } Index: xoops2jp/html/class/xoopsform/formtext.php diff -u xoops2jp/html/class/xoopsform/formtext.php:1.2 xoops2jp/html/class/xoopsform/formtext.php:1.2.8.1 --- xoops2jp/html/class/xoopsform/formtext.php:1.2 Fri Mar 18 21:51:55 2005 +++ xoops2jp/html/class/xoopsform/formtext.php Fri Sep 22 18:18:16 2006 @@ -1,5 +1,5 @@ <?php -// $Id: formtext.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $ +// $Id: formtext.php,v 1.2.8.1 2006/09/22 09:18:16 minahito Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -127,7 +127,17 @@ * @return string HTML */ function render(){ - return "<input type='text' name='".$this->getName()."' id='".$this->getName()."' size='".$this->getSize()."' maxlength='".$this->getMaxlength()."' value='".$this->getValue()."'".$this->getExtra()." />"; + $root =& XCube_Root::getSingleton(); + $renderTarget =& new Legacy_RenderTargetMain(); + + $renderTarget->setModuleName("base"); + $renderTarget->setTemplateName("legacy_xoopsform_text.html"); + $renderTarget->setAttribute("element", $this); + + $renderer =& $root->getRenderSystem(LEGACY_DEPENDENCE_RENDERER); + $renderer->renderWithTarget($renderTarget); + + return $renderTarget->getResult(); } } ?> \ No newline at end of file Index: xoops2jp/html/class/xoopsform/form.php diff -u xoops2jp/html/class/xoopsform/form.php:1.2.8.2 xoops2jp/html/class/xoopsform/form.php:1.2.8.3 --- xoops2jp/html/class/xoopsform/form.php:1.2.8.2 Sat Feb 18 23:51:46 2006 +++ xoops2jp/html/class/xoopsform/form.php Fri Sep 22 18:18:16 2006 @@ -1,5 +1,5 @@ <?php -// $Id: form.php,v 1.2.8.2 2006/02/18 14:51:46 nobunobu Exp $ +// $Id: form.php,v 1.2.8.3 2006/09/22 09:18:16 minahito Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -378,6 +378,26 @@ * @param boolean $withtags Include the < javascript > tags in the returned string */ function renderValidationJS( $withtags = true ) { + $root =& XCube_Root::getSingleton(); + $renderTarget =& new Legacy_RenderTargetMain(); + + $renderTarget->setModuleName("base"); + $renderTarget->setTemplateName("legacy_xoopsform_opt_validationjs.html"); + $renderTarget->setAttribute('form', $this); + $renderTarget->setAttribute('withtags', $withtags); + + $required =& $this->getRequired(); + $reqcount = count($required); + + $renderTarget->setAttribute('required', $required); + $renderTarget->setAttribute('required_count', $reqcount); + + $renderer =& $root->getRenderSystem(LEGACY_DEPENDENCE_RENDERER); + $renderer->renderWithTarget($renderTarget); + + return $renderTarget->getResult(); + + $js = ""; if ( $withtags ) { $js .= "\n<!-- Start Form Vaidation JavaScript //-->\n<script type='text/javascript'>\n<!--//\n"; Index: xoops2jp/html/class/xoopsform/formelementtray.php diff -u xoops2jp/html/class/xoopsform/formelementtray.php:1.2 xoops2jp/html/class/xoopsform/formelementtray.php:1.2.8.1 --- xoops2jp/html/class/xoopsform/formelementtray.php:1.2 Fri Mar 18 21:51:55 2005 +++ xoops2jp/html/class/xoopsform/formelementtray.php Fri Sep 22 18:18:16 2006 @@ -1,5 +1,5 @@ <?php -// $Id: formelementtray.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $ +// $Id: formelementtray.php,v 1.2.8.1 2006/09/22 09:18:16 minahito Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -164,21 +164,17 @@ * @return string HTML output */ function render(){ - $count = 0; - $ret = ""; - foreach ( $this->getElements() as $ele ) { - if ($count > 0) { - $ret .= $this->getDelimeter(); - } - if ($ele->getCaption() != '') { - $ret .= $ele->getCaption()." "; - } - $ret .= $ele->render()."\n"; - if (!$ele->isHidden()) { - $count++; - } - } - return $ret; + $root =& XCube_Root::getSingleton(); + $renderTarget =& new Legacy_RenderTargetMain(); + + $renderTarget->setModuleName("base"); + $renderTarget->setTemplateName("legacy_xoopsform_elementtray.html"); + $renderTarget->setAttribute("tray", $this); + + $renderer =& $root->getRenderSystem(LEGACY_DEPENDENCE_RENDERER); + $renderer->renderWithTarget($renderTarget); + + return $renderTarget->getResult(); } } ?> \ No newline at end of file Index: xoops2jp/html/class/xoopsform/formtextdateselect.php diff -u xoops2jp/html/class/xoopsform/formtextdateselect.php:1.2.8.2 xoops2jp/html/class/xoopsform/formtextdateselect.php:1.2.8.3 --- xoops2jp/html/class/xoopsform/formtextdateselect.php:1.2.8.2 Sat Jul 1 13:21:10 2006 +++ xoops2jp/html/class/xoopsform/formtextdateselect.php Fri Sep 22 18:18:16 2006 @@ -1,5 +1,5 @@ <?php -// $Id: formtextdateselect.php,v 1.2.8.2 2006/07/01 04:21:10 minahito Exp $ +// $Id: formtextdateselect.php,v 1.2.8.3 2006/09/22 09:18:16 minahito Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -57,9 +57,21 @@ function render() { + $root =& XCube_Root::getSingleton(); + $renderTarget =& new Legacy_RenderTargetMain(); + + $renderTarget->setModuleName("base"); + $renderTarget->setTemplateName("legacy_xoopsform_textdateselect.html"); + $renderTarget->setAttribute("element", $this); + $renderTarget->setAttribute("date", date("Y-m-d", $this->getValue())); + $jstime = formatTimestamp($this->getValue(), '"F j, Y H:i:s"'); include_once XOOPS_ROOT_PATH.'/include/calendarjs.php'; - return "<input type='text' name='".$this->getName()."' id='".$this->getId()."' size='".$this->getSize()."' maxlength='".$this->getMaxlength()."' value='".date("Y-m-d", $this->getValue())."'".$this->getExtra()." /><input type='reset' value=' ... ' onclick='return showCalendar(\"".$this->getName()."\");'>"; + + $renderer =& $root->getRenderSystem(LEGACY_DEPENDENCE_RENDERER); + $renderer->renderWithTarget($renderTarget); + + return $renderTarget->getResult(); } } ?> \ No newline at end of file