From: sakamocchi Date: Mon, 21 May 2012 13:22:28 +0000 (+0900) Subject: FIX: デフォルトの管理画面スキン以外を画面上で編集できないバグを修正 X-Git-Url: http://git.osdn.net/view?p=nucleus-jp%2Fnucleus-next.git;a=commitdiff_plain;h=0ee631aa30d460e5e2f273f6b142a3892c68880c FIX: デフォルトの管理画面スキン以外を画面上で編集できないバグを修正 AdminActions::parse_editadminskintype()内で、現在管理画面をパースするために使っているSkinクラスのインスタンスを使っていた。skinidからSkinクラスのインスタンスをコンストラクトし、そちらを用いるように修正した。 --- 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;