OSDN Git Service

merged 3.3 beta1
[nucleus-jp/nucleus-jp-ancient.git] / nucleus / plugins / NP_SkinFiles.php
1 <?php
2
3 /*                                       */
4 /* NP_SkinFiles                          */
5 /* ------------------------------------  */
6 /* A simple skin files manager           */
7 /*                                       */
8 /* code by Jeff MacMichael               */
9 /* http://wiki.gednet.com/               */
10 /*                                       */
11
12 /* Changes:
13  * v0.91 ged - added ICO, PHPx files, fixed/added some icons
14  *           - changed perms on file or folder creation or upload to 0755 from 0640
15  *           - changed 'cancel' links for delete actions to $parent dir from http_referer
16  *           - changed order of links next to files... moved 'del' over a bit.  ;)
17  * v0.92 ged - changed order of links next to dirs
18  *             $privateskins = FALSE by default
19  * v1.0  ged - fixed security catch so it actually quits the script
20  *             "columnated" the files & dirs display for easier viewing
21  *             Made the edit cancel link more intuitive
22  * v1.01 ged - fixed event_QuickMenu to properly skip for non-admins
23  *             lined up columns for directories & added <tr> highlights
24  */
25
26 class NP_SkinFiles extends NucleusPlugin {
27
28         function getName()              { return 'SkinFiles'; }
29         function getAuthor()    { return 'Jeff MacMichael'; }
30         function getURL()               { return 'http://wiki.gednet.com/'; }
31         function getVersion()   { return '1.01'; }
32         function getDescription() { return 'A simple file manager for skins.';  }
33
34         function supportsFeature($what) {
35                 switch($what)
36                 { case 'SqlTablePrefix':
37                                 return 1;
38                         default:
39                                 return 0; }
40         }
41
42         function install() {
43         }
44         
45         function unInstall() {
46         }
47
48         function getEventList() {
49                 return array('QuickMenu');
50         }
51         
52         function hasAdminArea() {
53                 return 1;
54         }
55         
56         function event_QuickMenu(&$data) {
57                 global $member, $nucleus, $blogid;
58                 // only show to admins
59                 if (preg_match("/MD$/", $nucleus['version'])) {
60                         $isblogadmin = $member->isBlogAdmin(-1);
61                 } else {
62                         $isblogadmin = $member->isBlogAdmin($blogid);
63                 }
64                 if (!($member->isLoggedIn() && ($member->isAdmin() | $isblogadmin))) return;
65                 array_push(
66                         $data['options'], 
67                         array(
68                                 'title' => 'Skin Files',
69                                 'url' => $this->getAdminURL(),
70                                 'tooltip' => 'Manage skin files'
71                         )
72                 );
73         }
74 }
75 ?>