Exemplo n.º 1
0
 * @addtogroup Okatea
 *
 */
# Accès direct interdit
if (!defined('ON_CONFIGURATION_MODULE')) {
    die;
}
define('ON_THEME_EDITOR', true);
if (!empty($_REQUEST['new_file'])) {
    require __DIR__ . '/theme_editor/new_file.php';
} else {
    if (!empty($_REQUEST['new_template'])) {
        l10n::set(OKT_LOCALES_PATH . '/' . $okt->user->language . '/admin.theme.editor');
        $sThemeId = !empty($_REQUEST['theme']) ? $_REQUEST['theme'] : null;
        $sBasicTemplate = !empty($_REQUEST['basic_template']) ? rawurldecode($_REQUEST['basic_template']) : 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'));
        }
        if (empty($sBasicTemplate)) {
            require __DIR__ . '/theme_editor/choose_basic_template.php';
        } else {
            require __DIR__ . '/theme_editor/new_template.php';
        }
Exemplo n.º 2
0
 */
/**
 * 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é
if (!empty($_POST['form_sent'])) {
    $p_filename = !empty($_POST['p_filename']) ? $_POST['p_filename'] : '';
Exemplo n.º 3
0
 * La page principale 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;
$sFilename = !empty($_REQUEST['file']) ? rawurldecode($_REQUEST['file']) : null;
$sMode = 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'));
}
if ($sThemeId && $sFilename) {
    try {
        $oThemeEditor->loadFile($sFilename);
        $sMode = $oThemeEditor->getCodeMirrorMode();
    } catch (Exception $e) {