Пример #1
0
/**
 * Smarty {pagecontent} function plugin
 *
 * Type:     function<br>
 * Name:     googlesitemap<br>
 * Purpose:  initialize overlib
 * @link http://smarty.php.net/manual/en/language.function.popup.init.php {popup_init}
 *          (Smarty online manual)
 * @author   Mathieu Vilaplana <*****@*****.**>
 * @param array
 * @param Smarty
 * @return string
 */
function smarty_function_pagecontent($params, &$site)
{
    global $oEventsManager;
    $strContent = $site->fetch(SITE_PATH . str_replace('/', SLASH, 'core/templates/pagecontent.tpl'), $site->getCompiledId());
    doEventAction('getpagecontent', array(&$strContent, &$params, $site));
    return $strContent;
}
Пример #2
0
function wrapupload()
{
    if (!isset($_POST['CURRENT_DIR'])) {
        return setError('Internal error, CURRENT_DIR is not set');
    }
    $strCurrDir = urldecode($_POST['CURRENT_DIR']);
    if (!($oDir =& getFileObject(SITE_PATH . SLASH . $strCurrDir)) || !is_dir($oDir->path)) {
        return setError(sprintf(_('Internal error, directory %s not exists.'), $strCurrDir));
    }
    if (!$oDir->uploadFile($_FILES, 'Filedata')) {
        return false;
    }
    $oFileUploaded =& getFileObject($oDir->path . SLASH . $oDir->getUnixName($_FILES['Filedata']['name']));
    if ($oFileUploaded && $oFileUploaded->is_image()) {
        if (!$oFileUploaded->createThumb(70)) {
            return false;
        }
        if (!$oFileUploaded->createThumb(480, false)) {
            return false;
        }
    }
    if ($oFileUploaded && !doEventAction('uploadfile', array(&$oFileUploaded))) {
        return false;
    }
    sleep(4);
    echo 'OK';
    return true;
}
Пример #3
0
        case 'fckstyles.xml':
            header('content-type: text/xml');
            $site->loadDefaultFilters();
            $site->display(SITE_PATH . 'core' . SLASH . 'templates' . SLASH . 'fckstyles.tpl');
            die;
    }
    /*for safety reasons, if user try to go out pages dir, go to first page*/
    if (strstr('..', $page)) {
        $oPage = $site->getFirstPage();
    } else {
        $oPage = $site->getPage($page, isConnected());
    }
}
//if page has not been found, load the extra page event
if (!$oPage) {
    $bRes = doEventAction('extrapage', array(&$page, &$site));
    if ($bRes !== true) {
        $oPage =& $bRes;
    }
}
if (!$oPage) {
    header("HTTP/1.0 404 Not Found");
    die(_('Page not found'));
}
//display the page
$site->displayPage($oPage);
setDebug('Generate page in ' . (time() + microtime() - $timestart) . ' s');
//var_dump($oGlobalEventsManager->_events);
if (DEBUG) {
    printDebug();
}
Пример #4
0
core/jscripts/admin_page.js" ></script>
<script language="JavaScript" src="<?php 
    echo SITE_URL;
    ?>
core/jscripts/admin_file_management.js" ></script>
<script language="JavaScript" src="<?php 
    echo SITE_URL;
    ?>
core/jscripts/admin_file_editor.js" ></script>
<script language="JavaScript" src="<?php 
    echo SITE_URL;
    ?>
core/jscripts/admin_configurator.js" ></script>

<?php 
    if (!doEventAction('adminHeader', array())) {
        printError();
    }
    ?>

<?php 
    $strUiTheme = $configFile->getDirectParam('UI_THEME');
    echo '<link rel="stylesheet" href="' . SITE_URL . 'vendors/jscripts/jqueryui/themes/' . $strUiTheme . '/jquery-ui-1.7.1.css" />';
    ?>

<link rel="stylesheet" href="<?php 
    echo SITE_URL;
    ?>
core/admin/theme/css/admin.css" />

