/**
  * Constructor.
  *
  */
 public function __construct($okt, $sPostPrefix = 'p_')
 {
     $this->okt = $okt;
     # POST prefix
     $this->sPostPrefix = $sPostPrefix;
     # locales
     l10n::set(OKT_LOCALES_PATH . '/' . $this->okt->user->language . '/definitions.less.editor');
 }
Beispiel #2
0
 protected function prepend()
 {
     # chargement des principales locales
     l10n::set(__DIR__ . '/locales/' . $this->okt->user->language . '/main');
     # permissions
     $this->okt->addPerm('rte_tinymce_4_config', __('m_rte_tinymce_4_perm_config'), 'configuration');
     # configuration
     $this->config = $this->okt->newConfig('conf_rte_tinymce_4');
 }
Beispiel #3
0
 protected function prepend_admin()
 {
     # on détermine si on est actuellement sur ce module
     $this->onThisModule();
     # chargement des locales admin
     l10n::set(__DIR__ . '/locales/' . $this->okt->user->language . '/admin');
     # on ajoutent un item au menu admin
     if (!defined('OKT_DISABLE_MENU')) {
         $this->okt->page->configSubMenu->add(__('Accessible Captcha'), 'module.php?m=accessible_captcha&action=index', ON_ACCESSIBLE_CAPTCHA_MODULE && (!$this->okt->page->action || $this->okt->page->action === 'index'), 30, $this->okt->checkPerm('accessible_captcha_config'), null);
     }
 }
Beispiel #4
0
 protected function prepend_admin()
 {
     # on détermine si on est actuellement sur ce module
     $this->onThisModule();
     # chargement des locales admin
     l10n::set(__DIR__ . '/locales/' . $this->okt->user->language . '/admin');
     # on ajoutent un item au menu admin
     if (!defined('OKT_DISABLE_MENU')) {
         $this->okt->page->configSubMenu->add(__('Images sets'), 'module.php?m=images_sets&action=index', ON_IMAGES_SETS_MODULE && (!$this->okt->page->action || $this->okt->page->action === 'index'), 42, $this->okt->checkPerm('is_superadmin'), null);
     }
 }
Beispiel #5
0
 protected function prepend_admin()
 {
     # on détermine si on est actuellement sur ce module
     $this->onThisModule();
     # chargement des locales admin
     l10n::set(__DIR__ . '/locales/' . $this->okt->user->language . '/admin');
     # on ajoutent un item au menu admin
     if (!defined('OKT_DISABLE_MENU')) {
         $this->okt->page->configSubMenu->add(__('m_lbl_fancybox_menu_config'), 'module.php?m=lbl_fancybox&action=config', ON_LBL_FANCYBOX_MODULE && $this->okt->page->action === 'config', 25, $this->okt->checkPerm('fancybox_config'), null);
     }
 }
Beispiel #6
0
 protected function prepend_admin()
 {
     # on détermine si on est actuellement sur ce module
     $this->onThisModule();
     # chargement des locales admin
     l10n::set(__DIR__ . '/locales/' . $this->okt->user->language . '/admin');
     # on ajoutent un item au menu admin
     if (!defined('OKT_DISABLE_MENU')) {
         $this->okt->page->configSubMenu->add(__('Antispam'), 'module.php?m=antispam', ON_ANTISPAM_MODULE, 25, $this->okt->checkPerm('antispam'), null);
     }
 }
Beispiel #7
0
function dc_load_locales()
{
    global $_lang, $core;
    $_lang = $core->auth->getInfo('user_lang');
    $_lang = preg_match('/^[a-z]{2}(-[a-z]{2})?$/', $_lang) ? $_lang : 'en';
    if (l10n::set(dirname(__FILE__) . '/../../locales/' . $_lang . '/date') === false && $_lang != 'en') {
        l10n::set(dirname(__FILE__) . '/../../locales/en/date');
    }
    l10n::set(dirname(__FILE__) . '/../../locales/' . $_lang . '/main');
    l10n::set(dirname(__FILE__) . '/../../locales/' . $_lang . '/plugins');
}
Beispiel #8
0
 protected function prepend()
 {
     # chargement des principales locales
     l10n::set(__DIR__ . '/locales/' . $this->okt->user->language . '/main');
     # enregistrement des triggers
     $this->okt->pages->triggers->registerTrigger('getPagesSelectFields', array('module_pages_example_extra_fields', 'getPagesSelectFields'));
     $this->okt->pages->triggers->registerTrigger('adminPostInit', array('module_pages_example_extra_fields', 'adminPostInit'));
     $this->okt->pages->triggers->registerTrigger('adminPopulateData', array('module_pages_example_extra_fields', 'adminPopulateData'));
     $this->okt->pages->triggers->registerTrigger('checkPostData', array('module_pages_example_extra_fields', 'checkPostData'));
     $this->okt->pages->triggers->registerTrigger('beforePageUpdate', array('module_pages_example_extra_fields', 'beforePageUpdate'));
     $this->okt->pages->triggers->registerTrigger('beforePageCreate', array('module_pages_example_extra_fields', 'beforePageCreate'));
     $this->okt->pages->triggers->registerTrigger('adminPostBuildTabs', array('module_pages_example_extra_fields', 'adminPostBuildTabs'));
 }
