function getPathUrl($strPath) { $strUrl = POFile::getPathRelativePath($strPath); if (SLASH != '/') { $strUrl = str_replace(SLASH, '/', $strUrl); } if (is_dir($strPath) && !preg_match('/\\/$/', $strUrl)) { $strUrl .= '/'; } //be shure that a directory url end with / return SITE_URL . $strUrl; }
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; }
<?php include 'admin_top.php'; $tabMainTabs = array(); $oTextConfigFile = new PTextFile($configFile->path); $tabMainTabs[] = array('FRAG_NAME' => 'frag_config', 'TAB_NAME' => _('Site Configuration'), 'TAB_CONTENT' => array_to_tabs(array(array('FRAG_NAME' => 'site_config', 'TAB_NAME' => _('Site Parameters'), 'TAB_CONTENT' => $configFile->DisplayEditor('actionClickOnSaveSiteConfig')), array('FRAG_NAME' => 'hotkeys_management', 'TAB_NAME' => _('Manage Hot Keys'), 'TAB_CONTENT' => $configFile->DisplayEditor('actionClickOnSaveConfig', 'HOTKEYS')), array('FRAG_NAME' => 'site_cache', 'TAB_NAME' => _('Cache Management'), 'TAB_CONTENT' => ' <div style="padding-top:60px"> <button onClick="clickOnClearCache(this,\'' . _('Clearing cache ....') . '\',\'site\');" class="ui-state-default ui-corner-all" type="button">' . _('clear site cache') . '</button> <button onClick="clickOnClearCache(this,\'' . _('Clearing cache ....') . '\',\'thumbs\');" class="ui-state-default ui-corner-all" type="button">' . _('clear thumbs cache') . '</button> <button onClick="clickOnClearCache(this,\'' . _('Clearing cache ....') . '\',\'history\');" class="ui-state-default ui-corner-all" type="button">' . _('clear history cache') . '</button> </div> '), array('FRAG_NAME' => 'site_file_config', 'TAB_NAME' => _('Config File'), 'TAB_CONTENT' => $oTextConfigFile->DisplayEditor())), 'tabConfiguratorLevel2')); /**Models **/ $strModelContent = ''; $strUrltabModels = 'admin_file_management.php?current_dir=' . urlencode(POFile::getPathRelativePath(PAGES_MODELS_PATH)); if (!is_dir(PAGES_MODELS_PATH)) { $oDirModels = new PDir(PAGES_MODELS_PATH); if (!$oDirModels->mkdir()) { $strModelContent .= getError(); } } if (is_dir(PAGES_MODELS_PATH)) { $oDirModels =& getFileObject(PAGES_MODELS_PATH); $tabListModels = $oDirModels->listDir($oDirModels->ONLY_FILES); foreach ($tabListModels as $filePath) { if (is_file($filePath)) { $oTemp =& getFileObject($filePath); //$strModelContent.=get_class($oTemp); $strModelContent .= $oTemp->Display(70, $url = false, $oDirModels); } }
function admin_btn_news() { return ' <a href="admin_file_management.php?current_dir=' . urlencode(POFile::getPathRelativePath(PAGES_PATH . '/actualites/')) . '" class="panel-link infobulles" id="actualites"> <img src="' . SITE_URL . 'plugins/news/img/news.jpg" /> <span> <h3> Gestion des actualités </h3> <p>Dans cette espace vous pouvez gérer vos actualités.</p> </span> </a> '; }
" class="panel-link infobulles" id="pages"> <div class="block-icon"><div class="img-icon"><img src="<?php echo SITE_URL; ?> core/admin/theme/images/admin/icon-pages.gif" /></div><div class="title-icon"><?php echo _('Models'); ?> </div><div class="reset"></div></div> <span> <h3> Gestion des modèles </h3> <p>Dans cette espace vous pouvez gérer les modèles de pages de votre site.</p> </span> </a> </td><td> <a href="admin_file_management.php?current_dir=<?php echo urlencode(POFile::getPathRelativePath(MEDIAS_PATH)); ?> " class="panel-link infobulles" id="images"> <div class="block-icon"><div class="img-icon"><img style="padding-top:5px;" src="<?php echo SITE_URL; ?> core/admin/theme/images/admin/icon-images.gif" /></div><div class="title-icon"><?php echo _('Medias'); ?> </div><div class="reset"></div></div> <span> <h3>Gestion de vos médias</h3> <p>Vous pouvez gérer ici les images du site ainsi que les fichiers joins (pdf ....)</p> </span> </a> </td>
echo SITE_URL; ?> vendors/jscripts/jqueryplugins/jquery.jeditable.js" ></script> <script language="JavaScript" src="../jscripts/admin_file_management.js"></script> <script language="JavaScript"> function myRelodPage(){ window.location = '<?php echo $_SERVER['REQUEST_URI']; ?> '; } function setUrl(url){ <?php $rootpathdirurl = $rootpathdir; $uploadpathurl = POFile::getPathRelativePath(MEDIAS_PATH); if (SLASH != '/') { $rootpathdirurl = str_replace(SLASH, '/', $rootpathdirurl); $uploadpathurl = str_replace(SLASH, '/', $uploadpathurl); } echo ' var rootpathdirurl = "' . $rootpathdirurl . '"; var uploadpathurl = "' . $uploadpathurl . '"; '; ?> //file selector if(oSelec = window.opener.document.getElementById("cmbLinkProtocol")){ oSelec.selectedIndex=4;//set protocol on other if( uploadpathurl == rootpathdirurl ) window.opener.SetUrl("{#SITE_URL#}"+rootpathdirurl+"/"+encodeURI(url));