Third batch of files modified to replace selected wgLang with wgContLang
[lhc/web/wiklou.git] / includes / SpecialUnusedimages.php
1 <?php
2 /**
3 *
4 * @package MediaWiki
5 * @subpackage SpecialPage
6 */
7
8 /** */
9 require_once("QueryPage.php");
10
11 /**
12 *
13 */
14 class UnusedimagesPage extends QueryPage {
15
16 function getName() {
17 return 'Unusedimages';
18 }
19
20 function sortDescending() {
21 return false;
22 }
23
24 function getSQL() {
25 $dbr =& wfGetDB( DB_SLAVE );
26 extract( $dbr->tableNames( 'image','imagelinks' ) );
27
28 return 'SELECT img_name as title, img_user, img_user_text, img_timestamp as value, img_description' .
29 ' FROM '.$image.' LEFT JOIN '.$imagelinks.' ON img_name=il_to WHERE il_to IS NULL ';
30 }
31
32 function formatResult( $skin, $result ) {
33 global $wgLang, $wgContLang;
34 $title = Title::makeTitle( NS_IMAGE, $result->title );
35 $ins = $wgContLang->getNsText(NS_IMAGE);
36
37 $return =
38 # The 'desc' linking to the image page
39 '('.$skin->makeKnownLink( $ins.':'.$result->title, wfMsg('imgdesc') ).') '
40 # Link to the image itself
41 . '<a href="'.Image::wfImageUrl($title->getText()).'">'.$title->getText().'</a>'
42 # Last modified date
43 . ' . . '.$wgLang->timeanddate($result->value)
44 # Link to username
45 . ' . . '.$skin->makeLink($wgContLang->getNsText(NS_USER).':'.$result->img_user_text,$result->img_user_text);
46
47 # If there is a description, show it
48 if($result->img_description != '') {
49 $return .= ' <em>('.$result->img_description.')</em>';
50 }
51 return $return;
52 }
53
54 function getPageHeader() {
55 return wfMsg( "unusedimagestext" );
56 }
57
58 }
59
60 /**
61 * Entry point
62 */
63 function wfSpecialUnusedimages() {
64 list( $limit, $offset ) = wfCheckLimits();
65 $uip = new UnusedimagesPage();
66
67 return $uip->doQuery( $offset, $limit );
68 }
69 ?>