本文整理汇总了PHP中HTML_QuickForm::toHTML方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML_QuickForm::toHTML方法的具体用法?PHP HTML_QuickForm::toHTML怎么用?PHP HTML_QuickForm::toHTML使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTML_QuickForm
的用法示例。
在下文中一共展示了HTML_QuickForm::toHTML方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderHtml
function renderHtml()
{
$kursus = new VIH_Model_LangtKursus($this->context->name());
if ($this->query("addrate")) {
if (!$kursus->addRate($this->query("addrate"))) {
throw new Exception('Kunne ikke tilføje rate.', E_USER_ERROR);
}
}
$this->document->setTitle('Opdater rater');
$pris = array('kursus' => $kursus);
if ($kursus->antalRater() == 0) {
$form = new HTML_QuickForm('rater', 'POST', $this->url());
$form->addElement('text', 'antal', 'Antal rater');
$form->addElement('text', 'foerste_rate_dato', 'Første rate dato', 'dd-mm-YYYY');
$form->addElement('submit', 'opret_rater', 'Opret rater');
$form_html = $form->toHTML();
} else {
$data = array('kursus' => $kursus);
$tpl = $this->template->create('langekurser/rater_form');
$form_html = $tpl->render($this, $data);
}
$this->document->setTitle('Rater for betaling ' . $kursus->get('kursusnavn'));
$this->document->addOption('Til kurset', $this->context->url());
$tpl = $this->template->create('langekurser/pris');
return '<p><strong>Periode</strong>: ' . $kursus->getDateStart()->format('%d-%m-%Y') . ' — ' . $kursus->getDateEnd()->format('%d-%m-%Y') . '</p>
' . $tpl->render($this, $pris) . $form_html;
}
示例2: renderHtml
function renderHtml()
{
$type_key = $this->context->getTypeKeys();
if (is_numeric($this->query('sletbillede'))) {
$fields = array('date_updated', 'pic_id');
$values = array('NOW()', 0);
$sth = $this->db->autoPrepare('langtkursus_tilmelding', $fields, DB_AUTOQUERY_UPDATE, 'id = ' . $this->query('id'));
$res = $this->db->execute($sth, $values);
if (PEAR::isError($res)) {
throw new Exception($res->getMessage());
}
}
$form = new HTML_QuickForm();
$form->addElement('hidden', 'id', $this->name());
$form->addElement('file', 'userfile', 'Fil');
$form->addElement('submit', null, 'Upload');
if ($form->validate()) {
$file = new VIH_FileHandler();
if ($file->upload('userfile')) {
$fields = array('date_updated', 'pic_id');
$values = array('NOW()', $file->get('id'));
$sth = $this->db->autoPrepare('langtkursus_tilmelding', $fields, DB_AUTOQUERY_UPDATE, 'id = ' . $form->exportValue('id'));
$res = $this->db->execute($sth, $values);
if (PEAR::isError($res)) {
throw new Exception($res->getMessage());
}
return new k_SeeOther($this->url('./'));
}
}
$tilmelding = new VIH_Model_LangtKursus_Tilmelding($this->name());
if ($tilmelding->get('id') == 0) {
throw new k_http_Response(404);
}
$file = new VIH_FileHandler($tilmelding->get('pic_id'));
$file->loadInstance('small');
$extra_html = $file->getImageHtml($tilmelding->get('name'), 'width="100""');
$file->loadInstance('medium');
$stor = $file->get('file_uri');
if (empty($extra_html)) {
$extra_html = $form->toHTML();
} else {
$extra_html .= ' <br /><a href="' . $stor . '">stor</a> <a href="' . url('./') . '?sletbillede=' . $this->name() . '" onclick="return confirm(\'Er du sikker\');">slet billede</a>';
}
$res = $this->db->query('SELECT *, DATE_FORMAT(date_start, "%d-%m %H:%i") AS date_start_dk, DATE_FORMAT(date_end, "%d-%m %H:%i") AS date_end_dk FROM langtkursus_tilmelding_protokol_item WHERE tilmelding_id = ' . (int) $this->name() . ' ORDER BY date_start DESC, date_end DESC');
if (PEAR::isError($res)) {
throw new Exception($res->getMessage());
}
$data = array('items' => $res, 'type_key' => $type_key, 'vis_navn' => false);
$this->document->setTitle($tilmelding->get('navn'));
$this->document->addOption('Ret', $this->url('../../../langekurser/tilmeldinger/' . $tilmelding->get('id')));
$this->document->addOption('Indtast', $this->url('indtast'));
$this->document->addOption('Tilmelding', $this->url('../../../langekurser/tilmeldinger/' . $tilmelding->get('id')));
$this->document->addOption('Fag', $this->url('../../../langekurser/tilmeldinger/' . $tilmelding->get('id') . '/fag'));
$this->document->addOption('Holdliste', $this->context->url());
$this->document->addOption('Diplom', $this->url('../../../langekurser/tilmeldinger/' . $tilmelding->get('id') . '/diplom'));
$tpl = $this->template->create('protokol/liste');
return '<div style="border: 1px solid #ccc; padding: 0.5em; float: right;">' . $extra_html . '</div>
' . $tpl->render($this, $data);
}
示例3: opAdd
/**
* function_description
*
* @author John.meng
* @since version - Jan 19, 2006
* @param datatype paramname description
* @return datatype description
*/
function opAdd()
{
global $__Lang__, $UrlParameter, $SiteDB, $AddIPObj, $__SITE_VAR__, $form, $FlushPHPObj, $thisDAO, $smarty, $class_path;
include_once PEAR_DIR . 'HTML/QuickForm.php';
$form = new HTML_QuickForm('firstForm', 'post', '', '_self', "onsubmit='save_in_textarea_all();'");
$renderer =& $form->defaultRenderer();
$renderer->setFormTemplate("\n<form{attributes}>\n<table border=\"0\" class=\"new_table\">\n{content}\n</table>\n</form>");
$renderer->setHeaderTemplate("\n\t<tr>\n\t\t<td class=\"grid_table_head\" align=\"left\" valign=\"top\" colspan=\"2\"><b>{header}</b></td>\n\t</tr>");
$class_path = INCLUDE_DIR . "editor/";
$CurrentUserPathImages = HTML_IMAGES_DIR;
$SiteCssFile = CURRENT_HTML_DIR . "style.css";
$row = $this->_DAO->getRowByID(SITE_CONTENT_TABLE, "SiteMenuID", $_GET['MenuID']);
$Content = $row["Content"];
$ed_4 =& new rich("", 'Content', $Content, "380", "350", "../../" . $CurrentUserPathImages, "../../" . $CurrentUserPathImages, false, false);
$ed_4->set_default_stylesheet($SiteCssFile);
$ed_4->myModule(true);
$editors = $ed_4->draw();
$smarty->assign("class_path_editor", $class_path);
$form->addElement('header', null, $__Lang__['langGeneralUpdate'] . " " . $__Lang__['langSiteModuleSingleContent']);
$form->addElement('static', 'Content', NULL, $editors);
$form->addElement('submit', null, $__Lang__['langGeneralSubmit']);
$form->addRule('Title', $__Lang__['langGeneralPleaseEnter'] . " " . $__Lang__['langModuleNewsTitle'], 'required');
$form->addElement('hidden', 'Module', $_REQUEST['Module']);
$form->addElement('hidden', 'Page', $_REQUEST['Page']);
$form->addElement('hidden', 'Action', $_REQUEST['Action']);
$form->addElement('hidden', 'MenuID', $_GET['MenuID']);
if ($form->validate()) {
if (get_magic_quotes_gpc()) {
$record["Content"] = stripslashes($_POST['Content']);
} else {
$record["Content"] = $_POST['Content'];
}
$record["SiteMenuID"] = $_POST['MenuID'];
$record = $record + $this->_DAO->baseField();
$this->_DAO->autoInsertOrUpdate(SITE_CONTENT_TABLE, $record, array("SiteMenuID"));
echo "<SCRIPT LANGUAGE='JavaScript'>opener.window.location.reload();window.close();</SCRIPT>";
}
$html_code = "<link rel=\"StyleSheet\" type=\"text/css\" href=\"" . $class_path . "rich_files/rich.css\"><script language=\"JScript.Encode\" src=\"" . $class_path . "rich_files/rich.js\"></script>" . $form->toHTML();
$smarty->assign("Main", str_replace(ROOT_DIR, "../", $html_code));
}
示例4: array
require_once 'include_elevforeningen.php';
require_once 'HTML/QuickForm.php';
//require_once 'Template/Template.php';
require_once 'IntrafacePublic/Contact/XMLRPC/Client.php';
session_start();
$credentials = array('private_key' => INTRAFACE_PRIVATE_KEY, 'session_id' => md5(session_id()));
$form = new HTML_QuickForm('login', 'get');
$form->addElement('text', 'handle', 'Kode');
$form->addElement('submit', null, 'Login');
$form->addRule('handle', 'Du skal indtaste en kode', 'required');
$form->applyFilter('__ALL__', 'trim');
$form->applyFilter('__ALL__', 'strip_tags');
$form->applyFilter('__ALL__', 'addslashes');
$form->setDefaults(array('handle' => @$_GET['handle']));
if ($form->validate()) {
$auth = new IntrafacePublic_Contact_XMLRPC_Client($credentials);
$contact_array = $auth->authenticateContact($form->exportValue('handle'));
$_SESSION['contact_id'] = $contact_array['id'];
if ($auth->isLoggedIn()) {
header('Location: index.php');
exit;
}
}
$tpl = new Template(PATH_TEMPLATE_KUNDELOGIN);
$tpl->set('title', 'Login');
$tpl->set('content_main', '
<h1>Login</h1>
<p>Du kan logge ind ved at indtaste din kode.</p>
' . $form->toHTML());
echo $tpl->fetch('main.tpl.php');
示例5: Template
var_dump($eval);
echo "</pre>";
*/
}
} else {
trigger_error('Kommunikationsfejl med PBS eller QuickPay', E_USER_ERROR);
}
}
$tpl = new Template(PATH_TEMPLATE_KUNDELOGIN);
$tpl->set('title', 'Betaling med dankort');
$tpl->set('body_class', 'sidebar');
$tpl->set('content_main', '
<div id="content-main">
<h1>Betaling</h1>
<p>Tak fordi du bruger <span class="dankort">Dankort</span> til at betale for din tilmelding.</p>
<p><strong>Du skal betale ' . number_format($betaling_amount, 0, ',', '.') . ' kroner.</strong></p>
' . $extra_text . '
' . $error . $form->toHTML() . '</div>
<div id="content-sub">
<h2>Sikkerhedsnummeret</h2>
<p>Du finder sikkerhedsnummeret (cvd) bag på Dankortet.</p>
<p><img src="/gfx/images/dankort_cifre.gif" alt="Hvor er sikkerhedscifrene" /></p>
<h2>Sikkerhed</h2>
<p>Du kan læse mere om sikkerhed og <span class="dankort">Dankort</span> på <a href="http://www.betaling.dk/" title="Linket åbner i et nyt vindue" target="_blank">PBS</a>.</p>
<p>Vores betalingsløsning ligger på en sikker server, og vi gemmer aldrig kortoplysninger i vores database.</p>
<p>Hvis du har spørgsmål, er du velkommen til at ringe til os på telefon 7582 0811.</p>
</div>
');
echo $tpl->fetch('main.tpl.php');
示例6: Copyright
<?php
/*
+----------------------------------------------------------------------+
| FlushPHP |
+----------------------------------------------------------------------+
| Copyright (c) 2005-2006 The FlushPHP Group |
+----------------------------------------------------------------------+
| This library is free software; you can redistribute it and/or |
| modify it under the terms of the GNU Lesser General Public |
| License as published by the Free Software Foundation; either |
| version 2.1 of the License, or (at your option) any later version. |
+----------------------------------------------------------------------+
| Author: John.meng(цот╤РШ) 2006-1-8 11:14:45
+----------------------------------------------------------------------+
*/
/* $Id: AboutUs.php,v 1.1 2006/01/08 05:33:34 arzen Exp $ */
if (empty($__Version__)) {
echo "Big error! ";
exit;
}
include_once PEAR_DIR . 'HTML/QuickForm.php';
$form = new HTML_QuickForm('firstForm');
$renderer =& $form->defaultRenderer();
$renderer->setFormTemplate("\n<form{attributes}>\n<table border=\"0\" class=\"new_table\">\n{content}\n</table>\n</form>");
$renderer->setHeaderTemplate("\n\t<tr>\n\t\t<td class=\"grid_table_head\" align=\"left\" valign=\"top\" colspan=\"2\"><b>{header}</b></td>\n\t</tr>");
$form->addElement('header', null, $__Lang__['langGeneralAbout']);
$form->addElement('static', NULL, NULL, $__Lang__['langGeneralAboutUsInfo']);
$smarty->assign("Main", $form->toHTML());
示例7: array
$res .= '<p style="font:10px verdana;">A 100% de remplissage, un mail sera envoyé à l\'ensemble des pré-inscrits pour fixer la date de la formation.</p>';
}
$form_contact = new HTML_QuickForm('preinscription', 'post', $this->config['base_url'] . $page . '/preinscription');
$squelette =& $form_contact->defaultRenderer();
$squelette->setFormTemplate("\n" . '<form {attributes}>' . "\n" . '{content}' . "\n" . '</form>' . "\n");
$squelette->setElementTemplate('<label style="display:block;float:left;clear:both;width:75px;text-align:right;margin:2px;font:10px verdana;">{label} </label>' . "\n" . '{element}' . "\n" . '<!-- BEGIN required --><span style="color:red;font:10px verdana;">*</span><!-- END required -->' . "\n" . '<br />' . "\n");
$squelette->setRequiredNoteTemplate("\n" . '<span style="color:red;font:10px verdana;float:right;">* {requiredNote}</span>' . "\n");
$option = array('style' => 'width:100px;border:1px solid black;font:10px verdana;margin:2px;', 'maxlength' => 100);
$form_contact->setRequiredNote('champs obligatoire');
$form_contact->setJsWarnings('erreur de saisie', 'corrigez les erreurs suivantes');
$form_contact->addElement('hidden', 'mailadmin', $mailadmin);
$form_contact->addElement('hidden', 'pagerenvoi', $this->tag);
$form_contact->addElement('text', 'Prenom', 'Prénom', $option);
$form_contact->addRule('Prenom', 'Prenom requis', 'required', '', 'client');
$form_contact->addElement('text', 'Nom', 'Nom', $option);
$form_contact->addRule('Nom', 'Nom requis', 'required', '', 'client');
$form_contact->addElement('text', 'Expediteur', 'Adresse mail', $option);
$form_contact->addRule('Expediteur', 'Adresse mail requise', 'required', '', 'client');
$form_contact->addRule('Expediteur', 'L\'adresse mail doit etre de la forme nom@domaine.ext', 'email', '', 'client');
$tarifs = array('100' => '100 euros (OPCA)', '25' => '25 euros (chômeurs, étudiants)');
$form_contact->addElement('select', 'Tarif', 'Tarif', $tarifs, $option);
//sécurité: il faut que javascript soit activé (passage par le template
$option = array('class' => 'bouton_antispam');
$form_contact->addElement('hidden', 'jsenabled', 'N', $option);
$option = array('style' => 'width:100px;border:1px solid black;font:10px verdana;margin:2px;', 'onclick' => '$(".bouton_antispam").val(\'Y\');return true;');
$form_contact->addElement('submit', 'Envoyer', 'Envoyer', $option);
$res .= $form_contact->toHTML() . '</div>';
} else {
$res = '';
}
echo $res;