Beispiel #9
0
 protected function prepend_admin()
 {
     # on détermine si on est actuellement sur ce module
     $this->onThisModule();
     # chargement des locales admin
     l10n::set(__DIR__ . '/locales/' . $this->okt->user->language . '/admin');
     # on ajoutent un item au menu admin
     if (!defined('OKT_DISABLE_MENU')) {
         $this->okt->page->guestbookSubMenu = new htmlBlockList(null, adminPage::$formatHtmlSubMenu);
         $this->okt->page->mainMenu->add($this->getName(), 'module.php?m=guestbook', ON_GUESTBOOK_MODULE, 10, $this->okt->checkPerm('guestbook'), null, $this->okt->page->guestbookSubMenu, $this->url() . '/icon.png');
         $this->okt->page->guestbookSubMenu->add(__('c_a_menu_management'), 'module.php?m=guestbook&action=index', ON_GUESTBOOK_MODULE && ($this->okt->page->action !== 'display' && $this->okt->page->action !== 'config'), 1);
         $this->okt->page->guestbookSubMenu->add(__('c_a_menu_display'), 'module.php?m=guestbook&action=display', ON_GUESTBOOK_MODULE && $this->okt->page->action === 'display', 2, $this->okt->checkPerm('guestbook_display'));
         $this->okt->page->guestbookSubMenu->add(__('c_a_menu_configuration'), 'module.php?m=guestbook&action=config', ON_GUESTBOOK_MODULE && $this->okt->page->action === 'config', 3, $this->okt->checkPerm('guestbook_config'));
     }
 }
Beispiel #10
0
 protected function prepend_admin()
 {
     # on détermine si on est actuellement sur ce module
     $this->onThisModule();
     # chargement des locales admin
     l10n::set(__DIR__ . '/locales/' . $this->okt->user->language . '/admin');
     # on ajoutent un item au menu admin
     if (!defined('OKT_DISABLE_MENU')) {
         $this->okt->page->contactSubMenu = new htmlBlockList(null, adminPage::$formatHtmlSubMenu);
         $this->okt->page->mainMenu->add($this->getName(), 'module.php?m=contact', ON_CONTACT_MODULE, 2000, $this->okt->checkPerm('contact_recipients'), null, $this->okt->page->contactSubMenu, $this->url() . '/icon.png');
         $this->okt->page->contactSubMenu->add(__('m_contact_menu_recipients'), 'module.php?m=contact&action=index', ON_CONTACT_MODULE && (!$this->okt->page->action || $this->okt->page->action === 'index'), 1, $this->okt->checkPerm('contact_recipients'));
         $this->okt->page->contactSubMenu->add(__('m_contact_menu_fields'), 'module.php?m=contact&action=fields', ON_CONTACT_MODULE && ($this->okt->page->action === 'fields' || $this->okt->page->action === 'field'), 2, $this->okt->checkPerm('contact_fields'));
         $this->okt->page->contactSubMenu->add(__('m_contact_menu_configuration'), 'module.php?m=contact&action=config', ON_CONTACT_MODULE && $this->okt->page->action === 'config', 3, $this->okt->checkPerm('contact_config'));
     }
 }
Beispiel #11
0
 protected function prepend_admin()
 {
     # on détermine si on est actuellement sur ce module
     $this->onThisModule();
     # chargement des locales admin
     l10n::set(__DIR__ . '/locales/' . $this->okt->user->language . '/admin');
     # on ajoutent un élément au menu admin
     if (!defined('OKT_DISABLE_MENU')) {
         $this->okt->page->diarySubMenu = new htmlBlockList(null, adminPage::$formatHtmlSubMenu);
         $this->okt->page->mainMenu->add($this->getName(), 'module.php?m=diary', ON_DIARY_MODULE, 20, $this->okt->checkPerm('diary'), null, $this->okt->page->diarySubMenu, $this->url() . '/icon.png');
         $this->okt->page->diarySubMenu->add(__('m_diary_menu_management'), 'module.php?m=diary&action=index', ON_DIARY_MODULE && (!$this->okt->page->action || $this->okt->page->action === 'index' || $this->okt->page->action === 'edit'), 10);
         $this->okt->page->diarySubMenu->add(__('m_diary_menu_add_event'), 'module.php?m=diary&action=add', ON_DIARY_MODULE && $this->okt->page->action === 'add', 20, $this->okt->checkPerm('diary_add'));
         $this->okt->page->diarySubMenu->add(__('m_diary_menu_display'), 'module.php?m=diary&action=display', ON_DIARY_MODULE && $this->okt->page->action === 'display', 200, $this->okt->checkPerm('diary_display'));
         $this->okt->page->diarySubMenu->add(__('m_diary_menu_config'), 'module.php?m=diary&action=config', ON_DIARY_MODULE && $this->okt->page->action === 'config', 300, $this->okt->checkPerm('diary_config'));
     }
 }
