Rev | Line | |
---|
[0] | 1 | <?php |
---|
| 2 | # -- BEGIN LICENSE BLOCK --------------------------------------- |
---|
| 3 | # |
---|
| 4 | # This file is part of Dotclear 2. |
---|
| 5 | # |
---|
[270] | 6 | # Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear |
---|
[0] | 7 | # Licensed under the GPL version 2.0 license. |
---|
| 8 | # See LICENSE file or |
---|
| 9 | # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
---|
| 10 | # |
---|
| 11 | # -- END LICENSE BLOCK ----------------------------------------- |
---|
| 12 | if (!defined('DC_CONTEXT_ADMIN')) { return; } |
---|
| 13 | |
---|
| 14 | l10n::set(dirname(__FILE__).'/locales/'.$_lang.'/main'); |
---|
| 15 | $css_file = path::real($core->blog->public_path).'/custom_style.css'; |
---|
| 16 | |
---|
| 17 | if (!is_file($css_file) && !is_writable(dirname($css_file))) { |
---|
| 18 | throw new Exception( |
---|
| 19 | sprintf(__('File %s does not exist and directory %s is not writable.'), |
---|
| 20 | $css_file,dirname($css_file)) |
---|
| 21 | ); |
---|
| 22 | } |
---|
| 23 | |
---|
| 24 | if (isset($_POST['css'])) |
---|
| 25 | { |
---|
| 26 | @$fp = fopen($css_file,'wb'); |
---|
| 27 | fwrite($fp,$_POST['css']); |
---|
| 28 | fclose($fp); |
---|
| 29 | |
---|
| 30 | echo |
---|
| 31 | '<div class="message"><p>'. |
---|
| 32 | __('Style sheet upgraded.'). |
---|
| 33 | '</p></div>'; |
---|
| 34 | } |
---|
| 35 | |
---|
| 36 | $css_content = is_file($css_file) ? file_get_contents($css_file) : ''; |
---|
| 37 | |
---|
| 38 | echo |
---|
| 39 | '<p class="area"><label>'.__('Style sheet:').' '. |
---|
| 40 | form::textarea('css',60,20,html::escapeHTML($css_content)).'</label></p>'; |
---|
| 41 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.