예제 #1
0
 /**
  * Constructs a new template view
  * @param \ride\library\template\Template $template Instance of the
  * template to render
  * @return null
  */
 public function __construct(Node $node, Theme $theme, $locale)
 {
     $template = new GenericThemedTemplate();
     $template->setResource('cms/frontend/index');
     $template->setResourceId($node->getId());
     $template->setTheme($theme->getName());
     $template->set('app', array('cms' => array('node' => $node, 'site' => $node->getRootNodeId()), 'locale' => $locale));
     parent::__construct($template);
     $this->cache = null;
     $this->cacheItem = null;
     $this->cachedViews = null;
     $this->contentView = null;
 }
 /**
  * Creates a form to select the region
  * @param \ride\library\cms\node\Node $node
  * @param \ride\library\cms\theme\Theme $theme
  * @param string $region
  * @return \ride\library\form\Form
  */
 protected function buildRegionForm(Node $node, Theme $theme = null, $region = null)
 {
     if ($theme) {
         $regions = $theme->getRegions();
     } else {
         $regions = array();
     }
     $form = $this->createFormBuilder(array('region' => $region));
     $form->setId('form-region-select');
     $form->addRow('region', 'select', array('options' => $regions));
     return $form->build();
 }