2
Hi deka,
if the <table class="outer"> is hardcoded into the php file you would need to edit the core file to remove the table and include divs instead, theres probably no other way to do it.
If you need to just style form elements i.e. inputs, text areas, buttons, etc then I believe all xoops form element styles are in /xoops.css
Of course no html should be in a php file, especially not when xoops has a templating system, it kinds of defeats the purpose of using templates.
Hopefully in the next major release core team will remove all html from php files and hopefully module devs will folow suit.
Ive edited themeform.php for you and removed table, tr, td, th and replaced with divs. i havent tested it or anything.
code is from line 63 to line 106
function render()
{
$ele_name = $this->getName();
$ret = '<form name="' . $ele_name . '" id="' . $ele_name . '" action="' . $this->getAction() . '" method="' . $this->getMethod() . '" onsubmit="return xoopsFormValidate_' . $ele_name . '();"' . $this->getExtra() . '>
<div class="tableWrap">
<div class="tableTitle"><span>' . $this->getTitle() . '</span></div>
';
$hidden = '';
$class = 'even';
foreach ($this->getElements() as $ele) {
if (!is_object($ele)) {
$ret .= $ele;
} else if (!$ele->isHidden()) {
if (!$ele->getNocolspan()) {
$ret .= '<div class="tableInner"><div class="head">';
if (($caption = $ele->getCaption()) != '') {
$ret .= '<div class="xoops-form-element-caption' . ($ele->isRequired() ? '-required' : '') . '">';
$ret .= '<span class="caption-text">' . $caption . '</span>';
$ret .= '<span class="caption-marker">*</span>';
$ret .= '</div>';
}
if (($desc = $ele->getDescription()) != '') {
$ret .= '<div class="xoops-form-element-help">' . $desc . '</div>';
}
$ret .= '</div><div class="' . $class . '">' . $ele->render() . '</div></div>' . NWLINE; //this is possibley where it adds odd/even class?
} else {
$ret .= '<div><div class="head">';
if (($caption = $ele->getCaption()) != '') {
$ret .= '<div class="xoops-form-element-caption' . ($ele->isRequired() ? '-required' : '') . '">';
$ret .= '<span class="caption-text">' . $caption . '</span>';
$ret .= '<span class="caption-marker">*</span>';
$ret .= '</div>';
}
$ret .= '</div></div><div><div class="' . $class . '">' . $ele->render() . '</div></div>';
}
} else {
$hidden .= $ele->render();
}
}
$ret .= '</div>' . NWLINE . ' ' . $hidden . '</form>' . NWLINE; //end tableWrap
$ret .= $this->renderValidationJS(true);
return $ret;
}
}
Edit: you might have to edit the td's & tr's in function insertBreak (line 37) in case it that insearts empty rows in the main form table.