Пример #1
0
 public function __construct($name, $style = 'default', $format = null)
 {
     $this->setName($name);
     $this->setStyle($style);
     $base = LAYOUT_DIR . $this->getName() . '/';
     $action = $this->getStyle();
     if (!$format) {
         $format = Ajde_Http_Request::isAjax() && $this->exist($base, $action, 'ajax') || Ajde::app()->getDocument()->getFormat() === 'ajax' ? 'ajax' : 'html';
     }
     parent::__construct($base, $action, $format);
 }
Пример #2
0
 public function __construct($name, $style = 'default', $format = null)
 {
     $this->setName($name);
     $this->setStyle($style);
     $base = LAYOUT_DIR . $this->getName() . DIRECTORY_SEPARATOR;
     $action = $this->getStyle();
     if (!$format) {
         if (Ajde_Http_Request::isAjax() && $this->exist($base, $action, 'ajax') || Ajde::app()->getDocument()->getFormat() === 'ajax') {
             $format = 'ajax';
         } else {
             if (Ajde::app()->getDocument()->getFormat() === 'crud') {
                 $format = 'crud';
             } else {
                 $format = 'html';
             }
         }
     }
     parent::__construct($base, $action, $format);
 }
Пример #3
0
 protected function _hasCustomTemplate($action)
 {
     $base = $this->_getCustomTemplateBase();
     $action = $this->_getCustomTemplateAction($action);
     return Ajde_Template::exist($base, $action) !== false;
 }
Пример #4
0
 private function _getTemplateActionDefault(Ajde_Template $template)
 {
     $actionArray = explode('/', $template->getAction());
     end($actionArray);
     $actionArray[key($actionArray)] = 'default';
     return implode('/', $actionArray);
 }