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

View file

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