[2235] | 1 | <?php |
---|
| 2 | // +-----------------------------------------------------------------------+ |
---|
[2297] | 3 | // | Piwigo - a PHP based picture gallery | |
---|
| 4 | // +-----------------------------------------------------------------------+ |
---|
| 5 | // | Copyright(C) 2008 Piwigo Team http://piwigo.org | |
---|
| 6 | // | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net | |
---|
| 7 | // | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick | |
---|
| 8 | // +-----------------------------------------------------------------------+ |
---|
| 9 | // | This program is free software; you can redistribute it and/or modify | |
---|
| 10 | // | it under the terms of the GNU General Public License as published by | |
---|
| 11 | // | the Free Software Foundation | |
---|
| 12 | // | | |
---|
| 13 | // | This program is distributed in the hope that it will be useful, but | |
---|
| 14 | // | WITHOUT ANY WARRANTY; without even the implied warranty of | |
---|
| 15 | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
---|
| 16 | // | General Public License for more details. | |
---|
| 17 | // | | |
---|
| 18 | // | You should have received a copy of the GNU General Public License | |
---|
| 19 | // | along with this program; if not, write to the Free Software | |
---|
| 20 | // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |
---|
| 21 | // | USA. | |
---|
| 22 | // +-----------------------------------------------------------------------+ |
---|
[2235] | 23 | |
---|
| 24 | define('PHPWG_ROOT_PATH', '../../'); |
---|
| 25 | include_once(PHPWG_ROOT_PATH . 'include/common.inc.php'); |
---|
[2291] | 26 | include_once(LOCALEDIT_PATH.'functions.inc.php'); |
---|
[2235] | 27 | check_status(ACCESS_ADMINISTRATOR); |
---|
| 28 | |
---|
| 29 | if (isset($_GET['file'])) |
---|
| 30 | { |
---|
| 31 | $path = $_GET['file']; |
---|
| 32 | if (!is_admin() or (!substr_count($path, 'config_default.inc.php') and !substr_count($path, '.lang.php'))) |
---|
| 33 | { |
---|
| 34 | die('Hacking attempt!'); |
---|
| 35 | } |
---|
| 36 | |
---|
| 37 | $template->set_filename('show_default', dirname(__FILE__) . '/show_default.tpl'); |
---|
[2291] | 38 | |
---|
| 39 | // Editarea |
---|
| 40 | if (!isset($conf['editarea_options']) or $conf['editarea_options'] !== false) |
---|
| 41 | { |
---|
| 42 | $editarea = array( |
---|
| 43 | 'syntax' => 'php', |
---|
| 44 | 'start_highlight' => true, |
---|
| 45 | 'is_editable' => false, |
---|
| 46 | 'language' => substr($user['language'], 0, 2)); |
---|
| 47 | |
---|
| 48 | $template->assign('editarea', array( |
---|
| 49 | 'URL' => LOCALEDIT_PATH . 'editarea/edit_area_full.js', |
---|
| 50 | 'OPTIONS' => $editarea)); |
---|
| 51 | } |
---|
| 52 | |
---|
[2235] | 53 | $file = file_get_contents(PHPWG_ROOT_PATH . $path); |
---|
[2291] | 54 | |
---|
| 55 | $template->assign(array('DEFAULT_CONTENT' => $file)); |
---|
| 56 | |
---|
[2235] | 57 | $title = $path; |
---|
| 58 | $page['page_banner'] = '<h1>'.str_replace('/', ' / ', $path).'</h1>'; |
---|
| 59 | $page['body_id'] = 'thePopuphelpPage'; |
---|
| 60 | |
---|
| 61 | include(PHPWG_ROOT_PATH.'include/page_header.php'); |
---|
[2291] | 62 | |
---|
[2235] | 63 | $template->pparse('show_default'); |
---|
[2291] | 64 | |
---|
[2235] | 65 | include(PHPWG_ROOT_PATH.'include/page_tail.php'); |
---|
| 66 | } |
---|
| 67 | |
---|
| 68 | ?> |
---|