Index: trunk/extensions/MiniPreview/MiniPreview.i18n.php |
— | — | @@ -13,5 +13,6 @@ |
14 | 14 | * PD- |
15 | 15 | * Self |
16 | 16 | ' ; |
| 17 | +$messages['minipreview-no_category_gallery'] = "No categories or galleries!"; |
17 | 18 | |
18 | 19 | ?> |
\ No newline at end of file |
Index: trunk/extensions/MiniPreview/MiniPreview.php |
— | — | @@ -1,7 +1,7 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | /** |
5 | | - * MiniPreview displays, next to an image, small previews |
| 5 | + * MiniPreview displays, next to an image, small previews |
6 | 6 | * of other images in the same categories or displayed on the same pages |
7 | 7 | * |
8 | 8 | * @addtogroup Extensions |
— | — | @@ -9,7 +9,7 @@ |
10 | 10 | * @copyright � 2007 Magnus Manske |
11 | 11 | * @licence GNU General Public Licence 2.0 or later |
12 | 12 | */ |
13 | | - |
| 13 | + |
14 | 14 | if( !defined( 'MEDIAWIKI' ) ) { |
15 | 15 | echo( "This file is an extension to the MediaWiki software and cannot be used standalone.\n" ); |
16 | 16 | die( 1 ); |
— | — | @@ -37,9 +37,9 @@ |
38 | 38 | * Register extension setup hook and credits |
39 | 39 | */ |
40 | 40 | $wgExtensionFunctions[] = 'efMiniPreview'; |
41 | | -$wgExtensionCredits['parserhook'][] = array( |
42 | | - 'name' => 'MiniPreview', |
43 | | - 'author' => 'Magnus Manske', |
| 41 | +$wgExtensionCredits['parserhook'][] = array( |
| 42 | + 'name' => 'MiniPreview', |
| 43 | + 'author' => 'Magnus Manske', |
44 | 44 | 'url' => 'http://www.mediawiki.org/wiki/Extension:MiniPreview', |
45 | 45 | 'description' => 'MiniPreview displays, next to an image, small previews of other images in the same categories or displayed on the same pages', |
46 | 46 | ); |
— | — | @@ -59,15 +59,15 @@ |
60 | 60 | global $wgMiniPreviewThumbnailSize, $wgMiniPreviewExtPath, $wgScriptPath; |
61 | 61 | global $wgMiniPreviewShowCategories, $wgMiniPreviewShowGalleries; |
62 | 62 | global $wgMiniPreviewMaxCategories, $wgMiniPreviewMaxGalleries, $wgMiniPreviewMaxTotal; |
63 | | - |
| 63 | + |
64 | 64 | if ( !$wgMiniPreviewEnabled ) return ; |
65 | | - |
| 65 | + |
66 | 66 | # Register CSS |
67 | | - $output->addLink( |
68 | | - array( |
69 | | - 'rel' => 'stylesheet', |
70 | | - 'type' => 'text/css', |
71 | | - 'href' => $wgScriptPath . $wgMiniPreviewExtPath . '/MiniPreview.css' |
| 67 | + $output->addLink( |
| 68 | + array( |
| 69 | + 'rel' => 'stylesheet', |
| 70 | + 'type' => 'text/css', |
| 71 | + 'href' => $wgScriptPath . $wgMiniPreviewExtPath . '/MiniPreview.css' |
72 | 72 | ) ) ; |
73 | 73 | |
74 | 74 | $previews = array(); # Will contain objects, each having $entry[0] as BEFORE and $entry[1] as AFTER file |
— | — | @@ -81,8 +81,8 @@ |
82 | 82 | $line = trim ( substr ( $line , 1 ) ) ; |
83 | 83 | $ignore_categories[] = $line; |
84 | 84 | } |
85 | | - |
86 | 85 | |
| 86 | + |
87 | 87 | # Run categories |
88 | 88 | if ( $wgMiniPreviewShowCategories ) { |
89 | 89 | $categories_timestamps = wfMiniPreviewGetImageCategories( $imagePage ); |
— | — | @@ -100,7 +100,7 @@ |
101 | 101 | $previews[] = wfMiniPreviewGetPreviewForCategory ( $category , $timestamp , $imagePage ); |
102 | 102 | } |
103 | 103 | } |
104 | | - |
| 104 | + |
105 | 105 | # Run galleries |
106 | 106 | if ( $wgMiniPreviewShowGalleries ) { |
107 | 107 | $cnt = 0; |
— | — | @@ -129,7 +129,7 @@ |
130 | 130 | 'style' => "float:right;clear:right" ) ) ; |
131 | 131 | |
132 | 132 | if ( count ( $previews ) == 0 ) { # No results |
133 | | - $html .= "No categories or galleries!" ; |
| 133 | + $html .= wfMiniPreviewMessage ( 'minipreview-no_category_gallery' ) ; |
134 | 134 | } else { |
135 | 135 | $last_type = $previews[0]->from_category; |
136 | 136 | foreach ( $previews AS $p ) { |
— | — | @@ -148,7 +148,7 @@ |
149 | 149 | $html .= wfMiniPreviewGetThumbnail ( $p->entry[1] , $image_data ) ; |
150 | 150 | |
151 | 151 | $html .= wfOpenElement( 'td' ); |
152 | | - $html .= wfOpenElement( 'div', array( |
| 152 | + $html .= wfOpenElement( 'div', array( |
153 | 153 | 'style' => "width:{$wgMiniPreviewThumbnailSize}px;height:{$wgMiniPreviewThumbnailSize}px;", |
154 | 154 | 'class' => 'MiniPreview_count' )); |
155 | 155 | $html .= wfMiniPreviewMessage ( 'minipreview-files_in_'.$mode , array("<b>".$p->image_count."</b>") ); |
— | — | @@ -165,12 +165,12 @@ |
166 | 166 | |
167 | 167 | function wfMiniPreviewGetThumbnail ( $entry , &$image_data ) { |
168 | 168 | global $wgMiniPreviewThumbnailSize; |
169 | | - |
| 169 | + |
170 | 170 | $divclass = ( $entry->id == 0 ) ? 'MiniPreview_no_thumb' : 'MiniPreview_thumb' ; |
171 | | - |
| 171 | + |
172 | 172 | $ret = ''; |
173 | 173 | $ret .= wfOpenElement( 'td' ); |
174 | | - $ret .= wfOpenElement( 'div', array( |
| 174 | + $ret .= wfOpenElement( 'div', array( |
175 | 175 | 'style' => "width:{$wgMiniPreviewThumbnailSize}px;height:{$wgMiniPreviewThumbnailSize}px;overflow:hidden", |
176 | 176 | 'class' => $divclass )); |
177 | 177 | |
— | — | @@ -198,11 +198,11 @@ |
199 | 199 | $style .= "top:" . floor($o) . "px;"; |
200 | 200 | $style .= "left:" . floor($o) . "px;"; |
201 | 201 | } |
202 | | - |
| 202 | + |
203 | 203 | $thumb_url = $image_data[$entry->title]->createThumb( $tw ); |
204 | 204 | $image_url = $image_data[$entry->title]->getTitle()->getLocalURL(); |
205 | 205 | $image_name = $image_data[$entry->title]->getTitle()->getText(); |
206 | | - |
| 206 | + |
207 | 207 | $ret .= wfOpenElement ( 'a' , array ( 'href' => $image_url )); |
208 | 208 | $ret .= wfElement ( 'img' , array ( 'border' => '0', 'style' => $style, 'src' => $thumb_url , 'alt' => $image_name )); |
209 | 209 | $ret .= wfCloseElement ( 'a' ); |
— | — | @@ -220,12 +220,12 @@ |
221 | 221 | $res = $dbr->select( |
222 | 222 | array( 'page', 'categorylinks' ), |
223 | 223 | array( 'cl_to', 'cl_timestamp' ), |
224 | | - array( |
| 224 | + array( |
225 | 225 | 'cl_from = page_id', |
226 | 226 | 'page_namespace' => '6', # Image page only |
227 | 227 | 'page_title' => $imagePage->mTitle->getDBKey() ) |
228 | 228 | ); |
229 | | - |
| 229 | + |
230 | 230 | $ret = array(); |
231 | 231 | while( $x = $dbr->fetchObject ( $res ) ) { |
232 | 232 | $ret[$x->cl_to] = $x->cl_timestamp; |
— | — | @@ -241,12 +241,12 @@ |
242 | 242 | $res = $dbr->select( |
243 | 243 | array( 'page', 'imagelinks' ), |
244 | 244 | array( 'il_from' , 'page_title' ), |
245 | | - array( |
| 245 | + array( |
246 | 246 | 'page_id = il_from', |
247 | 247 | 'page_namespace' => $wgMiniPreviewGalleryNamespace, |
248 | 248 | 'il_to' => $imagePage->mTitle->getDBKey() ) |
249 | 249 | ); |
250 | | - |
| 250 | + |
251 | 251 | $ret = array(); |
252 | 252 | while( $x = $dbr->fetchObject ( $res ) ) { |
253 | 253 | $ret[$x->il_from] = $x->page_title ; |
— | — | @@ -265,12 +265,12 @@ |
266 | 266 | $ret->entry = array(); |
267 | 267 | |
268 | 268 | $dbr = wfGetDB( DB_SLAVE ); |
269 | | - |
| 269 | + |
270 | 270 | # Get the image BEFORE the current one (according to timestamp) |
271 | 271 | $res = $dbr->select( |
272 | 272 | array( 'page', 'categorylinks' ), |
273 | 273 | array( 'page_title', 'page_id'), |
274 | | - array( |
| 274 | + array( |
275 | 275 | 'cl_to' => $category , # Same category as current one |
276 | 276 | 'cl_timestamp < ' . $dbr->addQuotes( $timestamp ), # Timestamp is before the current one |
277 | 277 | 'page_id = cl_from', |
— | — | @@ -284,12 +284,12 @@ |
285 | 285 | $ret->entry[0]->id = $x->page_id ; |
286 | 286 | } else $ret->entry[0]->id = 0 ; |
287 | 287 | $dbr->freeResult( $res ); |
288 | | - |
| 288 | + |
289 | 289 | # Get the image AFTER the current one (according to timestamp) |
290 | 290 | $res = $dbr->select( |
291 | 291 | array( 'page', 'categorylinks' ), |
292 | 292 | array( 'page_id', 'page_title' ), |
293 | | - array( |
| 293 | + array( |
294 | 294 | 'cl_to' => $category , # Same category as current one |
295 | 295 | 'cl_timestamp > ' . $dbr->addQuotes( $timestamp ), # Timestamp is after the current one |
296 | 296 | 'page_id = cl_from', |
— | — | @@ -303,12 +303,12 @@ |
304 | 304 | $ret->entry[1]->id = $x->page_id ; |
305 | 305 | } else $ret->entry[1]->id = 0 ; |
306 | 306 | $dbr->freeResult( $res ); |
307 | | - |
| 307 | + |
308 | 308 | # Get total image count for this category |
309 | 309 | $res = $dbr->select( |
310 | 310 | array( 'page', 'categorylinks' ), |
311 | 311 | array( 'count(*) AS cnt' ), |
312 | | - array( |
| 312 | + array( |
313 | 313 | 'cl_to' => $category, |
314 | 314 | 'page_id = cl_from', |
315 | 315 | 'page_namespace=6' # Images only |
— | — | @@ -328,14 +328,14 @@ |
329 | 329 | $ret->from_gallery = true; |
330 | 330 | $ret->source_title = $title; |
331 | 331 | $ret->entry = array(); |
332 | | - |
| 332 | + |
333 | 333 | $dbr = wfGetDB( DB_SLAVE ); |
334 | 334 | |
335 | 335 | # Get the image BEFORE the current one (according to title) |
336 | 336 | $res = $dbr->select( |
337 | 337 | array( 'page', 'imagelinks' ), |
338 | 338 | array( 'il_from', 'page_id', 'max(il_to) AS maxto' ), |
339 | | - array( |
| 339 | + array( |
340 | 340 | 'il_from' => $id, # Same page |
341 | 341 | 'il_to < ' . $dbr->addQuotes( $imagePage->getTitle()->getDBKey() ), # Title comes before the current one |
342 | 342 | 'page_title = il_to', |
— | — | @@ -354,7 +354,7 @@ |
355 | 355 | $res = $dbr->select( |
356 | 356 | array( 'page', 'imagelinks' ), |
357 | 357 | array( 'il_from', 'page_id', 'min(il_to) AS minto' ), |
358 | | - array( |
| 358 | + array( |
359 | 359 | 'il_from' => $id, # Same page |
360 | 360 | 'il_to > ' . $dbr->addQuotes( $imagePage->mTitle->getDBKey() ), # Title comes after the current one |
361 | 361 | 'page_title = il_to', |
— | — | @@ -401,13 +401,13 @@ |
402 | 402 | function wfMiniPreviewLoadMessages() { |
403 | 403 | global $wgLang; |
404 | 404 | $messages = array(); |
405 | | - |
| 405 | + |
406 | 406 | $f= dirname( __FILE__ ) . '/MiniPreview.i18n.php'; |
407 | 407 | include( $f ); |
408 | | - |
| 408 | + |
409 | 409 | $f= dirname( __FILE__ ) . '/MiniPreview.i18n.' . $wgLang->getCode() . '.php'; |
410 | 410 | if ( file_exists( $f ) ) include( $f ); |
411 | | - |
| 411 | + |
412 | 412 | return $messages; |
413 | 413 | } |
414 | 414 | |
Index: trunk/extensions/Translate/SpecialTranslate.php |
— | — | @@ -54,6 +54,7 @@ |
55 | 55 | 'ext-minimumnamelength' => 'MinimumNameLengthMessageClass', |
56 | 56 | 'ext-newuserlog' => 'NewuserLogMessageClass', |
57 | 57 | 'ext-patroller' => 'PatrollerMessageClass', |
| 58 | +'ext-picturepopup' => 'PicturePopupMessageClass', |
58 | 59 | 'ext-renameuser' => 'RenameUserMessageClass', |
59 | 60 | 'ext-sitematrix' => 'SiteMatrixMessageClass', |
60 | 61 | 'ext-translate' => 'TranslateMessageClass', |
Index: trunk/extensions/Translate/SpecialTranslate_exts.php |
— | — | @@ -568,6 +568,19 @@ |
569 | 569 | protected $exportEnd = '),'; |
570 | 570 | } |
571 | 571 | |
| 572 | +class PicturePopupMessageClass extends ExtensionMessageClass { |
| 573 | + protected $label = 'Extension: PicturePopup'; |
| 574 | + protected $id = 'ext-picturepopup'; |
| 575 | + |
| 576 | + protected $functionName = 'efPicturePopupMessages'; |
| 577 | + protected $messageFile = 'PicturePopup/PicturePopup.i18n.php'; |
| 578 | + |
| 579 | + protected $exportStart = '\'$CODE\' => array('; |
| 580 | + protected $exportPrefix= ''; |
| 581 | + protected $exportLineP = ''; |
| 582 | + protected $exportEnd = '),'; |
| 583 | +} |
| 584 | + |
572 | 585 | class RenameUserMessageClass extends ExtensionMessageClass { |
573 | 586 | protected $label = 'Extension: Rename User'; |
574 | 587 | protected $id = 'ext-renameuser'; |
Index: trunk/extensions/PicturePopup/PicturePopup.i18n.php |
— | — | @@ -20,6 +20,17 @@ |
21 | 21 | 'picturepopup_invalid_icon' => 'License template has missing or invalid imageLicenseIcon element', |
22 | 22 | ), |
23 | 23 | |
| 24 | +/* Indonesian */ |
| 25 | +'id' => array( |
| 26 | + 'picturepopup_invalid_title' => 'Judul gambar tak sah', |
| 27 | + 'picturepopup_no_license' => 'Gambar tak memiliki tag lisensi', |
| 28 | + 'picturepopup_no_image' => 'Gambar tak ditemukan', |
| 29 | + 'picturepopup_no_license_list' => 'Daftar lisensi tak valid atau tak ditemukan', |
| 30 | + 'picturepopup_license_list' => 'Project:Tag hak cipta gambar', |
| 31 | + 'picturepopup_no_license_text' => 'Templat lisensi tak memiliki elemen dengan id=imageLicenseText', |
| 32 | + 'picturepopup_invalid_icon' => 'Templat lisensi tak memiliki atau memiliki elemen imageLicenseIcon tak sah', |
| 33 | +), |
| 34 | + |
24 | 35 | /* Kazakh Cyrillic */ |
25 | 36 | 'kk-kz' => array( |
26 | 37 | 'picturepopup_invalid_title' => 'Сурет атауы жарамсыз ', |
Index: trunk/extensions/i18n.db |
— | — | @@ -82,6 +82,7 @@ |
83 | 83 | ./Newuserlog/Newuserlog.i18n.php wgNewuserlogMessages |
84 | 84 | ./Oversight/HideRevision.i18n.php efHideRevisionMessages |
85 | 85 | ./Patroller/Patroller.i18n.php efPatrollerMessages |
| 86 | +./PicturePopup/PicturePopup.i18n.php efPicturePopupMessages |
86 | 87 | ./ProfileMonitor/ProfileMonitor.i18n.php efProfileMonitorMessages |
87 | 88 | ./Quiz/Quiz.i18n.php wgQuizMessages |
88 | 89 | ./Renameuser/SpecialRenameuser.i18n.php wgRenameuserMessages |