/** * getMenuSpecificsItems, * allow to add some menu items in the right click of the menu. * Todo: plug a pollen event on it * * @return a string with specifics menu items */ function getMenuSpecificsItems() { $strMenu = parent::getMenuSpecificsItems(); //create a link $strLabel = _('Create Link'); $strMenu .= "\n" . '<li><a href="javascript:createLink(\'' . urljsencode($this->getRelativePath()) . '\');" id="hideMenu" >' . $strLabel . '</a></li>'; //show hide in menu $bVisible = $this->isShowInMenu(); $strLabel = $bVisible ? _('Hide') : _('Show'); $strVisible = $bVisible ? 'false' : 'true'; $strMenu .= '<li><a href="javascript:setPageConfigVar(\'' . urljsencode($this->getRelativePath()) . '\',\'SHOW_IN_MENU\',' . $strVisible . ');" id="hideMenu" >' . $strLabel . '</a></li>'; $bPublished = $this->isPublished(); $strLabel = $bPublished ? _('Unpublish') : _('Publish'); $strPublished = $bPublished ? 'false' : 'true'; $strMenu .= "\n" . '<li><a href="javascript:setPageConfigVar(\'' . urljsencode($this->getRelativePath()) . '\',\'PUBLISHED\',' . $strPublished . ');" id="hideMenu" >' . $strLabel . '</a></li>'; return $strMenu; }
function DisplayEditor() { //due to ie bug, we cannot use event as onSubmit, onClick in ajax result request !!, so we use links $strId = 'form_editor_config_' . preg_replace('/[^a-zA-Z]/', '', $this->getRelativePath()); $strTpl = ' <form action="' . $_SERVER["REQUEST_URI"] . '" method="POST" id="' . $strId . '" onSubmit="return false"> <textarea style="width:100%;height:220px;border:1px solid #000;" name="text" id="text">{VALUE}</textarea> <input type="hidden" name="todo" value="savetextfile" /> <input type="hidden" name="filepath" value="{PATH}" /> <div style="text-align:right;padding-top:10px;"> <button class="ui-state-default ui-corner-all" type="button" onClick="javascript:actionClickOnSaveTxt(\'' . $strId . '\',\'' . urljsencode($this->getRelativePath()) . '\');">' . _('Save') . '</button> </div> </form> <div class="reset"></div> '; return str_replace(array('{PATH}', '{VALUE}'), array($this->path, $this->getEditorFileContent()), $strTpl); }
function DisplayEditor($strJsAction = 'actionClickOnSaveConfig', $strSection = false) { if (!$this->parse()) { return getError(); } $idForm = 'form_editor_config_' . $this->getIdName(); if ($strSection) { $idForm .= '_section_' . $strSection; } $strReturn = ' <form action="' . $_SERVER["REQUEST_URI"] . '" method="POST" id="' . $idForm . '" onSubmit="return ' . $strJsAction . '(\'' . $idForm . '\',\'' . urljsencode($this->getRelativePath()) . '\',\'' . $strSection . '\');"> <div id="listParams"> '; $tabToEdit =& $this->tabParams; if ($strSection && isset($this->tabParams[$strSection])) { $tabToEdit =& $this->tabParams[$strSection]; } foreach ($tabToEdit as $strParam => $strValue) { if (!is_array($strValue)) { $strReturn .= $this->__getEditorFormItem($strParam, $strValue, $idForm); } /*else if($strSection){//edition d'une section $strTpl = '<FIELDSET> <LEGEND>'.$strParam.'</LEGEND> {ITEMS} </FIELDSET> '; $items=''; foreach($strValue as $strParamSec=>$strValueSec){ $items .= $this->__getEditorFormItem($strParamSec, $strValueSec,$idForm); } $strReturn .= str_replace('{ITEMS}',$items,$strTpl); }*/ } //end for each var $strReturn .= ' </div> <textarea name="srcParams" id="srcParams" wrap="off" style="width:90%;height:280px;display:none;">' . (is_file($this->path) ? file_get_contents($this->path) : '') . '</textarea> <div style="text-align:right;padding-top:10px;">' . (isSuperAdmin() ? '<button class="ui-state-default ui-corner-all" type="button" onclick="toggleShowConfigEditor(this.form);return false">' . _('Source') . '</button>' : '') . ' <button class="ui-state-default ui-corner-all" type="submit">' . _('save') . '</button> </div> </form> '; return $strReturn; }
function DisplayEditor() { $strReturn = ''; $strFCKConfigDir = SITE . SLASH . 'config' . SLASH . 'fckeditor' . SLASH; $strFCKConfigUrl = SITE_URL . (SLASH == '/' ? $strFCKConfigDir : str_replace(SLASH, '/', $strFCKConfigDir)); $strFCKConfigDir = CONFIG_DIR . 'fckeditor' . SLASH; $oFCKeditor = new FCKeditor('text'); $oFCKeditor->BasePath = SITE_URL . 'vendors/jscripts/fckeditor/'; $oFCKeditor->Value = $this->getEditorFileContent(); $oFCKeditor->Height = '400'; //the styles to apply to the editor, the page style and the fckeditor.css style $fileStyleUrls = ''; if ($pageStyle = $this->getConfig("PAGE_STYLE")) { $fileStyleUrls .= THEME_URL . 'css/' . $pageStyle . ','; } if (is_file($strFCKConfigDir . 'fckeditor.css')) { $fileStyleUrls .= $strFCKConfigUrl . 'fckeditor.css'; } $oFCKeditor->Config["EditorAreaCSS"] = $fileStyleUrls; $oFCKeditor->Config["ImageBrowserURL"] = SITE_URL . "core/admin/admin_file_selector.php?rootpath=" . urlencode(POFile::getPathRelativePath(MEDIAS_PATH)); $oFCKeditor->Config["FlashBrowserURL"] = SITE_URL . "core/admin/admin_file_selector.php?rootpath=" . urlencode(POFile::getPathRelativePath(MEDIAS_PATH)); //go to the parent path $oFCKeditor->Config["LinkBrowserURL"] = SITE_URL . "core/admin/admin_file_selector.php?current_dir=" . urlencode(POFile::getPathRelativePath($this->getParentPath(), PAGES_PATH)) . "&rootpath=" . urlencode(POFile::getPathRelativePath(PAGES_PATH)); $oFCKeditor->Config["CustomConfigurationsPath"] = SITE_URL . 'index.php?page=fckconfig.js'; if (is_file($strFCKConfigDir . 'fcktemplates.xml')) { $oFCKeditor->Config["TemplatesXmlPath"] = SITE_URL . 'index.php?page=fcktemplates.xml'; } if (is_file($strFCKConfigDir . 'fckstyles.xml')) { $oFCKeditor->Config["StylesXmlPath"] = SITE_URL . 'index.php?page=fckstyles.xml'; } $strBarName = getUserEditorBar(); if ($strBarName) { $oFCKeditor->ToolbarSet = $strBarName; } $strTabsTpl = ' <div id="tabPageEditor"> <ul> <li class="ui-tabs-nav-item"><a href="#fragEditor"><span>Edition</span></a></li> <li class="ui-tabs-nav-item"><a href="#fragOptions"><span>Options</span></a></li> </ul> <div id="fragEditor">{TAB_EDITOR}</div> <div id="fragOptions">{TAB_OPTIONS}</div> </div>'; $strFragEditorContent = ' <form action="' . $_SERVER["REQUEST_URI"] . '" method="POST" id="form_editor" onSubmit="return actionClickOnSaveHtml(this,\'' . $this->getUrl() . '\',\'' . urljsencode($_GET['file']) . '\');" style="text-align:right"> <div class="fckEditor"> ' . $oFCKeditor->CreateHtml() . ' <div class="panelHistory"> <h4>' . _('History') . '</h4> {HISTORY_CONTENT} </div><!-- end history --> </div><!-- end fckblock --> <!-- buttons --> <div style="text-align:right;clear:both;"> <button class="ui-state-default ui-corner-all" type="button" onClick="MyCancel();">' . _('cancel') . '</button> <button class="ui-state-default ui-corner-all" type="button" onClick="$(\'.openTabs:first\').trigger(\'click\');">' . _('history') . '</button> <button class="ui-state-default ui-corner-all" type="submit">' . _('save') . '</button> </div> <input type="hidden" value="false" name="view" /> <input type="hidden" name="todo" value="save" /> </form> '; // GESTION DE L'HISTORIQUE $strHistoryContent = '<ul class="historylist">{LIST_HISTORY}</ul>'; $strHtmlListHistory = ''; $tabHistory =& $this->getHistoryList(); if (sizeof($tabHistory) == 0) { $strHistoryContent = _('History empty !'); } else { $i = 0; foreach ($tabHistory as $elemHistory) { $strHtmlListHistory .= '<li><a class="itemHistory ' . ($i == 0 ? 'selected' : '') . '" href="#" onclick="loadHistoryPage(\'' . $elemHistory['PATH'] . '\',this);return false;">' . $elemHistory['PRINTNAME'] . '</a></li>'; $i++; } $strHistoryContent = str_replace('{LIST_HISTORY}', $strHtmlListHistory, $strHistoryContent); } $strFragEditorContent = str_replace('{HISTORY_CONTENT}', $strHistoryContent, $strFragEditorContent); $strFragOptionsContent = $this->oPConfigFile->DisplayEditor(); $strReturn = str_replace(array('{TAB_EDITOR}', '{TAB_OPTIONS}'), array($strFragEditorContent, $strFragOptionsContent), $strTabsTpl); return $strReturn; }
function getMenuSpecificsItems() { $menu = "\n" . '<li><a href="javascript:resizeimage(\'' . urljsencode($this->getRelativePath()) . '\');" id="image_resize" title="' . _('Resize') . '">' . _('Resize') . '</a></li>'; $menu .= '' . parent::getMenuSpecificsItems(); return $menu; }
?> ',true);" title="<?php echo _('create a page'); ?> "><?php echo _('create a page'); ?> </a></li> <?php } ?> <?php if (strpos($proot_dir->path, MEDIAS_PATH) !== FALSE || strpos($pcurrent_dir->path, PAGES_MODELS_PATH . SLASH . 'images') !== FALSE) { ?> <li><a href="javascript:clickSWFUpload('<?php echo session_id() . '\', \'' . urljsencode($pcurrent_dir->getRelativePath()); ?> ');" id="uploadfile" title="<?php echo _('upload file'); ?> "><?php echo _('upload file'); ?> </a></li> <?php } ?> </ul> </div> <?php
$strListActivated = ''; $strListAvailable = ''; if (is_dir(PLUGINS_DIR)) { $oPdir = getFileObject(PLUGINS_DIR); //parse each plugin directory $listDir = $oPdir->listDir($oPdir->ONLY_DIR); foreach ($listDir as $strPluginPath) { $oDirPlugin = new PPluginDir($strPluginPath); $bActivated = false; $configFile->getParam($oDirPlugin->getIdName(), $bActivated, 'PLUGINS'); $strAction = $bActivated === "true" ? _('UnActivate') : _('Activate'); $strLine = '<tr> <td>' . $oDirPlugin->getPluginName() . '</td> <td>' . $oDirPlugin->getAuthor() . '</td> <td>' . $oDirPlugin->getVersion() . '</td> <td><a href="#" onClick="return toggleactivatePlugin(\'' . urljsencode($oDirPlugin->getName()) . '\',\'false\');">[ ' . $strAction . ' ]</a></td> </tr>'; if ($bActivated === "true") { $strListActivated .= $strLine; } else { $strListAvailable .= $strLine; } } } $strContent = '<div id="listPlugins"> ' . str_replace('{LIST}', $strListActivated, $strTableActivated) . ' ' . str_replace('{LIST}', $strListAvailable, $strTableAvailable) . ' </div>'; $tabPlugins = array(); $tabPlugins[] = array('FRAG_NAME' => 'plugins_list', 'TAB_NAME' => _('Plugins List'), 'TAB_CONTENT' => $strContent); $tabExtraPlugins = array();
function menuMove($rootpath = '') { $objCurrDir = new PDir($this->getParentPath()); $strCurrDir = $objCurrDir->getRelativePath(SITE_PATH . $rootpath); return '<li><a href="javascript:move(\'' . urljsencode($this->getRelativePath()) . '\',\'' . urljsencode($strCurrDir) . '\',\'' . urljsencode($rootpath) . '\');" id="folder_move" title="' . _('Move') . '">' . _('Move') . '</a></li>'; }