Exemple #1
0
 public static function add($key, $data = null)
 {
     static::init();
     $d = parent::get($key, []);
     $d[] = $data;
     parent::set($key, $d);
     return Session::set('_messages', parent::all());
 }
Exemple #2
0
 public function result($xmlData, $intLevel = 0)
 {
     $xlyTemplate = new Dictionary();
     $xlyTemplate->set('headermenu', $this->buildHeaderMenu());
     $xlyTemplate->set('footermenu', $this->buildFooterMenu());
     // Build the body first, otherwise includes and collectors won't be executed
     $strBody = $this->dump($xmlData);
     $xlyTemplate->set('body', $strBody);
     $xlyTemplate->set('body', $strBody);
     $xlyTemplate->set('windowtitle', $this->hasAttribute('title') ? ' - ' . $this->attribute('title') : '');
     $xlyTemplate->set('header', $this->colHeader->implode());
     $xlyTemplate->set('include', ($this->hasAttribute('lang') ? '<script type="text/javascript" src="./index.php?_lang=' . $this->attribute('lang') . '"></script>' . "\n" : '') . file_get_contents(ASSET_DIR . 'html/include.html') . $this->colInclude->implode());
     $xlyTemplate->set('css', $this->colCSS->count() > 0 ? '<style type="text/css">' . "\n" . $this->colCSS->implode() . '</style>' : '');
     $xlyTemplate->set('javavars', $this->colJSVars->count() > 0 ? '<script language="JavaScript" type="text/javascript">' . "\n" . $this->colJSVars->implode() . '</script>' : '');
     $user = \APIFactory::getAuthenticator()->getUser();
     $xlyTemplate->set('javainit', '<script language="JavaScript" type="text/javascript">' . "\n" . '<!--' . "\n" . 'var AUTHENTICATED_USER = '******';' . ($this->colJSInit->count() > 0 ? 'window.addEvent(\'domready\', function(){' . "\n" . $this->colJSInit->implode() . "});\n" : '') . "\n" . '// -->' . "\n" . '</script>');
     // Insert the blocks into the template and return the result
     return $xlyTemplate->insertInto(file_get_contents(ASSET_DIR . 'html/main.html'));
 }
Exemple #3
0
 public function result($xmlData, $intLevel = 0)
 {
     $xlyTemplate = new Dictionary();
     if ($this->hasDataset('frame')) {
         $strTemplate = $this->hasDataset('frame');
     } elseif ($this->hasAttribute('file') && is_readable($this->attribute('file'))) {
         $strTemplate = $this->fileRead($this->attribute('file'));
     } else {
         throw new beanException('No Template specified for view:frame');
     }
     $arrSection = $this->children('section');
     foreach ($arrSection as $section) {
         if ($section->hasAttribute('name')) {
             $xlyTemplate->set($section->attribute('name'), $section->dump());
         }
     }
     // Insert the blocks into the template and return the result
     return $xlyTemplate->insertInto($strTemplate);
 }