/** * 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; } }
public function getLatestPoitionInNode($nodeId) { $tempObject = new Pagstructure(); $selector = $tempObject->select(true)->where('parent_id = ?', $nodeId)->where('safinstances_id = ?', Sydney_Tools::getSafinstancesId())->order('pagorder DESC'); $rowObject = $tempObject->fetchRow($selector); return ++$rowObject->pagorder; }
/** * */ public function editadvancedprocessAction() { $r = $this->getRequest(); $eid = 0; if ($r->id > 0) { $nodeDB = new Pagstructure(); $node = $nodeDB->fetchRow('id = ' . $r->id . ' AND safinstances_id = ' . $this->safinstancesId); $node->metakeywords = $r->metakeywords; $node->metadesc = $r->metadesc; $node->iscachable = $r->iscachable; $node->cachetime = $r->cachetime; $node->redirecttoid = $r->redirecttoid; $node->shortdesc = $r->shortdesc; $node->colorcode = $r->colorcode; $node->layout = $r->layout; $node->save(); $eid = $r->id; // GDE : 27/08/2010 - Add trace of current action Sydney_Db_Trace::add('trace.event.update_advanced_properties' . ' [' . $node->label . ']', 'adminpages', Sydney_Tools::getTableName($nodeDB), 'editadvancedproperties', $eid); } // update the linked menu $mns = new PagstructurePagmenus(); $mns->delete('pagstructure_id = ' . $eid); //Zend_Debug::dump($r->menus); if (is_array($r->menus)) { foreach ($r->menus as $mid) { $crow = $mns->createRow(); $crow->pagstructure_id = $eid; $crow->pagmenus_id = $mid; $crow->save(); } } PagstructureOp::cleanCache($this->safinstancesId); $this->redirect('/adminpages/pages/edit/id/' . $eid); }