Moving to GitHub.
[platal.git] / include / xorg.inc.php
index 8f548f9..164293e 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2007 Polytechnique.org                              *
+ *  Copyright (C) 2003-2014 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************/
 
-require_once('platal.inc.php');
-require_once('globals.inc.php');
-require_once('xorg/session.inc.php');
-$globals = new PlatalGlobals('XorgSession');
-XorgSession::init();
+define('PL_CLASS', 'Xorg');
+define('PL_GLOBALS_CLASS', 'PlatalGlobals');
+define('PL_LOGGER_CLASS', 'PlatalLogger');
+define('PL_SESSION_CLASS', 'XorgSession');
+define('PL_PAGE_CLASS', 'XorgPage');
 
-// {{{ class XorgPage
+require_once dirname(dirname(__FILE__)) . '/core/include/platal.inc.php';
+require_once 'security.inc.php';
+require_once 'common.inc.php';
 
-class XorgPage extends PlatalPage
-{
-    function XorgPage($tpl, $type = SKINNED)
-    {
-        $this->PlatalPage($tpl, $type);
-    }
-
-    function run()
-    {
-        global $globals, $platal;
-        $this->assign('globals', $globals);
-        if ($platal->path == 'register') {
-            $skin = 'register.tpl';
-        } else {
-            $skin = S::v('skin', 'default.tpl');
-        }
-        $this->_run('skin/' . $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();
-    }
-
-    // }}}
-}
-
-// }}}
-
-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);
-}
-
-// }}}
-
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8:
 ?>