Exemplo n.º 1
0
register_shutdown_function('oktShutdown');
/*
 * Destruction des variables globales créées si
 * register_globals est activé et inversion de
 * l'effet des magic_quotes
 */
util::trimRequest();
try {
    http::unsetGlobals();
} catch (Exception $e) {
    header('Content-Type: text/plain');
    echo $e->getMessage();
    exit;
}
# Let the music play (initialisation du coeur de l'application)
$okt = new oktCore();
# Chargement de la configuration du site
$okt->loadConfig();
# URL du dossier modules
define('OKT_MODULES_URL', $okt->config->app_path . OKT_MODULES_DIR);
# URL du dossier des fichiers publics
define('OKT_PUBLIC_URL', $okt->config->app_path . OKT_PUBLIC_DIR);
# URL du dossier upload depuis la racine
define('OKT_UPLOAD_URL', $okt->config->app_path . OKT_PUBLIC_DIR . '/' . OKT_UPLOAD_DIR);
# Définition du thème à utiliser
$sOktTheme = $okt->config->theme;
if (!empty($okt->config->theme_mobile) || !empty($okt->config->theme_tablet)) {
    if (isset($_REQUEST['disable_browser_check'])) {
        setcookie('okt_disable_browser_check', (bool) $_REQUEST['disable_browser_check'], 0, $okt->config->app_path, '', isset($_SERVER['HTTPS']));
    }
    if (empty($_COOKIE['okt_disable_browser_check'])) {
Exemplo n.º 2
0
 /**
  * Ajout d'éléments à la barre admin côté publique.
  *
  * @param oktCore $okt
  * @param arrayObject $aPrimaryAdminBar
  * @param arrayObject $aSecondaryAdminBar
  * @param arrayObject $aBasesUrl
  * @return void
  */
 public static function publicAdminBarItems($okt, $aPrimaryAdminBar, $aSecondaryAdminBar, $aBasesUrl)
 {
     # lien ajouter un utilisateur
     if ($okt->checkPerm('users')) {
         $aPrimaryAdminBar[200]['items'][1000] = array('href' => $aBasesUrl['admin'] . '/module.php?m=users&action=add', 'title' => __('m_users_ab_user_title'), 'intitle' => __('m_users_ab_user'));
     }
 }
Exemplo n.º 3
0
 /**
  * Traitement des champs avant ajout d'une page.
  *
  * @param oktCore $okt
  * @param arrayObject $aPageData
  * @return void
  */
 public static function beforePageCreate($okt, $aPageData)
 {
     foreach ($okt->languages->list as $aLanguage) {
         if (!empty($aPageData['locales'][$aLanguage['code']]['editor'])) {
             $aPageData['locales'][$aLanguage['code']]['editor'] = $okt->HTMLfilter($aPageData['locales'][$aLanguage['code']]['editor']);
         }
     }
 }
Exemplo n.º 4
0
 /**
  * Ajout d'éléments à la barre admin côté publique.
  *
  * @param oktCore $okt
  * @param arrayObject $aPrimaryAdminBar
  * @param arrayObject $aSecondaryAdminBar
  * @param arrayObject $aBasesUrl
  * @return void
  */
 public static function publicAdminBarItems($okt, $aPrimaryAdminBar, $aSecondaryAdminBar, $aBasesUrl)
 {
     # lien ajouter un article
     if ($okt->checkPerm('news_usage') || $okt->checkPerm('news_contentadmin')) {
         $aPrimaryAdminBar[200]['items'][200] = array('href' => $aBasesUrl['admin'] . '/module.php?m=news&action=add', 'title' => __('m_news_ab_post_title'), 'intitle' => __('m_news_ab_post'));
     }
     # modification de l'article en cours
     if (isset($okt->page->module) && $okt->page->module == 'news' && isset($okt->page->action) && $okt->page->action == 'item') {
         $aVars = $okt->tpl->getAssignedVars();
         if (isset($aVars['rsPost']) && $aVars['rsPost']->isEditable()) {
             $aPrimaryAdminBar[300] = array('href' => $aBasesUrl['admin'] . '/module.php?m=news&action=edit&post_id=' . $aVars['rsPost']->id, 'intitle' => __('m_news_ab_edit_post'));
         }
     }
 }