Ejemplo n.º 1
0
 /**
  * The "footer_script" block allows to add runtime script in the HTML page.
  *
  * @param array $params
  *    - require (optional) comma separated list of script ids
  * @param string $content
  */
 function block_footer_script($params, $content)
 {
     $content = trim($content);
     if (!empty($content)) {
         // second call
         $this->scriptLoader->add_inline($content, empty($params['require']) ? array() : explode(',', $params['require']));
     }
 }
Ejemplo n.º 2
0
 function load()
 {
     if ($this->didAdminLoad === true) {
         return parent::load();
     } else {
         add_action($this->startAction(), array($this, 'load'));
         $this->didAdminLoad = true;
     }
 }