Merge "Allow appending searchfilters to terms"

This commit is contained in:
jenkins-bot 2017-06-17 01:23:13 +00:00 committed by Gerrit Code Review
commit 947712ec34
2 changed files with 11 additions and 0 deletions

View file

@ -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] ) ) {

View file

@ -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;
}