Beispiel #12
0
 protected function prepend_admin()
 {
     # on détermine si on est actuellement sur ce module
     $this->onThisModule();
     # chargement des locales admin
     l10n::set(__DIR__ . '/locales/' . $this->okt->user->language . '/admin');
     # on ajoutent un item au menu admin
     if (!defined('OKT_DISABLE_MENU')) {
         $this->okt->page->catalogSubMenu = new htmlBlockList(null, adminPage::$formatHtmlSubMenu);
         $this->okt->page->mainMenu->add($this->getName(), 'module.php?m=catalog', ON_CATALOG_MODULE, 10, $this->okt->checkPerm('catalog'), null, $this->okt->page->catalogSubMenu, $this->url() . '/icon.png');
         $this->okt->page->catalogSubMenu->add('Gestion', 'module.php?m=catalog&action=index', ON_CATALOG_MODULE && (!$this->okt->page->action || $this->okt->page->action === 'index' || $this->okt->page->action === 'edit'), 1);
         $this->okt->page->catalogSubMenu->add('Ajouter un produit', 'module.php?m=catalog&action=add', ON_CATALOG_MODULE && $this->okt->page->action === 'add', 2, $this->config->categories_enable && $this->okt->checkPerm('catalog_add'));
         $this->okt->page->catalogSubMenu->add('Catégories', 'module.php?m=catalog&action=categories', ON_CATALOG_MODULE && $this->okt->page->action === 'categories', 5, $this->config->categories_enable && $this->okt->checkPerm('catalog_categories'));
         $this->okt->page->catalogSubMenu->add('Affichage', 'module.php?m=catalog&action=display', ON_CATALOG_MODULE && $this->okt->page->action === 'display', 10, $this->okt->checkPerm('catalog_display'));
         $this->okt->page->catalogSubMenu->add('Configuration', 'module.php?m=catalog&action=config', ON_CATALOG_MODULE && $this->okt->page->action === 'config', 20, $this->okt->checkPerm('catalog_config'));
     }
 }
Beispiel #13
0
 protected function prepend_admin()
 {
     # chargement des locales admin
     l10n::set(__DIR__ . '/locales/' . $this->okt->user->language . '/admin');
     # on détermine si on est actuellement sur ce module
     $this->onThisModule();
     # on ajoute un item au menu admin
     if (!defined('OKT_DISABLE_MENU')) {
         $this->okt->page->partnersSubMenu = new htmlBlockList(null, adminPage::$formatHtmlSubMenu);
         $this->okt->page->mainMenu->add($this->getName(), 'module.php?m=partners', ON_PARTNERS_MODULE, 10, $this->okt->checkPerm('partners'), null, $this->okt->page->partnersSubMenu, $this->url() . '/icon.png');
         $this->okt->page->partnersSubMenu->add(__('c_a_menu_management'), 'module.php?m=partners&action=index', ON_PARTNERS_MODULE && (!$this->okt->page->action || $this->okt->page->action === 'index' || $this->okt->page->action === 'edit'), 1);
         $this->okt->page->partnersSubMenu->add(__('m_partners_add_partner'), 'module.php?m=partners&action=add', ON_PARTNERS_MODULE && $this->okt->page->action === 'add', 2, $this->okt->checkPerm('partners_add'));
         $this->okt->page->partnersSubMenu->add(__('m_partners_Categories'), 'module.php?m=partners&action=categories', ON_PARTNERS_MODULE && $this->okt->page->action === 'categories', 3, $this->config->enable_categories && $this->okt->checkPerm('partners_add'));
         $this->okt->page->partnersSubMenu->add(__('c_a_menu_display'), 'module.php?m=partners&action=display', ON_PARTNERS_MODULE && $this->okt->page->action === 'display', 10, $this->okt->checkPerm('partners_display'));
         $this->okt->page->partnersSubMenu->add(__('c_a_menu_configuration'), 'module.php?m=partners&action=config', ON_PARTNERS_MODULE && $this->okt->page->action === 'config', 20, $this->okt->checkPerm('partners_config'));
     }
 }
Beispiel #14
0
 protected function prepend_admin()
 {
     # chargement des locales admin
     l10n::set(__DIR__ . '/locales/' . $this->okt->user->language . '/admin');
     # on détermine si on est actuellement sur ce module
     $this->onThisModule();
     # on ajoutent un item au menu principal
     if (!defined('OKT_DISABLE_MENU')) {
         $this->okt->page->mainMenu->add(__('Users'), 'module.php?m=users', ON_USERS_MODULE, 5000000, $this->okt->checkPerm('users'), null, $this->okt->page->usersSubMenu = new htmlBlockList(null, adminPage::$formatHtmlSubMenu), $this->url() . '/icon.png');
         $this->okt->page->usersSubMenu->add(__('c_a_menu_management'), 'module.php?m=users&action=index', ON_USERS_MODULE && (!$this->okt->page->action || $this->okt->page->action === 'index' || $this->okt->page->action === 'add' || $this->okt->page->action === 'edit'), 10, $this->okt->checkPerm('users'));
         $this->okt->page->usersSubMenu->add(__('m_users_Groups'), 'module.php?m=users&action=groups', ON_USERS_MODULE && $this->okt->page->action === 'groups', 20, $this->okt->checkPerm('groups'));
         $this->okt->page->usersSubMenu->add(__('m_users_Custom_fields'), 'module.php?m=users&action=fields', ON_USERS_MODULE && ($this->okt->page->action === 'fields' || $this->okt->page->action === 'field'), 30, $this->config->enable_custom_fields && $this->okt->checkPerm('users_custom_fields'));
         $this->okt->page->usersSubMenu->add(__('m_users_Export'), 'module.php?m=users&action=export', ON_USERS_MODULE && $this->okt->page->action === 'export', 40, $this->okt->checkPerm('users_export'));
         $this->okt->page->usersSubMenu->add(__('c_a_menu_display'), 'module.php?m=users&action=display', ON_USERS_MODULE && $this->okt->page->action === 'display', 90, $this->okt->checkPerm('users_display'));
         $this->okt->page->usersSubMenu->add(__('c_a_menu_configuration'), 'module.php?m=users&action=config', ON_USERS_MODULE && $this->okt->page->action === 'config', 100, $this->okt->checkPerm('users_config'));
     }
 }
