X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fxorg.inc.php;h=9d9b5923dc006c3a8eae73dde12c70bf46ce614c;hb=9e1816c7666767755abbc24f6a0df290efff81b6;hp=3b9519cbc378c74deaf01677c6c25be46826e5d0;hpb=b0b937fdb5cb3d4758d054ce9eb02d184f430ccc;p=platal.git diff --git a/include/xorg.inc.php b/include/xorg.inc.php index 3b9519c..9d9b592 100644 --- a/include/xorg.inc.php +++ b/include/xorg.inc.php @@ -1,6 +1,6 @@ PlatalPage($tpl, $type); - } - - function run() - { - global $globals; - if ($this->_page_type != NO_SKIN) { - $this->assign('menu', $globals->menu->menu()); - } - $this->_run('skin/'.S::v('skin')); - } - - function doLogin($new_name = false) - { - global $page; - if (S::logged() and !$new_name) { - $page->changeTpl('password_prompt_logged.tpl'); - $page->addJsLink('javascript/do_challenge_response_logged.js'); - } else { - $page->changeTpl('password_prompt.tpl'); - $page->addJsLink('javascript/do_challenge_response.js'); - } - $page->run(); - } -} - -// }}} -// {{{ 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(); - } - - // }}} -} - -// }}} - -function _new_page($type, $tpl_name, $admin=false) -{ - global $page; - if (!empty($admin)) { - $page = new XorgAdmin($tpl_name, $type); - } else { - $page = new XorgPage($tpl_name, $type); - } - - $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: ?>