Find: /isset\(\s*([^()]+?)\s*\)\s*\?\s*\1\s*:\s*/ Replace with: '\1 ?? ' (Everywhere except includes/PHPVersionCheck.php) (Then, manually fix some line length and indentation issues) Then manually reviewed the replacements for cases where confusing operator precedence would result in incorrect results (fixing those in I478db046a1cc162c6767003ce45c9b56270f3372). Change-Id: I33b421c8cb11cdd4ce896488c9ff5313f03a38cf
64 lines
1.6 KiB
PHP
64 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace MediaWiki\Widget;
|
|
|
|
/**
|
|
* Complex title input widget.
|
|
*
|
|
* @copyright 2011-2015 MediaWiki Widgets Team and others; see AUTHORS.txt
|
|
* @license MIT
|
|
*/
|
|
class ComplexTitleInputWidget extends \OOUI\Widget {
|
|
|
|
protected $namespace = null;
|
|
protected $title = null;
|
|
|
|
/**
|
|
* Like TitleInputWidget, but the namespace has to be input through a separate dropdown field.
|
|
*
|
|
* @param array $config Configuration options
|
|
* - array $config['namespace'] Configuration for the NamespaceInputWidget dropdown
|
|
* with list of namespaces
|
|
* - array $config['title'] Configuration for the TitleInputWidget text field
|
|
*/
|
|
public function __construct( array $config = [] ) {
|
|
// Configuration initialization
|
|
$config = array_merge(
|
|
[
|
|
'namespace' => [],
|
|
'title' => [],
|
|
],
|
|
$config
|
|
);
|
|
|
|
parent::__construct( $config );
|
|
|
|
// Properties
|
|
$this->config = $config;
|
|
$this->namespace = new NamespaceInputWidget( $config['namespace'] );
|
|
$this->title = new TitleInputWidget( array_merge(
|
|
$config['title'],
|
|
[
|
|
'relative' => true,
|
|
'namespace' => $config['namespace']['value'] ?? null,
|
|
]
|
|
) );
|
|
|
|
// Initialization
|
|
$this
|
|
->addClasses( [ '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['namespace']['dropdown']['$overlay'] = true;
|
|
$config['title'] = $this->config['title'];
|
|
$config['title']['$overlay'] = true;
|
|
return parent::getConfig( $config );
|
|
}
|
|
}
|