5
Class XoopsThemeTabForm comes from the Publisher module by Trabis.
I am currently just testing different things, so I can show you only this:
index.php
$xajax = new xajax();
if ( _CHARSET == 'ISO-8859-2' ) {
$xajax->configure("characterEncoding", 'ISO-8859-2');
$xajax->configure('decodeUTF8Input',true);
}
$xajax->setFlag("debug", false);
$xajax->register(XAJAX_FUNCTION,"symbolExist");
$xajax->processRequest();
$Xjavapath=BAZLE_AJAXLIB_URL;
$xajaxjava=$xajax->getJavascript($Xjavapath);
$xoopsOption['template_main'] = 'my_form_template.tpl';
/**
* XOOPS main header file
*/
require_once XOOPS_ROOT_PATH."/header.php";
include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php";
include_once BAZLE_PATH . '/class/themetabform.php';
$cform = new XoopsThemeTabForm('Title of form', 'frmObiekt', 'umenu0.php?op='.$akcja);
$cform->setExtra('enctype="multipart/form-data"');
$cform->startTab('Symbol');
//SYMBOL
$tray_symbol = new XoopsFormElementTray( _BAZLE_SYMBOL, '', 'symbol' );
$symbol_frm=new XoopsFormText('', 'symbol', 20, 10, $row_obiekt['symbol']);
if($op=='new')
$symbol_frm->setExtra(' onBlur="xajax_symbolExist(xajax.getFormValues('."'frmObiekt'".'));"');
$tray_symbol->addElement($symbol_frm, true);
$cform->addElement($tray_symbol, true);
$cform->startTab('Other');
//UWAGI
$cform->addElement(new XoopsFormTextArea(_BAZLE_UWAGI, 'uwagi', $row_obiekt['uwagi'], 4, $cols=50), false);
$cform->endTabs();
//SUBMIT
$cform->addElement(new XoopsFormHidden('id', $id), false);
$cform->addElement(new XoopsFormHidden('op', $op), false);
$button_tray = new XoopsFormElementTray('' ,'');
$submit_btn = new XoopsFormButton('', 'sbt', _SUBMIT, 'submit');
$button_tray->addElement($submit_btn);
$cancel_btn = new XoopsFormButton('', 'cancel', _CANCEL, 'button');
$cancel_btn->setExtra("onClick="document.location.href='".BAZLE_URL."/index_obiekty.php';"");
$button_tray->addElement($cancel_btn);
$cform->addElement($button_tray);
$cform->assign($xoopsTpl);
$xoopsTpl->assign('xajaxjava', $xajaxjava);
$xoTheme->addStylesheet(BAZLE_URL . '/css/publisher.css');
$xoTheme->addStylesheet(BAZLE_URL . '/css/jquery-ui-1.7.1.custom.css');
$xoTheme->addScript(BAZLE_URL . '/js/jquery-1.3.2.min.js');
$xoTheme->addScript(BAZLE_URL . '/js/jquery-easing-1.3.pack.js');
$xoTheme->addScript(BAZLE_URL . '/js/jquery.lightbox-0.5.js');
$xoTheme->addScript(BAZLE_URL . '/js/jquery.popeye-0.2.1.js');
$xoTheme->addScript(BAZLE_URL . '/js/ui.core.js');
$xoTheme->addScript(BAZLE_URL . '/js/ui.tabs.js');
$xoTheme->addScript(BAZLE_URL . '/js/publisher.js');
include_once XOOPS_ROOT_PATH . '/footer.php';
my_form_template.tpl
<div id="tabs">
<ul>
<{foreach item=tab key=key from=$frmObiekt.tabs}>
<li><a href="#tab_<{$key}>"><span><{$tab}>span>a>li>
<{/foreach}>
ul>
<form name="<{$frmObiekt.name}>" id="<{$frmObiekt.name}>" action="<{$frmObiekt.action}>" method="<{$frmObiekt.method}>" <{$frmObiekt.extra}>>
<{foreach item=tab key=key from=$frmObiekt.tabs}>
<div id="tab_<{$key}>">
<table class="outer" cellspacing="1">
<tr><th colspan="2"><{$frmObiekt.title}>th>tr>
<{foreach item=element from=$frmObiekt.elements}>
<{if $element.tab == $key || $element.tab == -1}>
<{if !$element.hidden}>
<tr>
<td class="head">
<{if $element.caption != ''}>
<div class="xoops-form-element-caption<{if $element.required}>-required<{/if}>">
<span class="caption-text"><{$element.caption}>span>
<span class="caption-marker">*span>
div>
<{/if}>
<{if $element.description}>
<div class="xoops-form-element-help"><{$element.description}>div>
<{/if}>
td>
<td id="xoops-form-element-body_<{$element.name}>" class="even"><{$element.body}><div class="xoops-form-element-alert" id="xoops-form-element-alert_<{$element.name}>">div>td>
tr>
<{/if}>
<{/if}>
<{/foreach}>
table>
div>
<{/foreach}>
<{foreach item=element from=$frmObiekt.elements}>
<{if $element.hidden}><{$element.body}><{/if}>
<{/foreach}>
form> <{$frmObiekt.javascript}>
div>
<{$xajaxjava}>