X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fxorg.inc.php;h=e26b20ca06af4598cb52606432cd67e4c1472b1b;hb=c4c8da69a5718740241d4f11c2f6cc3bba447396;hp=43dc4f6deb7af6f4cf30d458ef2ea787fe2af8b2;hpb=c1e60d2053a19af0198d644baa5dc337580eb395;p=platal.git diff --git a/include/xorg.inc.php b/include/xorg.inc.php index 43dc4f6..e26b20c 100644 --- a/include/xorg.inc.php +++ b/include/xorg.inc.php @@ -1,6 +1,6 @@ PlatalPage($tpl, $type); } - $page->assign('xorg_tpl', $tpl_name); + function run() + { + global $globals; + $this->assign('globals', $globals); + $this->_run('skin/'.S::v('skin', 'default.tpl')); + } } // }}} -// {{{ function new_skinned_page() +// {{{ class XorgAdmin -function new_skinned_page($tpl_name, $min_auth) +/** Une classe pour les pages réservées aux admins (authentifiés!). + */ +class XorgAdmin extends XorgPage { - _new_page(SKINNED, $tpl_name, $min_auth); + // {{{ function XorgAdmin() + + function XorgAdmin($tpl, $type = SKINNED) + { + $this->XorgPage($tpl, $type); + check_perms(); + } + + // }}} } // }}} -// {{{ function new_simple_page() -function new_simple_page($tpl_name, $min_auth) +function _new_page($type, $tpl_name, $admin=false) { global $page; - _new_page(SKINNED, $tpl_name, $min_auth); - $page->assign('simple', true); + if (!empty($admin)) { + $page = new XorgAdmin($tpl_name, $type); + } else { + $page = new XorgPage($tpl_name, $type); + } + + $page->assign('xorg_tpl', $tpl_name); } -// }}} -// {{{ function new_nonhtml_page() +// {{{ function new_skinned_page() -function new_nonhtml_page($tpl_name, $min_auth) +function new_skinned_page($tpl_name) { - _new_page(NO_SKIN, $tpl_name, $min_auth, false); + _new_page(SKINNED, $tpl_name); } // }}} @@ -80,22 +88,7 @@ function new_nonhtml_page($tpl_name, $min_auth) function new_admin_page($tpl_name) { - _new_page(SKINNED, $tpl_name, AUTH_MDP, 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); + _new_page(SKINNED, $tpl_name, true); } // }}}