function __construct($view = NULL, $application = NULL) { $this->controller = $view; $this->view = $view; $this->application = is_null($application) && !is_null($view) ? $view->_application : $application; $this->user =& $this->application->getCurrentUser(); }
function _readPageId() { __Request::set('pageId', 'Index'); parent::_readPageId(); }
function _startProcess($readPageId = true) { $this->log("startProcess", GLZ_LOG_SYSTEM); $this->checkSwitchLanguage(); $controller = __Request::get('controller', '', GLZ_REQUEST_ROUTING); if ($controller) { $controllerClass = org_glizy_ObjectFactory::createObject($controller, null, $this); org_glizy_helpers_PhpScript::callMethodWithParams($controllerClass, 'execute'); } $this->readSiteProperties(); $this->setTemplateFolder(); if ($readPageId) { $evt = array('type' => GLZ_EVT_BEFORE_CREATE_PAGE); $this->dispatchEvent($evt); $this->_readPageId(); } if ($this->siteMapMenu->isVisible === false) { while (true) { $parentMenu =& $this->siteMapMenu->parentNode(); if (is_null($parentMenu)) { // ERROR $e = new org_glizy_Exception(array('[%s] %s', $this->getClassName(), __T(GLZ_ERR_EMPTY_APP_PATH))); } $this->siteMapMenu =& $parentMenu; if ($parentMenu->isVisible === true) { $this->_pageId = $this->siteMapMenu->id; break; } } } // TODO da risolvare in modo migliore // creando un nuovo menu_type if ($this->siteMapMenu->pageType == 'Empty') { $currentPage =& $this->siteMapMenu; while (true) { $childNodes = $currentPage->childNodes(); if (!count($childNodes)) { org_glizy_helpers_Navigation::gotoUrl(GLZ_HOST); break; } $tempPage =& $childNodes[0]; $currentPage =& $tempPage; if ($currentPage->pageType != 'Empty') { $this->siteMapMenu =& $currentPage; $this->_pageId = $currentPage->id; break; } } } parent::_startProcess(false); }
/** * @return string */ public function getAjaxUrl() { return 'ajax.php?pageId=' . $this->_application->getPageId() . '&ajaxTarget=' . $this->getId() . '&action='; }
function getLanguage() { return !empty($this->_user->language) ? $this->_user->language : parent::getLanguage(); }