create portable infobox builder special page

This commit is contained in:
Rafal Leszczynski 2015-09-01 17:10:02 +02:00
parent 6067073b3c
commit 638be69305
3 changed files with 45 additions and 0 deletions

View file

@ -57,6 +57,11 @@ $wgAutoloadClasses[ 'ApiQueryPortableInfobox' ] = $dir . 'controllers/ApiQueryPo
$wgAutoloadClasses[ 'PortableInfoboxHooks' ] = $dir . 'PortableInfoboxHooks.class.php';
$wgAutoloadClasses[ 'ApiQueryAllinfoboxes' ] = $dir . 'controllers/ApiQueryAllinfoboxes.class.php';
$wgAutoloadClasses[ 'PortableInfoboxBuilderController' ] = $dir . 'controllers/PortableInfoboxBuilderController.class.php';
$wgAutoloadClasses[ 'PortableInfoboxBuilderSpecialController' ] = $dir . 'controllers/PortableInfoboxBuilderSpecialController.class.php';
// special pages
$wgSpecialPages[ 'PortableInfoboxBuilder' ] = 'PortableInfoboxBuilderSpecialController';
$wgSpecialPageGroups[ 'PortableInfoboxBuilder' ] = 'wikia';
// query pages
$wgAutoloadClasses[ 'AllinfoboxesQueryPage' ] = $dir . 'querypage/AllinfoboxesQueryPage.php';

View file

@ -0,0 +1,39 @@
<?php
/**
* Class WikiaMapsSpecialController
* @desc Special:Maps controller
*/
class PortableInfoboxBuilderSpecialController extends WikiaSpecialPageController {
const PAGE_NAME = 'PortableInfoboxBuilder';
const PAGE_RESTRICTION = 'editinterface';
const INFOBOX_BUILDER_MERCURY_ROUTE = 'infoboxBuilder';
/**
* Special page constructor
*
* @param null $name
* @param string $restriction
* @param bool $listed
* @param bool $function
* @param string $file
* @param bool $includable
*/
public function __construct( $name = null, $restriction = '', $listed = true, $function = false, $file = 'default', $includable = false ) {
parent::__construct( self::PAGE_NAME, self::PAGE_RESTRICTION, $listed, $function, $file, $includable );
}
/**
* Infobox Builder special page
*/
public function index() {
$this->wg->SuppressPageHeader = true;
//TODO: use i18n message for title
$this->wg->out->setHTMLTitle( 'Infobox Builder' );
//TODO: get better way of handling $this->getPar() to deal with "/dadada/adasdasd"
$url = $this->wg->server . '/' . infoboxBuilder . '/' . $this->getPar();
$this->response->setVal('iframeUrl', $url);
$this->response->setTemplateEngine( WikiaResponse::TEMPLATE_ENGINE_MUSTACHE );
}
}

View file

@ -0,0 +1 @@
<iframe id="infoboxBuilderIframe" width="100%" height="600" data-src="{{iframeUrl}}"></iframe>