X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fxorg.inc.php;h=62bfbe8fb1628e92aeb3bf7ea718a755f151f83c;hb=bd5e1f3db498fab68593b5163df0f0b8c3b67791;hp=209de7cd253052a163ba3ad5197a921412aae6eb;hpb=801fcad813666310da1ca5b6f07f91cfed1abbee;p=platal.git diff --git a/include/xorg.inc.php b/include/xorg.inc.php index 209de7c..62bfbe8 100644 --- a/include/xorg.inc.php +++ b/include/xorg.inc.php @@ -1,6 +1,6 @@ PlatalPage($tpl, $type); + parent::__construct($tpl, $type); } - // }}} - // {{{ function run() - - function run() + public function run() { - global $globals; - if ($this->_page_type != NO_SKIN) { - $this->assign('menu', $globals->menu->menu()); + global $globals, $platal; + $this->assign('globals', $globals); + if (isset($platal) && $platal->path == 'register') { + $skin = 'register.tpl'; + } else { + $skin = S::v('skin', 'default.tpl'); } - $this->_run('skin/'.S::v('skin')); - } - - // }}} -} - -// }}} -// {{{ class XorgAdmin - -/** Une classe pour les pages réservées aux admins (authentifiés!). - */ -class XorgAdmin extends XorgPage -{ - // {{{ function XorgAdmin() - - function XorgAdmin($tpl, $type=SKINNED) - { - $this->XorgPage($tpl, $type); - check_perms(); + $this->_run('skin/' . $skin); } - - // }}} } -// }}} +// {{{ function new_skinned_page() -function _new_page($type, $tpl_name, $admin=false) +function new_skinned_page($tpl_name) { global $page; - if (!empty($admin)) { - $page = new XorgAdmin($tpl_name, $type); + if (!$page instanceof XorgPage) { + $page = new XorgPage($tpl_name); } else { - $page = new XorgPage($tpl_name, $type); + $page->changeTpl($tpl_name); } - - $page->assign('xorg_tpl', $tpl_name); } -// {{{ function new_skinned_page() - -function new_skinned_page($tpl_name) -{ - _new_page(SKINNED, $tpl_name); -} - -// }}} -// {{{ function new_admin_page() - -function new_admin_page($tpl_name) -{ - _new_page(SKINNED, $tpl_name, true); -} - -// }}} -// {{{ function new_admin_table_editor() - -function new_admin_table_editor($table, $idfield, $idedit=false) -{ - array_walk($_GET, 'unfix_gpc_magic'); - array_walk($_POST, 'unfix_gpc_magic'); - array_walk($_REQUEST, 'unfix_gpc_magic'); - - global $editor; - new_admin_page('table-editor.tpl'); - require_once('xorg.table-editor.inc.php'); - $editor = new XOrgAdminTableEditor($table, $idfield, $idedit); -} - -// }}} - -// vim:set et sw=4 sts=4 sws=4 foldmethod=marker: +// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: ?>