Beispiel #15
0
 protected function prepend_admin()
 {
     # on détermine si on est actuellement sur ce module
     $this->onThisModule();
     # locales
     l10n::set(__DIR__ . '/locales/' . $this->okt->user->language . '/admin');
     # on ajoutent un item au menu admin
     if (!defined('OKT_DISABLE_MENU')) {
         $this->okt->page->homeSubMenu->add(__('Media manager'), 'module.php?m=media_manager', ON_MEDIA_MANAGER_MODULE && (!$this->okt->page->action || $this->okt->page->action === 'index'), 30, $this->okt->checkPerm('media') || $this->okt->checkPerm('media_admin'), null);
         /*
         			$this->okt->page->configSubMenu->add(
         				__('Media manager'),
         				'module.php?m=media_manager&action=config',
         				ON_MEDIA_MANAGER_MODULE && ($this->okt->page->action === 'config'),
         				30,
         				$this->okt->checkPerm('media_config'),
         				null
         			);
         */
     }
 }
Beispiel #16
0
 /**
  * Load the translation strings
  *
  * @access public
  * @author Jerome Bogaerts, <*****@*****.**>
  * @param  common_ext_Extension $extension
  * @param  string langCode
  * @return mixed
  */
 public static function init(common_ext_Extension $extension, $langCode)
 {
     // if the langCode is empty do nothing
     if (empty($langCode)) {
         throw new Exception("Language is not defined");
     }
     //init the ClearFw l10n tools
     l10n::init();
     $basePath = $extension->getDir();
     if (!empty($_GET['ext']) && is_string($_GET['ext'])) {
         $shownExtension = common_ext_ExtensionsManager::singleton()->getExtensionById($_GET['ext']);
         if (!empty($shownExtension)) {
             try {
                 $basePath = $shownExtension->getDir();
                 $baseUrl = $shownExtension->getConstant('BASE_URL');
             } catch (common_exception_Error $e) {
                 // let the current base path be used...
             }
         }
     }
     l10n::set($basePath . 'locales' . DIRECTORY_SEPARATOR . $langCode . DIRECTORY_SEPARATOR . 'messages');
 }
Beispiel #17
0
 protected function prepend_admin()
 {
     # On détermine si on est actuellement sur ce module
     $this->onThisModule();
     # Chargement des locales admin
     l10n::set(__DIR__ . '/locales/' . $this->okt->user->language . '/admin');
     # On ajoutent un item au menu
     if (!defined('OKT_DISABLE_MENU')) {
         $this->okt->page->developmentSubMenu = new htmlBlockList(null, adminPage::$formatHtmlSubMenu);
         $this->okt->page->mainMenu->add(__('m_development_menu_development'), null, ON_DEVELOPMENT_MODULE, 10000001, true, null, $this->okt->page->developmentSubMenu, $this->url() . '/icon.png');
         $this->okt->page->developmentSubMenu->add(__('m_development_menu_development'), 'module.php?m=development&amp;action=index', ON_DEVELOPMENT_MODULE && (!$this->okt->page->action || $this->okt->page->action === 'index'), 1, $this->okt->checkPerm('development_debug_bar'));
         $this->okt->page->developmentSubMenu->add(__('m_development_menu_debugbar'), 'module.php?m=development&amp;action=debug_bar', ON_DEVELOPMENT_MODULE && $this->okt->page->action === 'debug_bar', 2, $this->okt->checkPerm('development_debug_bar'));
         $this->okt->page->developmentSubMenu->add(__('m_development_menu_bootstrap'), 'module.php?m=development&amp;action=bootstrap', ON_DEVELOPMENT_MODULE && $this->okt->page->action === 'bootstrap', 3, $this->okt->checkPerm('development_bootstrap'));
         $this->okt->page->developmentSubMenu->add(__('m_development_menu_counting'), 'module.php?m=development&amp;action=counting', ON_DEVELOPMENT_MODULE && $this->okt->page->action === 'counting', 4, $this->okt->checkPerm('development_counting'));
     }
     # Message admin home
     if ($this->okt->user->is_superadmin) {
         $this->okt->triggers->registerTrigger('adminIndexHtmlContent', array('module_development', 'adminIndexHtmlContent'));
     }
     # Add admin debug bar
     $this->debugBar->loadInAdminPart();
 }
 /**
  * Constructor.
  *
  * @param oktCore $okt
  * @param array $aConfig
  * @param string $sBase
  * @param string $sTplFamily
  * @param string $sBaseUrl
  * @return void
  */
 public function __construct($okt, $aConfig, $sBase, $sTplFamily, $sBaseUrl = '/')
 {
     $this->okt = $okt;
     $this->aConfig = $aConfig;
     $this->sTplFamily = $sTplFamily;
     $this->sBase = util::formatAppPath($sBase, false, false);
     $this->sBaseUrl = $sBaseUrl;
     $this->loadTemplatesPaths();
     $this->loadTemplatesInfos();
     l10n::set(OKT_LOCALES_PATH . '/' . $this->okt->user->language . '/admin.templates.config');
     # téléchargement d'un template
     if (!empty($_GET['tpl_download']) && !empty($_GET['tpl_id']) && array_key_exists(rawurldecode($_GET['tpl_id']), $this->getTplInfos()) && !empty($_GET['tpl_family']) && rawurldecode($_GET['tpl_family']) == $this->sTplFamily) {
         $this->dowloadTemplate(rawurldecode($_GET['tpl_id']));
     }
     # suppression d'un template
     if (!empty($_GET['tpl_delete']) && !empty($_GET['tpl_id']) && array_key_exists(rawurldecode($_GET['tpl_id']), $this->getTplInfos()) && !empty($_GET['tpl_family']) && rawurldecode($_GET['tpl_family']) == $this->sTplFamily) {
         $this->deleteTemplate(rawurldecode($_GET['tpl_id']));
         $this->okt->redirect($this->sBaseUrl . 'tpl_family=' . rawurlencode($this->sTplFamily) . '&tpl_deleted=1');
     }
     if (isset($this->okt->page) && !empty($_GET['tpl_family']) && rawurldecode($_GET['tpl_family']) == $this->sTplFamily) {
         $this->okt->page->messages->success('tpl_deleted', __('c_a_tpl_config_tpl_deleted'));
     }
 }
