2 /* ==========================================================================================
3 * Nucleus SkinFiles Plugin
5 * Copyright 2005-2009 by Jeff MacMichael and Niels Leenheer
7 * ==========================================================================================
8 * This program is free software and open source software; you can redistribute
9 * it and/or modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of the License,
11 * or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA or visit
21 * http://www.gnu.org/licenses/gpl.html
22 * ==========================================================================================
25 * v0.91 ged - added ICO, PHPx files, fixed/added some icons
26 * - changed perms on file or folder creation or upload to 0755 from 0640
27 * - changed 'cancel' links for delete actions to $parent dir from http_referer
28 * - changed order of links next to files... moved 'del' over a bit. ;)
29 * v0.92 ged - changed order of links next to dirs
30 * - $privateskins = FALSE by default
31 * v1.0 ged - fixed security catch so it actually quits the script
32 * - "columnated" the files & dirs display for easier viewing
33 * - Made the edit cancel link more intuitive
34 * v1.01 ged - fixed event_QuickMenu to properly skip for non-admins
35 * - lined up columns for directories & added <tr> highlights
36 * v2.00 rakaz - Almost complete rewrite
37 * v2.01 yama - modified form button for IE
38 * v2.02 kimitake - multilingual support, modified form button for IE
39 * v2.03 yama - CSS out source. and textarea width bug fix for IE. And some lang add.And add routine empty file delete.
40 * cacher - replace function 'basename' (PHP BUG)
42 * Mocchi - arrange codes for PHP5
45 class NP_SkinFiles extends NucleusPlugin {
46 public function getName() { return 'SkinFiles'; }
47 public function getAuthor() { return 'Misc authors'; }
48 public function getURL() { return 'http://wakka.xiffy.nl/skinfiles'; }
49 public function getVersion() { return '2.032'; }
50 public function getDescription() { return _SKINFILES_01; }
51 public function supportsFeature($feature) { return in_array ($feature, array ('SqlTablePrefix', 'SqlApi', 'HelpPage'));}
52 public function hasAdminArea() { return 1; }
54 public function install() {
57 '_SKINFILES_OPT_GENBACKUP',
63 '_SKINFILES_OPT_BACKUPPREFIX',
70 public function unInstall() {
74 public function getEventList() {
78 'PrePluginOptionsEdit'
82 public function init() {
83 $language = preg_replace( '#\\\\|/#', '', getLanguageName());
84 if (file_exists($this->getDirectory().$language.'.php')) {
85 include_once($this->getDirectory().$language.'.php');
87 include_once($this->getDirectory().'english.php');
92 public function event_QuickMenu(&$data) {
95 if (!($member->isLoggedIn() && $member->isAdmin())) {
102 'title' => _SKINFILES_TITLE,
103 'url' => $this->getAdminURL(),
104 'tooltip' => _SKINFILES_TOOLTIP
110 public function event_AdminPrePageHead(&$data) {
112 $path = $CONF['PluginURL'];
113 if ($data['action'] != 'plugin_SkinFiles') {
117 $data['extrahead'] .= '<link rel="stylesheet" type="text/css" href="{$path}skinfiles/style.css" />';
120 public function event_PrePluginOptionsEdit($data) {
121 if ($data['context'] !== 'global' || $data['plugid'] !== $this->getID()) {
124 foreach($data['options'] as $key => $value){
125 if (defined($value['description'])) {
126 $data['options'][$key]['description'] = constant($value['description']);