OSDN Git Service

NP_SkinFiles差し替え
[nucleus-jp/nucleus-jp-ancient.git] / nucleus / plugins / NP_SkinFiles.php
index dc4c149..ed75536 100644 (file)
@@ -5,9 +5,9 @@ class NP_SkinFiles extends NucleusPlugin {
    /* ==========================================================================================
        * Nucleus SkinFiles Plugin
        *
-       * Copyright 2005-2007 by Jeff MacMichael and Niels Leenheer
+       * Copyright 2005-2009 by Jeff MacMichael and Niels Leenheer
        *
-       * @version $Id: NP_SkinFiles.php,v 1.5 2008-02-08 09:31:23 kimitake Exp $
+       * @version $Id$
        * @version $NucleusJP: NP_SkinFiles.php,v 1.4 2007/02/04 06:28:46 kimitake Exp $
        *
        * ==========================================================================================
@@ -42,41 +42,72 @@ class NP_SkinFiles extends NucleusPlugin {
        * v2.00 rakaz - Almost complete rewrite
        * v2.01 yama  - modified form button for IE
        * v2.02 kimitake - multilingual support, modified form button for IE
+       * v2.03 yama - CSS out source. and textarea width bug fix for IE. And some lang add.And add routine empty file delete.
        */
 
 
-       function getName()                { return 'SkinFiles'; }
-       function getAuthor()      { return 'Misc authors'; }
-       function getURL()                 { return 'http://www.nucleuscms.org/'; }
-       function getVersion()     { return '2.02'; }
-       function getDescription() { return _SKINFILES_DESC;     }
+       function getName() {
+               return 'SkinFiles';
+       }
+
+       function getAuthor() {
+               return 'Misc authors';
+       }
+
+       function getURL() {
+               return 'http://wakka.xiffy.nl/skinfiles';
+       }
+
+       function getVersion() {
+               return '2.03test';
+       }
+
+       function getDescription() {
+               return _SKINFILES_01;
+       }
 
        function supportsFeature($what) {
-               switch($what)
-               { case 'SqlTablePrefix':
+               switch($what) {
+                       case 'SqlTablePrefix':
+                       case 'HelpPage':
                                return 1;
                        default:
-                               return 0; }
+                               return 0;
+               }
        }
 
        function install() {
+               $this->createOption(
+                       'generate_backup',
+                       _SKINFILES_OPT_GENBACKUP,
+                       'yesno',
+                       'yes'
+               );
+               $this->createOption(
+                       _SKINFILES_OPT_BACKUPPREFIX,
+                       'prefix',
+                       'text',
+                       'bkup_'
+               );
        }
        
        function unInstall() {
        }
 
        function getEventList() {
-               return array('QuickMenu');
+               return array(
+                       'QuickMenu',
+                       'AdminPrePageHead'
+               );
        }
        
        function hasAdminArea() {
                return 1;
        }
 
-       function init()
-       {
+       function init() {
                // include language file for this plugin
-               $language = ereg_replace( '[\\|/]', '', getLanguageName());
+               $language = preg_replace( '@\\|/@', '', getLanguageName());
                if (file_exists($this->getDirectory().$language.'.php'))
                        include_once($this->getDirectory().$language.'.php');
                else
@@ -92,12 +123,33 @@ class NP_SkinFiles extends NucleusPlugin {
                array_push(
                        $data['options'], 
                        array(
-                               'title' => _SKINFILES_TITLE,
-                               'url' => $this->getAdminURL(),
+                               'title'   => _SKINFILES_TITLE,
+                               'url'     => $this->getAdminURL(),
                                'tooltip' => _SKINFILES_TOOLTIP
                        )
                );
        }
+
+
+// start add yama.kyms
+       function event_AdminPrePageHead(&$data) {
+               global $CONF;
+               $path = $CONF['PluginURL'];
+               if ($data['action'] != 'plugin_SkinFiles') return;
+               
+                       $data['extrahead'] .= <<< EOS
+
+<link rel="stylesheet" type="text/css" href="{$path}skinfiles/style.css" />
+
+
+EOS;
+               }
+               
+
+
+// end add yama.kyms
+
+
 }
 
-?>
+?>
\ No newline at end of file