本文整理汇总了PHP中TElement类的典型用法代码示例。如果您正苦于以下问题:PHP TElement类的具体用法?PHP TElement怎么用?PHP TElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TElement类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: show
/**
* Show the highlighted source code
*/
public function show()
{
$span = new TElement('span');
$span->style = 'font-size:10pt';
$span->add(highlight_string($this->content, TRUE));
$span->show();
}
开发者ID:jhonleandres,项目名称:pecommerce,代码行数:10,代码来源:TSourceCode.class.php
示例2: onView
/**
* method onEdit()
* Executed whenever the user clicks at the edit button da datagrid
*/
function onView($param)
{
try {
if (isset($param['key'])) {
// get the parameter $key
$key = $param['key'];
// open a transaction with database 'changeman'
TTransaction::open('changeman');
// instantiates object Document
$object = new Document($key);
$element = new TElement('div');
$element->add($object->content);
parent::add($element);
// close the transaction
TTransaction::close();
} else {
$this->form->clear();
}
} catch (Exception $e) {
// shows the exception error message
new TMessage('error', '<b>Error</b> ' . $e->getMessage());
// undo all pending operations
TTransaction::rollback();
}
}
开发者ID:jfrank1500,项目名称:curso_php,代码行数:29,代码来源:ViewDocumentForm.class.php
示例3: __construct
/**
* Class Constructor
* @param $type Type of the message (info, error)
* @param $message Message to be shown
* @param $action Action to process
*/
public function __construct($type, $message, TAction $action = NULL)
{
$this->id = uniqid();
if (!is_null($action)) {
$this->action = '__adianti_load_page(\'' . $action->serialize() . '\');';
}
if (TPage::isMobile()) {
$img = new TElement('img');
$img->src = "lib/adianti/images/{$type}.png";
$table = new TTable();
$table->width = '250px';
$table->bgcolor = '#E5E5E5';
$table->style = "border-collapse:collapse";
$row = $table->addRow();
$row->addCell($img);
$row->addCell($message);
$table->show();
} else {
TPage::include_css('lib/adianti/include/tmessage/tmessage.css');
// creates a pannel to show the dialog
$painel = new TElement('div');
$painel->{'class'} = 'tmessage';
$painel->id = 'tmessage_' . $this->id;
// creates a table for layout
$table = new TTable();
// creates a row for the icon and the message
$row = $table->addRow();
$row->addCell(new TImage("lib/adianti/images/{$type}.png"));
$scroll = new TScroll();
$scroll->setSize(350, 70);
$scroll->add($message);
$scroll->setTransparency(true);
$cell = $row->addCell($scroll);
// add the table to the pannel
$painel->add($table);
// show the pannel
$painel->show();
$script = new TElement('script');
$script->{'type'} = 'text/javascript';
$script->add(' $(function() {
$( "#' . $painel->id . '" ).dialog({
height: 180,
width: 440,
stack: false,
zIndex: 3000,
modal: true,
buttons: {
OK: function() {
$( this ).dialog( "close" ); ' . $this->action . '
}
}
}).css("visibility", "visible");
$( "#' . $painel->id . ' a" ).click(function () {
window.open($(this).attr(\'href\'));
});
});');
$script->show();
}
}
开发者ID:enieber,项目名称:adianti,代码行数:66,代码来源:TMessage.class.php
示例4: show
/**
* Show the widget at the screen
*/
public function show()
{
if ($this->items) {
// iterate the RadioButton options
foreach ($this->items as $index => $label) {
$button = new TRadioButton($this->name);
$button->setTip($this->tag->title);
$button->setValue($index);
// check if contains any value
if ($this->value == $index) {
// mark as checked
$button->setProperty('checked', '1');
}
// check whether the widget is non-editable
if (!parent::getEditable()) {
$button->setEditable(FALSE);
}
// create the label for the button
$obj = new TLabel($label);
$obj->add($button);
$obj->show();
if ($this->layout == 'vertical') {
// shows a line break
$br = new TElement('br');
$br->show();
}
echo "\n";
}
}
}
开发者ID:jhonleandres,项目名称:crmbf,代码行数:33,代码来源:TRadioGroup.class.php
示例5: __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);
}
开发者ID:jfrank1500,项目名称:curso_php,代码行数:37,代码来源:JqueryGalleryView.class.php
示例6: __construct
/**
* método construtor
* instancia objeto TQuestion
* @param $message = pergunta ao usuário
* @param $action_yes = ação para resposta positiva
* @param $action_no = ação para resposta negativa
*/
function __construct($message, $url_yes, $url_no)
{
// instancia o painel para exibir o diálogo
$painel = new TElement('div');
$painel->class = "tquestion";
// cria um botão para a resposta positiva
$button1 = new TElement('input');
$button1->type = 'button';
$button1->value = 'Sim';
$button1->onclick = "javascript:location='{$url_yes}'";
$button1->id = 'bt1';
// cria um botão para a resposta negativa
$button2 = new TElement('input');
$button2->type = 'button';
$button2->value = 'Não';
$button2->onclick = "javascript:location='{$url_no}'";
// cria uma tabela para organizar o layout
$table = new TTable();
$table->align = 'center';
$table->cellspacing = 10;
// cria uma linha para o ícone e a mensagem
$row = $table->addRow();
$row->addCell(new TImage('app.misc/images/question.png'));
$row->addCell($message);
// cria uma linha para os botões
$row = $table->addRow();
$row->addCell($button1);
$row->align = 'left';
$row->addCell($button2);
// adiciona a tabela ao painél
$painel->add($table);
// exibe o painél
$painel->show();
}
开发者ID:laiello,项目名称:almoxarifadocedup,代码行数:41,代码来源:TQuestion.class.php
示例7: show
/**
* Shows the widget at the screen
*/
public function show()
{
if ($this->items) {
// iterate the checkgroup options
foreach ($this->items as $index => $label) {
// instantiates a new CheckButton
$button = new TCheckButton("{$this->name}[]");
$button->setTip($this->tag->title);
$button->setIndexValue($index);
$button->setProperty('checkgroup', $this->name);
// verify if the checkbutton is checked
if (@in_array($index, $this->value)) {
//$button->setProperty('checked', '1');
$button->setValue($index);
// value=indexvalue (checked)
}
// check whether the widget is non-editable
if (!parent::getEditable()) {
$button->setEditable(FALSE);
}
// create the label for the button
$obj = new TLabel($label);
$obj->add($button);
$obj->show();
if ($this->layout == 'vertical') {
// shows a line break
$br = new TElement('br');
$br->show();
echo "\n";
}
}
}
}
开发者ID:enieber,项目名称:adianti,代码行数:36,代码来源:TCheckGroup.class.php
示例8: add
/**
* Add an child element
* @param $child Any object that implements the show() method
*/
public function add($child)
{
$wrapper = new TElement('div');
$wrapper->{'style'} = 'display:inline-block;';
$wrapper->add($child);
parent::add($wrapper);
return $wrapper;
}
开发者ID:jhonleandres,项目名称:pecommerce,代码行数:12,代码来源:THBox.class.php
示例9: add
/**
* Add an child element
* @param $child Any object that implements the show() method
*/
public function add($child)
{
$wrapper = new TElement('div');
$wrapper->style = 'clear:both';
$wrapper->add($child);
parent::add($wrapper);
return $wrapper;
}
开发者ID:jhonleandres,项目名称:pecommerce,代码行数:12,代码来源:TVBox.class.php
示例10: addCellTitle
public function addCellTitle($content, $align, $stylename = 'active', $colspan = 1)
{
$td = new TElement('th');
$td->add($content);
$td->class = $stylename;
$td->style = "text-align: {$align}";
$td->colspan = $colspan;
$this->trT->add($td);
}
开发者ID:cbsistem,项目名称:PWD-Lib,代码行数:9,代码来源:PTableWriteHTML.class.php
示例11: show
public function show()
{
$time = new TElement('div');
$time->id = "ptimer_" . uniqid();
$url = 'engine.php';
$code = "\n\ntimer({$url},'{$this->page}',{$this->time},'{$time->id}');\n\n";
TScript::create($code);
$time->show();
}
开发者ID:cbsistem,项目名称:adiantiframework,代码行数:9,代码来源:Timer.class.php
示例12: __construct
/**
* Class constructor
* Creates the page and the registration form
*/
function __construct()
{
parent::__construct();
$table = new TTable();
$table->width = '100%';
// creates the form
$this->form = new TForm('form_User');
$this->form->class = 'tform';
$this->form->style = 'width: 450px;margin:auto; margin-top:10px;';
// add the notebook inside the form
$this->form->add($table);
// create the form fields
$login = new TEntry('login');
$password = new TPassword('password');
// define the sizes
$login->setSize(320, 40);
$password->setSize(320, 40);
$login->style = 'height:35px; font-size:14px;float:left;border-bottom-left-radius: 0;border-top-left-radius: 0;';
$password->style = 'height:35px;margin-bottom: 15px;font-size:14px;float:left;border-bottom-left-radius: 0;border-top-left-radius: 0;';
$row = $table->addRow();
$row->addCell(new TLabel('Login'))->colspan = 2;
$row->class = 'tformtitle';
$login->placeholder = _t('User');
$password->placeholder = _t('Password');
$user = '<span style="float:left;width:35px;margin-left:45px;height:35px;" class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>';
$locker = '<span style="float:left;width:35px;margin-left:45px;height:35px;" class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>';
$container1 = new TElement('div');
$container1->add($user);
$container1->add($login);
$container2 = new TElement('div');
$container2->add($locker);
$container2->add($password);
$row = $table->addRow();
$row->addCell($container1)->colspan = 2;
// add a row for the field password
$row = $table->addRow();
$row->addCell($container2)->colspan = 2;
// create an action button (save)
$save_button = new TButton('save');
// define the button action
$save_button->setAction(new TAction(array($this, 'onLogin')), _t('Log in'));
$save_button->class = 'btn btn-success btn-defualt';
$save_button->style = 'margin-left:32px;width:355px;height:40px;border-radius:6px;font-size:18px';
$row = $table->addRow();
$row->class = 'tformaction';
$cell = $row->addCell($save_button);
$cell->colspan = 2;
$this->form->setFields(array($login, $password, $save_button));
// add the form to the page
$caixa = new TVBox();
$caixa->style = "text-align:center";
$caixa->add(new TImage("app/images/pgo.png"));
$caixa->add($this->form);
parent::add($caixa);
}
开发者ID:jfrank1500,项目名称:curso_php,代码行数:59,代码来源:LoginForm.class.php
示例13: show
/**
* Show
*/
public function show()
{
$script = new TElement('script');
$script->{'type'} = 'text/javascript';
$code = '$(document).ready( function() {
$(\'.dropdown-toggle\').dropdown()
});';
$script->add($code);
$script->show();
parent::show();
}
开发者ID:enieber,项目名称:adianti,代码行数:14,代码来源:TMenuBar.class.php
示例14: put
/**
* método put()
* posiciona um objeto no painel
* @param $widget = objeto a ser inserido no painel
* @param $col = coluna em pixels.
* @param $row = linha em pixels.
*/
public function put($widget, $col, $row)
{
// cria uma camada para o widget
$camada = new TElement('div');
// define a posição da camada
$camada->style = "position:absolute; left:{$col}px; top:{$row}px;";
// adiciona o objeto (widget) à camada recém-criada
$camada->add($widget);
// adiciona widget no array de elementos
parent::add($camada);
}
开发者ID:laiello,项目名称:almoxarifadocedup,代码行数:18,代码来源:TPanel.class.php
示例15: tag
/**
* Create an element
* @param $tagname Element name
* @param $value Element value
* @param $attributes Element attributes
*/
public static function tag($tagname, $value, $attributes = NULL)
{
$object = new TElement($tagname);
$object->add($value);
if ($attributes) {
foreach ($attributes as $att_name => $att_value) {
$object->{$att_name} = $att_value;
}
}
return $object;
}
开发者ID:kiibe,项目名称:linkERP,代码行数:17,代码来源:TElement.php
示例16: put
/**
* Put a widget inside the panel
* @param $widget = widget to be shown
* @param $col = column in pixels.
* @param $row = row in pixels.
*/
public function put($widget, $col, $row)
{
// creates a layer to put the widget inside
$camada = new TElement('div');
// define the layer position
$camada->style = "position:absolute; left:{$col}px; top:{$row}px;";
// add the widget to the layer
$camada->add($widget);
// add the widget to the element's array
parent::add($camada);
}
开发者ID:jhonleandres,项目名称:pecommerce,代码行数:17,代码来源:TPanel.class.php
示例17: show
/**
* Shows the widget at the screen
*/
public function show()
{
$js_mask = str_replace('yyyy', 'yy', $this->mask);
if (parent::getEditable()) {
$script = new TElement('script');
$script->type = 'text/javascript';
$script->add("\n \t\$(function() {\n \$(\"#{$this->id}\").datepicker({\n showOn: 'button',\n buttonImage: 'lib/adianti/images/tdate.png',\n buttonImageOnly: true, \n \t\tchangeMonth: true,\n \t\tchangeYear: true,\n \t\tdateFormat: '{$js_mask}',\n \t\tshowButtonPanel: true\n \t});\n });");
$script->show();
}
parent::show();
}
开发者ID:enieber,项目名称:adianti,代码行数:14,代码来源:TDate.class.php
示例18: __construct
public function __construct()
{
parent::__construct('ul');
$this->class = 'dropdown-menu dropdown-messages';
$messages = array();
$messages[] = array(TSession::getValue('login'), 'Yesterday', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eleifend...');
$messages[] = array(TSession::getValue('login'), 'Yesterday', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eleifend...');
$messages[] = array(TSession::getValue('login'), 'Yesterday', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eleifend...');
$a = new TElement('a');
$a->{'class'} = "dropdown-toggle";
$a->{'data-toggle'} = "dropdown";
$a->{'href'} = "#";
$a->add(TElement::tag('i', '', array('class' => "fa fa-envelope fa-fw")));
$a->add(TElement::tag('span', count($messages), array('class' => "badge badge-notify")));
$a->add(TElement::tag('i', '', array('class' => "fa fa-caret-down")));
$a->show();
foreach ($messages as $message) {
$name = $message[0];
$date = $message[1];
$body = $message[2];
$li = new TElement('li');
$a = new TElement('a');
$div = new TElement('div');
$a->href = '#';
$li->add($a);
$a->add($div);
$div->add(TElement::tag('strong', $name));
$div->add(TElement::tag('span', TElement::tag('em', $date), array('class' => 'pull-right text-muted')));
$div2 = new TElement('div');
$div2->add($body);
$a->add($div2);
parent::add($li);
parent::add(TElement::tag('li', '', array('class' => 'divider')));
}
$li = new TElement('li');
$a = new TElement('a');
$li->add($a);
$a->class = 'text-center';
$a->href = '#';
$a->add(TElement::tag('strong', 'Read messages'));
$a->add($i = TElement::tag('i', '', array('class' => 'fa fa-inbox')));
parent::add($li);
parent::add(TElement::tag('li', '', array('class' => 'divider')));
$li = new TElement('li');
$a = new TElement('a');
$li->add($a);
$a->class = 'text-center';
$a->href = '#';
$a->add(TElement::tag('strong', 'Send message'));
$a->add($i = TElement::tag('i', '', array('class' => 'fa fa-envelope-o')));
parent::add($li);
}
开发者ID:edurbs,项目名称:sobcontrole,代码行数:52,代码来源:MessageList.class.php
示例19: __construct
/**
* método construtor
* instancia objeto TQuestion
* @param $message = pergunta ao usuário
* @param $action_yes = ação para resposta positiva
* @param $action_no = ação para resposta negativa
*/
function __construct($message, TAction $action_yes, TAction $action_no)
{
$style = new TStyle('tquestion');
$style->position = 'absolute';
$style->left = '30%';
$style->top = '30%';
$style->width = '300';
$style->height = '150';
$style->border_width = '1px';
$style->color = 'black';
$style->background = '#DDDDDD';
$style->border = '4px solid #000000';
$style->z_index = '10000000000000000';
// converte os nomes de métodos em URL's
$url_yes = $action_yes->serialize();
$url_no = $action_no->serialize();
// exibe o estilo na tela
$style->show();
// instancia o painel para exibir o diálogo
$painel = new TElement('div');
$painel->class = "tquestion";
// cria um botão para a resposta positiva
$button1 = new TElement('input');
$button1->type = 'button';
$button1->value = 'Sim';
$button1->onclick = "javascript:location='{$url_yes}'";
// cria um botão para a resposta negativa
$button2 = new TElement('input');
$button2->type = 'button';
$button2->value = 'Não';
$button2->onclick = "javascript:location='{$url_no}'";
// cria uma tabela para organizar o layout
$table = new TTable();
$table->align = 'center';
$table->cellspacing = 10;
// cria uma linha para o ícone e a mensagem
$row = $table->addRow();
$row->addCell(new TImage('app.images/question.png'));
$row->addCell($message);
// cria uma linha para os botões
$row = $table->addRow();
$row->addCell($button1);
$row->addCell($button2);
// adiciona a tabela ao painél
$painel->add($table);
// exibe o painél
$painel->show();
}
开发者ID:ricardohenriq,项目名称:learn-php,代码行数:55,代码来源:TQuestion.class.php
示例20: show
/**
* Shows the widget at the screen
*/
public function show()
{
// define the tag properties
$this->tag->name = $this->name;
// TAG name
$this->tag->value = $this->value;
// TAG value
$this->tag->type = 'text';
// input type
$this->tag->style = "width:{$this->size}px";
// size
if ($this->id) {
$this->tag->id = $this->id;
}
// verify if the widget is editable
if (parent::getEditable()) {
$this->tag->readonly = "1";
$this->tag->style = "width:40px;-moz-user-select:none;border:0;text-align:center";
$div = new TElement('div');
$div->id = $this->id . '_div';
$div->style = "width:{$this->size}px";
$main_div = new TElement('div');
$main_div->style = "text-align:center;width:{$this->size}px";
$script = new TElement('script');
$script->add(' $(function() {
$( "#' . $this->id . '_div" ).slider({
value: ' . $this->value . ',
min: ' . $this->min . ',
max: ' . $this->max . ',
step: ' . $this->step . ',
slide: function( event, ui ) {
$( "#' . $this->id . '" ).val( ui.value );
}
});
});');
$script->show();
$main_div->add($this->tag);
$main_div->add($div);
$main_div->show();
} else {
$this->tag->readonly = "1";
$this->tag->{'class'} = 'tfield_disabled';
// CSS
$this->tag->style = "width:40px;-moz-user-select:none;";
$this->tag->onmouseover = "style.cursor='default'";
$this->tag->show();
}
}
开发者ID:enieber,项目名称:adianti,代码行数:51,代码来源:TSlider.class.php
注:本文中的TElement类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论