Beispiel #19
0
# Manage the current language selected
$lang = $GLOBALS['lang'];
# Not really used because the anonymous account is always used
if (Auth::isAuth()) {
    $lang = Auth::getLanguage();
    # Special case to add synchro for changing temporary langue via the top control panel
    $re = new HttpRequest();
    $module = $re->getModule();
    $action = $re->getAction();
    if ($module == 'wall' && $action == 'index') {
        $args = $re->getArgs();
        if (isset($args['langage'])) {
            $availableLanguages = Util::getAvailableLanguages();
            if ($args['langage'] !== null && in_array($args['langage'], array_keys($availableLanguages))) {
                $_SESSION['globalLangage'] = $lang = $args['langage'];
            }
        }
    }
}
// internationalisation
l10n::init();
l10n::set(dirname(__FILE__) . '/locales/' . $lang . '/messages');
try {
    $re = new HttpRequest();
    $fc = new AdminEnabledDefaultFC($re);
    $fc->loadModule();
} catch (Exception $e) {
    $message = $e;
    header('HTTP/1.1 500 Internal Error');
    require_once DIR_VIEWS . $GLOBALS['dir_theme'] . "error404.tpl";
}
Beispiel #20
0
<?php

/**
 * @ingroup okt_module_galleries
 * @brief Page de gestion des galeries
 *
 */
