Automation of the management of associations' mailing lists (Closes #817), Updates...
[platal.git] / include / xnet.inc.php
index 98275a3..e9689e3 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2006 Polytechnique.org                              *
+ *  Copyright (C) 2003-2008 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
  ***************************************************************************/
 
 require_once('platal.inc.php');
-require_once('xnet/globals.inc.php');
+require_once('globals.inc.php');
 require_once('xnet/session.inc.php');
-XnetGlobals::init();
-XnetGlobals::setlocale();
+$globals = new PlatalGlobals('XnetSession');
 XnetSession::init();
 
-// {{{ function new_skinned_page()
-
-function new_page($tpl_name, $type = SKINNED)
-{
-    global $page, $globals;
-    require_once("xnet/page.inc.php");
-    $page = new XnetPage($tpl_name, $type);
-    $page->assign('xorg_tpl', $tpl_name);
-}
-
 function new_skinned_page($tpl_name)
 {
-    return new_page($tpl_name);
-}
-
-// }}}
-// {{{ function new_group_page()
-
-function new_group_page($tpl_name)
-{
-    global $page, $globals;
-
-    new_page($tpl_name);
-
-    if (!is_member() && !S::has_perms()) {
-        $page->kill("You have not sufficient credentials");
-    }
-
-    $page->useMenu();
-    $page->assign('asso', $globals->asso());
-    $page->setType($globals->asso('cat'));
-}
-
-// }}}
-// {{{ function new_groupadmin_page()
-
-function new_groupadmin_page($tpl_name)
-{
-    global $page, $globals;
-
-    new_page($tpl_name);
-
-    if (!may_update()) {
-        $page->kill("You have not sufficient credentials");
-    }
-
-    $page->useMenu();
-    $page->assign('asso', $globals->asso());
-    $page->setType($globals->asso('cat'));
-}
-
-// }}}
-// {{{ function new_admin_page()
-
-function new_admin_page($tpl_name)
-{
-    global $page, $globals;
-
-    new_page($tpl_name);
-
-    check_perms();
-
-    $page->useMenu();
-    if ($globals->asso('cat')) {
-        $page->assign('asso', $globals->asso());
-        $page->setType($globals->asso('cat'));
+    global $page;
+    require_once("xnet/page.inc.php");
+    if (!$page instanceof XnetPage) {
+        $page = new XnetPage($tpl_name);
+    } else {
+        $page->changeTpl($tpl_name);
     }
 }
 
-// }}}
-// 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:
 ?>