Index: branches/wmf/1.17wmf1/extensions/SubPageList3/SubPageList3.i18n.php |
— | — | @@ -0,0 +1,564 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * ***** BEGIN LICENSE BLOCK ***** |
| 5 | + * This file is part of the SubPageList3 extension. |
| 6 | + * Copyright (c) 2008 James McCormack |
| 7 | + * |
| 8 | + * This is free software; you can redistribute it and/or modify |
| 9 | + * it under the terms of the GNU General Public License as published by |
| 10 | + * the Free Software Foundation; either version 2 of the License, or |
| 11 | + * (at your option) any later version. |
| 12 | + * |
| 13 | + * This software is distributed in the hope that it will be useful, |
| 14 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | + * GNU General Public License for more details. |
| 17 | + * |
| 18 | + * You should have received a copy of the GNU General Public License |
| 19 | + * along with SubPageList3; if not, write to the Free Software |
| 20 | + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 21 | + * |
| 22 | + * ***** END LICENSE BLOCK ***** |
| 23 | + * |
| 24 | + * @version 1.02 |
| 25 | + * @link http://www.mediawiki.org/wiki/Extension:SubPageList3 |
| 26 | + * @license GNU General Public Licence 2.0 or later |
| 27 | + * @author McCormack, James |
| 28 | + */ |
| 29 | + |
| 30 | +$messages = array(); |
| 31 | + |
| 32 | +/** English |
| 33 | + * @author McCormack, James |
| 34 | + */ |
| 35 | +$messages['en'] = array( |
| 36 | + 'spl3-desc' => 'Automatically creates a list of the subpages of a page using the tag <code><nowiki><splist /></nowiki></code>', |
| 37 | + 'spl3_debug' => 'Unknown value for option $1.', |
| 38 | + 'spl3_nosubpages' => '$1 has no subpages to list.', |
| 39 | +); |
| 40 | + |
| 41 | +/** Message documentation (Message documentation) |
| 42 | + * @author Purodha |
| 43 | + * @author The Evil IP address |
| 44 | + */ |
| 45 | +$messages['qqq'] = array( |
| 46 | + 'spl3-desc' => '{{desc}}', |
| 47 | +); |
| 48 | + |
| 49 | +/** Arabic (العربية) |
| 50 | + * @author Meno25 |
| 51 | + * @author OsamaK |
| 52 | + */ |
| 53 | +$messages['ar'] = array( |
| 54 | + 'spl3-desc' => 'تلقائيا ينشئ قائمة بالصفحات الفرعية لصفحة باستخدام الوسم <code><nowiki><splist /></nowiki></code>', |
| 55 | + 'spl3_debug' => 'قيمة غير معروفة للخيار $1.', |
| 56 | + 'spl3_nosubpages' => '$1 لا تمتلك أي صفحات فرعية لوضعها في قائمة.', |
| 57 | +); |
| 58 | + |
| 59 | +/** Egyptian Spoken Arabic (مصرى) |
| 60 | + * @author Meno25 |
| 61 | + */ |
| 62 | +$messages['arz'] = array( |
| 63 | + 'spl3-desc' => 'تلقائيا ينشئ قائمة بالصفحات الفرعية لصفحة باستخدام الوسم <code><nowiki><splist /></nowiki></code>', |
| 64 | + 'spl3_debug' => 'قيمة غير معروفة للخيار $1.', |
| 65 | + 'spl3_nosubpages' => '$1 لا تمتلك أى صفحات فرعية لوضعها فى قائمة.', |
| 66 | +); |
| 67 | + |
| 68 | +/** Belarusian (Taraškievica orthography) (Беларуская (тарашкевіца)) |
| 69 | + * @author EugeneZelenko |
| 70 | + * @author Jim-by |
| 71 | + */ |
| 72 | +$messages['be-tarask'] = array( |
| 73 | + 'spl3-desc' => 'Аўтаматычна стварае сьпіс падстаронак з дапамогай тэга <code><nowiki><splist /></nowiki></code>', |
| 74 | + 'spl3_debug' => 'Невядомае значэньне парамэтра $1.', |
| 75 | + 'spl3_nosubpages' => '$1 ня мае падстаронак.', |
| 76 | +); |
| 77 | + |
| 78 | +/** Bulgarian (Български) |
| 79 | + * @author DCLXVI |
| 80 | + */ |
| 81 | +$messages['bg'] = array( |
| 82 | + 'spl3-desc' => 'Автоматично създава списък на подстраниците с помощта на етикета <code><nowiki><splist /></nowiki></code>', |
| 83 | + 'spl3_nosubpages' => '$1 не съдържа подстраници, които да бъдат показани.', |
| 84 | +); |
| 85 | + |
| 86 | +/** Breton (Brezhoneg) |
| 87 | + * @author Fulup |
| 88 | + */ |
| 89 | +$messages['br'] = array( |
| 90 | + 'spl3-desc' => 'Sevel a ra ent emgefre roll ispajennoù ur bajenn en ur ober gant ar valizenn <code><nowiki><splist /></nowiki></code>', |
| 91 | + 'spl3_debug' => 'Talvoudenn dianav evit an dibarzh $1', |
| 92 | + 'spl3_nosubpages' => "N'eus ispajenn ebet da rollañ evit $1", |
| 93 | +); |
| 94 | + |
| 95 | +/** Bosnian (Bosanski) |
| 96 | + * @author CERminator |
| 97 | + */ |
| 98 | +$messages['bs'] = array( |
| 99 | + 'spl3-desc' => 'Automatski napravljen spisak podstranica stranice koja koristi oznaku <code><nowiki><splist /></nowiki></code>', |
| 100 | + 'spl3_debug' => 'Nepoznata vrijednost za opciju $1.', |
| 101 | + 'spl3_nosubpages' => '$1 nema podstranica za prikaz.', |
| 102 | +); |
| 103 | + |
| 104 | +/** Catalan (Català) |
| 105 | + * @author SMP |
| 106 | + */ |
| 107 | +$messages['ca'] = array( |
| 108 | + 'spl3-desc' => "Crea automàticament una llista de les subpàgines d'una pàgina fent servir el codi <code><nowiki><splist /></nowiki></code>", |
| 109 | + 'spl3_debug' => "Valor desconegut per a l'opció $1.", |
| 110 | + 'spl3_nosubpages' => '$1 no té subpàgines a mostrar.', |
| 111 | +); |
| 112 | + |
| 113 | +/** Czech (Česky) |
| 114 | + * @author Matěj Grabovský |
| 115 | + */ |
| 116 | +$messages['cs'] = array( |
| 117 | + 'spl3-desc' => 'Automaticky vytváří seznam podstránek stránky pomocí značky <tt><splist /></tt>', |
| 118 | + 'spl3_debug' => 'Neznáma hodnota volby $1.', |
| 119 | + 'spl3_nosubpages' => '$1 nemá žádné zobrazitelné podstránky.', |
| 120 | +); |
| 121 | + |
| 122 | +/** German (Deutsch) |
| 123 | + * @author Raimond Spekking |
| 124 | + */ |
| 125 | +$messages['de'] = array( |
| 126 | + 'spl3-desc' => 'Automatisches Erstellen einer Liste von Unterseiten zu einer Seite mit Hilfe des <tt><nowiki><splist /></nowiki></tt>-Tags.', |
| 127 | + 'spl3_debug' => 'Unbekannter Wert für Option $1.', |
| 128 | + 'spl3_nosubpages' => '$1 hat keine Unterseiten.', |
| 129 | +); |
| 130 | + |
| 131 | +/** Lower Sorbian (Dolnoserbski) |
| 132 | + * @author Michawiki |
| 133 | + */ |
| 134 | +$messages['dsb'] = array( |
| 135 | + 'spl3-desc' => 'Napórajo awtomatiski lisćinu pódbokow boka z pomocu toflicki <code><nowiki><splist /></nowiki></code>', |
| 136 | + 'spl3_debug' => 'Njeznata gódnota za opciju $1.', |
| 137 | + 'spl3_nosubpages' => '$1 njama pódboki za lisćinu.', |
| 138 | +); |
| 139 | + |
| 140 | +/** Greek (Ελληνικά) |
| 141 | + * @author Omnipaedista |
| 142 | + * @author ZaDiak |
| 143 | + */ |
| 144 | +$messages['el'] = array( |
| 145 | + 'spl3-desc' => 'Δημιουργεί αυτόματα μία λίστα υποσελίδων μίας σελίδας χρησιμοποιώντας την ετικέτα <code><nowiki><splist /></nowiki></code>', |
| 146 | + 'spl3_debug' => 'Άγνωστη αξία για την επιλογή $1.', |
| 147 | + 'spl3_nosubpages' => 'Η $1 δεν έχει υποσελίδες για καταγραφή.', |
| 148 | +); |
| 149 | + |
| 150 | +/** Esperanto (Esperanto) |
| 151 | + * @author Michawiki |
| 152 | + * @author Yekrats |
| 153 | + */ |
| 154 | +$messages['eo'] = array( |
| 155 | + 'spl3-desc' => 'Aŭtomate kreas liston de la subpaĝoj de paĝo uzante la etikedon <code><nowiki><splist /></nowiki></code>', |
| 156 | + 'spl3_debug' => 'Nekonata valoro por opcio $1.', |
| 157 | + 'spl3_nosubpages' => '$1 havas neniujn subpaĝojn por listigi.', |
| 158 | +); |
| 159 | + |
| 160 | +/** Spanish (Español) |
| 161 | + * @author Crazymadlover |
| 162 | + */ |
| 163 | +$messages['es'] = array( |
| 164 | + 'spl3-desc' => 'Crea automáticamente una lista de las subpáginas de una página usando la etiqueta <code><nowiki><splist /></nowiki></code>', |
| 165 | + 'spl3_debug' => 'Valor desconocido para opción $1.', |
| 166 | + 'spl3_nosubpages' => '$1 no tiene subpáginas a listar.', |
| 167 | +); |
| 168 | + |
| 169 | +/** Finnish (Suomi) |
| 170 | + * @author Crt |
| 171 | + * @author Silvonen |
| 172 | + */ |
| 173 | +$messages['fi'] = array( |
| 174 | + 'spl3_debug' => 'Tuntematon arvo valinnassa $1.', |
| 175 | + 'spl3_nosubpages' => 'Sivulla $1 ei ole alasivuja.', |
| 176 | +); |
| 177 | + |
| 178 | +/** French (Français) |
| 179 | + * @author Crochet.david |
| 180 | + * @author Grondin |
| 181 | + * @author Urhixidur |
| 182 | + */ |
| 183 | +$messages['fr'] = array( |
| 184 | + 'spl3-desc' => 'Crée automatiquement une liste de sous-pages d’une page utilisant la balise <code><nowiki><splist /></nowiki></code>', |
| 185 | + 'spl3_debug' => 'Valeur pour l’option $1 inconnue.', |
| 186 | + 'spl3_nosubpages' => '$1 n’a pas de sous-pages à énumérer.', |
| 187 | +); |
| 188 | + |
| 189 | +/** Franco-Provençal (Arpetan) |
| 190 | + * @author ChrisPtDe |
| 191 | + */ |
| 192 | +$messages['frp'] = array( |
| 193 | + 'spl3_debug' => 'Valor por lo chouèx $1 encognua.', |
| 194 | + 'spl3_nosubpages' => '$1 at gins de sot-pâge a ènumèrar.', |
| 195 | +); |
| 196 | + |
| 197 | +/** Galician (Galego) |
| 198 | + * @author Toliño |
| 199 | + */ |
| 200 | +$messages['gl'] = array( |
| 201 | + 'spl3-desc' => 'Crea automaticamente unha lista das subpáxinas dunha páxina usando a etiqueta <code><nowiki><splist /></nowiki></code>', |
| 202 | + 'spl3_debug' => 'Valor descoñecido para a opción $1.', |
| 203 | + 'spl3_nosubpages' => '$1 non ten subpáxinas que poñer nunha lista.', |
| 204 | +); |
| 205 | + |
| 206 | +/** Swiss German (Alemannisch) |
| 207 | + * @author Als-Holder |
| 208 | + */ |
| 209 | +$messages['gsw'] = array( |
| 210 | + 'spl3-desc' => 'E Lischt vu Untersyte zuen ere Syte mit em <tt><nowiki><splist /></nowiki></tt>-Tag automatisch aalege.', |
| 211 | + 'spl3_debug' => 'Nit bekannter Wärt fir Option $1.', |
| 212 | + 'spl3_nosubpages' => '$1 het kei Untersyte.', |
| 213 | +); |
| 214 | + |
| 215 | +/** Hebrew (עברית) |
| 216 | + * @author Rotemliss |
| 217 | + * @author YaronSh |
| 218 | + */ |
| 219 | +$messages['he'] = array( |
| 220 | + 'spl3-desc' => 'יצירת רשימת דפי המשנה של דף באמצעות התגית <code><nowiki><splist /></nowiki></code>', |
| 221 | + 'spl3_debug' => 'ערך לא ידוע עבור האפשרות $1.', |
| 222 | + 'spl3_nosubpages' => 'ל־$1 אין דפי משנה להצגה.', |
| 223 | +); |
| 224 | + |
| 225 | +/** Upper Sorbian (Hornjoserbsce) |
| 226 | + * @author Michawiki |
| 227 | + */ |
| 228 | +$messages['hsb'] = array( |
| 229 | + 'spl3-desc' => 'Wutworja awtomatisce lisćinu podstronow z pomocu taflički <code><nowiki><splist /></nowiki></code>', |
| 230 | + 'spl3_debug' => 'Njeznata hódnota za opciju $1.', |
| 231 | + 'spl3_nosubpages' => '$1 nima podstrony za lisćinu.', |
| 232 | +); |
| 233 | + |
| 234 | +/** Hungarian (Magyar) |
| 235 | + * @author Dani |
| 236 | + * @author Glanthor Reviol |
| 237 | + */ |
| 238 | +$messages['hu'] = array( |
| 239 | + 'spl3-desc' => 'Automatikusan listát készít egy lap allapjairól az <code><nowiki><splist /></nowiki></code> tag használatával', |
| 240 | + 'spl3_debug' => 'Ismeretlen érték a(z) $1 beállításhoz.', |
| 241 | + 'spl3_nosubpages' => 'A(z) $1 című lapnak nincsenek allapjai.', |
| 242 | +); |
| 243 | + |
| 244 | +/** Interlingua (Interlingua) |
| 245 | + * @author McDutchie |
| 246 | + */ |
| 247 | +$messages['ia'] = array( |
| 248 | + 'spl3-desc' => 'Crea automaticamente un lista del subpaginas de unpagina con le etiquetta <code><nowiki><splist /></nowiki></code>', |
| 249 | + 'spl3_debug' => 'Valor incognite pro le option $1.', |
| 250 | + 'spl3_nosubpages' => '$1 non ha subpaginas a listar.', |
| 251 | +); |
| 252 | + |
| 253 | +/** Indonesian (Bahasa Indonesia) |
| 254 | + * @author Bennylin |
| 255 | + */ |
| 256 | +$messages['id'] = array( |
| 257 | + 'spl3-desc' => 'Membuat secara otomatis daftar upa halaman menggunakan tag <code><nowiki><splist /></nowiki></code>', |
| 258 | + 'spl3_debug' => 'Nilai paramater yang tidak diketahui untuk $1.', |
| 259 | + 'spl3_nosubpages' => '$1 tidak memiliki upa halaman untuk didaftarkan.', |
| 260 | +); |
| 261 | + |
| 262 | +/** Italian (Italiano) |
| 263 | + * @author Darth Kule |
| 264 | + */ |
| 265 | +$messages['it'] = array( |
| 266 | + 'spl3-desc' => 'Crea automaticamente un elenco delle sottopagine della pagina usando il tag <code><nowiki><splist /></nowiki></code>', |
| 267 | + 'spl3_debug' => "Valore sconosciuto per l'opzione $1.", |
| 268 | + 'spl3_nosubpages' => '$1 non ha sottopagine da elencare.', |
| 269 | +); |
| 270 | + |
| 271 | +/** Japanese (日本語) |
| 272 | + * @author Aotake |
| 273 | + * @author Mizusumashi |
| 274 | + */ |
| 275 | +$messages['ja'] = array( |
| 276 | + 'spl3-desc' => '<code><nowiki><splist /></nowiki></code>タグを使っているページのサブページ一覧を自動生成する', |
| 277 | + 'spl3_debug' => '$1オプションの値が不明。', |
| 278 | + 'spl3_nosubpages' => '$1には一覧すべきサブページがありません。', |
| 279 | +); |
| 280 | + |
| 281 | +/** Javanese (Basa Jawa) |
| 282 | + * @author Meursault2004 |
| 283 | + */ |
| 284 | +$messages['jv'] = array( |
| 285 | + 'spl3-desc' => 'Sacara otomatis nggawé daftar subkaca-subkaca sawijining kaca nganggo tag <code><nowiki><splist /></nowiki></code>', |
| 286 | + 'spl3_debug' => 'Bijih kanggo opsi $1 ora dimangertèni.', |
| 287 | + 'spl3_nosubpages' => '$1 ora nduwé subkaca-subkaca sing bisa dituduhaké.', |
| 288 | +); |
| 289 | + |
| 290 | +/** Khmer (ភាសាខ្មែរ) |
| 291 | + * @author Thearith |
| 292 | + */ |
| 293 | +$messages['km'] = array( |
| 294 | + 'spl3_debug' => 'មិនត្រូវបានស្គាល់តម្លៃសម្រាប់ជម្រើស $1 ។', |
| 295 | + 'spl3_nosubpages' => '$1 មិនមានទំព័ររងក្នុងបញ្ជីទេ។', |
| 296 | +); |
| 297 | + |
| 298 | +/** Colognian (Ripoarisch) |
| 299 | + * @author Purodha |
| 300 | + */ |
| 301 | +$messages['ksh'] = array( |
| 302 | + 'spl3-desc' => 'Määt automattesch en Leß met Ungersigge met däm <code><nowiki><splist /></nowiki></code>-Befäähl.', |
| 303 | + 'spl3_debug' => 'Ene unbikannte Wäät för „$1“.', |
| 304 | + 'spl3_nosubpages' => 'De Sigg „$1“ hät kei Ungersigge.', |
| 305 | +); |
| 306 | + |
| 307 | +/** Luxembourgish (Lëtzebuergesch) |
| 308 | + * @author Robby |
| 309 | + */ |
| 310 | +$messages['lb'] = array( |
| 311 | + 'spl3-desc' => 'Mécht automatesch eng Lëscht vun Ënnersäite vun enger Säit mat Hëllef vum Tag <code><nowiki><splist /></nowiki></code>', |
| 312 | + 'spl3_debug' => "Onbekannte Wäert fir d'Optioun $1", |
| 313 | + 'spl3_nosubpages' => '$1 huet keng Ënnersäite fir ze weisen', |
| 314 | +); |
| 315 | + |
| 316 | +/** Macedonian (Македонски) |
| 317 | + * @author Bjankuloski06 |
| 318 | + */ |
| 319 | +$messages['mk'] = array( |
| 320 | + 'spl3-desc' => 'Автоматски создава список на потстраници на страница која ја користи ознаката <code><nowiki><splist /></nowiki></code>', |
| 321 | + 'spl3_debug' => 'Непозната вредност за параметарот $1.', |
| 322 | + 'spl3_nosubpages' => '$1 нема потстраници за наведување.', |
| 323 | +); |
| 324 | + |
| 325 | +/** Marathi (मराठी) |
| 326 | + * @author Kaustubh |
| 327 | + */ |
| 328 | +$messages['mr'] = array( |
| 329 | + 'spl3-desc' => '<code><nowiki><splist /></nowiki></code> टॅग चा वापर करून आपोआप उपपानांची यादी तयार करते', |
| 330 | + 'spl3_debug' => 'विकल्प $1 साठी अनोळखी किंमत.', |
| 331 | + 'spl3_nosubpages' => '$1 ला यादी करण्यासाठी उपपाने नाहीत.', |
| 332 | +); |
| 333 | + |
| 334 | +/** Dutch (Nederlands) |
| 335 | + * @author Siebrand |
| 336 | + */ |
| 337 | +$messages['nl'] = array( |
| 338 | + 'spl3-desc' => "Maakt automatisch een lijst met de subpagina's van een pagina met de tag <code><nowiki><splist /></nowiki></code>", |
| 339 | + 'spl3_debug' => 'Onbekende waarde voor optie $1.', |
| 340 | + 'spl3_nosubpages' => "$1 heeft geen subpagina's.", |
| 341 | +); |
| 342 | + |
| 343 | +/** Norwegian Nynorsk (Norsk (nynorsk)) |
| 344 | + * @author Frokor |
| 345 | + */ |
| 346 | +$messages['nn'] = array( |
| 347 | + 'spl3-desc' => 'Lagar automatisk ei liste over undersidene til ei side ved å bruke taggen <code><nowiki><splist /></nowiki></code>', |
| 348 | + 'spl3_debug' => 'Ukjend verdi for val $1.', |
| 349 | + 'spl3_nosubpages' => '$1 har ingen undersider å vise.', |
| 350 | +); |
| 351 | + |
| 352 | +/** Norwegian (bokmål) (Norsk (bokmål)) |
| 353 | + * @author Jon Harald Søby |
| 354 | + */ |
| 355 | +$messages['no'] = array( |
| 356 | + 'spl3-desc' => 'Lager automatisk en liste over undersidene til en side ved å bruke taggen <code><nowiki><splist /></nowiki></code>', |
| 357 | + 'spl3_debug' => 'Ukjent verdi for valg $1.', |
| 358 | + 'spl3_nosubpages' => '$1 har ingen undersider å vise.', |
| 359 | +); |
| 360 | + |
| 361 | +/** Occitan (Occitan) |
| 362 | + * @author Cedric31 |
| 363 | + */ |
| 364 | +$messages['oc'] = array( |
| 365 | + 'spl3-desc' => "Crèa automaticament una lista de sospaginas d’una pagina qu'utiliza la balisa <code><nowiki><splist /></nowiki></code>", |
| 366 | + 'spl3_debug' => 'Valor per l’opcion $1 desconeguda.', |
| 367 | + 'spl3_nosubpages' => "$1 a pas de sospaginas d'enumerar.", |
| 368 | +); |
| 369 | + |
| 370 | +/** Polish (Polski) |
| 371 | + * @author Wpedzich |
| 372 | + */ |
| 373 | +$messages['pl'] = array( |
| 374 | + 'spl3-desc' => 'Automatycznie tworzy listę podstron za pomocą znacznika <code><nowiki><splist /></nowiki></code>', |
| 375 | + 'spl3_debug' => 'Nieznana wartość opcji $1.', |
| 376 | + 'spl3_nosubpages' => 'Nie można wyświetlić podstron strony $1.', |
| 377 | +); |
| 378 | + |
| 379 | +/** Piedmontese (Piemontèis) |
| 380 | + * @author Dragonòt |
| 381 | + */ |
| 382 | +$messages['pms'] = array( |
| 383 | + 'spl3-desc' => 'A crea automaticament na lista dle sotpàgine ëd na pàgina an dovrand ël tag <code><nowiki><splist /></nowiki></code>', |
| 384 | + 'spl3_debug' => "Valor pa conossù për l'opsion $1.", |
| 385 | + 'spl3_nosubpages' => "$1 a l'ha pa ëd sotpàgine da listé.", |
| 386 | +); |
| 387 | + |
| 388 | +/** Portuguese (Português) |
| 389 | + * @author Hamilton Abreu |
| 390 | + * @author Malafaya |
| 391 | + */ |
| 392 | +$messages['pt'] = array( |
| 393 | + 'spl3-desc' => 'Cria automaticamente uma lista das subpáginas de uma página usando o elemento <code><nowiki><splist /></nowiki></code>', |
| 394 | + 'spl3_debug' => 'Valor desconhecido para a opção $1.', |
| 395 | + 'spl3_nosubpages' => '$1 não tem subpáginas para listar.', |
| 396 | +); |
| 397 | + |
| 398 | +/** Brazilian Portuguese (Português do Brasil) |
| 399 | + * @author Eduardo.mps |
| 400 | + */ |
| 401 | +$messages['pt-br'] = array( |
| 402 | + 'spl3-desc' => 'Cria automaticamente uma lista das subpáginas de uma página usando a marca <code><nowiki><splist /></nowiki></code>', |
| 403 | + 'spl3_debug' => 'Valor desconhecido para a opção $1.', |
| 404 | + 'spl3_nosubpages' => '$1 não tem subpáginas para listar.', |
| 405 | +); |
| 406 | + |
| 407 | +/** Romanian (Română) |
| 408 | + * @author KlaudiuMihaila |
| 409 | + */ |
| 410 | +$messages['ro'] = array( |
| 411 | + 'spl3_debug' => 'Valoare necunoscută pentru opțiunea $1.', |
| 412 | + 'spl3_nosubpages' => '$1 nu are subpagini pentru afișat.', |
| 413 | +); |
| 414 | + |
| 415 | +/** Tarandíne (Tarandíne) |
| 416 | + * @author Joetaras |
| 417 | + */ |
| 418 | +$messages['roa-tara'] = array( |
| 419 | + 'spl3-desc' => "Automaticamende ccreje 'n'elenghe de sottopàggene de 'na pàgene ausanne 'u tag <code><nowiki><splist /></nowiki></code>", |
| 420 | + 'spl3_debug' => "Valore scanusciute pe l'opzione $1.", |
| 421 | + 'spl3_nosubpages' => '$1 non ge tène sottopàggene da elengà.', |
| 422 | +); |
| 423 | + |
| 424 | +/** Russian (Русский) |
| 425 | + * @author Александр Сигачёв |
| 426 | + */ |
| 427 | +$messages['ru'] = array( |
| 428 | + 'spl3-desc' => 'Автоматически создаёт список подстраниц некоторой страницы, использующей тег <code><nowiki><splist /></nowiki></code>', |
| 429 | + 'spl3_debug' => 'Неизвестное значение параметра $1.', |
| 430 | + 'spl3_nosubpages' => '$1 не имеет подстраниц для включения в список.', |
| 431 | +); |
| 432 | + |
| 433 | +/** Slovak (Slovenčina) |
| 434 | + * @author Helix84 |
| 435 | + */ |
| 436 | +$messages['sk'] = array( |
| 437 | + 'spl3-desc' => 'Automatická tvorba zoznamu podstránok stránky pomocou značky <code><nowiki><splist /></nowiki></code>', |
| 438 | + 'spl3_debug' => 'Neznáma hodnota voľby $1.', |
| 439 | + 'spl3_nosubpages' => '$1 nemá zobraziteľné podstránky.', |
| 440 | +); |
| 441 | + |
| 442 | +/** Serbian Cyrillic ekavian (Српски (ћирилица)) |
| 443 | + * @author Rancher |
| 444 | + * @author Михајло Анђелковић |
| 445 | + */ |
| 446 | +$messages['sr-ec'] = array( |
| 447 | + 'spl3-desc' => 'Аутоматски прави списак подстрана неке стране преко тага <code><nowiki><splist /></nowiki></code>', |
| 448 | + 'spl3_debug' => 'Непозната вредност за опцију $1.', |
| 449 | + 'spl3_nosubpages' => '$1 нема подстраница.', |
| 450 | +); |
| 451 | + |
| 452 | +/** Serbian Latin ekavian (Srpski (latinica)) |
| 453 | + * @author Michaello |
| 454 | + */ |
| 455 | +$messages['sr-el'] = array( |
| 456 | + 'spl3-desc' => 'Automatski pravi spisak podstrana neke strane preko taga <code><nowiki><splist /></nowiki></code>', |
| 457 | + 'spl3_debug' => 'Nepoznata vrednost za opciju $1.', |
| 458 | + 'spl3_nosubpages' => '$1 nema podstrana.', |
| 459 | +); |
| 460 | + |
| 461 | +/** Swedish (Svenska) |
| 462 | + * @author M.M.S. |
| 463 | + */ |
| 464 | +$messages['sv'] = array( |
| 465 | + 'spl3-desc' => 'Skapar automatiskt en lista över undersidorna till en sida av användning av <code><nowiki><splist /></nowiki></code>-taggen', |
| 466 | + 'spl3_debug' => 'Okänt värde för alternativ $1.', |
| 467 | + 'spl3_nosubpages' => '$1 har inga undersidor att visa.', |
| 468 | +); |
| 469 | + |
| 470 | +/** Telugu (తెలుగు) |
| 471 | + * @author Veeven |
| 472 | + */ |
| 473 | +$messages['te'] = array( |
| 474 | + 'spl3_nosubpages' => '$1లో చూపించాల్సిన ఉపపేజీలు ఏమీలేవు.', |
| 475 | +); |
| 476 | + |
| 477 | +/** Tajik (Cyrillic) (Тоҷикӣ (Cyrillic)) |
| 478 | + * @author Ibrahim |
| 479 | + */ |
| 480 | +$messages['tg-cyrl'] = array( |
| 481 | + 'spl3-desc' => 'Бо роҳи худкор феҳристи зерсаҳифаҳои саҳифаи барчасби <code><nowiki><splist /></nowiki></code> истифодабурдаро эҷод мекунад', |
| 482 | + 'spl3_debug' => 'Қимати ношинос барои ихтиёри $1.', |
| 483 | + 'spl3_nosubpages' => '$1 дорои ҳеҷ зерсаҳифаҳое барои феҳристкунӣ нест.', |
| 484 | +); |
| 485 | + |
| 486 | +/** Tajik (Latin) (Тоҷикӣ (Latin)) |
| 487 | + * @author Liangent |
| 488 | + */ |
| 489 | +$messages['tg-latn'] = array( |
| 490 | + 'spl3-desc' => 'Bo rohi xudkor fehristi zersahifahoi sahifai barcasbi <code><nowiki><splist /></nowiki></code> istifodaburdaro eçod mekunad', |
| 491 | + 'spl3_debug' => 'Qimati noşinos baroi ixtijori $1.', |
| 492 | + 'spl3_nosubpages' => '$1 doroi heç zersahifahoe baroi fehristkunī nest.', |
| 493 | +); |
| 494 | + |
| 495 | +/** Tagalog (Tagalog) |
| 496 | + * @author AnakngAraw |
| 497 | + */ |
| 498 | +$messages['tl'] = array( |
| 499 | + 'spl3-desc' => 'Kusang lumilikha ng isang talaan ng kabahaging mga pahina ng isang pahina na gumagamit ng tatak na <code><nowiki><splist /></nowiki></code>', |
| 500 | + 'spl3_debug' => 'Hindi nalalamang halaga para sa pagpipiliang $1.', |
| 501 | + 'spl3_nosubpages' => 'Walang maitatalang kabahaging mga pahina ang $1.', |
| 502 | +); |
| 503 | + |
| 504 | +/** Turkish (Türkçe) |
| 505 | + * @author Vito Genovese |
| 506 | + */ |
| 507 | +$messages['tr'] = array( |
| 508 | + 'spl3-desc' => '<code><nowiki><splist /></nowiki></code> etiketi kullanılarak otomatik olarak bir sayfaya ait altsayfaların listesini oluşturur', |
| 509 | + 'spl3_debug' => '$1 seçeneği için bilinmeyen değer.', |
| 510 | + 'spl3_nosubpages' => '$1, listelenecek altsayfalara sahip değil.', |
| 511 | +); |
| 512 | + |
| 513 | +/** Ukrainian (Українська) |
| 514 | + * @author Тест |
| 515 | + */ |
| 516 | +$messages['uk'] = array( |
| 517 | + 'spl3-desc' => 'Автоматично створює список підсторінок сторінки за допомогою тегу <code><nowiki><splist /></nowiki></code>', |
| 518 | + 'spl3_debug' => 'Невідоме значення параметра $1.', |
| 519 | + 'spl3_nosubpages' => '$1 не має підсторінок для складання списку.', |
| 520 | +); |
| 521 | + |
| 522 | +/** Vèneto (Vèneto) |
| 523 | + * @author Candalua |
| 524 | + */ |
| 525 | +$messages['vec'] = array( |
| 526 | + 'spl3-desc' => 'Crea automaticamente na lista de le sotopagine de na pagine doparando el tag <code><nowiki><splist /></nowiki></code>', |
| 527 | + 'spl3_debug' => "Valor sconossiùo par l'opsion $1.", |
| 528 | + 'spl3_nosubpages' => '$1 no la gà sotopagine da elencar.', |
| 529 | +); |
| 530 | + |
| 531 | +/** Vietnamese (Tiếng Việt) |
| 532 | + * @author Vinhtantran |
| 533 | + */ |
| 534 | +$messages['vi'] = array( |
| 535 | + 'spl3-desc' => 'Tự động tạo danh sách các trang con của một trang nào đó bằng cách sử dụng thẻ <code><nowiki><splist /></nowiki></code>', |
| 536 | + 'spl3_debug' => 'Giá trị không rõ đối với tùy chọn $1.', |
| 537 | + 'spl3_nosubpages' => '$1 không có trang con nào cả.', |
| 538 | +); |
| 539 | + |
| 540 | +/** Volapük (Volapük) |
| 541 | + * @author Smeira |
| 542 | + */ |
| 543 | +$messages['vo'] = array( |
| 544 | + 'spl3_nosubpages' => 'Pad: $1 no labon donapadis ad palisedön.', |
| 545 | +); |
| 546 | + |
| 547 | +/** Simplified Chinese (中文(简体)) |
| 548 | + * @author Gzdavidwong |
| 549 | + * @author Liangent |
| 550 | + */ |
| 551 | +$messages['zh-hans'] = array( |
| 552 | + 'spl3_debug' => '未知的选项$1的数值', |
| 553 | + 'spl3_nosubpages' => '$1没有子页面来显示', |
| 554 | +); |
| 555 | + |
| 556 | +/** Traditional Chinese (中文(繁體)) |
| 557 | + * @author Liangent |
| 558 | + * @author Mark85296341 |
| 559 | + * @author Wrightbus |
| 560 | + */ |
| 561 | +$messages['zh-hant'] = array( |
| 562 | + 'spl3_debug' => '不明的選項 $1 的設定值', |
| 563 | + 'spl3_nosubpages' => '$1 沒有子頁面來顯示', |
| 564 | +); |
| 565 | + |
Property changes on: branches/wmf/1.17wmf1/extensions/SubPageList3/SubPageList3.i18n.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 566 | + native |
Index: branches/wmf/1.17wmf1/extensions/SubPageList3/SubPageList3.php |
— | — | @@ -0,0 +1,510 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Add a <splist /> tag which produces a linked list of all subpages of the current page |
| 5 | + * |
| 6 | + * @file |
| 7 | + * @ingroup Extensions |
| 8 | + * @author James McCormack (email: user "qedoc" at hotmail); preceding version Martin Schallnahs <myself@schaelle.de>, original Rob Church <robchur@gmail.com> |
| 9 | + * @copyright © 2008 James McCormack, preceding version Martin Schallnahs, original Rob Church |
| 10 | + * @licence GNU General Public Licence 2.0 or later |
| 11 | + * @link http://www.mediawiki.org/wiki/Extension:SubPageList3 |
| 12 | + * |
| 13 | + */ |
| 14 | + |
| 15 | +if( !defined( 'MEDIAWIKI' ) ) { |
| 16 | + echo( "This file is an extension to the MediaWiki software and cannot be used standalone.\n" ); |
| 17 | + die( 1 ); |
| 18 | +} |
| 19 | + |
| 20 | +$wgHooks['ParserFirstCallInit'][] = 'efSubpageList3'; |
| 21 | +$wgExtensionCredits['parserhook'][] = array( |
| 22 | + 'path' => __FILE__, |
| 23 | + 'name' => 'Subpage List 3', |
| 24 | + 'version' => '1.1', |
| 25 | + 'descriptionmsg' => 'spl3-desc', |
| 26 | + 'url' => 'http://www.mediawiki.org/wiki/Extension:SubPageList3', |
| 27 | + 'author' => array( |
| 28 | + 'James McCormack', |
| 29 | + 'Martin Schallnahs', |
| 30 | + 'Rob Church' |
| 31 | + ), |
| 32 | +); |
| 33 | + |
| 34 | +$dir = dirname(__FILE__) . '/'; |
| 35 | +$wgExtensionMessagesFiles['SubPageList3'] = $dir . 'SubPageList3.i18n.php'; |
| 36 | + |
| 37 | +/** |
| 38 | + * Hook in function |
| 39 | + * |
| 40 | + * @param $parser Parser |
| 41 | + */ |
| 42 | +function efSubpageList3( &$parser ) { |
| 43 | + $parser->setHook( 'splist', 'efRenderSubpageList3' ); |
| 44 | + return true; |
| 45 | +} |
| 46 | + |
| 47 | +/** |
| 48 | + * Function called by the Hook, returns the wiki text |
| 49 | + */ |
| 50 | +function efRenderSubpageList3( $input, $args, $parser ) { |
| 51 | + $list = new SubpageList3( $parser ); |
| 52 | + $list->options( $args ); |
| 53 | + |
| 54 | + # $parser->disableCache(); |
| 55 | + return $list->render(); |
| 56 | +} |
| 57 | + |
| 58 | +/** |
| 59 | + * SubPageList3 class |
| 60 | + */ |
| 61 | +class SubpageList3 { |
| 62 | + |
| 63 | + /** |
| 64 | + * @var Parser |
| 65 | + */ |
| 66 | + private $parser; |
| 67 | + |
| 68 | + |
| 69 | + /** |
| 70 | + * @var Title |
| 71 | + */ |
| 72 | + private $title; |
| 73 | + |
| 74 | + /** |
| 75 | + * @var Title |
| 76 | + */ |
| 77 | + private $ptitle; |
| 78 | + |
| 79 | + /** |
| 80 | + * @var string |
| 81 | + */ |
| 82 | + private $namespace = ''; |
| 83 | + |
| 84 | + /** |
| 85 | + * @var string token object |
| 86 | + */ |
| 87 | + private $token = '*'; |
| 88 | + |
| 89 | + /** |
| 90 | + * @var Language |
| 91 | + */ |
| 92 | + private $language; |
| 93 | + |
| 94 | + /** |
| 95 | + * @var int error display on or off |
| 96 | + * @default 0 hide errors |
| 97 | + */ |
| 98 | + private $debug = 0; |
| 99 | + |
| 100 | + /** |
| 101 | + * contain the error messages |
| 102 | + * @var array contain the errors messages |
| 103 | + */ |
| 104 | + private $errors = array(); |
| 105 | + |
| 106 | + /** |
| 107 | + * order type |
| 108 | + * Can be: |
| 109 | + * - asc |
| 110 | + * - desc |
| 111 | + * @var string order type |
| 112 | + */ |
| 113 | + private $order = 'asc'; |
| 114 | + |
| 115 | + /** |
| 116 | + * column thats used as order method |
| 117 | + * Can be: |
| 118 | + * - title: alphabetic order of a page title |
| 119 | + * - lastedit: Timestamp numeric order of the last edit of a page |
| 120 | + * @var string order method |
| 121 | + * @private |
| 122 | + */ |
| 123 | + private $ordermethod = 'title'; |
| 124 | + |
| 125 | + /** |
| 126 | + * mode of the output |
| 127 | + * Can be: |
| 128 | + * - unordered: UL list as output |
| 129 | + * - ordered: OL list as output |
| 130 | + * - bar: uses · as a delimiter producing a horizontal bar menu |
| 131 | + * @var string mode of output |
| 132 | + * @default unordered |
| 133 | + */ |
| 134 | + private $mode = 'unordered'; |
| 135 | + |
| 136 | + /** |
| 137 | + * parent of the listed pages |
| 138 | + * Can be: |
| 139 | + * - -1: the current page title |
| 140 | + * - string: title of the specific title |
| 141 | + * e.g. if you are in Mainpage/ it will list all subpages of Mainpage/ |
| 142 | + * @var mixed parent of listed pages |
| 143 | + * @default -1 current |
| 144 | + */ |
| 145 | + private $parent = -1; |
| 146 | + |
| 147 | + /** |
| 148 | + * style of the path (title) |
| 149 | + * Can be: |
| 150 | + * - full: normal, e.g. Mainpage/Entry/Sub |
| 151 | + * - notparent: the path without the $parent item, e.g. Entry/Sub |
| 152 | + * - no: no path, only the page title, e.g. Sub |
| 153 | + * @var string style of the path (title) |
| 154 | + * @default normal |
| 155 | + * @see $parent |
| 156 | + */ |
| 157 | + private $showpath = 'no'; |
| 158 | + |
| 159 | + /** |
| 160 | + * whether to show next sublevel only, or all sublevels |
| 161 | + * Can be: |
| 162 | + * - 0 / no / false |
| 163 | + * - 1 / yes / true |
| 164 | + * @var mixed show one sublevel only |
| 165 | + * @default 0 |
| 166 | + * @see $parent |
| 167 | + */ |
| 168 | + private $kidsonly = 0; |
| 169 | + |
| 170 | + /** |
| 171 | + * whether to show parent as the top item |
| 172 | + * Can be: |
| 173 | + * - 0 / no / false |
| 174 | + * - 1 / yes / true |
| 175 | + * @var mixed show one sublevel only |
| 176 | + * @default 0 |
| 177 | + * @see $parent |
| 178 | + */ |
| 179 | + private $showparent = 0; |
| 180 | + |
| 181 | + /** |
| 182 | + * Constructor function of the class |
| 183 | + * @param $parser Parser the parser object |
| 184 | + * @global $wgContLang |
| 185 | + * @see SubpageList |
| 186 | + * @private |
| 187 | + */ |
| 188 | + function __construct( $parser ) { |
| 189 | + global $wgContLang; |
| 190 | + $this->parser = $parser; |
| 191 | + $this->title = $parser->mTitle; |
| 192 | + $this->language = $wgContLang; |
| 193 | + } |
| 194 | + |
| 195 | + /** |
| 196 | + * adds error to the $errors container |
| 197 | + * but only if $debug is true or 1 |
| 198 | + * @param string $message the errors message |
| 199 | + * @see $errors |
| 200 | + * @see $debug |
| 201 | + * @private |
| 202 | + */ |
| 203 | + function error( $message ) { |
| 204 | + if ( $this->debug ) { |
| 205 | + $this->errors[] = "<strong>Error [Subpage List 3]:</strong> $message"; |
| 206 | + } |
| 207 | + } |
| 208 | + |
| 209 | + /** |
| 210 | + * returns all errors as a string |
| 211 | + * @return string all errors separated by a newline |
| 212 | + * @private |
| 213 | + */ |
| 214 | + function geterrors() { |
| 215 | + return implode( "\n", $this->errors ); |
| 216 | + } |
| 217 | + |
| 218 | + /** |
| 219 | + * parse the options that the user has entered |
| 220 | + * a bit long way, but because that it's easy to add alias |
| 221 | + * @param array $options the options inserts by the user as array |
| 222 | + * @see $debug |
| 223 | + * @see $order |
| 224 | + * @see $ordermethod |
| 225 | + * @see $mode |
| 226 | + * @see $parent |
| 227 | + * @see $showpath |
| 228 | + * @see $kidsonly |
| 229 | + * @see $showparent |
| 230 | + * @private |
| 231 | + */ |
| 232 | + function options( $options ) { |
| 233 | + if( isset( $options['debug'] ) ) { |
| 234 | + if( $options['debug'] == 'true' || intval( $options['debug'] ) == 1 ) { |
| 235 | + $this->debug = 1; |
| 236 | + } elseif( $options['debug'] == 'false' || intval( $options['debug'] ) == 0 ) { |
| 237 | + $this->debug = 0; |
| 238 | + } else { |
| 239 | + $this->error( wfMsg('spl3_debug','debug') ); |
| 240 | + } |
| 241 | + } |
| 242 | + if( isset( $options['sort'] ) ) { |
| 243 | + if( strtolower( $options['sort'] ) == 'asc' ) { |
| 244 | + $this->order = 'asc'; |
| 245 | + } elseif( strtolower( $options['sort'] ) == 'desc' ) { |
| 246 | + $this->order = 'desc'; |
| 247 | + } else { |
| 248 | + $this->error( wfMsg('spl3_debug','sort') ); |
| 249 | + } |
| 250 | + } |
| 251 | + if( isset( $options['sortby'] ) ) { |
| 252 | + switch( strtolower( $options['sortby'] ) ) { |
| 253 | + case 'title': |
| 254 | + $this->ordermethod = 'title'; |
| 255 | + break; |
| 256 | + case 'lastedit': |
| 257 | + $this->ordermethod = 'lastedit'; |
| 258 | + break; |
| 259 | + default: |
| 260 | + $this->error( wfMsg('spl3_debug','sortby') ); |
| 261 | + } |
| 262 | + } |
| 263 | + if( isset( $options['liststyle'] ) ) { |
| 264 | + switch( strtolower( $options['liststyle'] ) ) { |
| 265 | + case 'ordered': |
| 266 | + $this->mode = 'ordered'; |
| 267 | + $this->token = '#'; |
| 268 | + break; |
| 269 | + case 'unordered': |
| 270 | + $this->mode = 'unordered'; |
| 271 | + $this->token = '*'; |
| 272 | + break; |
| 273 | + case 'bar': |
| 274 | + $this->mode = 'bar'; |
| 275 | + $this->token = ' · '; |
| 276 | + break; |
| 277 | + default: |
| 278 | + $this->error( wfMsg('spl3_debug','liststyle') ); |
| 279 | + } |
| 280 | + } |
| 281 | + if( isset( $options['parent'] ) ) { |
| 282 | + if( intval( $options['parent'] ) == -1 ) { |
| 283 | + $this->parent = -1; |
| 284 | + } elseif( is_string( $options['parent'] ) ) { |
| 285 | + $this->parent = $options['parent']; |
| 286 | + } else { |
| 287 | + $this->error( wfMsg('spl3_debug','parent') ); |
| 288 | + } |
| 289 | + } |
| 290 | + if( isset( $options['showpath'] ) ) { |
| 291 | + switch( strtolower( $options['showpath'] ) ) { |
| 292 | + case 'no': |
| 293 | + case '0': |
| 294 | + case 'false': |
| 295 | + $this->showpath = 'no'; |
| 296 | + break; |
| 297 | + case 'notparent': |
| 298 | + $this->showpath = 'notparent'; |
| 299 | + break; |
| 300 | + case 'full': |
| 301 | + case 'yes': |
| 302 | + case '1': |
| 303 | + case 'true': |
| 304 | + $this->showpath = 'full'; |
| 305 | + break; |
| 306 | + default: |
| 307 | + $this->error( wfMsg('spl3_debug','showpath') ); |
| 308 | + } |
| 309 | + } |
| 310 | + if( isset( $options['kidsonly'] ) ) { |
| 311 | + if( $options['kidsonly'] == 'true' || $options['kidsonly'] == 'yes' || intval( $options['kidsonly'] ) == 1 ) { |
| 312 | + $this->kidsonly = 1; |
| 313 | + } elseif( $options['kidsonly'] == 'false' || $options['kidsonly'] == 'no' || intval( $options['kidsonly'] ) == 0 ) { |
| 314 | + $this->kidsonly = 0; |
| 315 | + } else { |
| 316 | + $this->error( wfMsg('spl3_debug','kidsonly') ); |
| 317 | + } |
| 318 | + } |
| 319 | + if( isset( $options['showparent'] ) ) { |
| 320 | + if( $options['showparent'] == 'true' || $options['showparent'] == 'yes' || intval( $options['showparent'] ) == 1 ) { |
| 321 | + $this->showparent = 1; |
| 322 | + } elseif( $options['showparent'] == 'false' || $options['showparent'] == 'no' || intval( $options['showparent'] ) == 0 ) { |
| 323 | + $this->showparent = 0; |
| 324 | + } else { |
| 325 | + $this->error( wfMsg('spl3_debug','showparent') ); |
| 326 | + } |
| 327 | + } |
| 328 | + } |
| 329 | + |
| 330 | + /** |
| 331 | + * produce output using this class |
| 332 | + * @return string html output |
| 333 | + * @private |
| 334 | + */ |
| 335 | + function render() { |
| 336 | + wfProfileIn( __METHOD__ ); |
| 337 | + $pages = $this->getTitles(); |
| 338 | + if( $pages != null && count( $pages ) > 0 ) { |
| 339 | + $list = $this->makeList( $pages ); |
| 340 | + $html = $this->parse( $list ); |
| 341 | + } else { |
| 342 | + $plink = "[[" . $this->parent . "]]"; |
| 343 | + $out = "''" . wfMsg('spl3_nosubpages', $plink) . "''\n"; |
| 344 | + $html = $this->parse( $out ); |
| 345 | + } |
| 346 | + $html = $this->geterrors() . $html; |
| 347 | + wfProfileOut( __METHOD__ ); |
| 348 | + return "<div class=\"subpagelist\">{$html}</div>"; |
| 349 | + } |
| 350 | + |
| 351 | + /** |
| 352 | + * return the page titles of the subpages in an array |
| 353 | + * @return array all titles |
| 354 | + * @private |
| 355 | + */ |
| 356 | + function getTitles() { |
| 357 | + wfProfileIn( __METHOD__ ); |
| 358 | + |
| 359 | + $dbr = wfGetDB( DB_SLAVE ); |
| 360 | + |
| 361 | + $conditions = array(); |
| 362 | + $options = array(); |
| 363 | + $order = strtoupper( $this->order ); |
| 364 | + |
| 365 | + if( $this->ordermethod == 'title' ) { |
| 366 | + $options['ORDER BY'] = 'page_title' . $order; |
| 367 | + } elseif( $this->ordermethod == 'lastedit' ) { |
| 368 | + $options['ORDER BY'] = 'page_touched ' . $order; |
| 369 | + } |
| 370 | + if( $this->parent !== -1) { |
| 371 | + $this->ptitle = Title::newFromText( $this->parent ); |
| 372 | + # note that non-existent pages may nevertheless have valid subpages |
| 373 | + # on the other hand, not checking that the page exists can let input through which causes database errors |
| 374 | + if ( $this->ptitle instanceof Title && $this->ptitle->exists() && $this->ptitle->userCanRead() ) { |
| 375 | + $parent = $this->ptitle->getDBkey(); |
| 376 | + $this->parent = $parent; |
| 377 | + $this->namespace = $this->ptitle->getNsText(); |
| 378 | + $nsi = $this->ptitle->getNamespace(); |
| 379 | + } else { |
| 380 | + $this->error( wfMsg('spl3_debug','parent') ); |
| 381 | + return null; |
| 382 | + } |
| 383 | + } else { |
| 384 | + $this->ptitle = $this->title; |
| 385 | + $parent = $this->title->getDBkey(); |
| 386 | + $this->parent = $parent; |
| 387 | + $this->namespace = $this->title->getNsText(); |
| 388 | + $nsi = $this->title->getNamespace(); |
| 389 | + } |
| 390 | + |
| 391 | + // don't let list cross namespaces |
| 392 | + if ( strlen( $nsi ) > 0 ) { |
| 393 | + $conditions['page_namespace'] = $nsi; |
| 394 | + } |
| 395 | + $conditions['page_is_redirect'] = 0; |
| 396 | + $conditions[] = 'page_title ' . $dbr->buildLike( $parent . '/', $dbr->anyString() ); |
| 397 | + |
| 398 | + $fields = array(); |
| 399 | + $fields[] = 'page_title'; |
| 400 | + $fields[] = 'page_namespace'; |
| 401 | + $res = $dbr->select( 'page', $fields, $conditions, __METHOD__, $options ); |
| 402 | + |
| 403 | + $titles = array(); |
| 404 | + foreach ( $res as $row ) { |
| 405 | + $title = Title::makeTitleSafe( $row->page_namespace, $row->page_title ); |
| 406 | + if( $title ) { |
| 407 | + $titles[] = $title; |
| 408 | + } |
| 409 | + } |
| 410 | + wfProfileOut( __METHOD__ ); |
| 411 | + return $titles; |
| 412 | + } |
| 413 | + |
| 414 | + /** |
| 415 | + * create one list item |
| 416 | + * cases: |
| 417 | + * - full: full, e.g. Mainpage/Entry/Sub |
| 418 | + * - notparent: the path without the $parent item, e.g. Entry/Sub |
| 419 | + * - no: no path, only the page title, e.g. Sub |
| 420 | + * @param $title Title the title of a page |
| 421 | + * @return string the prepared string |
| 422 | + * @see $showpath |
| 423 | + */ |
| 424 | + function makeListItem( $title ) { |
| 425 | + switch( $this->showpath ) { |
| 426 | + case 'no': |
| 427 | + $linktitle = substr( strrchr( $title->getText(), "/" ), 1 ); |
| 428 | + break; |
| 429 | + case 'notparent': |
| 430 | + $linktitle = substr( strstr( $title->getText(), "/" ), 1 ); |
| 431 | + break; |
| 432 | + case 'full': |
| 433 | + $linktitle = $title->getText(); |
| 434 | + } |
| 435 | + return ' [[' . $title->getPrefixedText() . '|' . $linktitle . ']]'; |
| 436 | + } |
| 437 | + |
| 438 | + /** |
| 439 | + * create whole list using makeListItem |
| 440 | + * @param $titles Array all page titles |
| 441 | + * @param $token string the token symbol: |
| 442 | + * - * for ul, |
| 443 | + * - # for ol |
| 444 | + * - · for horizontal lists |
| 445 | + * @return string the whole list |
| 446 | + * @see SubPageList::makeListItem |
| 447 | + */ |
| 448 | + function makeList( $titles ) { |
| 449 | + $c = 0; |
| 450 | + # add parent item |
| 451 | + if ($this->showparent) { |
| 452 | + $pn = '[[' . $this->ptitle->getPrefixedText() .'|'. $this->ptitle->getText() .']]'; |
| 453 | + if( $this->mode != 'bar' ) { |
| 454 | + $pn = $this->token . $pn; |
| 455 | + } |
| 456 | + $ss = trim($pn); |
| 457 | + $list[] = $ss; |
| 458 | + $c++; // flag for bar token to be added on next item |
| 459 | + } |
| 460 | + # add descendents |
| 461 | + $parlv = substr_count($this->ptitle->getPrefixedText(), '/'); |
| 462 | + $list = array(); |
| 463 | + foreach( $titles as $title ) { |
| 464 | + $lv = substr_count($title, '/') - $parlv; |
| 465 | + if ( $this->kidsonly!=1 || $lv < 2 ) { |
| 466 | + if ($this->showparent) { |
| 467 | + $lv++; |
| 468 | + } |
| 469 | + $ss = ""; |
| 470 | + if( $this->mode == 'bar' ) { |
| 471 | + if( $c>0) { |
| 472 | + $ss .= $this->token; |
| 473 | + } |
| 474 | + } else { |
| 475 | + for ( $i = 0; $i < $lv; $i++ ) { |
| 476 | + $ss .= $this->token; |
| 477 | + } |
| 478 | + } |
| 479 | + $ss .= $this->makeListItem( $title ); |
| 480 | + $ss = trim( $ss ); // make sure we don't get any <pre></pre> tags |
| 481 | + $list[] = $ss; |
| 482 | + } |
| 483 | + $c++; |
| 484 | + if ( $c > 200 ) { |
| 485 | + break; |
| 486 | + } |
| 487 | + } |
| 488 | + $retval = ''; |
| 489 | + if( count( $list ) > 0 ) { |
| 490 | + $retval = implode( "\n", $list ); |
| 491 | + if ( $this->mode == 'bar' ) { |
| 492 | + $retval = implode( "", $list ); |
| 493 | + } |
| 494 | + } |
| 495 | + |
| 496 | + return $retval; |
| 497 | + } |
| 498 | + |
| 499 | + /** |
| 500 | + * Wrapper function parse, call the other functions |
| 501 | + * @param string $text the content |
| 502 | + * @return string the parsed output |
| 503 | + */ |
| 504 | + function parse( $text ) { |
| 505 | + wfProfileIn( __METHOD__ ); |
| 506 | + $output = $this->parser->recursiveTagParse( $text ); |
| 507 | + wfProfileOut( __METHOD__ ); |
| 508 | + return $output->getText(); |
| 509 | + } |
| 510 | + |
| 511 | +} |
Property changes on: branches/wmf/1.17wmf1/extensions/SubPageList3/SubPageList3.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 512 | + native |