OSDN Git Service

MERGE: リビジョン1816。Skinクラスのコード整理。
authorsakamocchi <o-takashi@sakamocchi.jp>
Thu, 3 May 2012 01:50:07 +0000 (10:50 +0900)
committersakamocchi <o-takashi@sakamocchi.jp>
Thu, 3 May 2012 01:50:07 +0000 (10:50 +0900)
Revision 1815:
minor code change for Skin class
http://nucleuscms.svn.sourceforge.net/viewvc/nucleuscms?view=revision&revision=1816

nucleus/libs/SKIN.php

index b1c125d..4925961 100644 (file)
@@ -14,7 +14,7 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2009 The Nucleus Group
- * @version $Id: SKIN.php 1813 2012-05-02 14:41:57Z sakamocchi $
+ * @version $Id: SKIN.php 1816 2012-05-03 01:40:10Z sakamocchi $
  */
 
 if ( !function_exists('requestVar') )
@@ -277,16 +277,14 @@ class Skin
        {
                global $manager;
                
-               $manager->notify(
-                       'PreAddSkin',
-                       array(
-                               'name' => &$name,
-                               'description' => &$desc,
-                               'type' => &$type,
-                               'includeMode' => &$includeMode,
-                               'includePrefix' => &$includePrefix
-                       )
+               $data = array(
+                       'name'                  => &$name,
+                       'description'   => &$desc,
+                       'type'                  => &$type,
+                       'includeMode'   => &$includeMode,
+                       'includePrefix' => &$includePrefix
                );
+               $manager->notify('PreAddSkin', $data);
                
                $query = "INSERT INTO %s (sdname, sddesc, sdtype, sdincmode, sdincpref) VALUES (%s, %s, %s, %s, %s);";
                $sdname         = DB::quoteValue($name);
@@ -298,17 +296,16 @@ class Skin
                DB::execute($query);
                $newid = DB::getInsertId();
                
-               $manager->notify(
-                       'PostAddSkin',
-                       array(
-                               'skinid'                => $newid,
-                               'name'                  => $name,
-                               'description'   => $desc,
-                               'type'                  => $type,
-                               'includeMode'   => $includeMode,
-                               'includePrefix' => $includePrefix
-                       )
+               $data = array(
+                       'skinid'                => $newid,
+                       'name'                  => $name,
+                       'description'   => $desc,
+                       'type'                  => $type,
+                       'includeMode'   => $includeMode,
+                       'includePrefix' => $includePrefix
                );
+               $manager->notify('PostAddSkin', $data);
+               
                return $newid;
        }
        
@@ -324,7 +321,11 @@ class Skin
        {
                global $currentSkinName, $manager, $CONF, $DIR_NUCLEUS;
                
-               $manager->notify("Init{$this->event_identifier}Parse", array('skin' => &$this, 'type' => $type));
+               $data = array(
+                       'skin' => &$this,
+                       'type' => $type
+               );
+               $manager->notify("Init{$this->event_identifier}Parse", $data);
                
                // include skin locale file for <%text%> tag if useable
                $this->includeTranslation();
@@ -357,7 +358,12 @@ class Skin
                        }
                }
                
-               $manager->notify("Pre{$this->event_identifier}Parse", array('skin' => &$this, 'type' => $type, 'contents' => &$contents));
+               $data = array(
+                       'skin'          => &$this,
+                       'type'          => $type,
+                       'contents'      => &$contents
+               );
+               $manager->notify("Pre{$this->event_identifier}Parse", $data);
                
                // set IncludeMode properties of parser
                Parser::setProperty('IncludeMode', $this->getIncludeMode());
@@ -375,7 +381,12 @@ class Skin
                $handler->setSkin($this);
                $parser->parse($contents);
                
-               $manager->notify("Post{$this->event_identifier}Parse", array('skin' => &$this, 'type' => $type));
+               $data = array(
+                       'skin' => &$this,
+                       'type' => $type
+               );
+               $manager->notify("Post{$this->event_identifier}Parse", $data);
+               
                return;
        }
        
@@ -458,9 +469,9 @@ class Skin
                else if( $skintypevalue && !$skintypeexists )
                {
                        $data = array(
-                               'skinid' => $this->id,
-                               'type' => $type,
-                               'content' => &$content
+                               'skinid'        => $this->id,
+                               'type'          => $type,
+                               'content'       => &$content
                        );
                        
                        $manager->notify("PreAdd{$this->event_identifier}Part", $data);
@@ -468,8 +479,8 @@ class Skin
                else if( !$skintypevalue && $skintypeexists )
                {
                        $data = array(
-                               'skinid' => $this->id,
-                               'type' => $type
+                               'skinid'        => $this->id,
+                               'type'          => $type
                        );
                        
                        $manager->notify("PreDelete{$this->event_identifier}Part", $data);