OSDN Git Service

Merge branch 'skinnable-master'
[nucleus-jp/nucleus-next.git] / nucleus / plugins / NP_SkinFiles.php
1 <?php
2
3 class NP_SkinFiles extends NucleusPlugin {
4
5    /* ==========================================================================================
6         * Nucleus SkinFiles Plugin
7         *
8         * Copyright 2005-2007 by Jeff MacMichael and Niels Leenheer
9         *
10 <<<<<<< HEAD
11         * @version $Id: NP_SkinFiles.php 1678 2012-02-26 07:31:36Z sakamocchi $
12 =======
13         * @version $Id: NP_SkinFiles.php 1749 2012-04-13 14:06:34Z sakamocchi $
14 >>>>>>> skinnable-master
15         * @version $NucleusJP: NP_SkinFiles.php,v 1.3 2006/07/17 20:03:45 kimitake Exp $
16         *
17         * ==========================================================================================
18         * This program is free software and open source software; you can redistribute
19         * it and/or modify it under the terms of the GNU General Public License as
20         * published by the Free Software Foundation; either version 2 of the License,
21         * or (at your option) any later version.
22         *
23         * This program is distributed in the hope that it will be useful, but WITHOUT
24         * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
25         * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
26         * more details.
27         *
28         * You should have received a copy of the GNU General Public License along
29         * with this program; if not, write to the Free Software Foundation, Inc.,
30         * 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  or visit
31         * http://www.gnu.org/licenses/gpl.html
32         * ==========================================================================================
33         *
34         * Changes:
35         * v0.91 ged   - added ICO, PHPx files, fixed/added some icons
36         *             - changed perms on file or folder creation or upload to 0755 from 0640
37         *             - changed 'cancel' links for delete actions to $parent dir from http_referer
38         *             - changed order of links next to files... moved 'del' over a bit.  ;)
39         * v0.92 ged   - changed order of links next to dirs
40         *               $privateskins = FALSE by default
41         * v1.0  ged   - fixed security catch so it actually quits the script
42         *               "columnated" the files & dirs display for easier viewing
43         *               Made the edit cancel link more intuitive
44         * v1.01 ged   - fixed event_QuickMenu to properly skip for non-admins
45         *               lined up columns for directories & added <tr> highlights
46         * v2.00 rakaz - Almost complete rewrite
47         * v2.01 yama  - modified form button for IE
48         * v2.02 kimitake - multilingual support, modified form button for IE
49         */
50         
51         public function getName()
52         {
53                 return 'SkinFiles';
54         }
55         public function getAuthor()
56         {
57                 return 'Misc authors';
58         }
59
60         public function getURL()
61         {
62                 return 'http://www.nucleuscms.org/';
63         }
64
65         public function getVersion()
66         {
67                 return '2.02';
68         }
69
70         public function getDescription()
71         {
72                 return 'A simple file manager for skins.';
73         }
74
75         public function hasAdminArea()
76         {
77                 return 1;
78         }
79
80         public function getEventList()
81         {
82                 return array('QuickMenu');
83         }
84
85         public function supportsFeature($what)
86         {
87                 if ( $what == 'SqlTablePrefix' )
88                 {
89                         return 1;
90                 }
91                 return 0;
92         }
93         
94         public function install()               { return; }
95         public function unInstall()             { return; }
96         
97         public function init()
98         {
99                 // include translation file for this plugin
100                 if ( file_exists($this->getDirectory() . i18n::get_current_locale() . '.' . i18n::get_current_charset() . '.php') )
101                 {
102                         include_once($this->getDirectory() . i18n::get_current_locale() . '.' . i18n::get_current_charset() . '.php');
103                 }
104                 else
105                 {
106                         include_once($this->getDirectory().'en_Latn_US.UTF-8.php');
107                 }
108                 return;
109         }
110         
111         public function event_QuickMenu(&$data)
112         {
113                 global $member;
114                 
115                 // only show to admins
116                 if ( !($member->isLoggedIn() && $member->isAdmin()) )
117                 {
118                         return;
119                 }
120                 
121                 array_push(
122                         $data['options'], 
123                         array(
124                                 'title' => _SKINFILES_TITLE,
125                                 'url' => $this->getAdminURL(),
126                                 'tooltip' => _SKINFILES_TOOLTIP
127                         ));
128                 return;
129         }
130 }