当前位置: 首页>>代码示例>>PHP>>正文


PHP TPage::include_js方法代码示例

本文整理汇总了PHP中TPage::include_js方法的典型用法代码示例。如果您正苦于以下问题:PHP TPage::include_js方法的具体用法?PHP TPage::include_js怎么用?PHP TPage::include_js使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TPage的用法示例。


在下文中一共展示了TPage::include_js方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: show

 /**
  * Show the widget at the screen
  */
 public function show()
 {
     TPage::include_js('lib/adianti/include/tfile/tfile.js');
     // define the tag properties
     $this->tag->id = $this->name . '_' . uniqid();
     $this->tag->name = 'file_' . $this->name;
     // tag name
     $this->tag->value = $this->value;
     // tag value
     $this->tag->type = 'file';
     // input type
     $this->tag->style = "width:{$this->size}px;height:{$this->height}px";
     // size
     $hdFileName = new THidden($this->name);
     $hdFileName->setValue($this->value);
     // verify if the widget is editable
     if (!parent::getEditable()) {
         // make the field read-only
         $this->tag->readonly = "1";
         $this->tag->type = 'text';
         $this->tag->{'class'} = 'tfield_disabled';
         // CSS
     }
     $div = new TElement('div');
     $div->style = "display:inline;width:100%;";
     $div->id = 'div_file_' . uniqid();
     $div->add($hdFileName);
     $div->add($this->tag);
     $div->show();
     $script = new TElement('script');
     $script->{'type'} = 'text/javascript';
     $action = 'engine.php?class=TFileUploader';
     $script->add("\n            \$(document).ready( function()\n            {\n                \$('#{$this->tag->id}').change( function()\n                {\n                    var tfile = new TFileAjaxUpload('{$this->tag->id}','{$action}','{$div->id}');\n                    \n                    tfile.initFileAjaxUpload();\n                });\n            });");
     $script->show();
 }
开发者ID:jhonleandres,项目名称:pecommerce,代码行数:38,代码来源:TFile.class.php

示例2: __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

示例3: show

 /**
  * Shows the widget at the screen
  */
 public function show()
 {
     TPage::include_js('lib/adianti/include/tentry/tentry.js');
     // 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 non-editable
     if (parent::getEditable()) {
         if (isset($this->exitAction)) {
             $string_action = $this->exitAction->serialize(FALSE);
             $this->setProperty('onBlur', "serialform=(\$('#{$this->formName}').serialize());\n                                              ajaxLookup('{$string_action}&'+serialform, this)");
         }
         if ($this->mask) {
             TPage::include_js('app/lib/include/jquery.meiomaskmoney.js');
             if ($this->mask == 'msk:money') {
                 $this->tag->{'class'} = 'tfield money';
                 $this->tag->{'id'} = $this->name;
             } else {
                 if ($this->mask == 'msk:decimal') {
                     $this->tag->{'class'} = 'tfield decimal';
                     $this->tag->{'id'} = $this->name;
                 } else {
                     if (substr($this->mask, 3) == 'msk') {
                         $this->tag->{'msk'} = substr($this->mask, 4);
                         $this->tag->{'id'} = $this->name;
                     } else {
                         $this->tag->onKeyPress = "return entryMask(this,event,'{$this->mask}')";
                     }
                 }
             }
         }
     } else {
         $this->tag->readonly = "1";
         $this->tag->{'class'} = 'tfield_disabled';
         // CSS
         $this->tag->style = "width:{$this->size}px;" . "-moz-user-select:none;";
         $this->tag->onmouseover = "style.cursor='default'";
     }
     // shows the tag
     $this->tag->show();
     if (isset($this->completion)) {
         $options = json_encode($this->completion);
         $script = new TElement('script');
         $script->add("\$('input[name=\"{$this->name}\"]').autocomplete({source: {$options} });");
         $script->show();
     }
 }
开发者ID:enieber,项目名称:adianti,代码行数:59,代码来源:TEntry.class.php

示例4: __construct

 /**
  * Class Constructor
  * @param $source Image path
  */
 public function __construct($type = 'danger', $msg = 'alerta', $titulo = "Alerta")
 {
     TPage::include_js('app/lib/PComponetes/util/js/bootstrap.js');
     TPage::include_css('app/lib/PComponetes/util/css/bootstrap.css');
     parent::__construct('div');
     $this->setType($type);
     $this->titulo = $titulo;
     $this->msg = $msg;
     $this->class = "alert alert-dismissable {$this->type} ";
     $this->role = "alert";
 }
开发者ID:jhonleandres,项目名称:pecommerce,代码行数:15,代码来源:PAlert.php

