From 0ee631aa30d460e5e2f273f6b142a3892c68880c Mon Sep 17 00:00:00 2001 From: sakamocchi Date: Mon, 21 May 2012 22:22:28 +0900 Subject: [PATCH] =?utf8?q?FIX:=20=E3=83=87=E3=83=95=E3=82=A9=E3=83=AB?= =?utf8?q?=E3=83=88=E3=81=AE=E7=AE=A1=E7=90=86=E7=94=BB=E9=9D=A2=E3=82=B9?= =?utf8?q?=E3=82=AD=E3=83=B3=E4=BB=A5=E5=A4=96=E3=82=92=E7=94=BB=E9=9D=A2?= =?utf8?q?=E4=B8=8A=E3=81=A7=E7=B7=A8=E9=9B=86=E3=81=A7=E3=81=8D=E3=81=AA?= =?utf8?q?=E3=81=84=E3=83=90=E3=82=B0=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit AdminActions::parse_editadminskintype()内で、現在管理画面をパースするために使っているSkinクラスのインスタンスを使っていた。skinidからSkinクラスのインスタンスをコンストラクトし、そちらを用いるように修正した。 --- nucleus/libs/AdminActions.php | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/nucleus/libs/AdminActions.php b/nucleus/libs/AdminActions.php index 5aa0fd9..ff0a6ca 100644 --- a/nucleus/libs/AdminActions.php +++ b/nucleus/libs/AdminActions.php @@ -2522,35 +2522,48 @@ class AdminActions extends BaseActions { global $CONF, $manager, $member; - $fNames = $this->parser->skin->getAvailableTypes(); - $sType = strtolower(trim(requestVar('type'))); + static $skin = NULL; + static $types = array(); + + if ( $skin == NULL ) + { + $skinid = intRequestVar('skinid'); + $skin = new Skin($skinid, 'AdminActions'); + $types = $skin->getAvailableTypes(); + } + + $stype = strtolower(trim(requestVar('type'))); + if ( empty($stype) ) + { + $stype = $type; + } switch ( $type ) { case 'id': - echo intRequestVar('skinid'); + echo $skin->getID(); break; case 'name': - echo Entity::hsc($this->parser->skin->getName()); + echo Entity::hsc($skin->getName()); break; case 'desc': - echo Entity::hsc($this->parser->skin->getDescription()); + echo Entity::hsc($skin->getDescription()); break; case 'type': - echo Entity::hsc($this->parser->skin->getContentType()); + echo Entity::hsc($skin->getContentType()); break; case 'content': - echo Entity::hsc($this->parser->skin->getContentFromDB($sType)); + echo Entity::hsc($skin->getContentFromDB($stype)); break; case 'skintype': - $skinType = !array_key_exists($sType, $fNames) ? ucfirst($sType) : $fNames[$sType]; - echo Entity::hsc($skinType); + $friendly_name = !array_key_exists($stype, $types) ? ucfirst($stype) : $types[$stype]; + echo Entity::hsc($friendly_name); break; case 'skintyperaw': - echo Entity::hsc($sType); + echo Entity::hsc($stype); break; case 'prefix': - echo Entity::hsc($this->parser->skin->getIncludePrefix()); + echo Entity::hsc($skin->getIncludePrefix()); break; case 'mode': $incMode = $skin->getIncludeMode() ? _PARSER_INCMODE_SKINDIR : _PARSER_INCMODE_NORMAL; -- 2.11.0