OSDN Git Service

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