2015-08-27 08:30:25 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class PortableInfoboxBuilderController extends WikiaController {
|
|
|
|
|
2015-08-27 11:41:33 +00:00
|
|
|
const INFOBOX_BUILDER_PARAM = 'infoboxBuilder';
|
|
|
|
|
2015-08-27 08:30:25 +00:00
|
|
|
public function getAssets() {
|
|
|
|
$dir = PortableInfoboxRenderService::getTemplatesDir();
|
|
|
|
$result = array_map( function ( $template ) use ( $dir ) {
|
|
|
|
return file_get_contents( "{$dir}/{$template}" );
|
|
|
|
}, PortableInfoboxRenderService::getTemplates() );
|
|
|
|
|
|
|
|
$response = $this->getResponse();
|
|
|
|
$response->setFormat( WikiaResponse::FORMAT_JSON );
|
|
|
|
$response->setVal( "css", AssetsManager::getInstance()->getURL( "portable_infobox_scss" ) );
|
|
|
|
$response->setVal( "templates", $result );
|
|
|
|
}
|
|
|
|
}
|