Ejemplo n.º 1
0
 /**
  * vraci instanci sve zobrazovane page
  * @return LBoxPage
  */
 public static function getPage()
 {
     try {
         if (self::$page instanceof LBoxPage) {
             return self::$page;
         }
         $className = self::getPageCfg()->getClassName();
         if (!class_exists($className)) {
             LBoxUtil::copyClassTo(LBoxConfigSystem::getInstance()->getParamByPath("pages/classes/default"), $className);
         }
         $pageInstance = new $className(self::getPageCfg());
         if (!$pageInstance instanceof LBoxPage && !$pageInstance instanceof PageList) {
             throw new LBoxExceptionFront(LBoxExceptionFront::MSG_PAGE_BAD_TYPE, LBoxExceptionFront::CODE_PAGE_BAD_TYPE);
         }
         return self::$page = $pageInstance;
     } catch (Exception $e) {
         throw $e;
     }
 }