Ejemplo n.º 1
0
 function _renderForm(&$page)
 {
     $pageName = $page->getAttribute('name');
     $tabPreview = array_slice($page->controller->_tabs, -2, 1);
     // can use either HTML_Template_Sigma or HTML_Template_ITX
     $tpl = new HTML_Template_Sigma('.', 'cache/');
     $tpl->loadTemplateFile('itdynamic.html');
     // on preview tab, add progress bar javascript and stylesheet
     if ($pageName == $tabPreview[0][0]) {
         $pb = $page->controller->createProgressBar();
         $tpl->setVariable(array('qf_style' => $pb->getStyle(), 'qf_script' => $pb->getScript()));
         $pbElement = $page->getElement('progressBar');
         $pbElement->setText($pb->toHtml() . '<br /><br />');
     }
     $renderer = new HTML_QuickForm_Renderer_ITDynamic($tpl);
     $renderer->setElementBlock(array('buttons' => 'qf_buttons'));
     $page->accept($renderer);
     $tpl->show();
 }
Ejemplo n.º 2
0
<!-- BEGIN label_2 --><tr><th>{label_2}</th><!-- END label_2 -->
<!-- BEGIN label_3 --><th>&nbsp;</th><th>{label_3}</th></tr><!-- END label_3 -->
<tr>
  <td valign="top">{unselected}</td>
  <td align="center">{add}{remove}</td>
  <td valign="top">{selected}</td>
</tr>
</table>
';
$ams->setElementTemplate($template);
if (isset($_POST['fruit'])) {
    $form->setDefaults(array('fruit' => $_POST['fruit']));
}
$form->addElement('submit', 'send', 'Send', array('class' => 'inputCommand'));
$form->addRule('name', 'Your name is required', 'required');
$form->addGroupRule('fruit', 'At least one fruit is required', 'required', null, 1);
$form->applyFilter('__ALL__', 'trim');
$form->applyFilter('__ALL__', 'strip_tags');
$valid = $form->validate();
$tpl = new HTML_Template_Sigma('.');
$tpl->loadTemplateFile('itdynamic.html');
$tpl->setVariable('ams_javascript', $ams->getElementJs(false));
$renderer = new HTML_QuickForm_Renderer_ITDynamic($tpl);
$form->accept($renderer);
if ($valid) {
    $clean = $form->getSubmitValues();
    $msg = sprintf("<p>Welcome <b>%s</b> you've selected these fruits:<br />%s</p>", $clean['name'], implode(', ', $clean['fruit']));
    $tpl->setVariable('message_form_validate', $msg);
}
$tpl->show();
Ejemplo n.º 3
0
if (!@(include_once $basePath . '/config/config.php')) {
    die('Unable to load file ' . $basePath . '/config/config.php');
}
require_once $basePath . '/classloader.inc.php';
@header('content-type: text/html; charset=' . ($useUtf8 ? 'UTF-8' : 'ISO-8859-1'));
if (!@(include_once ASCMS_LIBRARY_PATH . '/PEAR/HTML/Template/Sigma/Sigma.php')) {
    die('Unable to load file ' . ASCMS_LIBRARY_PATH . '/PEAR/HTML/Template/Sigma/Sigma.php');
}
if (!@(include_once $basePath . '/common.class.php')) {
    die('Unable to load file ' . $basePath . '/common.class.php');
}
if (!@(include_once $basePath . '/installer.class.php')) {
    die('Unable to load file ' . $basePath . '/installer.class.php');
}
if (!@(include_once $basePath . '/../core/Env.class.php')) {
    die('Unable to load file ' . $basePath . '/../core/Env.class.php');
}
$objCommon = new CommonFunctions();
$objInstaller = new Installer();
$objCommon->initLanguage();
$objTpl = new HTML_Template_Sigma($templatePath);
$objTpl->setErrorHandling(PEAR_ERROR_DIE);
$objTpl->loadTemplateFile('index.html');
$objTpl->setVariable('CHARSET', $useUtf8 ? 'UTF-8' : 'ISO-8859-1');
$objTpl->setVariable($_ARRLANG);
$objInstaller->checkOptions();
$objInstaller->getNavigation();
$objInstaller->getPage();
$objInstaller->getContentNavigation();
$objTpl->show();