public function __construct($title = '', $url = null) { $this->title = $title; $this->url = $url; $this->option = array(); $this->opened = 1; $this->id = MenuBoxBox::$Count++; if (Session::DATA('m' . $this->id)) { $this->opened = Session::DATA('m' . $this->id); } }
public function generate() { try { $this->setData('exec', $this->genExecList()); $this->setData('theme', $this->genThemeList()); $this->setData('script', $this->genScriptList()); $this->setData('content', $this->splitContent()); $this->setData('command', Session::DATA('command')); $this->setData('target', Session::DATA('target')); $this->setData('method', Session::DATA('method')); return Template::getInstance()->get('ajax', $this->data); } catch (CoreException $exception) { throw new CoreException("Cannot Generate Ajax Xml"); } }
$core->loadModule('org.sygil.menu.block'); $blocks = new MenuBlockManager(); $cacti = 'http://cacti.sygil.local/graph_view.php'; $block = new MenuBlockBlock('Monitoring'); $menu = new MenuBoxBox('Statistique System'); $menu->addOption(new MenuBoxOption('Aegis [sygil]', 'org.sygil.frame.open(\'' . $cacti . '?action=tree&tree_id=2\', this)')); $menu->addOption(new MenuBoxOption('Enae [sygil]', 'org.sygil.frame.open(\'' . $cacti . '?action=tree&tree_id=3\', this)')); $menu->addOption(new MenuBoxOption('Ashaan [sygil]', 'org.sygil.frame.open(\'' . $cacti . '?action=tree&tree_id=4\', this)')); $menu->addOption(new MenuBoxOption('Elorah [sygil]', null)); $menu->addOption(new MenuBoxOption('Jean-Mi [chocat]', 'org.sygil.frame.open(\'' . $cacti . '?action=tree&tree_id=5\', this)')); $menu->addOption(new MenuBoxOption('Féfé [chocat]', null)); $menu->addOption(new MenuBoxOption('Antonin [chocat]', null)); $block->addElement($menu); $menu = new MenuBoxBox('Statistique Reseau'); $menu->addOption(new MenuBoxOption('nTop', 'org.sygil.frame.open(\'http://sygil.local:3000\', this)')); $menu->addOption(new MenuBoxOption('Webalizer', 'org.sygil.frame.open(\'http://sygil.local/webalizer\', this)')); $menu->addOption(new MenuBoxOption('MailGraph', 'org.sygil.frame.open(\'http://sygil.local/mailgraph/mailgraph.cgi\', this)')); $block->addElement($menu); $menu = new MenuBoxBox('Administration'); $menu->addOption(new MenuBoxOption('phpMyAdmin', 'org.sygil.frame.open(\'http://phpmyadmin.sygil.local\', this)')); $menu->addOption(new MenuBoxOption('WebMin', 'org.sygil.frame.open(\'https://sygil.local:10000/\', this)')); $block->addElement($menu); $blocks->addBlock($block); $core->setContent($blocks); $core->addExec('menu_block.change(' . Session::DATA('default') . ');'); if (Session::DATA('close')) { $core->addExec('menu_block.close();'); } if (Session::DATA('box')) { $core->addExec('menu_box.closes([' . Session::DATA('box') . ']);'); }
<?php $core = Core::getInstance(); $core->loadModule('org.sygil.menu.vertical'); $menu = new MenuVertical(Session::DATA('target'), Session::DATA('parent')); $menu->position->setTop('45px'); $menu->position->setRight('150px'); $menu->position->setWidth('150px'); $menu->position->setZ('151'); $themes = $core->getThemeList(); foreach ($themes as $theme => $desc) { $menu->addOption($desc, 'org.sygil.utilities.switchStyle(\'' . $theme . '\');'); } $core->setData('__CONTENT__', $menu->generate());
$core->addExec('org.sygil.session.update();'); } /** * TODO a migrer en ajax **/ foreach ($preload as $script) { $core->addExec($script . ';'); } // Page central par default if (!Session::DATA('Frame') && !Session::DATA('Ajax')) { if (strpos(' ' . DEFAULT_CENTER, 'http://') > 0) { $core->addExec('org.sygil.frame.open(\'' . DEFAULT_CENTER . '\');'); } else { $core->addExec('org.sygil.ajax.load(\'' . DEFAULT_CENTER . '\',\'center\',\'replace\',[]);'); } } else { if (Session::DATA('Frame')) { $core->addExec('org.sygil.frame.open(\'' . Session::DATA('Frame') . '\',\'Last\');'); } else { $core->addExec('org.sygil.ajax.load(\'' . Session::DATA('Ajax') . '\',\'center\',\'replace\',[]);'); } } $session->save(); ob_start('ob_gzhandler'); header('Content-Type: text/html'); echo $core->generate(); } catch (SygilException $exception) { var_dump(SygilLog::getInstance()); echo $exception->getTraceAsString(); } exit(0);
<?php $core = Core::getInstance(); $core->loadModule('org.sygil.news'); $event = new NewsEvents(Session::DATA('module')); $event->setDate(Session::DATA('date')); $event->load(); $day = new NewsDaily($event); $core->setContent($day->generate());
<?php $core = Core::getInstance(); $core->loadModule('org.sygil.menu.vertical'); $menu = new MenuVertical(Session::DATA('target')); $menu->position->setTop('19px'); $menu->position->setRight('0px'); $menu->position->setWidth('150px'); $menu->position->setZ('150'); $menu->addSubMenu('Langue', 'vmenu_langue', 'org.sygil.ajax.load(\'top/langue\',\'vmenu_langue\',\'replace\',[[\'parent\',\'' . Session::DATA('target') . '\']])'); $menu->addSubMenu('Theme', 'vmenu_theme', 'org.sygil.ajax.load(\'top/theme\',\'vmenu_theme\',\'replace\',[[\'parent\',\'' . Session::DATA('target') . '\']])'); $menu->addSeparator(); $session = Session::getInstance(); if (!$session->isLogged()) { $menu->addOption('Connection', 'org.sygil.ajax.load(\'top/log\',\'window_connect\',\'replace\',[])'); $menu->addOption('Inscription', 'org.sygil.ajax.load(\'top/register\',\'window_register\',\'replace\',[])'); } else { $menu->addOption('Déconnection', 'org.sygil.ajax.load(\'top/logout\',\'window_disconnect\',\'replace\',[[\'disconnect\',1]])'); } $menu->addSeparator(); $menu->addOption('A propos..', 'org.sygil.ajax.load(\'top/about\',\'window_about\',\'replace\',[])'); //echo $menu->generate(); $core->setContent($menu);
<?php $core = Core::getInstance(); $core->loadModule('org.sygil.news'); $event = new NewsEvents(Session::DATA('module')); $event->load(); $day = new NewsDaily($event); $core->setContent($day);
<?php $core = Core::getInstance(); $core->loadModule('org.sygil.calendar'); $calendar = new Calendar('panel_right_row1'); if (Session::DATA('date')) { $calendar->setDate(Session::DATA('date')); } else { $calendar->setDate(time()); } $calendar->setKey('home/calendar'); $calendar->setType('home/news/daily'); $calendar->setModule(Session::DATA('module')); $calendar->setType('home/news/daily'); $calendar->setPanel('panel_left'); $core->setContent($calendar);
} catch (Exception $exception) { throw new Exception('Fatal Error: Cannot Load Core System', $exception); } /** * Load Session */ $session = null; try { $session = Session::getInstance(); } catch (Exception $exception) { throw new Exception('Fatal Error: Cannot Load Session', $exception); } /** * Load default template */ try { $core->load(Session::DATA('command')); $session->save(); } catch (Exception $exception) { throw new Exception('Fatal Error: Cannot Load default template', $exception); } try { ob_start('ob_gzhandler'); header('Content-Type: text/xml'); echo $core->generate(); } catch (Exception $exception) { throw new Exception('Fatal Error: Cannot Send Content', $exception); } } catch (Exception $exception) { echo $exception->getTraceAsString(); }