$sName, "class" => $sClass, "title" => $sTitle, "description"=> $sDescription, "filepath" => $sDispatcherFilePath, "url" => $sURL, "fullname" => $sFullname); $this->aResources[$sFullname] = $aInfo; // is this a toplevel item? if ($sCategory != null) { if (!array_key_exists($sCategory, $this->aCategories)) { $this->registerCategory($sCategory, $sCategory, ''); } $this->aCategorisation[$sCategory][] = $aInfo; } } function isRegistered($sName) { if (KTUtil::arrayGet($this->aResources, $sName)) { return true; } return false; } function registerCategory($sName, $sTitle, $sDescription) { $this->aCategories[$sName] = array("title" => $sTitle, "description" => $sDescription, "name" => $sName); } function getCategories() { return $this->aCategories; } function getCategory($sCategory) { return $this->aCategories[$sCategory]; } function getItemsForCategory($sCategory) { return $this->aCategorisation[$sCategory]; } function getDispatcher($sName) { // FIXME this probably needs to use require_once mojo. $aInfo = $this->aResources[$sName]; if ($aInfo["filepath"] !== null) { require_once($aInfo["filepath"]); } if (!empty($aInfo["url"])) { return new RedirectingDispatcher($aInfo["url"]); } return new $aInfo["class"]; } } class RedirectingDispatcher { var $url = ''; function RedirectingDispatcher($sURL) { $this->url = $sURL; } function dispatch() { redirect($this->url); } } ?>