From 638be6930511de4392c85523282a43b5a232acc2 Mon Sep 17 00:00:00 2001 From: Rafal Leszczynski Date: Tue, 1 Sep 2015 17:10:02 +0200 Subject: [PATCH] create portable infobox builder special page --- PortableInfobox.setup.php | 5 +++ ...eInfoboxBuilderSpecialController.class.php | 39 +++++++++++++++++++ ...boxBuilderSpecialController_index.mustache | 1 + 3 files changed, 45 insertions(+) create mode 100644 controllers/PortableInfoboxBuilderSpecialController.class.php create mode 100644 controllers/templates/PortableInfoboxBuilderSpecialController_index.mustache diff --git a/PortableInfobox.setup.php b/PortableInfobox.setup.php index b84f159..b7a4914 100644 --- a/PortableInfobox.setup.php +++ b/PortableInfobox.setup.php @@ -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'; diff --git a/controllers/PortableInfoboxBuilderSpecialController.class.php b/controllers/PortableInfoboxBuilderSpecialController.class.php new file mode 100644 index 0000000..895e021 --- /dev/null +++ b/controllers/PortableInfoboxBuilderSpecialController.class.php @@ -0,0 +1,39 @@ +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 ); + } +} diff --git a/controllers/templates/PortableInfoboxBuilderSpecialController_index.mustache b/controllers/templates/PortableInfoboxBuilderSpecialController_index.mustache new file mode 100644 index 0000000..4563710 --- /dev/null +++ b/controllers/templates/PortableInfoboxBuilderSpecialController_index.mustache @@ -0,0 +1 @@ +