示例5: show

 /**
  * Show the widget at the screen
  */
 public function show()
 {
     TPage::include_css('lib/valums/fileuploader.css');
     TPage::include_js('lib/valums/fileuploader.js');
     // 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
     // verify if the widget is editable
     if (!parent::getEditable()) {
         // make the field read-only
         $this->tag->readonly = "1";
         $this->tag->{'class'} = 'tfield_disabled';
         // CSS
     }
     $div = new TElement('div');
     $div->style = "display:inline";
     $div->id = 'div_file_' . uniqid();
     $table = new TTable();
     $table->cellspacing = 0;
     $row = $table->addRow();
     $row->addCell($this->tag);
     $row->addCell($div);
     $table->show();
     $script = new TElement('script');
     $script->{'type'} = 'text/javascript';
     $class = 'TFileUploader';
     $script->add('
         new qq.FileUploader({
             element: document.getElementById("' . $div->id . '"),
             action: "engine.php?class=' . $class . '",
             debug: true,
             onComplete: function(id, fileName, responseJSON)
             {
                 document.getElementsByName("' . $this->name . '")[0].value= responseJSON.target;
             }
         });');
     $script->show();
 }
开发者ID:enieber,项目名称:adianti,代码行数:47,代码来源:TFile.class.php

示例6: show

 /**
  * Show the notebook at the screen
  */
 public function show()
 {
     // includes the CSS and JavaScript functions to handle notebooks
     TPage::include_css('lib/adianti/include/tnotebook/tnotebook.css');
     TPage::include_js('lib/adianti/include/tnotebook/tnotebook.js');
     // count the pages
     $pages = $this->getPageCount();
     // creates a table
     $note_table = new TTable();
     $note_table->{'width'} = $this->width;
     $note_table->{'border'} = 0;
     $note_table->{'cellspacing'} = 0;
     $note_table->{'cellpadding'} = 0;
     $note_table->{'class'} = 'notebook-table';
     // add a row for the tabs
     $row = $note_table->addRow();
     $i = 0;
     $id = $this->id;
     // get javascript code to show/hide sub-notebooks
     $subnotes_hide = $this->_getHideCode();
     $subnotes_show = $this->_getShowCode();
     if ($this->pages) {
         // iterate the tabs, showing them
         foreach ($this->pages as $title => $content) {
             // verify if the current page is to be shown
             $classe = $i == $this->currentPage ? 'tnotebook_aba_sim' : 'tnotebook_aba_nao';
             // add a cell for this tab
             if ($this->tabsVisibility) {
                 $cell = $row->addCell("&nbsp;{$title}&nbsp;");
                 $cell->{'class'} = $classe;
                 $cell->id = "aba_{$id}_{$i}";
                 $cell->height = '23px';
                 $cell->onclick = $subnotes_hide . "tnotebook_hide({$id}, {$pages});" . "tnotebook_show_tab({$id},{$i});" . $this->getShowPageCode($title);
                 // show only this page sub-contents
                 if ($this->tabAction) {
                     $this->tabAction->setParameter('current_page', $i + 1);
                     $string_action = $this->tabAction->serialize(FALSE);
                     $cell->onclick = $cell->onclick . "ajaxExec('{$string_action}')";
                 }
                 $cell->onmouseover = "javascript:tnotebook_prelight(this, {$id}, {$i})";
                 $cell->onmouseout = "javascript:tnotebook_unprelight(this, {$id}, {$i})";
                 // creates the cell spacer
                 $cell = $row->addCell('&nbsp;');
                 $cell->{'class'} = 'tnotebook_spacer';
                 $cell->width = '3px';
                 $i++;
             }
         }
     }
     // creates the cell terminator
     $cell = $row->addCell('&nbsp;');
     $cell->{'class'} = 'tnotebook_end';
     if ($this->tabsVisibility) {
         $row = $note_table->addRow();
         $row->height = '7px';
         $cell = $row->addCell('<span></span>');
         $cell->{'class'} = 'tnotebook_down';
         $cell->colspan = 100;
     }
     // show the table
     $note_table->show();
     // creates a <div> around the content
     $quadro = new TElement('div');
     $quadro->{'class'} = 'tnotebook_quadro';
     $width = $this->width - 7;
     $quadro->style = "height:{$this->height}px;width:{$width}px";
     if ($this->id == 1) {
         self::$subNotes = $this->_getSubNotes();
     }
     $i = 0;
     // iterate the tabs again, now to show the content
     if ($this->pages) {
         foreach ($this->pages as $title => $content) {
             // verify if the current page is to be shown
             if ($i == $this->currentPage and ($this->id == 1 or in_array($this->id, self::$subNotes))) {
                 $classe = 'tnotebook_painel_sim';
             } else {
                 $classe = 'tnotebook_painel_nao';
             }
             // creates a <div> for the contents
             $painel = new TElement('div');
             $painel->{'class'} = $classe;
             // CSS
             $painel->id = "painel_{$id}_{$i}";
             // ID
             $quadro->add($painel);
             // check if the content is an object
             if (is_object($content)) {
                 $painel->add($content);
             }
             $i++;
         }
     }
     $quadro_table = new TTable();
     $quadro_table->width = $this->width;
     $quadro_table->{'class'} = 'tnotebook_table';
     $quadro_table->border = 0;
//.........这里部分代码省略.........
开发者ID:jhonleandres,项目名称:pecommerce,代码行数:101,代码来源:TNotebook.class.php

示例7: show

 /**
  * Shows the tag
  */
 public function show()
 {
     TPage::include_js('lib/adianti/include/ttreeview/jquery.treeview.js');
     TPage::include_css('lib/adianti/include/ttreeview/jquery.treeview.css');
     $collapsed = $this->collapsed ? 'true' : 'false';
     $script = new TElement('script');
     $script->type = 'text/javascript';
     $script->add("\n        \t\$(document).ready(function(){\n        \t    \$('#{$this->id}').treeview({\n        \t\tpersist: 'location',\n        \t\tanimated: 'fast',\n        \t\tcollapsed: {$collapsed}\n        \t}); });");
     parent::add($script);
     parent::show();
 }
开发者ID:jhonleandres,项目名称:pecommerce,代码行数:14,代码来源:TTreeView.class.php

示例8: show

 /**
  * Shows the widget at the screen
  */
 public function show()
 {
     if ($this->mask) {
         TPage::include_js('lib/adianti/include/tentry/tentry.js');
     } else {
         if ($this->numericMask) {
             TPage::include_js('lib/adianti/include/tentry/jquery-imask-min.js');
         }
     }
     // 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 non-editable
     if (parent::getEditable()) {
         if (isset($this->exitAction)) {
             $string_action = $this->exitAction->serialize(FALSE);
             $this->setProperty('onBlur', "serialform=(\$('#{$this->formName}').serialize());\n                                              ajaxLookup('{$string_action}&'+serialform, this)", FALSE);
         }
         if ($this->mask) {
             $this->tag->onKeyPress = "return entryMask(this,event,'{$this->mask}')";
         }
     } else {
         $this->tag->readonly = "1";
         $this->tag->{'class'} = 'tfield_disabled';
         // CSS
         $this->tag->style = "width:{$this->size}px;" . "-moz-user-select:none;";
         $this->tag->onmouseover = "style.cursor='default'";
     }
     // shows the tag
     $this->tag->show();
     if (isset($this->completion)) {
         $options = json_encode($this->completion);
         $script = new TElement('script');
         $script->add("\$('input[name=\"{$this->name}\"]').autocomplete({source: {$options} });");
         $script->show();
     }
     if ($this->numericMask) {
         $script = new TElement('script');
         $script->add("\$('input[name=\"{$this->name}\"]').iMask({\n\t\t                        type : 'number',\n\t\t                        decDigits   : {$this->decimals},\n\t\t                        decSymbol   : '{$this->decimalsSeparator}',\n\t\t                        groupSymbol : '{$this->thousandSeparator}'\n\t                    });");
         $script->show();
     }
 }
开发者ID:jhonleandres,项目名称:crmbf,代码行数:54,代码来源:TEntry.class.php

示例9: show

 /**
  * Shows the widget at the screen
  */
 public function show()
 {
     if ($this->mask) {
         TPage::include_js('lib/adianti/include/tentry/tentry.js');
     } else {
         if ($this->numericMask) {
             TPage::include_js('lib/adianti/include/tentry/jquery-imask-min.js');
         }
     }
     // 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->setProperty('style', "width:{$this->size}px", FALSE);
     //aggregate style info
     if ($this->id) {
         $this->tag->id = $this->id;
     }
     // verify if the widget is non-editable
     if (parent::getEditable()) {
         if (isset($this->exitAction)) {
             if (!TForm::getFormByName($this->formName) instanceof TForm) {
                 throw new Exception(TAdiantiCoreTranslator::translate('You must pass the ^1 (^2) as a parameter to ^3', __CLASS__, $this->name, 'TForm::setFields()'));
             }
             $string_action = $this->exitAction->serialize(FALSE);
             $this->setProperty('exitaction', "serialform=(\$('#{$this->formName}').serialize());\n                                                 ajaxLookup('{$string_action}&'+serialform, document.{$this->formName}.{$this->name})", FALSE);
             $this->setProperty('onBlur', $this->getProperty('exitaction'), FALSE);
         }
         if ($this->mask) {
             $this->tag->onKeyPress = "return entryMask(this,event,'{$this->mask}')";
         }
     } else {
         $this->tag->readonly = "1";
         $this->tag->{'class'} = 'tfield_disabled';
         // CSS
         $this->tag->onmouseover = "style.cursor='default'";
     }
     // shows the tag
     $this->tag->show();
     if (isset($this->completion)) {
         $options = json_encode($this->completion);
         $script = new TElement('script');
         $script->add("\$('input[name=\"{$this->name}\"]').autocomplete({source: {$options} });");
         $script->show();
     }
     if ($this->numericMask) {
         $script = new TElement('script');
         $script->add("\$('input[name=\"{$this->name}\"]').iMask({\n\t\t                        type : 'number',\n\t\t                        decDigits   : {$this->decimals},\n\t\t                        decSymbol   : '{$this->decimalsSeparator}',\n\t\t                        groupSymbol : '{$this->thousandSeparator}'\n\t                    });");
         $script->show();
     }
 }
开发者ID:jhonleandres,项目名称:pecommerce,代码行数:57,代码来源:TEntry.class.php


注:本文中的TPage::include_js方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。