public function __construct($request) { $aspectPath = $this->getLibraryPath(); $rootAlias = $this->getName(); Zool::import($aspectPath, $rootAlias); $doc = ZXmlParser::fromFileToTree(APP_PATH . '/' . $request); $this->baseDocuemt = $doc; $this->currentViewId = APP_PATH . '/' . $request; $this->init(); }
private function __construct() { //$this->reset(); if (!isset($_SESSION[ZOOL_CONTEXT_NAME][self::PREVIOUS_PAGE_NAME])) { $_SESSION[ZOOL_CONTEXT_NAME][self::PREVIOUS_PAGE_NAME] = $this->previousPage = $this->currentPage = Zool::app()->request; } else { $this->previousPage = $_SESSION[ZOOL_CONTEXT_NAME][self::PREVIOUS_PAGE_NAME]; $this->currentPage = isset($_SESSION[ZOOL_CONTEXT_NAME][self::CURRENT_PAGE_NAME]) ? $_SESSION[ZOOL_CONTEXT_NAME][self::CURRENT_PAGE_NAME] : $this->previousPage; } /* * Persist previous page */ if (!isset($this->currentPage) || $this->currentPage != $this->previousPage) { $this->previousPage = isset($_SESSION[ZOOL_CONTEXT_NAME][self::CURRENT_PAGE_NAME]) ? $_SESSION[ZOOL_CONTEXT_NAME][self::CURRENT_PAGE_NAME] : Zool::app()->request; $_SESSION[ZOOL_CONTEXT_NAME][self::CURRENT_PAGE_NAME] = $this->currentPage = Zool::app()->request; $this->reset(); } /* * Reset context, if other page */ if (!isset($_SESSION[ZOOL_CONTEXT_NAME][self::CONTEXT_NAME]) || $this->currentPage != $this->previousPage) { $this->reset(); } if (isset($_SESSION[ZOOL_CONTEXT_NAME][self::CONTEXT_CLASSES_NAME])) { $this->classesNeedToLoad = $_SESSION[ZOOL_CONTEXT_NAME][self::CONTEXT_CLASSES_NAME]; } else { $this->classesNeedToLoad = array(); } if (isset($_SESSION[ZOOL_CONTEXT_NAME][self::CONTEXT_ROOT_PATHS_NAME])) { $this->rootPaths = $_SESSION[ZOOL_CONTEXT_NAME][self::CONTEXT_ROOT_PATHS_NAME]; } else { $this->rootPaths = array(); } foreach ($this->classesNeedToLoad as $class) { Zool::loadClass($class); } foreach ($this->rootPaths as $ns => $path) { Zool::import($path, $ns); } foreach ($_SESSION[ZOOL_CONTEXT_NAME][self::CONTEXT_NAME] as $key => $value) { $this->context[$key] = unserialize($value); } }