예제 #1
0
파일: index.php 프로젝트: HackerMajor/root
# Copyright (c) 2003-2009 Olivier Meunier and contributors
# 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;
}
require dirname(__FILE__) . '/class.themeEditor.php';
$file_default = $file = array('c' => null, 'w' => false, 'type' => null, 'f' => null, 'default_file' => false);
# Loading themes
$core->themes = new dcThemes($core);
$core->themes->loadModules($core->blog->themes_path, null);
$T = $core->themes->getModules($core->blog->settings->theme);
$o = new dcThemeEditor($core);
try {
    try {
        if (!empty($_REQUEST['tpl'])) {
            $file = $o->getFileContent('tpl', $_REQUEST['tpl']);
        } elseif (!empty($_REQUEST['css'])) {
            $file = $o->getFileContent('css', $_REQUEST['css']);
        } elseif (!empty($_REQUEST['js'])) {
            $file = $o->getFileContent('js', $_REQUEST['js']);
        }
    } catch (Exception $e) {
        $file = $file_default;
        throw $e;
    }
    # Write file
    if (!empty($_POST['write'])) {
예제 #2
0
파일: index.php 프로젝트: nikrou/dotclear
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK -----------------------------------------
if (!defined('DC_CONTEXT_ADMIN')) {
    return;
}
require dirname(__FILE__) . '/class.themeEditor.php';
$file_default = $file = array('c' => null, 'w' => false, 'type' => null, 'f' => null, 'default_file' => false);
# Get interface setting
$core->auth->user_prefs->addWorkspace('interface');
$user_ui_colorsyntax = $core->auth->user_prefs->interface->colorsyntax;
# Loading themes
$core->themes = new dcThemes($core);
$core->themes->loadModules($core->blog->themes_path, null);
$T = $core->themes->getModules($core->blog->settings->system->theme);
$o = new dcThemeEditor($core);
try {
    try {
        if (!empty($_REQUEST['tpl'])) {
            $file = $o->getFileContent('tpl', $_REQUEST['tpl']);
        } elseif (!empty($_REQUEST['css'])) {
            $file = $o->getFileContent('css', $_REQUEST['css']);
        } elseif (!empty($_REQUEST['js'])) {
            $file = $o->getFileContent('js', $_REQUEST['js']);
        } elseif (!empty($_REQUEST['po'])) {
            $file = $o->getFileContent('po', $_REQUEST['po']);
        }
    } catch (Exception $e) {
        $file = $file_default;
        throw $e;
    }