X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fxorg.inc.php;h=5aea1870fb0c3600b4c3971fc58a90e8908ddcef;hb=9162f4ed1e2f9567805f6465511d69460c83d766;hp=45dccf9f63e59cd96e0002587d0a31d2e572b9b0;hpb=fa36e5264c28077f3f7c6ea30f5edbd323401a72;p=platal.git diff --git a/include/xorg.inc.php b/include/xorg.inc.php index 45dccf9..5aea187 100644 --- a/include/xorg.inc.php +++ b/include/xorg.inc.php @@ -1,6 +1,6 @@ assign('xorg_tpl', $tpl_name); -} - -// }}} -// {{{ function new_skinned_page() - -function new_skinned_page($tpl_name, $min_auth) -{ - _new_page(SKINNED, $tpl_name, $min_auth); + public function run() + { + 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/' . $skin); + } } // }}} -// {{{ 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); } // }}} @@ -81,37 +73,10 @@ 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); -} - -// }}} -// {{{ function redirect - -function redirect($page) -{ - if (count($_SESSION)) { - session_write_close(); - } - header("Location: $page"); - exit; + _new_page(SKINNED, $tpl_name, true); } // }}} -// 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: ?>