public function init() { //parent::init(); $usersData = Sydney_Tools::getUserdata(); $this->view->cdn = Sydney_Tools::getRootUrlCdn(); $this->view->allowPermission = in_array(7, $usersData['member_of_groups']); }
/** * 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; } }
private function setLayoutLoginAdmin() { $this->view->headLink()->appendStylesheet($this->view->cdn . '/sydneyassets/styles/reset.css'); $this->view->headLink()->appendStylesheet($this->view->cdn . '/sydneyassets/styles/main.css'); $this->view->headLink()->appendStylesheet($this->view->cdn . '/sydneyassets/styles/antidot.css'); $this->view->headLink()->appendStylesheet($this->view->cdn . '/sydneyassets/styles/antidotprint.css', 'print'); $this->view->headLink()->appendStylesheet('/sydneyassets/jslibs/jquery/css/smoothness/jquery-ui-1.10.4.min.css'); $this->view->headScript()->appendFile(Sydney_Tools::getRootUrlCdn() . '/sydneyassets/scripts/sydneyscripts.js', 'text/javascript'); $this->_helper->layout->setLayoutPath(Sydney_Tools_Paths::getCorePath() . '/webinstances/sydney/layouts'); $this->_helper->layout->setLayout('login'); }
/** * Returns the HTML for the possible action for a node * * ( * [id] => 4031 * [label] => Welcome in Sydney docs * [isCollapsed] => * [status] => published * [datemodified] => 2010-11-24 06:38:37 * [date_lastupdate_content] => 2010-11-24 06:38:37 * [who_modified] => Gilles Demaret * [who_lastupdate_content] => Gilles Demaret * [ishome] => 1 * [iscachable] => * [cachetime] => 0 * [menusid] => Array * ( * ) * * [redirecttoid] => 0 * [usersgroups_id] => 2 * [pagorder] => 0 * [kids] => Array * ( * ) * * [stats] => Array * ( * ) * * ) * * * @return String HTML string * @param int $dbid [optional] DB ID of the node * @param int $ishome [optional] */ private function getActionsHtml($dbid = 0, $ishome = 0, $status = 'draft', $node = '') { $hidit = $ishome == 1 ? ' invisible' : ''; $btnStatus = $status != 'published' ? 'publish' : 'unpublish'; $toret = '<div id="adminpageaction-' . $dbid . '" style="display:none; text-align:right;" class="adminpages_action_container">'; $toret .= ' <div class="actionsContainer"> <span class="actions"> <a class="button ' . $btnStatus . '" id="btn_publish_' . $dbid . '" dbid="' . $dbid . '"> ' . ucfirst($btnStatus) . ' </a> <a class="button" href="/adminpages/index/create/parentid/' . $dbid . '"> <img src="' . Sydney_Tools::getRootUrlCdn() . '/sydneyassets/images/ui/button/icon_add.png"/> Add a sub-page </a> <a class="button" href="/adminpages/index/editproperties/id/' . $dbid . '"> Properties </a> <a class="button duplicate" dbid="' . $dbid . '" href="#"> Duplicate </a> <a class="button warning' . $hidit . ' deletenodea" dbid="' . $dbid . '" href="#"> Delete </a> </span> </div>'; $toret .= '</div>'; return $toret; }
/** * * @param unknown_type $type * @param Zend_View $zview * @param unknown_type $useCompression * @param unknown_type $useConcatenation * @param unknown_type $ctrl */ public static function concatScripts($type, Zend_View $zview, $useConcatenation = true) { $r = ''; $path = Sydney_Tools_Paths::getCorePath() . '/webinstances/sydney/html'; $path2 = Sydney_Tools_Paths::getJslibsPath(); $arrayOrig['jsOrig'] = Zend_Registry::getInstance()->get('config')->admin->js->orig; $arrayOrig['cssOrig'] = Zend_Registry::getInstance()->get('config')->admin->css->orig; $arrayLibs['jsLibs'] = Zend_Registry::getInstance()->get('config')->admin->js->libs; $arrayLibs['cssLibs'] = Zend_Registry::getInstance()->get('config')->admin->css->libs; /** * CSS + JS */ // adding the main files from the jslibs foreach ($arrayLibs[$type . 'Libs'] as $file) { if ($useConcatenation) { if (file_exists($path2 . $file)) { $tcnt = file_get_contents($path2 . $file); if ($type == 'css' && preg_match('#sydneyassets\\/jslibs\\/jquery#', $file)) { $needleStr = "#url\\(\"images\\/([a-zA-Z0-9_-]+)\\.(png|gif|jpg)\"#"; $replaceStr = "url(" . Sydney_Tools_Paths::getRootUrlCdn() . "\\/sydneyassets\\/jslibs\\/jquery\\/css\\/smoothness\\/images\\/\$1.\$2"; $tcnt = preg_replace($needleStr, $replaceStr, $tcnt); } if ($type == 'css' && preg_match('/skins\\/sam/', $file)) { $pht = preg_replace("/^\\/assets\\/yui\\/build\\/([A-z]{1,50})\\/assets\\/skins\\/sam\\/([A-z-_]{1,50}(\\.css))/", "/sydneyassets/yui/build/\\1/assets/skins/sam/", $file); $tcnt = str_replace('../../../../assets/skins/sam/', Sydney_Tools::getRootUrlCdn() . '/sydneyassets/yui/build/assets/skins/sam/', $tcnt); $tcnt = preg_replace("/url\\(([A-z0-9_-]{1,50})\\.(png)\\)/", "url(" . $pht . "\\1.\\2)", $tcnt); } $r .= "/* =========== File: " . $path2 . $file . " ================ */ \n\n\n" . $tcnt . "\n\n\n\n"; } } else { if ($type == 'css') { $zview->headLink()->appendStylesheet($file); } else { // GDE - 19/08/2013 - On va chercher "jslibs" sur le cdn (com.antidot.sydney) $zview->headScript()->appendFile(Zend_Registry::getInstance()->get('config')->general->cdn . $file, 'text/javascript'); } } } // adding the main files foreach ($arrayOrig[$type . 'Orig'] as $file) { if ($useConcatenation) { $tcnt = file_get_contents($path . $file); $r .= "/* =========== File: " . $path . $file . " ================ */ \n\n\n" . $tcnt . "\n\n\n\n"; } else { if ($type == 'css') { $zview->headLink()->appendStylesheet($file); } else { $zview->headScript()->appendFile(Sydney_Tools::getRootUrlCdn() . $file, 'text/javascript'); } } } // END Foreach /** * JS */ if ($type == 'js') { // adding the UI files $t = self::getDirList($path . '/sydneyassets/scripts/ui/'); foreach ($t as $file) { if ($useConcatenation) { $r .= "/* =========== File: " . $path . '/sydneyassets/scripts/ui/' . $file . " ================ */ \n\n\n" . file_get_contents($path . '/sydneyassets/scripts/ui/' . $file) . "\n\n\n\n"; } else { $zview->headScript()->appendFile(Sydney_Tools::getRootUrlCdn() . '/sydneyassets/scripts/ui/' . $file, 'text/javascript'); } } // add the launcher $launchFile = '/sydneyassets/scripts/zLauncher.js'; if ($useConcatenation) { $r .= "/* =========== File: " . $path . $launchFile . " ================ */ \n\n\n" . file_get_contents($path . $launchFile) . "\n\n\n\n"; } else { $zview->headScript()->appendFile(Sydney_Tools::getRootUrlCdn() . $launchFile, 'text/javascript'); } } return $r; }