From a1789ddde42033f1b05cc4929491214ee6e79383 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 17 Dec 2015 09:15:42 +0100 Subject: Update to MediaWiki 1.26.0 --- includes/widget/ComplexTitleInputWidget.php | 67 +++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 includes/widget/ComplexTitleInputWidget.php (limited to 'includes/widget/ComplexTitleInputWidget.php') diff --git a/includes/widget/ComplexTitleInputWidget.php b/includes/widget/ComplexTitleInputWidget.php new file mode 100644 index 00000000..73ef54c8 --- /dev/null +++ b/includes/widget/ComplexTitleInputWidget.php @@ -0,0 +1,67 @@ + array(), + 'title' => array(), + ), + $config + ); + + // Parent constructor + parent::__construct( $config ); + + // Properties + $this->config = $config; + $this->namespace = new NamespaceInputWidget( $config['namespace'] ); + $this->title = new TitleInputWidget( array_merge( + $config['title'], + array( + // The inner TitleInputWidget shouldn't be infusable, only the ComplexTitleInputWidget itself can be. + 'infusable' => false, + 'relative' => true, + 'namespace' => isset( $config['namespace']['value'] ) ? $config['namespace']['value'] : null, + ) + ) ); + + // Initialization + $this + ->addClasses( array( 'mw-widget-complexTitleInputWidget' ) ) + ->appendContent( $this->namespace, $this->title ); + } + + protected function getJavaScriptClassName() { + return 'mw.widgets.ComplexTitleInputWidget'; + } + + public function getConfig( &$config ) { + $config['namespace'] = $this->config['namespace']; + $config['title'] = $this->config['title']; + return parent::getConfig( $config ); + } +} -- cgit v1.2.2