/**
  * @param $repo CodeRepository|String
  */
 function __construct($repo)
 {
     parent::__construct($repo);
     global $wgRequest;
     $path = $wgRequest->getVal('path');
     if ($path != '') {
         $this->mPath = self::pathsToArray($path);
     } else {
         $this->mPath = array();
     }
     $this->mAuthor = $wgRequest->getText('author');
     $this->mStatus = $wgRequest->getText('status');
     if ($this->mAuthor) {
         $this->filters[] = wfMsg('code-revfilter-cr_author', $this->mAuthor);
     }
     if ($this->mStatus) {
         $this->filters[] = wfMsg('code-revfilter-cr_status', $this->mStatus);
     }
     if (count($this->filters)) {
         global $wgLang;
         $this->mAppliedFilter = $wgLang->listToText($this->filters);
     } else {
         $this->mAppliedFilter = null;
     }
 }
Example #2
0
 function __construct($repo)
 {
     global $wgRequest, $IP;
     parent::__construct($repo);
     $this->mPath = htmlspecialchars(trim($wgRequest->getVal('path')));
     if (strlen($this->mPath) && $this->mPath[0] !== '/') {
         $this->mPath = "/{$this->mPath}";
         // make sure this is a valid path
     }
     $this->mPath = preg_replace('/\\/$/', '', $this->mPath);
     // kill last slash
     $this->mStartRev = $wgRequest->getIntOrNull('startrev');
     $this->mEndRev = $wgRequest->getIntOrNull('endrev');
 }
Example #3
0
 /**
  * @param string|CodeRepository $repo
  * @param string|CodeRevision $rev
  * @param null $replyTarget
  */
 function __construct($repo, $rev, $replyTarget = null)
 {
     parent::__construct($repo);
     global $wgRequest;
     if ($rev instanceof CodeRevision) {
         $this->mRevId = $rev->getId();
         $this->mRev = $rev;
     } else {
         $this->mRevId = intval(ltrim($rev, 'r'));
         $this->mRev = $this->mRepo ? $this->mRepo->getRevision($this->mRevId) : null;
     }
     $this->mPreviewText = false;
     # Search path for navigation links
     $this->mPath = htmlspecialchars(trim($wgRequest->getVal('path')));
     if (strlen($this->mPath) && $this->mPath[0] !== '/') {
         $this->mPath = "/{$this->mPath}";
         // make sure this is a valid path
     }
     # URL params...
     $this->mAddTags = $wgRequest->getText('wpTag');
     $this->mRemoveTags = $wgRequest->getText('wpRemoveTag');
     $this->mStatus = $wgRequest->getText('wpStatus');
     $this->jumpToNext = $wgRequest->getCheck('wpSaveAndNext') || $wgRequest->getCheck('wpNext');
     $this->mReplyTarget = $replyTarget ? (int) $replyTarget : $wgRequest->getIntOrNull('wpParent');
     $this->text = $wgRequest->getText("wpReply{$this->mReplyTarget}");
     $this->mSkipCache = $wgRequest->getVal('action') == 'purge';
     # Make tag arrays
     $this->mAddTags = $this->splitTags($this->mAddTags);
     $this->mRemoveTags = $this->splitTags($this->mRemoveTags);
     $this->mSignoffFlags = $wgRequest->getCheck('wpSignoff') ? $wgRequest->getArray('wpSignoffFlags') : array();
     $this->mSelectedSignoffs = $wgRequest->getArray('wpSignoffs');
     $this->mStrikeSignoffs = $wgRequest->getCheck('wpStrikeSignoffs') ? $this->mSelectedSignoffs : array();
     $this->mAddReferences = $wgRequest->getCheck('wpAddReferencesSubmit') ? $this->stringToRevList($wgRequest->getText('wpAddReferences')) : array();
     $this->mRemoveReferences = $wgRequest->getCheck('wpRemoveReferences') ? $wgRequest->getIntArray('wpReferences', array()) : array();
     $this->mAddReferenced = $wgRequest->getCheck('wpAddReferencedSubmit') ? $this->stringToRevList($wgRequest->getText('wpAddReferenced')) : array();
     $this->mRemoveReferenced = $wgRequest->getCheck('wpRemoveReferenced') ? $wgRequest->getIntArray('wpReferenced', array()) : array();
 }
Example #4
0
 function __construct($repo)
 {
     parent::__construct($repo);
 }