{
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;