Index: trunk/phase3/includes/LinkBatch.php |
— | — | @@ -32,6 +32,10 @@ |
33 | 33 | $this->caller = $caller; |
34 | 34 | } |
35 | 35 | |
| 36 | + /** |
| 37 | + * @param $title Title |
| 38 | + * @return void |
| 39 | + */ |
36 | 40 | public function addObj( $title ) { |
37 | 41 | if ( is_object( $title ) ) { |
38 | 42 | $this->add( $title->getNamespace(), $title->getDBkey() ); |
Index: trunk/phase3/includes/api/ApiQueryImages.php |
— | — | @@ -84,6 +84,19 @@ |
85 | 85 | } |
86 | 86 | $this->addOption( 'LIMIT', $params['limit'] + 1 ); |
87 | 87 | |
| 88 | + if ( !is_null( $params['images'] ) ) { |
| 89 | + $images = array(); |
| 90 | + foreach ( $params['images'] as $img ) { |
| 91 | + $title = Title::newFromText( $img ); |
| 92 | + if ( !$title || $title->getNamespace() != NS_FILE ) { |
| 93 | + $this->setWarning( "``$img'' is not a file" ); |
| 94 | + } else { |
| 95 | + $images[] = $title->getDBkey(); |
| 96 | + } |
| 97 | + } |
| 98 | + $this->addWhereFld( 'il_to', $images ); |
| 99 | + } |
| 100 | + |
88 | 101 | $res = $this->select( __METHOD__ ); |
89 | 102 | |
90 | 103 | if ( is_null( $resultPageSet ) ) { |
— | — | @@ -136,6 +149,9 @@ |
137 | 150 | ApiBase::PARAM_MAX2 => ApiBase::LIMIT_BIG2 |
138 | 151 | ), |
139 | 152 | 'continue' => null, |
| 153 | + 'images' => array( |
| 154 | + ApiBase::PARAM_ISMULTI => true, |
| 155 | + ) |
140 | 156 | ); |
141 | 157 | } |
142 | 158 | |
— | — | @@ -143,6 +159,7 @@ |
144 | 160 | return array( |
145 | 161 | 'limit' => 'How many images to return', |
146 | 162 | 'continue' => 'When more results are available, use this to continue', |
| 163 | + 'images' => 'Only list these images. Useful for checking whether a certain page has a certain Image.', |
147 | 164 | ); |
148 | 165 | } |
149 | 166 | |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -72,6 +72,7 @@ |
73 | 73 | * (bug 26560) On allusers if limit < total number of users, last user gets duplicate |
74 | 74 | * (bug 25135) add "normalized" to action=parse |
75 | 75 | * (bug 26460) Add support for listing category members by category pageid |
| 76 | +* (bug 26482) add a imimages param to prop=images |
76 | 77 | |
77 | 78 | === Languages updated in 1.18 === |
78 | 79 | |