Пример #5
0
 /**
  * Rename the page.
  * This function is called to rename the page.
  * If the new name of the page contains specific caracters as éà, it is replace by ea,
  * but the menu name is set with special caracters
  * An event is attached to this fonction: renamepage
  * This event is used for example by the search engine plugin to index the file content.
  * 
  * The difference between move and rename, is that in move do not set the menu title !!
  * @param string $newname, the new name (basename)
  * @param string $destDir, if == false the parent dir
  * @return true if suceed
  */
 function Rename($newname, $destDir = false)
 {
     $fileNewName = $this->getUnixName($newname);
     $pageNewName = $newname;
     $pageCurrName = $this->getVirtualName();
     $fileCurrName = $this->getName();
     if (strlen($fileNewName) == 0) {
         return setError(_('Can not rename with empty name'));
     }
     //manage extensions
     $oFile = new PFile($fileNewName);
     if ($oFile->getExtension() == '') {
         $fileNewName .= '.' . $this->getExtension();
     } else {
         $oFile = new PFile($pageNewName);
         $pageNewName = $oFile->getNameWithoutExt();
     }
     if ($fileNewName == $fileCurrName && $pageCurrName == $pageNewName && $destDir === false) {
         return true;
     }
     //check the name is valid, not a php file or a cgi one for example
     if (!$this->checkname($pageNewName)) {
         return false;
     }
     //set the menu name in the ini file if has been renamed !! not moved
     if (!$destDir && !$this->setVirtualName($pageNewName)) {
         return false;
     }
     if ($fileCurrName != $fileNewName || $destDir !== false) {
         //if history dir exists, rename it
         $oDirHistoryCache = new PDir(CACHE_HIST_DIR . SLASH . $this->getId());
         if (is_dir($oDirHistoryCache->path)) {
             $destDirModify = !$destDir ? $this->getParentPath() : $destDir;
             if (substr($destDirModify, -1) == SLASH) {
                 $destDirModify = substr($destDirModify, 0, strlen($destDirModify) - 1);
             }
             $oPageNewHistory = new PPage($destDirModify . SLASH . $fileNewName);
             $strNewHistoryName = $oPageNewHistory->getId();
             if ($this->getId() != $strNewHistoryName) {
                 if (!$oDirHistoryCache->Rename($strNewHistoryName)) {
                     return false;
                 }
             }
         }
         if (!doEventAction('renamepage', array(&$this, ($destDir ? $destDir : $this->getParentPath()) . SLASH . $fileNewName))) {
             return false;
         }
         //on supprime le cache du menu
         if (!deleteMenuCache()) {
             return false;
         }
         //rename the config file if exists
         if (is_file($this->oPConfigFile->path)) {
             $oFileTmp = new PFile($fileNewName);
             if (!$this->oPConfigFile->Rename($oFileTmp->getNameWithoutExt() . ".ini", $destDir)) {
                 return false;
             }
         }
         if (!parent::Rename($fileNewName, $destDir)) {
             return false;
         }
     }
     return true;
 }
Пример #6
0
		</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();
