Ejemplo n.º 1
0
 /**
  * displays the page content in edition mode
  */
 public function editAction()
 {
     // [AS] add CKEditor (moved from the global as it was using a lot of ressource)
     $this->view->headScript()->appendFile(Sydney_Tools::getRootUrlCdn() . '/sydneyassets/jslibs/ckeditor/ckeditor.js', 'text/javascript');
     $this->view->headScript()->appendFile(Sydney_Tools::getRootUrlCdn() . '/sydneyassets/jslibs/ckeditor/adapters/jquery.js', 'text/javascript');
     $r = $this->getRequest();
     $elid = isset($r->id) && preg_match('/^[0-9]{1,50}$/', $r->id) ? $r->id : 0;
     $emodule = isset($r->emodule) ? $r->emodule : 'pages';
     $this->view->emodule = $emodule;
     $this->view->pagstructure_id = $elid;
     $this->view->customHelpers = $this->_registry->get('customhelpers');
     switch ($emodule) {
         case 'pages':
             $nodes = new Pagstructure();
             $where = 'id = ' . $elid . ' AND safinstances_id = ' . $this->safinstancesId;
             $this->view->node = $nodes->fetchRow($where);
             $this->view->pagid = $elid;
             $this->view->moduleName = 'adminpages';
             // set layout and titles properties
             $this->setSubtitle2($this->view->node->label);
             $this->setSubtitle('Edit page');
             $this->setSideBar('edit', 'pages');
             $this->layout->langswitch = true;
             $this->layout->search = true;
             // get the div content
             $cnt = new Pagdivspage();
             $this->view->contentDivs = $cnt->getDivs($this->view->node->id, false);
             // Affichage d'un design spécifique
             $layout = new Sydney_Layout_Layout();
             /* If layout if empty we will take the one in the config */
             if (!$this->view->node->layout) {
                 $this->view->node->layout = $this->_config->general->layout;
             }
             $layout->setName($this->view->node->layout);
             if ($layout->loadZones()->hasZones()) {
                 $this->view->layout = $layout;
                 $this->view->preview = $layout->calculatePreview()->getPreview();
                 $this->view->zones = $layout->getZones();
                 $this->render('editzones');
             }
             break;
     }
 }
Ejemplo n.º 2
0
 public function getpreviewlayoutAction()
 {
     $layoutName = $this->_getParam('layoutname');
     $layout = new Sydney_Layout_Layout();
     $layout->setName($layoutName);
     $this->view->resultSet = array('preview' => $layout->calculatePreview()->getPreview());
 }
Ejemplo n.º 3
0
 /**
  * On gère ici les zones pour le design
  * @since 12/11/2013
  */
 private function manageLayoutZones()
 {
     $layoutObject = new Sydney_Layout_Layout();
     // On prend en compte les redirection
     $layoutName = !empty($this->view->thisnode['redirecttoid']) ? $this->structure->stringNodes[$this->view->thisnode['redirecttoid']]['layout'] : $this->view->thisnode['layout'];
     /* If layout if empty we will take the one in the config */
     if (!$layoutName) {
         $layoutName = $this->_config->general->layout;
     }
     $layoutObject->setName($layoutName);
     if ($layoutObject->loadZones()->hasZones()) {
         $data = array();
         $this->view->hasZone = true;
         $this->view->saveContentDivs = $this->view->contentDivs;
         // On enregistre l'ancien contentDivs
         foreach ($layoutObject->getZones() as $zoneName => $zone) {
             $this->filterContentDivByZone($zoneName);
             /* On rend "partiellement" les zones et on r�cup�re le contenu
              * g�n�rer pour apr�s l'injecter dans le template
              */
             $data[$zoneName] .= $this->view->render('index/view.phtml', null, true);
         }
         // On "injecte" les donn�es g�n�r�es dans le template
         $this->_helper->layout->assign('zones', $data);
         $this->_helper->viewRenderer->setNoRender();
     }
 }