/**
  *
  */
 protected function createControls()
 {
     $this->page = $this->controller->page;
     $this->setPostback('site', 'endEditPage', array('id' => $this->page->id, 'pa_site' => $this->page->pa_site, 'pa_module' => 'site', 'pa_action' => $this->page->pa_action, 'initPanel' => $this->request->initPanel));
     $panel = new CaptionedTabPanelControl($this, 'panel');
     $panel->setCaption('Seite » bearbeiten');
     $tabStammdaten = $panel->tabs->addTab('Stammdaten');
     $tabLayout = $panel->tabs->addTab('Layout');
     $lookup = new LookupBoxControl(null, 'pa_parent');
     $lookup->setLookupEntity(new Page())->setTextfield('pa_bezeichnung')->setValuefield('pa_id')->setGroupfield('parent')->setFilter(array('site' => $this->page->pa_site))->showNull(0, '-- Kein Parent --')->preSelect($this->page->pa_parent);
     $edit = new EditControl($tabStammdaten, 'edit');
     $edit->setEntity($this->page)->addRow('pa_ausblenden')->addRow('pa_bezeichnung')->addRow('Parent-Page', $lookup)->addRow('pa_css')->addRow('-')->addRow('pa_link')->addRow('pa_description')->addRow('pa_keywords')->addRow('pa_icon');
     $button = new SaveButtonControl($tabStammdaten, 'button');
     // region Texte
     $texte = new TranslatedTextControl($tabStammdaten, 'texte');
     $texte->setCaption('Angezeiger Text im Menü');
     $texte->setElement($this->page->getElementId());
     if ($this->request->action === 'newPage' && isset($this->request->text)) {
         $texte->setText($this->request->text);
     }
     // endregion
     // region Rechte
     $panelRechte = new CaptionedPanelControl($tabStammdaten, 'panelRechte');
     $panelRechte->setCaption('Seiten » Berechtigungen');
     $security = new SecurityCheckboxControl($panelRechte, 'berechtigung');
     $security->setElement($this->page->getElementId());
     // endregion
     // region Layout (Neu)
     if ($this->page->pa_action == 'composePage') {
         $rootRegions = Region::loadByPageAndParent($this->page->id, 0);
         foreach ($rootRegions as $region) {
             $block = $region->getBlock();
             if ($block !== null) {
                 $control = $block->toDesignModeHtml();
                 $tabLayout->add($control);
             }
         }
         $addRegion = new Controls\ChooseLayoutBlockControl($tabLayout, 'choose');
         $addRegion->setPage($this->page);
     }
     // endregion
     // region Layout (alt)
     if ($this->page->pa_action == 'useInnerTemplate') {
         $choose = new Controls\ChooseTemplateControl($tabLayout, 'pa_innertemplate');
         $choose->setChosenTemplate($this->page->pa_innertemplate);
         $choose->setOuterTemplate(Template::load($this->controller->site->si_template));
         $edit = new Controls\EditRegionsControl($tabLayout, 'editInPlace');
         $edit->setPageId($this->page->id);
         $edit->setRegions($this->page->getRegions());
         $edit->setTemplate($this->page->pa_innertemplate);
         $button = new ButtonControl($tabLayout, 'button2');
         $button->setCaption('Speichern')->setOnClick("\$('#initPanel').val(1); \$('#postback').submit();");
     }
     // endregion
 }
 /**
  * @param $outerTemplate
  */
 public function __construct($outerTemplate = '')
 {
     if ($outerTemplate != '') {
         $templateToUse = Template::load($outerTemplate);
     } else {
         $templateToUse = Template::getInstance();
     }
     // Default Templates
     $this->readTemplatesInPath('site/templates');
     // Theme Templates
     //if (file_exists($templateToUse->getTemplateDirectory())) {
     //    $this->readTemplatesInPath($templateToUse->getTemplateDirectory());
     //}
 }
 /**
  * @covers \NewFrontiers\Framework\Output\Template::listTemplates
  */
 public function testListTemplates()
 {
     $template = Template::load('test', true);
     static::assertEquals(array("another", "test"), Template::listTemplates());
 }
 /**
  * Äußeres Template ausgeben
  * @param View $view
  */
 protected function display(View $view)
 {
     Profiler::startSection('Application.display');
     // Gibt es überhaupt was zum Ausgeben? Übertragen von displayMain
     if ($view !== null) {
         $this->view = $view;
         if ($this->template === null) {
             $this->template = Configuration::get('template');
         }
         Template::load($this->template, true);
         Template::display();
     } else {
         Logging::error('Kein View zum Anzeigen gefunden');
         $this->showError();
     }
     Profiler::endSection('Application.display');
 }