/** * Define the object data preview page URL * (needs to be redefined in the child class * as per the application structure) * @param Db_Object $object * @return string */ public function getStagingUrl(Db_Object $object) { $frontendRouter = new Frontend_Router(); $stagingUrl = $frontendRouter->findUrl(strtolower($object->getName())); if (!strlen($stagingUrl)) { return Request::url(array('404')); } return Request::url(array($stagingUrl, 'item', $object->getId())); }
/** * Run frontend application */ protected function _runFrontend() { Blockmanager::useHardCacheTime($this->_config->get('blockmanager_use_hardcache_time')); if ($this->_config->get('maintenance')) { $tpl = new Template(); $tpl->set('msg', Lang::lang()->get('MAINTENANCE')); echo $tpl->render($this->_config->get('templates') . 'public/error.php'); self::close(); } /* * Update "Users Online" statistics */ if ($this->_config->get('usersOnline')) { $user = User::getInstance(); if ($user->isAuthorized()) { Model::factory('Online')->addOnline(session_id(), $user->id); } } self::$_templates = $this->_config->get('templates') . 'public/'; $page = Page::getInstance(); $page->setTemplatesPath(self::$_templates); /* * Start routing */ $router = new Frontend_Router(); $router->route(); }