# Accès direct interdit
if (!defined('ON_GALLERIES_MODULE')) {
    die;
}
/* Initialisations
----------------------------------------------------------*/
# Chargement des locales
l10n::set(__DIR__ . '/../../locales/' . $okt->user->language . '/admin.list');
/* Traitements
----------------------------------------------------------*/
# Régénération des miniatures d'une galerie
if (!empty($_REQUEST['regenerate_thumbnails'])) {
    if ($okt->galleries->items->regenMinImages($_REQUEST['regenerate_thumbnails'])) {
        $okt->redirect('module.php?m=galleries&minregenerated=1');
    }
}
# Switch statut
if (!empty($_GET['switch_status']) && $okt->checkPerm('galleries_manage')) {
    try {
        $okt->galleries->tree->switchGalleryStatus($_GET['switch_status']);
        # log admin
        $okt->logAdmin->info(array('code' => 32, 'component' => 'galleries', 'message' => 'category #' . $_GET['switch_status']));
        $okt->redirect('module.php?m=galleries&switched=1');
    } catch (Exception $e) {
Beispiel #21
0
#
# This file is part of QrazyTimes2, a theme for Dotclear 2.
# Pierre Van Glabeke
#
# Licensed under the GPL version 2.0 license.
# See LICENSE file or
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
if (!defined('DC_CONTEXT_ADMIN')) {
    return;
}
global $core;
//PARAMS
# Translations
l10n::set(dirname(__FILE__) . '/locales/' . $_lang . '/main');
# Default values
$default_about = false;
# Settings
$my_about = $core->blog->settings->themes->qrazytimes2_about;
# About
$html_fileabout = path::real($core->blog->themes_path) . '/' . $core->blog->settings->system->theme . '/tpl/_about.html';
if (!is_file($html_fileabout) && !is_writable(dirname($html_fileabout))) {
    throw new Exception(sprintf(__('File %s does not exist and directory %s is not writable.'), $css_fileabout, dirname($html_fileabout)));
}
// POST ACTIONS
if (!empty($_POST)) {
    try {
        $core->blog->settings->addNamespace('themes');
        # About
        if (!empty($_POST['qrazytimes2_about'])) {
    public static function displayPublicAdminBar($okt)
    {
        $aBasesUrl = new ArrayObject();
        $aPrimaryAdminBar = new ArrayObject();
        $aSecondaryAdminBar = new ArrayObject();
        $aBasesUrl['admin'] = $okt->config->app_path . OKT_ADMIN_DIR;
        $aBasesUrl['logout'] = $aBasesUrl['admin'] . '/index.php?logout=1';
        $aBasesUrl['profil'] = $aBasesUrl['admin'];
        # -- CORE TRIGGER : publicAdminBarBeforeDefaultsItems
        $okt->triggers->callTrigger('publicAdminBarBeforeDefaultsItems', $okt, $aPrimaryAdminBar, $aSecondaryAdminBar, $aBasesUrl);
        # éléments première barre
        $aPrimaryAdminBar[10] = array('intitle' => '<img src="' . OKT_PUBLIC_URL . '/img/notify/error.png" width="22" height="22" alt="' . __('c_c_warning') . '" />', 'items' => array());
        $aPrimaryAdminBar[100] = array('href' => $aBasesUrl['admin'], 'intitle' => __('c_c_administration'));
        $aPrimaryAdminBar[200] = array('intitle' => __('c_c_action_Add'), 'items' => array());
        # éléments seconde barre
        $aSecondaryAdminBar[100] = array('href' => $aBasesUrl['profil'], 'intitle' => sprintf(__('c_c_user_hello_%s'), html::escapeHTML(oktAuth::getUserCN($okt->user->username, $okt->user->lastname, $okt->user->firstname))));
        if (!$okt->languages->unique) {
            $iStartIdx = 150;
            foreach ($okt->languages->list as $aLanguage) {
                if ($aLanguage['code'] == $okt->user->language) {
                    continue;
                }
                $aSecondaryAdminBar[$iStartIdx++] = array('href' => html::escapeHTML($okt->config->app_path . $aLanguage['code'] . '/'), 'title' => html::escapeHTML($aLanguage['title']), 'intitle' => '<img src="' . OKT_PUBLIC_URL . '/img/flags/' . $aLanguage['img'] . '" alt="' . html::escapeHTML($aLanguage['title']) . '" />');
            }
        }
        $aSecondaryAdminBar[200] = array('href' => $aBasesUrl['logout'], 'intitle' => __('c_c_user_log_off_action'));
        # infos super-admin
        if ($okt->checkPerm('is_superadmin')) {
            # avertissement nouvelle version disponible
            if ($okt->config->update_enabled && is_readable(OKT_DIGESTS)) {
                $updater = new oktUpdate($okt->config->update_url, 'okatea', $okt->config->update_type, OKT_CACHE_PATH . '/versions');
                $new_v = $updater->check(util::getVersion());
                if ($updater->getNotify() && $new_v) {
                    # locales
                    l10n::set(OKT_LOCALES_PATH . '/' . $okt->user->language . '/admin.update');
                    $aPrimaryAdminBar[10]['items'][100] = array('href' => $aBasesUrl['admin'] . '/configuration.php?action=update', 'intitle' => sprintf(__('c_a_update_okatea_%s_available'), $new_v));
                }
            }
            # avertissement mode maintenance est activé sur la partie publique
            if ($okt->config->public_maintenance_mode) {
                $aPrimaryAdminBar[10]['items'][300] = array('href' => $aBasesUrl['admin'] . '/configuration.php?action=advanced#tab_others', 'intitle' => sprintf(__('c_a_public_maintenance_mode_enabled'), $new_v));
            }
            # avertissement mode maintenance est activé sur l'admin
            if ($okt->config->admin_maintenance_mode) {
                $aPrimaryAdminBar[10]['items'][400] = array('href' => $aBasesUrl['admin'] . '/configuration.php?action=advanced#tab_others', 'intitle' => sprintf(__('c_a_admin_maintenance_mode_enabled'), $new_v));
            }
            # info execution
            $aExecInfos = array();
            $aExecInfos['execTime'] = util::getExecutionTime();
            if (OKT_XDEBUG) {
                $aExecInfos['memUsage'] = util::l10nFileSize(xdebug_memory_usage());
                $aExecInfos['peakUsage'] = util::l10nFileSize(xdebug_peak_memory_usage());
            } else {
                $aExecInfos['memUsage'] = util::l10nFileSize(memory_get_usage());
                $aExecInfos['peakUsage'] = util::l10nFileSize(memory_get_peak_usage());
            }
            $aSecondaryAdminBar[1000] = array('title' => $aExecInfos['execTime'] . ' s - ' . $aExecInfos['memUsage'], 'intitle' => '<img src="' . OKT_PUBLIC_URL . '/img/ico/terminal.gif" width="16" height="16" alt="" />', 'items' => array(array('intitle' => 'Temps d\'execution du script&nbsp;: ' . $aExecInfos['execTime'] . ' s'), array('intitle' => 'Mémoire utilisée par PHP&nbsp;: ' . $aExecInfos['memUsage']), array('intitle' => 'Pic mémoire allouée par PHP&nbsp;: ' . $aExecInfos['peakUsage']), array('intitle' => 'Router lang&nbsp;: ' . $okt->router->getLanguage()), array('intitle' => 'Router path&nbsp;: ' . $okt->router->getPath()), array('intitle' => 'Router route ID&nbsp;: ' . $okt->router->getFindedRouteId())));
            if (!empty($okt->page->module)) {
                $aSecondaryAdminBar[1000]['items'][] = array('intitle' => '$okt->page->module&nbsp;: ' . $okt->page->module);
            }
            if (!empty($okt->page->action)) {
                $aSecondaryAdminBar[1000]['items'][] = array('intitle' => '$okt->page->action&nbsp;: ' . $okt->page->action);
            }
        }
        # -- CORE TRIGGER : publicAdminBarItems
        $okt->triggers->callTrigger('publicAdminBarItems', $okt, $aPrimaryAdminBar, $aSecondaryAdminBar, $aBasesUrl);
        # sort items of by keys
        $aPrimaryAdminBar->ksort();
        $aSecondaryAdminBar->ksort();
        # remove empty values of admins bars
        $aPrimaryAdminBar = array_filter((array) $aPrimaryAdminBar);
        $aSecondaryAdminBar = array_filter((array) $aSecondaryAdminBar);
        # reverse sedond bar items
        $aSecondaryAdminBar = array_reverse($aSecondaryAdminBar);
        $class = '';
        ?>
		<div id="oktadminbar" class="<?php 
        echo $class;
        ?>
" role="navigation">
			<a class="screen-reader-shortcut" href="#okt-toolbar" tabindex="1"><?php 
        _e('Skip to toolbar');
        ?>
			</a>
			<div class="quicklinks" id="okt-toolbar" role="navigation"
				aria-label="<?php 
        echo util::escapeAttrHTML(__('Top navigation toolbar.'));
        ?>
"
				tabindex="0">
				<ul class="ab-top-menu">
					<?php 
        foreach ($aPrimaryAdminBar as $aPrimaryItem) {
            echo self::getItems($aPrimaryItem);
        }
        ?>
				</ul>
				<ul class="ab-top-secondary ab-top-menu">
					<?php 
        foreach ($aSecondaryAdminBar as $aSecondaryItem) {
            echo self::getItems($aSecondaryItem);
        }
        ?>
				</ul>
			</div>
			<a class="screen-reader-shortcut"
				href="<?php 
        echo $aBasesUrl['logout'];
        ?>
"><?php 
        _e('c_c_user_log_off_action');
        ?>
			</a>
		</div>
		<?php 
    }
Beispiel #23
0
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
/**
 * La page de création de fichier de l'éditeur de themes.
 *
 * @addtogroup Okatea
 */
# Accès direct interdit
if (!defined('ON_THEME_EDITOR')) {
    die;
}
/* Initialisations
----------------------------------------------------------*/
# locales
l10n::set(OKT_LOCALES_PATH . '/' . $okt->user->language . '/admin.theme.editor');
$sThemeId = !empty($_REQUEST['theme']) ? $_REQUEST['theme'] : null;
$oThemeEditor = new oktThemeEditor($okt, OKT_THEMES_DIR, OKT_THEMES_PATH);
if ($sThemeId) {
    try {
        $oThemeEditor->loadTheme($sThemeId);
    } catch (Exception $e) {
        $okt->error->set($e->getMessage());
        $sThemeId = null;
    }
} else {
    $okt->error->set(__('c_a_te_error_choose_theme'));
}
/* Traitements
----------------------------------------------------------*/
# formulaire envoyé
Beispiel #24
0
 /**
 This method will search for file <var>$file</var> in language
 <var>$lang</var> for module <var>$id</var>.
 
 <var>$file</var> should not have any extension.
 
 @param	id		<b>string</b>		Module ID
 @param	lang		<b>string</b>		Language code
 @param	file		<b>string</b>		File name (without extension)
 */
 public function loadModuleL10N($id, $lang, $file)
 {
     if (!$lang || !isset($this->modules[$id])) {
         return;
     }
     $lfile = $this->modules[$id]['root'] . '/locales/%s/%s';
     if (l10n::set(sprintf($lfile, $lang, $file)) === false && $lang != 'en') {
         l10n::set(sprintf($lfile, 'en', $file));
     }
 }
Beispiel #25
0
<?php

/**
 * @ingroup okt_module_news
 * @brief Page de gestion des rubriques
 *
 */
# Accès direct interdit
if (!defined('ON_NEWS_MODULE')) {
    die;
}
/* Initialisations
----------------------------------------------------------*/
# Chargement des locales
l10n::set(__DIR__ . '/../../locales/' . $okt->user->language . '/admin.categories');
# Récupération de la liste complète des rubriques
$rsCategories = $okt->news->categories->getCategories(array('active' => 2, 'with_count' => true, 'language' => $okt->user->language));
$iCategoryId = null;
$aCategoryData = new ArrayObject();
$aCategoryLocalesData = new ArrayObject();
$aCategoryData['active'] = 1;
$aCategoryData['parent_id'] = 0;
$aCategoryData['tpl'] = '';
$aCategoryData['items_tpl'] = '';
foreach ($okt->languages->list as $aLanguage) {
    $aCategoryLocalesData[$aLanguage['code']] = array();
    $aCategoryLocalesData[$aLanguage['code']]['title'] = '';
    $aCategoryLocalesData[$aLanguage['code']]['content'] = '';
    if ($okt->news->config->enable_metas) {
        $aCategoryLocalesData[$aLanguage['code']]['title_seo'] = '';
        $aCategoryLocalesData[$aLanguage['code']]['title_tag'] = '';
Beispiel #26
0
<?php

# -- BEGIN LICENSE BLOCK ----------------------------------
#
# This file is part of QrazyTimes2, a theme for Dotclear 2.
# Pierre Van Glabeke
#
# Licensed under the GPL version 2.0 license.
# See LICENSE file or
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
if (!defined('DC_RC_PATH')) {
    return;
}
l10n::set(dirname(__FILE__) . '/locales/' . $_lang . '/public');
# appel css about
if ($core->blog->settings->themes->qrazytimes2_about) {
    $core->addBehavior('publicHeadContent', array('tplQrazytimes2_about', 'publicHeadContent'));
}
class tplQrazytimes2_about
{
    public static function publicHeadContent($core)
    {
        $url = $core->blog->settings->system->themes_url . '/' . $core->blog->settings->system->theme;
        echo '<link rel="stylesheet" type="text/css" media="screen" href="' . $url . "/about.css\" />\n";
    }
}
Beispiel #27
0
<?php

/**
 * @ingroup okt_module_galleries
 * @brief Ajout de plusieurs éléments d'un coup
 *
 */
# Accès direct interdit
if (!defined('ON_GALLERIES_MODULE')) {
    die;
}
/* Initialisations
----------------------------------------------------------*/
# Chargement des locales
l10n::set(__DIR__ . '/../../../locales/' . $okt->user->language . '/admin.plupload');
$iGalleryId = !empty($_REQUEST['gallery_id']) ? intval($_REQUEST['gallery_id']) : null;
$aItemLocalesData = array();
foreach ($okt->languages->list as $aLanguage) {
    $aItemLocalesData[$aLanguage['code']] = array();
    $aItemLocalesData[$aLanguage['code']]['title'] = '';
}
/* Traitements
----------------------------------------------------------*/
#  ajout d'éléments
if (!empty($_POST['sended'])) {
    $okt->galleries->items->regenMinImages($iGalleryId);
    $okt->redirect('module.php?m=galleries&action=items&gallery_id=' . $iGalleryId);
}
/* Affichage
----------------------------------------------------------*/
$okt->page->addButton('galleriesBtSt', array('permission' => true, 'title' => __('c_c_action_Go_back'), 'url' => $iGalleryId ? 'module.php?m=galleries&amp;action=items&amp;gallery_id=' . $iGalleryId : 'module.php?m=galleries&amp;action=index', 'ui-icon' => 'arrowreturnthick-1-w'), 'before');
Beispiel #28
0
<?php

# uncomment this to check for uninitialized variables etc.:
# error_reporting (E_ALL);
#language support
require_once "lib/lib.l10n.php";
require_once "inc/config.inc.php";
require_once "inc/www.class.inc.php";
require_once "inc/funkce.inc.php";
//session_name("navstevnik");
//session_register("page");
#set the language translation
l10n::set("{$root}/l10n/" . $sclang . "/main.lang");
l10n::set("{$root}/l10n/" . $sclang . "/date.lang");
# always get sorted directory entries
$adr = new SortDir("{$gallery_dir}");
# get variables passed in from the URL:
$galerie = '';
if (isset($_GET['galerie'])) {
    $galerie = $_GET["galerie"];
}
if (isset($_GET['gallery'])) {
    $galerie = $_GET["gallery"];
}
$galerie = preg_replace('/\\//', '', $galerie);
if (isset($_GET["thumbsize"])) {
    $thumbsize = $_GET["thumbsize"];
}
$snimek = 0;
if (isset($_GET["snimek"])) {
    $snimek = $_GET["snimek"];
Beispiel #29
0
			width: 70%;
		}
	');
}
# En-tête
require OKT_ADMIN_HEADER_FILE;
?>

<?php 
# updates notifications
if ($okt->config->update_enabled && $okt->checkPerm('is_superadmin') && is_readable(OKT_DIGESTS)) {
    $updater = new oktUpdate($okt->config->update_url, 'okatea', $okt->config->update_type, OKT_CACHE_PATH . '/versions');
    $new_v = $updater->check(util::getVersion());
    if ($updater->getNotify() && $new_v) {
        # locales
        l10n::set(OKT_LOCALES_PATH . '/' . $okt->user->language . '/admin.update');
        echo '<div id="updates-notifications"><h3>' . __('c_a_update') . '</h3>' . '<p>' . sprintf(__('c_a_update_okatea_%s_available'), $new_v) . '</p><ul>' . '<li><strong><a href="configuration.php?action=update">' . sprintf(__('c_a_update_upgrade_now'), $new_v) . '</a></strong></li>' . '<li><a href="configuration.php?action=update&amp;hide_msg=1">' . __('c_a_update_remind_later') . '</a></li></ul></div>';
    }
}
?>

<div class="ui-helper-clearfix">
	<?php 
# lecteur de flux d'actualités
if ($okt->config->news_feed['enabled'] && $feed_success) {
    ?>

	<div id="news_feed_list">
		<?php 
    foreach ($feed->get_items() as $item) {
        ?>
 function loadl10n($p)
 {
     if (defined('DC_LANG')) {
         if (dc_encoding == 'UTF-8') {
             l10n::set($this->location . $p . '/l10n/' . DC_LANG . '-utf8/main');
         } else {
             l10n::set($this->location . $p . '/l10n/' . DC_LANG . '/main');
         }
     }
 }