本文整理汇总了PHP中TPage类的典型用法代码示例。如果您正苦于以下问题:PHP TPage类的具体用法?PHP TPage怎么用?PHP TPage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TPage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Class constructor
* Creates the page
*/
function __construct()
{
parent::__construct();
// loads the galleria javascript library
TPage::include_js('app/lib/jquery/galleria/galleria-1.2.2.min.js');
// creates a table
$table = new TTable();
// creates the DIV element with the images
$galleria = new TElement('div');
$galleria->id = 'images';
$galleria->style = "width:600px;height:460px";
for ($n = 1; $n <= 4; $n++) {
$img = new TElement('img');
$img->src = "app/images/nature/nature{$n}.jpg";
$galleria->add($img);
}
// add the DIV to the table
$table->addRow()->addCell($galleria);
// creates the script element
$script = new TElement('script');
$script->type = 'text/javascript';
$script->add('
Galleria.loadTheme("app/lib/jquery/galleria/themes/classic/galleria.classic.min.js");
$("#images").galleria();
');
// add the script to the table
$table->addRow()->addCell($script);
// wrap the page content using vertical box
$vbox = new TVBox();
$vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
$vbox->add($table);
parent::add($vbox);
}
示例2: onLoad
public function onLoad($param)
{
parent::onLoad($param);
$list = $this->getPageList(dirname(__FILE__), '');
$this->List->DataSource = $list;
$this->List->dataBind();
}
示例3: BootstrapFormWrapper
/**
* Class constructor
* Creates the page
*/
function __construct()
{
parent::__construct();
// create the form using TQuickForm class
$this->form = new BootstrapFormWrapper(new TQuickForm());
$this->form->setFormTitle('cadastroTarefas');
// create the form fields
$id = new TEntry('id');
$id->setEditable(FALSE);
$description = new TEntry('titulo');
$list = new TCombo('prioridade');
$text = new TText('descricao');
$combo_items = array();
$combo_items['1'] = 'Baixa';
$combo_items['2'] = 'Media';
$combo_items['3'] = 'Alta';
$list->addItems($combo_items);
// add the fields inside the form
$this->form->addQuickField('Id', $id, 40);
$this->form->addQuickField('Título', $description, 250);
$this->form->addQuickField('Descrição', $text, 120);
$this->form->addQuickField('Prioridade', $list, 120);
$text->setSize(250, 50);
// define the form action
$btn = $this->form->addQuickAction('Save', new TAction(array($this, 'onSave')), 'fa:save');
$btn->class = 'btn btn-success';
$panel = new TPanelGroup('Cadastro de taredas');
$panel->add($this->form);
// wrap the page content using vertical box
$vbox = new TVBox();
$vbox->add($panel);
parent::add($vbox);
}
示例4: onInit
public function onInit($param)
{
parent::onInit($param);
if (!$this->isPostBack) {
switch ($this->Request['modus']) {
case 0:
$sql = "SELECT idtm_country, country_ful FROM tm_country";
$data = PFH::convertdbObjectArray(CountryRecord::finder()->findAllBySql($sql), array("idtm_country", "country_ful"));
$this->Country->DataSource = $data;
$this->Country->dataBind();
$this->idta_partei->Data = $this->Request['idta_partei'];
break;
case 1:
$sql = "SELECT idtm_country, country_ful FROM tm_country";
$data = PFH::convertdbObjectArray(CountryRecord::finder()->findAllBySql($sql), array("idtm_country", "country_ful"));
$this->edCountry->DataSource = $data;
$this->edCountry->dataBind();
$this->fillValues($this->getSelected($this->Request['idta_adresse']));
break;
default:
break;
}
$this->viewPanel->ActiveViewIndex = $this->Request['modus'];
}
}
示例5: onLoad
public function onLoad($param)
{
parent::onLoad($param);
date_default_timezone_set('Europe/Berlin');
if (!$this->IsPostBack || !$this->IsCallBack) {
$sql = "SELECT idta_organisation_type, org_type_name FROM ta_organisation_type";
$data = PFH::convertdbObjectArray(OrganisationTypeRecord::finder()->findAllBySql($sql), array("idta_organisation_type", "org_type_name"));
$this->RCedidta_organisation_type->DataSource = $data;
$this->RCedidta_organisation_type->dataBind();
$this->RCedidta_organisation_art->DataSource = $this->idta_organisation_art;
$this->RCedidta_organisation_art->dataBind();
$this->RCedorg_idtm_user_role->DataSource = PFH::build_SQLPullDown(UserRoleRecord::finder(), "tm_user_role", array("idtm_user_role", "user_role_name"));
$this->RCedorg_idtm_user_role->dataBind();
$this->RCedidta_branche->DataSource = PFH::build_SQLPullDown(BrancheRecord::finder(), "ta_branche", array("idta_branche", "bra_name"));
$this->RCedidta_branche->dataBind();
$this->RCedidtm_ressource->DataSource = PFH::build_SQLPullDown(RessourceRecord::finder(), "tm_ressource", array("idtm_ressource", "res_name"));
$this->RCedidtm_ressource->dataBind();
$this->RCedidtm_country->DataSource = PFH::build_SQLPullDown(CountryRecord::finder(), "tm_country", array("idtm_country", "country_iso"));
$this->RCedidtm_country->dataBind();
$this->RCedkom_type->DataSource = array(1 => "Telefon", "Fax", "Mail");
$this->RCedkom_type->dataBind();
$this->RCedorg_status->DataSource = array(0 => "offen", "interessant", "nicht interessant", "Kunde", "EX-Kunde");
$this->RCedorg_status->dataBind();
if (isset($_GET['idtm_organisation'])) {
$this->view_Organisation($_GET['idtm_organisation']);
} else {
$this->view_Organisation(1);
}
//$this->bindListOrgListe();
}
}
示例6: onLoad
public function onLoad($param)
{
parent::onLoad($param);
if (!$this->IsPostBack) {
$this->setViewState("clicks", 0);
}
}
示例7: OnInit
function OnInit($param)
{
parent::onInit($param);
include "config.php";
$repositoryid = $_GET['RepositoryID'];
$results = $this->Module->Database->Execute("SELECT * FROM repositories WHERE id=" . makeSqlString($repositoryid));
$fields = $results->fields;
$ownerid = $fields['ownerid'];
$name = $fields['name'];
if (!$this->User->isAdmin() && $this->User->getId() != $ownerid) {
echo "Not enough rights to change this repository!";
exit(-1);
}
$filename = $name . ".dump";
if (isset($_SERVER['HTTP_USER_AGENT']) && preg_match("/MSIE/", $_SERVER['HTTP_USER_AGENT'])) {
// IE Bug in download name workaround
error_log("ini_set");
ini_set('zlib.output_compression', 'Off');
}
header('Cache-Control:');
header('Pragma:');
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"{$filename}\"");
header("Content-Transfer-Encoding: binary");
passthru($svnadmin_cmd . " dump " . $svn_repos_loc . DIRECTORY_SEPARATOR . $name);
exit(0);
//$this->Application->transfer('Repository:AdminPage');
}
示例8: onLoad
public function onLoad($param)
{
parent::onLoad($param);
if (!$this->isPostBack && !$this->isCallback) {
$this->clearLog(null, null);
}
}
示例9: __construct
public function __construct()
{
parent::__construct();
try {
TTransaction::open('samples');
// abre uma transação
// cria novo objeto
$giovani = new Customer();
$giovani->name = 'Giovanni Dall Oglio';
$giovani->address = 'Rua da Conceicao';
$giovani->phone = '(51) 8111-2222';
$giovani->birthdate = '2013-02-15';
$giovani->status = 'S';
$giovani->email = 'giovanni@dalloglio.net';
$giovani->gender = 'M';
$giovani->category_id = '1';
$giovani->city_id = '1';
$giovani->store();
// armazena o objeto
new TMessage('info', 'Objeto armazenado com sucesso');
TTransaction::close();
// fecha a transação.
} catch (Exception $e) {
new TMessage('error', $e->getMessage());
}
}
示例10: onLoad
public function onLoad($param)
{
parent::onLoad($param);
$checkNewsletter = nNewsletterRecord::finder()->findByStatus(1);
if ($checkNewsletter) {
$layout = nLayoutRecord::finder()->findBy_nNewsletterID($checkNewsletter->ID);
$mail = new PHPMailer();
$mail->isSendmail();
$mail->setFrom('from@vp.d2.pl', 'First Last');
$mail->addReplyTo('from@vp.d2.pl');
$lista = nSenderRecord::finder()->findAll('nLayoutID = ? AND Status = 0 LIMIT 25', $layout->ID);
foreach ($lista as $person) {
$mail->addAddress($person->Email);
$mail->Subject = $checkNewsletter->Name;
$mail->msgHTML($layout->HtmlText);
if ($mail->send()) {
$person->Status = 1;
$person->save();
} else {
$person->Status = 5;
$person->save();
echo "Mailer Error: " . $mail->ErrorInfo;
}
}
if (empty($lista)) {
$checkNewsletter->Status = 0;
$checkNewsletter->save();
}
}
die;
}
示例11: TNotebook
/**
* Class constructor
* Creates the page and the registration form
*/
function __construct()
{
parent::__construct();
// creates the notebook
$this->notebook = new TNotebook();
$this->notebook->setSize(400, 170);
// creates the form
$this->form = new TQuickForm('form_account');
$this->notebook->appendPage('Personal details', $this->form);
// create the form fields
$email = new TEntry('email');
$first_name = new TEntry('first_name');
$last_name = new TEntry('last_name');
$phone = new TEntry('phone');
$email->setEditable(FALSE);
// add the fields
$this->form->addQuickField('Email: ', $email, 200);
$this->form->addQuickField('First name: ', $first_name, 200);
$this->form->addQuickField('Last name: ', $last_name, 200);
$this->form->addQuickField('Phone: ', $phone, 200);
// validations
$first_name->addValidation('First name', new TRequiredValidator());
$last_name->addValidation('Last name', new TRequiredValidator());
$phone->addValidation('Phone', new TRequiredValidator());
// add a form action
$this->form->addQuickAction('Confirm', new TAction(array($this, 'onConfirm')), 'ico_apply.png');
$this->form->addQuickAction('Back', new TAction(array($this, 'onBackForm')), 'ico_back.png');
// add the form to the page
parent::add($this->notebook);
}
示例12: onPreRender
public function onPreRender($param)
{
parent::onPreRender($param);
if (trim($this->_status)) {
$this->label1->Text = $this->_status;
}
}
示例13: TQuickForm
/**
* Class constructor
* Creates the page
*/
function __construct()
{
parent::__construct();
// create the form using TQuickForm class
$this->form = new TQuickForm('form_dynamic_filter');
// create the notebook
$notebook = new TNotebook(530, 160);
// adds the notebook page
$notebook->appendPage('Dynamic filtering', $this->form);
$check_gender = new TCheckGroup('check_gender');
$check_gender->addItems(array('M' => 'Male', 'F' => 'Female'));
$check_gender->setLayout('horizontal');
$combo_status = new TCombo('combo_status');
$combo_status->addItems(array('S' => 'Single', 'C' => 'Committed', 'M' => 'Married'));
$combo_customers = new TCombo('customers');
// add the fields inside the form
$this->form->addQuickField('Load customers: ', $check_gender, 200);
$this->form->addQuickField('', $combo_status, 200);
$this->form->addQuickField('', $combo_customers, 200);
$check_gender->setChangeAction(new TAction(array($this, 'onGenderChange')));
$combo_status->setChangeAction(new TAction(array($this, 'onGenderChange')));
// wrap the page content using vertical box
$vbox = new TVBox();
$vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
$vbox->add($notebook);
parent::add($vbox);
}
示例14: onLoad
public function onLoad($param)
{
parent::onLoad($param);
if (!$this->isPostBack and !$this->isCallBack) {
$this->Lbl->setText(date("h:m:s"));
}
}
示例15: onLoad
public function onLoad($param)
{
parent::onLoad($param);
$handler = $this->Application->getErrorHandler();
$this->ErrorCode->setText($handler->getErrorCode());
$this->ErrorMessage->setText($handler->getErrorMessage());
}