* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
+define('PL_GLOBALS_CLASS', 'PlatalGlobals');
+define('PL_SESSION_CLASS', 'XnetSession');
+define('PL_PAGE_CLASS', 'XnetPage');
+
require_once('platal.inc.php');
require_once('globals.inc.php');
require_once('xnet/session.inc.php');
-$globals = new PlatalGlobals('XnetSession');
-XnetSession::init();
-
-function new_skinned_page($tpl_name)
-{
- global $page;
- require_once("xnet/page.inc.php");
- if (!$page instanceof XnetPage) {
- $page = new XnetPage($tpl_name);
- } else {
- $page->changeTpl($tpl_name);
- }
-}
+require_once('xnet/page.inc.php');
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
?>
// {{{ function XnetPage()
- public function __construct($tpl, $type=SKINNED)
+ public function __construct()
{
- parent::__construct($tpl, $type);
+ parent::__construct();
$this->register_function('list_all_my_groups', 'list_all_my_groups');
$this->register_modifier('cat_pp', 'cat_pp');
$this->assign('it_is_xnet', true);
- if (!S::logged() && Get::has('auth')) {
- XnetSession::doAuthX();
+ global $globals;
+ $this->assign('is_logged', S::logged());
+ if ($globals->asso('id')) {
+ $this->assign('asso', $globals->asso());
+ $this->setType($globals->asso('cat'));
+ $this->assign('is_admin', may_update());
+ $this->assign('is_member', is_member());
}
}
}
// }}}
- // {{{ function changeTpl()
-
- public function changeTpl($tpl, $type = SKINNED)
- {
- global $globals;
- parent::changeTpl($tpl, $type);
- $this->assign('is_logged', S::logged());
- if ($globals->asso('id')) {
- $this->assign('asso', $globals->asso());
- $this->setType($globals->asso('cat'));
- $this->assign('is_admin', may_update());
- $this->assign('is_member', is_member());
- }
- }
-
- // }}}
// {{{ function setType
public function setType($type)
class XnetSession
{
+ public function __construct()
+ {
+ self::init();
+ }
+
// {{{ function init
public static function init()
S::init();
+ if (!S::logged() && Get::has('auth')) {
+ XnetSession::doAuthX();
+ }
+
if (!S::logged()) {
// prevent connexion to be linked to deconnexion
if (($i = strpos($_SERVER['REQUEST_URI'], 'exit')) !== false)