mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/InputBox
synced 2024-11-14 18:55:16 +00:00
Merge "Allow appending searchfilters to terms"
This commit is contained in:
commit
947712ec34
|
@ -36,6 +36,7 @@ class InputBox {
|
|||
private $mInline = false;
|
||||
private $mPrefix = '';
|
||||
private $mDir = '';
|
||||
private $mSearchFilter = '';
|
||||
|
||||
/* Functions */
|
||||
|
||||
|
@ -169,6 +170,10 @@ class InputBox {
|
|||
$htmlOut .= Html::hidden( 'prefix', $this->mPrefix );
|
||||
}
|
||||
|
||||
if ( $this->mSearchFilter != '' ) {
|
||||
$htmlOut .= Html::hidden( 'searchfilter', $this->mSearchFilter );
|
||||
}
|
||||
|
||||
$htmlOut .= $this->mBR;
|
||||
|
||||
// Determine namespace checkboxes
|
||||
|
@ -599,6 +604,7 @@ class InputBox {
|
|||
'inline' => 'mInline',
|
||||
'prefix' => 'mPrefix',
|
||||
'dir' => 'mDir',
|
||||
'searchfilter' => 'mSearchFilter'
|
||||
];
|
||||
foreach ( $options as $name => $var ) {
|
||||
if ( isset( $values[$name] ) ) {
|
||||
|
|
|
@ -22,10 +22,15 @@ class InputBoxHooks {
|
|||
$request = $special->getRequest();
|
||||
$prefix = $request->getText( 'prefix', '' );
|
||||
$title = $request->getText( 'wpNewTitle', '' );
|
||||
$search = $request->getText( 'search', '' );
|
||||
$searchfilter = $request->getText( 'searchfilter', '' );
|
||||
if ( $special->getName() == 'Movepage' && $prefix !== '' && $title !== '' ) {
|
||||
$request->setVal( 'wpNewTitle', $prefix . $title );
|
||||
$request->unsetVal( 'prefix' );
|
||||
}
|
||||
if ( $special->getName() == 'Search' && $searchfilter !== '' ) {
|
||||
$request->setVal( 'search', $search . ' ' . $searchfilter );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue