コード例 #1
0
 /**
  * @param string|Message|MalformedTitleException $msg A message key (default: 'badtitletext'), or
  *     a MalformedTitleException to figure out things from
  * @param array $params Parameter to wfMessage()
  */
 public function __construct($msg = 'badtitletext', $params = array())
 {
     if ($msg instanceof MalformedTitleException) {
         $errorMessage = $msg->getErrorMessage();
         if (!$errorMessage) {
             parent::__construct('badtitle', 'badtitletext', array());
         } else {
             $errorMessageParams = $msg->getErrorMessageParameters();
             parent::__construct('badtitle', $errorMessage, $errorMessageParams);
         }
     } else {
         parent::__construct('badtitle', $msg, $params);
     }
 }
コード例 #2
0
ファイル: Exception.php プロジェクト: yusufchang/app
 public function __construct(Block $block)
 {
     global $wgLang, $wgRequest;
     $blocker = $block->getBlocker();
     if ($blocker instanceof User) {
         // local user
         $blockerUserpage = $block->getBlocker()->getUserPage();
         $link = "[[{$blockerUserpage->getPrefixedText()}|{$blockerUserpage->getText()}]]";
     } else {
         // foreign user
         $link = $blocker;
     }
     $reason = $block->mReason;
     if ($reason == '') {
         $reason = wfMsg('blockednoreason');
     }
     /* $ip returns who *is* being blocked, $intended contains who was meant to be blocked.
      * This could be a username, an IP range, or a single IP. */
     $intended = $block->getTarget();
     parent::__construct('blockedtitle', $block->mAuto ? 'autoblockedtext' : 'blockedtext', array($link, $reason, $wgRequest->getIP(), $block->getByName(), $block->getId(), $wgLang->formatExpiry($block->mExpiry), $intended, $wgLang->timeanddate(wfTimestamp(TS_MW, $block->mTimestamp), true)));
 }
コード例 #3
0
 public function __construct(Block $block)
 {
     // @todo FIXME: Implement a more proper way to get context here.
     $params = $block->getPermissionsError(RequestContext::getMain());
     parent::__construct('blockedtitle', array_shift($params), $params);
 }
コード例 #4
0
 public function __construct()
 {
     parent::__construct('readonly', 'readonlytext', wfReadOnlyReason() ?: []);
 }
コード例 #5
0
ファイル: UserNotLoggedIn.php プロジェクト: paladox/mediawiki
 /**
  * @note The value of the $reasonMsg parameter must be put into LoginForm::validErrorMessages or
  * set with the LoginFormValidErrorMessages Hook.
  * if you want the user to be automatically redirected to the login form.
  *
  * @param string $reasonMsg A message key containing the reason for the error.
  *        Optional, default: 'exception-nologin-text'
  * @param string $titleMsg A message key to set the page title.
  *        Optional, default: 'exception-nologin'
  * @param array $params Parameters to wfMessage().
  *        Optional, default: []
  */
 public function __construct($reasonMsg = 'exception-nologin-text', $titleMsg = 'exception-nologin', $params = [])
 {
     parent::__construct($titleMsg, $reasonMsg, $params);
 }
コード例 #6
0
 public function __construct()
 {
     parent::__construct('actionthrottled', 'actionthrottledtext');
 }
コード例 #7
0
 public function __construct()
 {
     parent::__construct('centralauth-readonly', 'centralauth-readonlytext');
 }
コード例 #8
0
 /**
  * @param string|Message $msg A message key (default: 'badtitletext')
  * @param array $params Parameter to wfMessage()
  */
 public function __construct($msg = 'badtitletext', $params = array())
 {
     parent::__construct('badtitle', $msg, $params);
 }
コード例 #9
0
 public function __construct($message)
 {
     parent::__construct('moderation', $message);
 }
コード例 #10
0
ファイル: LocalFile.php プロジェクト: paladox/mediawiki
 public function __construct(Status $status)
 {
     parent::__construct('actionfailed', $status->getMessage());
 }