+
+ # Cache messages used in each row
+ $this->mMessages['imgdesc'] = wfMsgHtml( 'imgdesc' );
+ $this->mMessages['imgfile'] = wfMsgHtml( 'imgfile' );
+
+ return parent::getStartBody();
+ }
+
+ function formatValue( $field, $value ) {
+ global $wgLang;
+ switch ( $field ) {
+ case 'links':
+ $name = $this->mCurrentRow->img_name;
+ $ilink = "<a href=\"" . htmlspecialchars( Image::imageUrl( $name ) ) .
+ "\">" . $this->mMessages['imgfile'] . "</a>";
+ $desc = $this->getSkin()->makeKnownLinkObj( Title::makeTitle( NS_IMAGE, $name ),
+ $this->mMessages['imgdesc'] );
+ return "$desc | $ilink";
+ case 'img_timestamp':
+ return $wgLang->timeanddate( $value, true );
+ case 'img_name':
+ return htmlspecialchars( $value );
+ case 'img_user_text':
+ if ( $this->mCurrentRow->img_user ) {
+ $link = $this->getSkin()->makeLinkObj( Title::makeTitle( NS_USER, $value ),
+ htmlspecialchars( $value ) );
+ } else {
+ $link = htmlspecialchars( $value );
+ }
+ return $link;
+ case 'img_size':
+ return $wgLang->formatNum( $value );
+ case 'img_description':
+ return $this->getSkin()->commentBlock( $value );
+ }
+ }
+
+ function getForm() {
+ global $wgRequest, $wgMiserMode;
+ $url = $this->getTitle()->escapeLocalURL();
+ $msgSubmit = wfMsgHtml( 'table_pager_limit_submit' );
+ $msgSearch = wfMsgHtml( 'imagelist_search_for' );
+ $search = $wgRequest->getText( 'ilsearch' );
+ $encSearch = htmlspecialchars( $search );
+ $s = "<form method=\"get\" action=\"$url\">\n" .
+ wfMsgHtml( 'table_pager_limit', $this->getLimitSelect() );
+ if ( !$wgMiserMode ) {
+ $s .= "<br/>\n" . $msgSearch .
+ " <input type=\"text\" size=\"20\" name=\"ilsearch\" value=\"$encSearch\"/><br/>\n";
+ }
+ $s .= " <input type=\"submit\" value=\"$msgSubmit\"/>\n" .
+ $this->getHiddenFields( array( 'limit', 'ilsearch' ) ) .
+ "</form>\n";
+ return $s;
+ }
+
+ function getTableClass() {
+ return 'imagelist ' . parent::getTableClass();
+ }
+
+ function getNavClass() {
+ return 'imagelist_nav ' . parent::getNavClass();
+ }
+
+ function getSortHeaderClass() {
+ return 'imagelist_sort ' . parent::getSortHeaderClass();