Address code review remarks

This commit is contained in:
Sebastian Marzjan 2015-06-19 14:16:07 +02:00
parent 1c0b69edee
commit 5375ae8541
2 changed files with 9 additions and 4 deletions

View file

@ -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 );
}

View file

@ -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;
}
}