mirror of
https://github.com/Universal-Omega/PortableInfobox.git
synced 2024-11-15 20:09:44 +00:00
Address code review remarks
This commit is contained in:
parent
1c0b69edee
commit
5375ae8541
|
@ -1,6 +1,8 @@
|
|||
<?php
|
||||
|
||||
class PortableInfoboxHooks {
|
||||
const PARSER_TAG_GALLERY = 'gallery';
|
||||
|
||||
static public function onBeforePageDisplay( OutputPage $out, Skin $skin ) {
|
||||
if ( F::app()->checkSkin( 'monobook', $skin ) ) {
|
||||
Wikia::addAssetsToOutput( 'portable_infobox_monobook_scss' );
|
||||
|
@ -34,7 +36,7 @@ class PortableInfoboxHooks {
|
|||
* @param $frame
|
||||
*/
|
||||
static public function onParserTagHooksBeforeInvoke( $name, $marker, $content, $attributes, $parser, $frame ) {
|
||||
if ( $name === 'gallery' ) {
|
||||
if ( $name === self::PARSER_TAG_GALLERY ) {
|
||||
\Wikia\PortableInfobox\Helpers\PortableInfoboxDataBag::getInstance()->setGallery( $marker, $content );
|
||||
}
|
||||
|
||||
|
|
|
@ -27,11 +27,14 @@ class PortableInfoboxDataBag {
|
|||
$this->galleries[$marker] = $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve source content of a gallery identified by Parser marker id
|
||||
*/
|
||||
public function getGallery( $marker ) {
|
||||
if(isset($this->galleries[$marker])) {
|
||||
if ( isset( $this->galleries[$marker] ) ) {
|
||||
return $this->galleries[$marker];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue