Example #1
0
 *
 * @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'] : '';
    $p_parent = !empty($_POST['p_parent']) ? rawurldecode($_POST['p_parent']) : '/';
    if (empty($p_filename)) {
        $okt->error->set(__('c_a_te_error_must_filename'));