From 5144e5e33e736a08c3d3f8235330d3fb514520cd Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Sun, 22 Jun 2008 15:31:50 +0200 Subject: [PATCH] Move xorg/xnet classes in /classes. Signed-off-by: Florent Bruneau --- include/xnet/page.inc.php => classes/xnetpage.php | 0 .../session.inc.php => classes/xnetsession.php | 0 classes/xorgpage.php | 45 ++++++++++++++++++++++ .../session.inc.php => classes/xorgsession.php | 0 include/wiki.inc.php | 1 - include/xnet.inc.php | 3 +- include/xorg.inc.php | 28 +------------- 7 files changed, 47 insertions(+), 30 deletions(-) rename include/xnet/page.inc.php => classes/xnetpage.php (100%) rename include/xnet/session.inc.php => classes/xnetsession.php (100%) create mode 100644 classes/xorgpage.php rename include/xorg/session.inc.php => classes/xorgsession.php (100%) diff --git a/include/xnet/page.inc.php b/classes/xnetpage.php similarity index 100% rename from include/xnet/page.inc.php rename to classes/xnetpage.php diff --git a/include/xnet/session.inc.php b/classes/xnetsession.php similarity index 100% rename from include/xnet/session.inc.php rename to classes/xnetsession.php diff --git a/classes/xorgpage.php b/classes/xorgpage.php new file mode 100644 index 0000000..f0d42ea --- /dev/null +++ b/classes/xorgpage.php @@ -0,0 +1,45 @@ +changeTpl('platal/index.tpl'); + } + + public function run() + { + global $globals, $platal; + if (isset($platal) && $platal->path == 'register') { + $skin = $globals->register_skin . ".tpl"; + } else { + $skin = S::v('skin', $globals->skin . ".tpl"); + } + $this->_run('skin/' . $skin); + } +} + +// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: +?> diff --git a/include/xorg/session.inc.php b/classes/xorgsession.php similarity index 100% rename from include/xorg/session.inc.php rename to classes/xorgsession.php diff --git a/include/wiki.inc.php b/include/wiki.inc.php index 4c42135..bba6b11 100644 --- a/include/wiki.inc.php +++ b/include/wiki.inc.php @@ -130,7 +130,6 @@ function wiki_apply_feed_perms($perm) } $table = $res->fetchOneAssoc(); $_SESSION = array_merge($_SESSION, $table, array('forlife' => Env::v('user'))); - require_once 'xorg/session.inc.php'; $_SESSION['perms'] =& XorgSession::make_perms($_SESSION['perms']); if ($perm == 'logged' || $_SESSION['perms']->hasFlag('admin')) { return; diff --git a/include/xnet.inc.php b/include/xnet.inc.php index fb24876..42b047d 100644 --- a/include/xnet.inc.php +++ b/include/xnet.inc.php @@ -25,11 +25,10 @@ define('PL_PAGE_CLASS', 'XnetPage'); require_once dirname(dirname(__FILE__)) . '/core/include/platal.inc.php'; require_once 'globals.inc.php'; -require_once 'xnet/session.inc.php'; -require_once 'xnet/page.inc.php'; function __autoload($cls) { + $cls = strtolower($cls); if (!pl_autoload($cls)) { if (substr($cls, -3, 3) == 'req') { @include 'validations.inc.php'; diff --git a/include/xorg.inc.php b/include/xorg.inc.php index 0d46e8d..d463f7d 100644 --- a/include/xorg.inc.php +++ b/include/xorg.inc.php @@ -26,10 +26,10 @@ define('PL_PAGE_CLASS', 'XorgPage'); require_once dirname(dirname(__FILE__)) . '/core/include/platal.inc.php'; require_once 'security.inc.php'; require_once 'globals.inc.php'; -require_once 'xorg/session.inc.php'; function __autoload($cls) { + $cls = strtolower($cls); if (!pl_autoload($cls)) { if (substr($cls, -3, 3) == 'req') { @include 'validations.inc.php'; @@ -72,31 +72,5 @@ function update_NbNotifs() $_SESSION['notifs'] = $n->numRows(); } - - -// {{{ class XorgPage - -class XorgPage extends PlPage -{ - public function __construct() - { - parent::__construct(); - - // Set the default page - $this->changeTpl('platal/index.tpl'); - } - - public function run() - { - global $globals, $platal; - if (isset($platal) && $platal->path == 'register') { - $skin = $globals->register_skin . ".tpl"; - } else { - $skin = S::v('skin', $globals->skin . ".tpl"); - } - $this->_run('skin/' . $skin); - } -} - // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: ?> -- 2.1.4