Exemple #1
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 (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);
 }
Exemple #2
0
 private function _hasCustomTemplate()
 {
     $base = $this->_getCustomTemplateBase();
     $action = $this->_getCustomTemplateAction();
     return Template::exist($base, $action) !== false;
 }
Exemple #3
0
 private function _getTemplateActionDefault(Template $template)
 {
     $actionArray = explode('/', $template->getAction());
     end($actionArray);
     $actionArray[key($actionArray)] = 'default';
     return implode('/', $actionArray);
 }