if (!doEventAction('addPluginsTabs', array(&$tabExtraPlugins))) {
    printError();
} else {
    $tabPlugins = array_merge($tabPlugins, $tabExtraPlugins);
}
$tabMainTabs[] = array('FRAG_NAME' => 'plugins', 'TAB_NAME' => _('Plugins'), 'TAB_CONTENT' => array_to_tabs($tabPlugins, 'tabConfiguratorLevel2'));
/**
	TAB ABOUT
*/
$tabMainTabs[] = array('FRAG_NAME' => 'about', 'TAB_NAME' => _('About'), 'TAB_CONTENT' => '<div><strong>Pollen CMS version :</strong> ' . POLLEN_CMS_VERSION . '</div>' . '<div class="blockLicence"><strong>Licence:</strong><br /><textarea readonly>' . file_get_contents(SITE_PATH . "Licence.txt") . '</textarea></div>');
echo '<div style="height:20px"></div>' . array_to_tabs($tabMainTabs, 'tabConfigurator');
function array_to_tabs($aArray, $strWrapperClass)
{
    $strTpl = '
		<ul>
			{LISTE_ONGLETS}
Пример #7
0
 function getMenuSpecificsItems()
 {
     $strMenu = '';
     doEventAction('file_menu', array(&$this, &$strMenu));
     return $strMenu;
 }
Пример #8
0
 /**
  * Function: display
  * If page has not been cached, calculate it.
  * Then call the smarty display fonction
  *
  *
  * param: &$oPage, a reference to the object page to display
  */
 function displayPage(&$oPage)
 {
     $strTemplateName = $oPage->getTemplateName();
     $strCompiledId = $this->getCompiledId();
     $this->oPageCurrent =& $oPage;
     $this->register_object('oPageCurrent', $oPage);
     //if page must not be cached, set the site cache to 0
     $this->caching = $this->caching && $oPage->isCached() ? 1 : 0;
     //on regénére le menu si le menu n'existe pas en cache ou si la page courante a été modifiée après le menu
     $bGenerateMenu = !is_file(SMARTY_CACHE_DIR . 'menu.cache');
     //|| (is_file(SMARTY_CACHE_DIR.'menu.cache') && $oPage->getModifiedTime()>filemtime(SMARTY_CACHE_DIR.'menu.cache'));
     //rebuild menu not exist (a page has been updated) or the page if cache not exists or page not use cache
     if ($bGenerateMenu || $this->caching == 0 || $this->force_compile || !$this->is_cached($strTemplateName, $strCompiledId)) {
         //check that the template file exists
         if (!is_file($this->template_dir . SLASH . $strTemplateName)) {
             setError(sprintf(_("The template file %s doesn't exist."), $strTemplateName));
             printFatalHtmlError();
         }
         //si on doit regénérer le menu, on le supprime avant
         if ($bGenerateMenu) {
             if (!deleteMenuCache()) {
                 printFatalError();
             }
         }
         //assign the menu
         $this->assign_by_ref("menu", $this->getMenu(isConnected()));
         $this->assign("PAGE_PATH", $oPage->path);
         $this->assign("PAGE_CONTENU", $oPage->path);
         $this->assign("PAGE_PATH_TITLE", $oPage->getPagePathForTitle());
         $this->assign('MEDIAS_URL', POFile::getPathUrl(MEDIAS_PATH));
         $oPageConfigFile = $oPage->getConfigFileObject();
         if (is_file($oPageConfigFile->path)) {
             $this->assign("CONFIG_FILE_PAGE", $oPageConfigFile->path);
         }
         $oCatConfigFile = $oPage->getConfigFileObjectCategory();
         if (is_file($oCatConfigFile->path)) {
             $this->assign("CONFIG_FILE_CATAGORY", $oCatConfigFile->path);
         }
         //we load filter only in case of cache
         $this->loadAdminFilters();
     }
     //end calcul
     if (true || checkKey()) {
         //display the page !!
         $strContent = parent::fetch($strTemplateName, $strCompiledId);
         doEventAction('beforedisplay', array(&$strContent, &$this));
         echo $strContent;
     } else {
         printError();
     }
 }
Пример #9
0
        ?>
core/admin/theme/images/admin/icon-options.gif" /></div><div class="title-icon"><?php 
        echo _('Options');
        ?>
</div><div class="reset"></div></div>
			<span>
				<h3><?php 
        echo _('Configuration du site');
        ?>
</h3>
				<p>Vous pouvez ici gérer la configuration de votre site</p>
			</span>
		</a>
		</td>
		<?php 
    }
    if (!doEventAction('adminmainmenu', array())) {
        printError();
    }
    ?>
		
	<div class="reset"></div>
	
	</tr></table>
	</div>
<div class="reset"></div>

<?php 
}
//end connect ok
include 'admin_bottom.php';