Beispiel #1
0
 public function getTemplate(Kwf_Component_Data $component, $type)
 {
     $template = Kwc_Abstract::getTemplateFile($component->componentClass, $type);
     if (!$template) {
         throw new Kwf_Exception("No {$type}-Template found for '{$component->componentClass}'");
     }
     return $template;
 }
 /**
  * Includes Template for current Component
  *
  * @param string $name Template Name without path and .tpl (e.g. "Mail.html")
  * @param string $module
  * @param string $model
  */
 public function includeTemplate($name = null, $module = null, $model = null)
 {
     $name = Kwc_Abstract::getTemplateFile($this->view->data->componentClass, $name);
     if (!$module) {
         $module = $this->view;
     }
     return $this->partial($name, $module, $model);
 }
 public function getTemplate(Kwf_Component_Data $component, $type)
 {
     if ($type == 'Master') {
         if (Kwc_Abstract::hasSetting($component->componentClass, 'masterTemplate')) {
             return Kwc_Abstract::getSetting($component->componentClass, 'masterTemplate');
         }
     }
     $template = Kwc_Abstract::getTemplateFile($component->componentClass, $type);
     if (!$template) {
         throw new Kwf_Exception("No {$type}-Template found for '{$component->componentClass}'");
     }
     return $template;
 }
 public static function getComponentsWithMasterTemplate($component)
 {
     $ret = array();
     $ret[] = array('type' => 'component', 'data' => $component);
     while ($component) {
         if (Kwc_Abstract::getTemplateFile($component->componentClass, 'Master') || Kwc_Abstract::hasSetting($component->componentClass, 'masterTemplate')) {
             $ret[] = array('type' => 'master', 'data' => $component);
         }
         if (Kwc_Abstract::getFlag($component->componentClass, 'resetMaster')) {
             break;
         }
         $component = $component->parent;
     }
     return $ret;
 }
 public function getTemplate(Kwf_Component_Data $component, $type)
 {
     if ($type == 'Component') {
         $mailType = 'Mail.' . $this->getRenderFormat();
     } else {
         if ($type == 'Partial') {
             $mailType = 'Partial.' . $this->getRenderFormat();
         }
     }
     $template = Kwc_Abstract::getTemplateFile($component->componentClass, $mailType);
     if (!$template) {
         $template = parent::getTemplate($component, $type);
     }
     return $template;
 }
 public function getTemplate(Kwf_Component_Data $component, $type)
 {
     if ($type == 'Component') {
         $tpl = 'Component.exp';
     } else {
         if ($type == 'Partial') {
             $tpl = 'Partial.exp';
         }
     }
     $template = Kwc_Abstract::getTemplateFile($component->componentClass, $tpl);
     if (!$template) {
         $template = parent::getTemplate($component, $type);
     }
     return $template;
 }