parent::__construct( 'Emailuser' );
}
+ public function getDescription() {
+ $target = self::getTarget( $this->mTarget );
+ if( !$target instanceof User ) {
+ return $this->msg( 'emailuser-title-notarget' )->text();
+ }
+
+ return $this->msg( 'emailuser-title-target', $target->getName() )->text();
+ }
+
protected function getFormFields() {
return array(
'From' => array(
}
public function execute( $par ) {
- $this->setHeaders();
- $this->outputHeader();
$out = $this->getOutput();
$out->addModuleStyles( 'mediawiki.special' );
+
$this->mTarget = is_null( $par )
? $this->getRequest()->getVal( 'wpTarget', $this->getRequest()->getVal( 'target', '' ) )
: $par;
+
+ // This needs to be below assignment of $this->mTarget because
+ // getDescription() needs it to determine the correct page title.
+ $this->setHeaders();
+ $this->outputHeader();
+
// error out if sending user cannot do this
$error = self::getPermissionsError( $this->getUser(), $this->getRequest()->getVal( 'wpEditToken' ) );
switch ( $error ) {
return false;
}
- $out->setPageTitle( $this->msg( 'emailpage' ) );
$result = $form->show();
if( $result === true || ( $result instanceof Status && $result->isGood() ) ) {