Example #1
0
 /**
  * @return string
  */
 function getBody()
 {
     $s = '';
     $this->doQuery();
     if (count($this->mHist)) {
         $list = new ImageHistoryList($this->mImagePage);
         # Generate prev/next links
         $navLink = $this->getNavigationBar();
         $s = $list->beginImageHistoryList($navLink);
         // Skip rows there just for paging links
         for ($i = $this->mRange[0]; $i <= $this->mRange[1]; $i++) {
             $file = $this->mHist[$i];
             $s .= $list->imageHistoryLine(!$file->isOld(), $file);
         }
         $s .= $list->endImageHistoryList($navLink);
         if ($list->getPreventClickjacking()) {
             $this->preventClickjacking();
         }
     }
     return $s;
 }
 /**
  * @return string
  */
 function getBody()
 {
     $s = '';
     $this->doQuery();
     if (count($this->mHist)) {
         if ($this->mImg->isLocal()) {
             // Do a batch existence check for user pages and talkpages
             $linkBatch = new LinkBatch();
             for ($i = $this->mRange[0]; $i <= $this->mRange[1]; $i++) {
                 $file = $this->mHist[$i];
                 $user = $file->getUser('text');
                 $linkBatch->add(NS_USER, $user);
                 $linkBatch->add(NS_USER_TALK, $user);
             }
             $linkBatch->execute();
         }
         $list = new ImageHistoryList($this->mImagePage);
         # Generate prev/next links
         $navLink = $this->getNavigationBar();
         $s = $list->beginImageHistoryList($navLink);
         // Skip rows there just for paging links
         for ($i = $this->mRange[0]; $i <= $this->mRange[1]; $i++) {
             $file = $this->mHist[$i];
             $s .= $list->imageHistoryLine(!$file->isOld(), $file);
         }
         $s .= $list->endImageHistoryList($navLink);
         if ($list->getPreventClickjacking()) {
             $this->preventClickjacking();
         }
     }
     return $s;
 }
Example #3
0
 /**
  * If the page we've just displayed is in the "Image" namespace,
  * we follow it with an upload history of the image and its usage.
  */
 function imageHistory()
 {
     global $wgUser, $wgOut, $wgUseExternalEditor;
     $sk = $wgUser->getSkin();
     if ($this->img->exists()) {
         $list = new ImageHistoryList($sk, $this->current);
         $file = $this->current;
         $dims = $file->getDimensionsString();
         $lineNum = 0;
         $s = $list->beginImageHistoryList() . $list->imageHistoryLine(true, wfTimestamp(TS_MW, $file->getTimestamp()), $this->mTitle->getDBkey(), $file->getUser('id'), $file->getUser('text'), $file->getSize(), $file->getDescription(), $dims, $lineNum);
         $lineNum++;
         $hist = $this->img->getHistory();
         foreach ($hist as $file) {
             $dims = $file->getDimensionsString();
             $s .= $list->imageHistoryLine(false, wfTimestamp(TS_MW, $file->getTimestamp()), $file->getArchiveName(), $file->getUser('id'), $file->getUser('text'), $file->getSize(), $file->getDescription(), $dims, $lineNum);
             $lineNum;
         }
         $s .= $list->endImageHistoryList();
         if ($wgUseExternalEditor) {
             $s .= $this->uploadLinksBox(false);
         }
         $s .= '</div>';
         $s = '<div class="minor_section">' . $s . '</div>';
     } else {
         $s = '';
     }
     $wgOut->addHTML($s);
     $this->img->resetHistory();
     // free db resources
 }
Example #4
0
 /**
  * If the page we've just displayed is in the "Image" namespace,
  * we follow it with an upload history of the image and its usage.
  */
 function imageHistory()
 {
     global $wgUser, $wgOut, $wgUseExternalEditor;
     $sk = $wgUser->getSkin();
     $line = $this->img->nextHistoryLine();
     if ($line) {
         $list = new ImageHistoryList($sk);
         $s = $list->beginImageHistoryList() . $list->imageHistoryLine(true, wfTimestamp(TS_MW, $line->img_timestamp), $this->mTitle->getDBkey(), $line->img_user, $line->img_user_text, $line->img_size, $line->img_description, $line->img_width, $line->img_height);
         while ($line = $this->img->nextHistoryLine()) {
             $s .= $list->imageHistoryLine(false, $line->img_timestamp, $line->oi_archive_name, $line->img_user, $line->img_user_text, $line->img_size, $line->img_description, $line->img_width, $line->img_height);
         }
         $s .= $list->endImageHistoryList();
     } else {
         $s = '';
     }
     $wgOut->addHTML($s);
     # Exist check because we don't want to show this on pages where an image
     # doesn't exist along with the noimage message, that would suck. -ævar
     if ($wgUseExternalEditor && $this->img->exists()) {
         $this->uploadLinksBox();
     }
 }
 function __construct($imagePage)
 {
     parent::__construct($imagePage);
     $this->showThumb = false;
 }
 /**
  * If the page we've just displayed is in the "Image" namespace,
  * we follow it with an upload history of the image and its usage.
  */
 function imageHistory()
 {
     global $wgUser, $wgOut, $wgUseExternalEditor;
     $sk = $wgUser->getSkin();
     if ($this->img->exists()) {
         $list = new ImageHistoryList($sk, $this->current);
         $file = $this->current;
         $dims = $file->getDimensionsString();
         $s = $list->beginImageHistoryList() . $list->imageHistoryLine(true, wfTimestamp(TS_MW, $file->getTimestamp()), $this->mTitle->getDBkey(), $file->getUser('id'), $file->getUser('text'), $file->getSize(), $file->getDescription(), $dims);
         $hist = $this->img->getHistory();
         foreach ($hist as $file) {
             $dims = $file->getDimensionsString();
             $s .= $list->imageHistoryLine(false, wfTimestamp(TS_MW, $file->getTimestamp()), $file->getArchiveName(), $file->getUser('id'), $file->getUser('text'), $file->getSize(), $file->getDescription(), $dims);
         }
         $s .= $list->endImageHistoryList();
     } else {
         $s = '';
     }
     $wgOut->addHTML($s);
     $this->img->resetHistory();
     // free db resources
     # Exist check because we don't want to show this on pages where an image
     # doesn't exist along with the noimage message, that would suck. -ævar
     if ($wgUseExternalEditor && $this->img->exists()) {
         $this->uploadLinksBox();
     }
 }