From 7b3b2179db4bc4afea4512afaf92dd37e81996c8 Mon Sep 17 00:00:00 2001 From: nbm Date: Thu, 8 Dec 2005 10:44:11 +0000 Subject: [PATCH] Move admin.php into the root of the KT installation. --- admin.php | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ presentation/lookAndFeel/knowledgeTree/administration/admin.php | 96 ------------------------------------------------------------------------------------------------ 2 files changed, 96 insertions(+), 96 deletions(-) create mode 100644 admin.php delete mode 100644 presentation/lookAndFeel/knowledgeTree/administration/admin.php diff --git a/admin.php b/admin.php new file mode 100644 index 0000000..58d32f1 --- /dev/null +++ b/admin.php @@ -0,0 +1,96 @@ +aBreadcrumbs = array( + array('action' => 'administration', 'name' => 'Administration'), + ); + + parent::KTAdminDispatcher(); + } + + function do_main() { + if ($this->category !== '') { + return $this->do_viewCategory(); + }; + + + // are we categorised, or not? + $oRegistry =& KTAdminNavigationRegistry::getSingleton(); + $categories = $oRegistry->getCategories(); + + // we need to investigate sub_url solutions. + + $this->oPage->title = _("DMS Administration") . ": "; + $oTemplating = new KTTemplating; + $oTemplate = $oTemplating->loadTemplate("kt3/admin_categories"); + $aTemplateData = array( + "context" => $this, + "categories" => $categories, + "baseurl" => KTUtil::getRequestScriptName($_SERVER), + ); + return $oTemplate->render($aTemplateData); + } + + function do_viewCategory() { + // are we categorised, or not? + + $category = KTUtil::arrayGet($_REQUEST, "fCategory", $this->category); + + $oRegistry =& KTAdminNavigationRegistry::getSingleton(); + $aCategory = $oRegistry->getCategory($category); + + $aItems = $oRegistry->getItemsForCategory($category); + $this->aBreadcrumbs[] = array("name" => $aCategory["title"]); + + + $this->oPage->title = _("DMS Administration") . ": " . $aCategory["title"]; + $oTemplating = new KTTemplating; + $oTemplate = $oTemplating->loadTemplate("kt3/admin_items"); + $aTemplateData = array( + "context" => $this, + "category" => $aCategory, + "items" => $aItems, + "baseurl" => KTUtil::getRequestScriptName($_SERVER), + ); + return $oTemplate->render($aTemplateData); + } +} + +$sub_url = KTUtil::arrayGet($_SERVER, 'PATH_INFO'); +$sub_url = trim($sub_url); +$sub_url= trim($sub_url, "/"); + +if (empty($sub_url)) { + $oDispatcher = new AdminSplashDispatcher(); +} else { + $oRegistry =& KTAdminNavigationRegistry::getSingleton(); + if ($oRegistry->isRegistered($sub_url)) { + $oDispatcher = $oRegistry->getDispatcher($sub_url); + + $aParts = explode('/',$sub_url); + + $oRegistry =& KTAdminNavigationRegistry::getSingleton(); + $aCategory = $oRegistry->getCategory($aParts[0]); + + $oDispatcher->aBreadcrumbs[] = array("name" => $aCategory['title'], "url" => KTUtil::getRequestScriptName($_SERVER) . '/' . $aParts[0]); + } else { + // FIXME (minor) redirect to no-suburl? + $oDispatcher = new AdminSplashDispatcher(); + $oDispatcher->category = $sub_url; + } +} + +$oDispatcher->dispatch(); // we _may_ be redirected at this point (see KTAdminNavigation) + +?> diff --git a/presentation/lookAndFeel/knowledgeTree/administration/admin.php b/presentation/lookAndFeel/knowledgeTree/administration/admin.php deleted file mode 100644 index b46a77a..0000000 --- a/presentation/lookAndFeel/knowledgeTree/administration/admin.php +++ /dev/null @@ -1,96 +0,0 @@ -aBreadcrumbs = array( - array('action' => 'administration', 'name' => 'Administration'), - ); - - parent::KTAdminDispatcher(); - } - - function do_main() { - if ($this->category !== '') { - return $this->do_viewCategory(); - }; - - - // are we categorised, or not? - $oRegistry =& KTAdminNavigationRegistry::getSingleton(); - $categories = $oRegistry->getCategories(); - - // we need to investigate sub_url solutions. - - $this->oPage->title = _("DMS Administration") . ": "; - $oTemplating = new KTTemplating; - $oTemplate = $oTemplating->loadTemplate("kt3/admin_categories"); - $aTemplateData = array( - "context" => $this, - "categories" => $categories, - "baseurl" => KTUtil::getRequestScriptName($_SERVER), - ); - return $oTemplate->render($aTemplateData); - } - - function do_viewCategory() { - // are we categorised, or not? - - $category = KTUtil::arrayGet($_REQUEST, "fCategory", $this->category); - - $oRegistry =& KTAdminNavigationRegistry::getSingleton(); - $aCategory = $oRegistry->getCategory($category); - - $aItems = $oRegistry->getItemsForCategory($category); - $this->aBreadcrumbs[] = array("name" => $aCategory["title"]); - - - $this->oPage->title = _("DMS Administration") . ": " . $aCategory["title"]; - $oTemplating = new KTTemplating; - $oTemplate = $oTemplating->loadTemplate("kt3/admin_items"); - $aTemplateData = array( - "context" => $this, - "category" => $aCategory, - "items" => $aItems, - "baseurl" => KTUtil::getRequestScriptName($_SERVER), - ); - return $oTemplate->render($aTemplateData); - } -} - -$sub_url = KTUtil::arrayGet($_SERVER, 'PATH_INFO'); -$sub_url = trim($sub_url); -$sub_url= trim($sub_url, "/"); - -if (empty($sub_url)) { - $oDispatcher = new AdminSplashDispatcher(); -} else { - $oRegistry =& KTAdminNavigationRegistry::getSingleton(); - if ($oRegistry->isRegistered($sub_url)) { - $oDispatcher = $oRegistry->getDispatcher($sub_url); - - $aParts = explode('/',$sub_url); - - $oRegistry =& KTAdminNavigationRegistry::getSingleton(); - $aCategory = $oRegistry->getCategory($aParts[0]); - - $oDispatcher->aBreadcrumbs[] = array("name" => $aCategory['title'], "url" => KTUtil::getRequestScriptName($_SERVER) . '/' . $aParts[0]); - } else { - // FIXME (minor) redirect to no-suburl? - $oDispatcher = new AdminSplashDispatcher(); - $oDispatcher->category = $sub_url; - } -} - -$oDispatcher->dispatch(); // we _may_ be redirected at this point (see KTAdminNavigation) - -?> -- libgit2 0.21.4