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 $mInline = false;
|
||||||
private $mPrefix = '';
|
private $mPrefix = '';
|
||||||
private $mDir = '';
|
private $mDir = '';
|
||||||
|
private $mSearchFilter = '';
|
||||||
|
|
||||||
/* Functions */
|
/* Functions */
|
||||||
|
|
||||||
|
@ -169,6 +170,10 @@ class InputBox {
|
||||||
$htmlOut .= Html::hidden( 'prefix', $this->mPrefix );
|
$htmlOut .= Html::hidden( 'prefix', $this->mPrefix );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( $this->mSearchFilter != '' ) {
|
||||||
|
$htmlOut .= Html::hidden( 'searchfilter', $this->mSearchFilter );
|
||||||
|
}
|
||||||
|
|
||||||
$htmlOut .= $this->mBR;
|
$htmlOut .= $this->mBR;
|
||||||
|
|
||||||
// Determine namespace checkboxes
|
// Determine namespace checkboxes
|
||||||
|
@ -599,6 +604,7 @@ class InputBox {
|
||||||
'inline' => 'mInline',
|
'inline' => 'mInline',
|
||||||
'prefix' => 'mPrefix',
|
'prefix' => 'mPrefix',
|
||||||
'dir' => 'mDir',
|
'dir' => 'mDir',
|
||||||
|
'searchfilter' => 'mSearchFilter'
|
||||||
];
|
];
|
||||||
foreach ( $options as $name => $var ) {
|
foreach ( $options as $name => $var ) {
|
||||||
if ( isset( $values[$name] ) ) {
|
if ( isset( $values[$name] ) ) {
|
||||||
|
|
|
@ -22,10 +22,15 @@ class InputBoxHooks {
|
||||||
$request = $special->getRequest();
|
$request = $special->getRequest();
|
||||||
$prefix = $request->getText( 'prefix', '' );
|
$prefix = $request->getText( 'prefix', '' );
|
||||||
$title = $request->getText( 'wpNewTitle', '' );
|
$title = $request->getText( 'wpNewTitle', '' );
|
||||||
|
$search = $request->getText( 'search', '' );
|
||||||
|
$searchfilter = $request->getText( 'searchfilter', '' );
|
||||||
if ( $special->getName() == 'Movepage' && $prefix !== '' && $title !== '' ) {
|
if ( $special->getName() == 'Movepage' && $prefix !== '' && $title !== '' ) {
|
||||||
$request->setVal( 'wpNewTitle', $prefix . $title );
|
$request->setVal( 'wpNewTitle', $prefix . $title );
|
||||||
$request->unsetVal( 'prefix' );
|
$request->unsetVal( 'prefix' );
|
||||||
}
|
}
|
||||||
|
if ( $special->getName() == 'Search' && $searchfilter !== '' ) {
|
||||||
|
$request->setVal( 'search', $search . ' ' . $searchfilter );
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue