function getChangeDescription()
 {
     $args = array();
     $revision = $this->mDisplayRevision;
     $change_type = $revision->getChangeType();
     $post = $revision->getChangeObject();
     $args[] = LqtView::linkInContextURL($post);
     $msg = $this->getMessageForChangeType($change_type);
     switch ($change_type) {
         case Threads::CHANGE_EDITED_SUBJECT:
             $args[] = $revision->prev()->getChangeObject()->subject();
             $args[] = $revision->getChangeObject()->subject();
             break;
     }
     $html = wfMsgExt($msg, 'parseinline', $args);
     if ($change_type == Threads::CHANGE_ROOT_BLANKED || $change_type == Threads::CHANGE_EDITED_ROOT) {
         $diff_link = $this->diffPermalink($post, wfMsgExt('diff', 'parseinline'), $this->mDisplayRevision);
         $html .= " [{$diff_link}]";
     }
     return $html;
 }
Ejemplo n.º 2
0
 /**
  * Sends a Reflect email in response to a new bullet or response.
  *
  * @param $threadObj A reference to the relevant LQT Thread
  * @param $to A User object to whom the email will be sent
  * @param $catalystUser A User object who triggered this series of events
  * @param $msgType The name of the message type to be used in accessing localized msg
  * @param $bodyParams Additional parameters to be used in the sprintf of the body text
  * @param $subjectParams Additional parameters to be used in the sprintf of the subject text
  *
  */
 private function sendMail($threadObj, $to, $catalystUser, $msgType, $bodyParams, $subjectParams)
 {
     global $wgPasswordSender, $wgLanguageCode;
     // TODO: create Reflect mailing preferences for individuals & respect them
     if (!$to) {
         return;
     }
     $from = new MailAddress($wgPasswordSender, 'WikiAdmin');
     $permaLink = LqtView::linkInContextURL($threadObj);
     $params = array($to->getName(), $catalystUser->getName(), $threadObj->subjectWithoutIncrement(), $permaLink);
     $bodyParams = array_merge($params, $bodyParams);
     $subjectParams = array_merge($params, $subjectParams);
     $msg = wfMsgReal($msgType, $bodyParams, true, $wgLanguageCode, true);
     $subject = wfMsgReal($msgType . '-subject', $subjectParams, true, $wgLanguageCode, true);
     UserMailer::send(new MailAddress($to), $from, $subject, $msg);
 }