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


PHP ilYuiUtil::initEvent方法代码示例

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


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

示例1: addJavaScript

 /**
  * Add javascript files that are necessary to run accordion
  */
 static function addJavaScript()
 {
     global $tpl;
     include_once "./Services/YUI/classes/class.ilYuiUtil.php";
     ilYuiUtil::initEvent();
     ilYuiUtil::initDom();
     ilYuiUtil::initAnimation();
     ilYuiUtil::initConnection();
     $tpl->addJavaScript("./Services/Accordion/js/accordion.js", true, 3);
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:13,代码来源:class.ilAccordionGUI.php

示例2: getContent

 /**
  * Get Content.
  */
 function getContent()
 {
     global $lng, $tpl, $ilUser;
     include_once "./Services/YUI/classes/class.ilYuiUtil.php";
     ilYuiUtil::initEvent();
     ilYuiUtil::initDom();
     ilYuiUtil::initAnimation();
     $tpl->addJavaScript("./Services/JavaScript/js/Basic.js");
     $tpl->addJavaScript("Services/Form/js/Form.js");
     $this->tpl = new ilTemplate("tpl.property_form.html", true, true, "Services/Form");
     // check if form has not title and first item is a section header
     // -> use section header for title and remove section header
     // -> command buttons are presented on top
     $fi = $this->items[0];
     if ($this->getMode() == "std" && $this->getTitle() == "" && is_object($fi) && $fi->getType() == "section_header") {
         $this->setTitle($fi->getTitle());
         unset($this->items[0]);
     }
     // title icon
     if ($this->getTitleIcon() != "" && @is_file($this->getTitleIcon())) {
         $this->tpl->setCurrentBlock("title_icon");
         $this->tpl->setVariable("IMG_ICON", $this->getTitleIcon());
         $this->tpl->parseCurrentBlock();
     }
     // title
     if ($this->getTitle() != "") {
         // commands on top
         if (count($this->buttons) > 0 && $this->getShowTopButtons()) {
             // command buttons
             foreach ($this->buttons as $button) {
                 $this->tpl->setCurrentBlock("cmd2");
                 $this->tpl->setVariable("CMD", $button["cmd"]);
                 $this->tpl->setVariable("CMD_TXT", $button["text"]);
                 $this->tpl->parseCurrentBlock();
             }
             $this->tpl->setCurrentBlock("commands2");
             $this->tpl->parseCurrentBlock();
         }
         $this->tpl->setCurrentBlock("header");
         $this->tpl->setVariable("TXT_TITLE", $this->getTitle());
         $this->tpl->setVariable("LABEL", $this->getTopAnchor());
         $this->tpl->setVariable("TXT_DESCRIPTION", $this->getDescription());
         $this->tpl->parseCurrentBlock();
     }
     $this->tpl->touchBlock("item");
     // properties
     $this->required_text = false;
     foreach ($this->items as $item) {
         if ($item->getType() != "hidden") {
             $this->insertItem($item);
         }
     }
     // required
     if ($this->required_text && $this->getMode() == "std") {
         $this->tpl->setCurrentBlock("required_text");
         $this->tpl->setVariable("TXT_REQUIRED", $lng->txt("required_field"));
         $this->tpl->parseCurrentBlock();
     }
     // command buttons
     foreach ($this->buttons as $button) {
         $this->tpl->setCurrentBlock("cmd");
         $this->tpl->setVariable("CMD", $button["cmd"]);
         $this->tpl->setVariable("CMD_TXT", $button["text"]);
         $this->tpl->parseCurrentBlock();
     }
     // try to keep uploads even if checking input fails
     if ($this->getMultipart()) {
         $hash = $_POST["ilfilehash"];
         if (!$hash) {
             $hash = md5(uniqid(mt_rand(), true));
         }
         $fhash = new ilHiddenInputGUI("ilfilehash");
         $fhash->setValue($hash);
         $this->addItem($fhash);
     }
     // hidden properties
     $hidden_fields = false;
     foreach ($this->items as $item) {
         if ($item->getType() == "hidden") {
             $item->insert($this->tpl);
             $hidden_fields = true;
         }
     }
     if ($this->required_text || count($this->buttons) > 0 || $hidden_fields) {
         $this->tpl->setCurrentBlock("commands");
         $this->tpl->parseCurrentBlock();
     }
     if ($this->getMode() == "subform") {
         $this->tpl->touchBlock("sub_table");
     } else {
         $this->tpl->touchBlock("std_table");
         $this->tpl->setVariable('STD_TABLE_WIDTH', $this->getTableWidth());
     }
     return $this->tpl->get();
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:98,代码来源:class.ilPropertyFormGUI.php


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