use php5-isms
[platal.git] / include / xorg.inc.php
index 3b9519c..deb9a49 100644 (file)
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************/
+
 require_once('platal.inc.php');
-require_once('xorg/globals.inc.php');
+require_once('globals.inc.php');
 require_once('xorg/session.inc.php');
-XorgGlobals::init();
-XorgGlobals::setlocale();
+$globals = new PlatalGlobals('XorgSession');
 XorgSession::init();
 
-require_once('platal/page.inc.php');
+require_once dirname(__FILE__).'/../classes/page.php';
 
 // {{{ class XorgPage
 
 class XorgPage extends PlatalPage
 {
-    function XorgPage($tpl, $type=SKINNED)
+    function XorgPage($tpl, $type = SKINNED)
     {
         $this->PlatalPage($tpl, $type);
     }
@@ -39,23 +39,8 @@ class XorgPage extends PlatalPage
     function run()
     {
         global $globals;
-        if ($this->_page_type != NO_SKIN) {
-            $this->assign('menu', $globals->menu->menu());
-        }
-        $this->_run('skin/'.S::v('skin'));
-    }
-
-    function doLogin($new_name = false)
-    {
-        global $page;
-        if (S::logged() and !$new_name) {
-            $page->changeTpl('password_prompt_logged.tpl');
-            $page->addJsLink('javascript/do_challenge_response_logged.js');
-        } else {
-            $page->changeTpl('password_prompt.tpl');
-            $page->addJsLink('javascript/do_challenge_response.js');
-       }
-        $page->run();
+        $this->assign('globals', $globals);
+        $this->_run('skin/'.S::v('skin', 'default.tpl'));
     }
 }
 
@@ -68,7 +53,7 @@ class XorgAdmin extends XorgPage
 {
     // {{{ function XorgAdmin()
 
-    function XorgAdmin($tpl, $type=SKINNED)
+    function XorgAdmin($tpl, $type = SKINNED)
     {
         $this->XorgPage($tpl, $type);
         check_perms();
@@ -107,21 +92,6 @@ function new_admin_page($tpl_name)
 }
 
 // }}}
-// {{{ 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);
-}
-
-// }}}
 
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
 ?>