/** * Gets the description of a group. This is a bit slow thing to do for * thousand+ groups, so some caching is involved. * @param $group MessageGroup * @return string Plain text */ public function getGroupDescription( MessageGroup $group ) { $code = $this->lang->getCode(); $cache = wfGetCache( CACHE_ANYTHING ); $key = wfMemckey( "translate-groupdesc-$code-" . $group->getId() ); $desc = $cache->get( $key ); if ( is_string( $desc ) ) { return $desc; } $realFunction = array( 'MessageCache', 'singleton' ); if ( is_callable( $realFunction ) ) { $mc = MessageCache::singleton(); } else { global $wgMessageCache; $mc = $wgMessageCache; } $desc = $mc->transform( $group->getDescription(), true, $this->lang ); $cache->set( $key, $desc ); return $desc; }
protected function getGroupDescription(MessageGroup $group) { $description = $group->getDescription($this->getContext()); if ($description !== null) { return $this->getOutput()->parse($description, false); } return ''; }
protected function getGroupDescription(MessageGroup $group) { $description = $group->getDescription(); if ($description !== null) { global $wgOut; return $wgOut->parse($description, false); } return ''; }