PortableInfobox/PortableInfoboxHooks.class.php

25 lines
674 B
PHP

<?php
class PortableInfoboxHooks {
static public function onBeforePageDisplay( OutputPage $out, Skin $skin ) {
if ( F::app()->checkSkin( 'monobook', $skin ) ) {
Wikia::addAssetsToOutput( 'portable_infobox_monobook_scss' );
} else {
Wikia::addAssetsToOutput( 'portable_infobox_scss' );
}
return true;
}
static public function onImageServingCollectImages( &$imageNamesArray, $articleTitle ) {
if ( $articleTitle ) {
$infoboxImages = PortableInfoboxDataService::newFromTitle( $articleTitle )->getImages();
if ( !empty( $infoboxImages ) ) {
$imageNamesArray = array_merge( $infoboxImages, (array)$imageNamesArray );
}
}
return true;
}
}