Index: tags/extensions/SemanticFormsInputs/REL_0_5/SemanticFormsInputs.i18n.php |
— | — | @@ -0,0 +1,816 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Language file for Semantic Forms Inputs |
| 5 | + */ |
| 6 | + |
| 7 | +$messages = array(); |
| 8 | + |
| 9 | +$messages['en'] = array( |
| 10 | + 'semanticformsinputs-desc' => 'Additional input types for [http://www.mediawiki.org/wiki/Extension:Semantic_Forms Semantic Forms]', |
| 11 | + 'semanticformsinputs-wrongformat' => 'Wrong format.', |
| 12 | + 'semanticformsinputs-close' => 'Close', |
| 13 | + 'semanticformsinputs-prev' => 'Previous', |
| 14 | + 'semanticformsinputs-next' => 'Next', |
| 15 | + 'semanticformsinputs-today' => 'Today', |
| 16 | + 'semanticformsinputs-dateformatlong' => 'd MM yy', // see http://docs.jquery.com/UI/Datepicker/formatDate |
| 17 | + 'semanticformsinputs-dateformatshort' => 'dd/mm/yy', // see http://docs.jquery.com/UI/Datepicker/formatDate |
| 18 | + 'semanticformsinputs-firstdayofweek' => '0', // 0 - sunday, 1 - monday... |
| 19 | + 'semanticformsinputs-malformedregexp' => 'Malformed regular expression ($1).', |
| 20 | + |
| 21 | + 'semanticformsinputs-datepicker-dateformat' => 'The date format string. See the [http://www.mediawiki.org/w/index.php?title=Extension:Semantic_Forms_Inputs&fromsection=Date_picker#Parameters online documentation] for more information.', |
| 22 | + 'semanticformsinputs-datepicker-weekstart' => 'The first day of the week (0 - Sunday, 1 - Monday, ...).', |
| 23 | + 'semanticformsinputs-datepicker-firstdate' => 'The first date that can be chosen (in yyyy/mm/dd format).', |
| 24 | + 'semanticformsinputs-datepicker-lastdate' => 'The last date that can be chosen (in yyyy/mm/dd format).', |
| 25 | + 'semanticformsinputs-datepicker-disabledaysofweek' => 'A list of days that can not be selected (e.g. weekend: 6, 0).', |
| 26 | + 'semanticformsinputs-datepicker-highlightdaysofweek' => 'A list of days that shall appear highlighted (e.g. weekend: 6, 0).', |
| 27 | + 'semanticformsinputs-datepicker-disabledates' => 'A comma-separated list of disabled dates/date ranges (dates in yyyy/mm/dd format, ranges in yyyy/mm/dd-yyyy/mm/dd format).', |
| 28 | + 'semanticformsinputs-datepicker-highlightdates' => 'A comma-separated list of dates/date ranges that shall appear highlighted (dates in yyyy/mm/dd format, ranges in yyyy/mm/dd-yyyy/mm/dd format).', |
| 29 | + 'semanticformsinputs-datepicker-showweeknumbers' => 'Should week numbers be shown left of the week?', |
| 30 | + 'semanticformsinputs-datepicker-enableinputfield' => 'Should the user be able to fill the input field directly or only via the date picker?', |
| 31 | + 'semanticformsinputs-datepicker-showresetbutton' => 'Should a reset button be shown? This is the only way for the user to erase the input field if it is disabled for direct input.', |
| 32 | + |
| 33 | + 'semanticformsinputs-timepicker-mintime' => 'The earliest time to show. Format: hh:mm', |
| 34 | + 'semanticformsinputs-timepicker-maxtime' => 'The latest time to show. Format: hh:mm', |
| 35 | + 'semanticformsinputs-timepicker-interval' => 'Interval between minutes. Number between 1 and 60.', |
| 36 | + 'semanticformsinputs-timepicker-enableinputfield' => 'Should the user be able to fill the input field directly or only via the date picker?', |
| 37 | + 'semanticformsinputs-timepicker-showresetbutton' => 'Should a reset button be shown? This is the only way for the user to erase the input field if it is disabled for direct input.', |
| 38 | + |
| 39 | + 'semanticformsinputs-regexp-regexp' => 'The regular expression the input has to match to be valid. This must be given including the slashes! Defaults to "/.*/", i.e. any value.', |
| 40 | + 'semanticformsinputs-regexp-basetype' => 'The base type to be used. May be any input type that generates an html form element of type input or select (e.g. text, listbox, datepicker) or another regexp. Defaults to "text".', |
| 41 | + 'semanticformsinputs-regexp-baseprefix' => 'Prefix for the parameters of the base type.', |
| 42 | + 'semanticformsinputs-regexp-orchar' => 'The OR-character to be used in the regular expression instead of |. Defaults to "!"', |
| 43 | + 'semanticformsinputs-regexp-inverse' => 'If set, the input must NOT match the regular expression to be valid. I.e. the regular expression is inverted.', |
| 44 | + 'semanticformsinputs-regexp-message' => 'The error message to be displayed if the match fails. Defaults to "Wrong format!" (or equivalent in the current locale)', |
| 45 | + |
| 46 | + 'semanticformsinputs-menuselect-structure' => 'The menu structure as an unordered list.', |
| 47 | + 'semanticformsinputs-menuselect-enableinputfield' => 'Should the user be able to fill the input field directly?', |
| 48 | + ); |
| 49 | + |
| 50 | +/** Message documentation (Message documentation) |
| 51 | + * @author EugeneZelenko |
| 52 | + * @author F.trott |
| 53 | + * @author Siebrand |
| 54 | + * @author The Evil IP address |
| 55 | + */ |
| 56 | +$messages['qqq'] = array( |
| 57 | + 'semanticformsinputs-desc' => '{{desc}}', |
| 58 | + 'semanticformsinputs-close' => '{{Identical|Close}}', |
| 59 | + 'semanticformsinputs-prev' => '{{Identical|Previous}}', |
| 60 | + 'semanticformsinputs-next' => '{{Identical|Next}}', |
| 61 | + 'semanticformsinputs-dateformatlong' => "{{doc-important|This is a machine-readable date format string!| <br>It is used by a function to format a date. It will not be read by a human user. Do not translate each letter literally! Instead insert the date format for your language using the english-based letters. See http://docs.jquery.com/UI/Datepicker/formatDate }} |
| 62 | + |
| 63 | +{{doc-important|This is an ''optional'' message. Do not translate it, if it would remain unchanged in your language. }}", |
| 64 | + 'semanticformsinputs-dateformatshort' => "{{doc-important|This is a machine-readable date format string!| <br>It is used by a function to format a date. It will not be read by a human user. Do not translate each letter literally! Instead insert the date format for your language using the english-based letters. See http://docs.jquery.com/UI/Datepicker/formatDate }} |
| 65 | + |
| 66 | +{{doc-important|This is an ''optional'' message. Do not translate it, if it would remain unchanged in your language. }}", |
| 67 | + 'semanticformsinputs-firstdayofweek' => '0 - sunday, 1 - monday...', |
| 68 | + 'semanticformsinputs-malformedregexp' => 'An error message.', |
| 69 | + |
| 70 | + 'semanticformsinputs-datepicker-dateformat' => 'This is a help text for the Special:CreateForm page.', |
| 71 | + 'semanticformsinputs-datepicker-weekstart' => 'This is a help text for the Special:CreateForm page.', |
| 72 | + 'semanticformsinputs-datepicker-firstdate' => 'This is a help text for the Special:CreateForm page.', |
| 73 | + 'semanticformsinputs-datepicker-lastdate' => 'This is a help text for the Special:CreateForm page.', |
| 74 | + 'semanticformsinputs-datepicker-disabledaysofweek' => 'This is a help text for the Special:CreateForm page.', |
| 75 | + 'semanticformsinputs-datepicker-highlightdaysofweek' => 'This is a help text for the Special:CreateForm page.', |
| 76 | + 'semanticformsinputs-datepicker-disabledates' => 'This is a help text for the Special:CreateForm page.', |
| 77 | + 'semanticformsinputs-datepicker-highlightdates' => 'This is a help text for the Special:CreateForm page.', |
| 78 | + 'semanticformsinputs-datepicker-showweeknumbers' => 'This is a help text for the Special:CreateForm page.', |
| 79 | + 'semanticformsinputs-datepicker-enableinputfield' => 'This is a help text for the Special:CreateForm page.', |
| 80 | + 'semanticformsinputs-datepicker-showresetbutton' => 'This is a help text for the Special:CreateForm page.', |
| 81 | + |
| 82 | + 'semanticformsinputs-timepicker-mintime' => 'This is a help text for the Special:CreateForm page.', |
| 83 | + 'semanticformsinputs-timepicker-maxtime' => 'This is a help text for the Special:CreateForm page.', |
| 84 | + 'semanticformsinputs-timepicker-interval' => 'This is a help text for the Special:CreateForm page.', |
| 85 | + 'semanticformsinputs-timepicker-enableinputfield' => 'This is a help text for the Special:CreateForm page.', |
| 86 | + 'semanticformsinputs-timepicker-showresetbutton' => 'This is a help text for the Special:CreateForm page.', |
| 87 | + |
| 88 | + 'semanticformsinputs-regexp-regexp' => 'This is a help text for the Special:CreateForm page.', |
| 89 | + 'semanticformsinputs-regexp-basetype' => 'This is a help text for the Special:CreateForm page.', |
| 90 | + 'semanticformsinputs-regexp-baseprefix' => 'This is a help text for the Special:CreateForm page.', |
| 91 | + 'semanticformsinputs-regexp-orchar' => 'This is a help text for the Special:CreateForm page.', |
| 92 | + 'semanticformsinputs-regexp-inverse' => 'This is a help text for the Special:CreateForm page.', |
| 93 | + 'semanticformsinputs-regexp-message' => 'This is a help text for the Special:CreateForm page.', |
| 94 | + |
| 95 | + 'semanticformsinputs-menuselect-structure' => 'This is a help text for the Special:CreateForm page.', |
| 96 | + 'semanticformsinputs-menuselect-enableinputfield' => 'This is a help text for the Special:CreateForm page.', |
| 97 | +); |
| 98 | + |
| 99 | +/** Message documentation (Message documentation) |
| 100 | + * @author EugeneZelenko |
| 101 | + * @author F.trott |
| 102 | + * @author The Evil IP address |
| 103 | + * @author Umherirrender |
| 104 | + */ |
| 105 | +$messages['qqq'] = array( |
| 106 | + 'semanticformsinputs-desc' => '{{desc}}', |
| 107 | + 'semanticformsinputs-close' => '{{Identical|Close}}', |
| 108 | + 'semanticformsinputs-prev' => '{{Identical|Previous}}', |
| 109 | + 'semanticformsinputs-next' => '{{Identical|Next}}', |
| 110 | + 'semanticformsinputs-dateformatlong' => "{{doc-important|This is a machine-readable date format string!| <br>It is used by a function to format a date. It will not be read by a human user. Do not translate each letter literally! Instead insert the date format for your language using the english-based letters. See http://docs.jquery.com/UI/Datepicker/formatDate }} |
| 111 | + |
| 112 | +{{doc-important|This is an ''optional'' message. Do not translate it, if it would remain unchanged in your language. }}", |
| 113 | + 'semanticformsinputs-dateformatshort' => "{{doc-important|This is a machine-readable date format string!| <br>It is used by a function to format a date. It will not be read by a human user. Do not translate each letter literally! Instead insert the date format for your language using the english-based letters. See http://docs.jquery.com/UI/Datepicker/formatDate }} |
| 114 | + |
| 115 | +{{doc-important|This is an ''optional'' message. Do not translate it, if it would remain unchanged in your language. }}", |
| 116 | + 'semanticformsinputs-firstdayofweek' => '{{optional}} |
| 117 | +0 - sunday, 1 - monday...', |
| 118 | +); |
| 119 | + |
| 120 | +/** Afrikaans (Afrikaans) |
| 121 | + * @author Naudefj |
| 122 | + */ |
| 123 | +$messages['af'] = array( |
| 124 | + 'semanticformsinputs-desc' => 'Ekstra invoertipes vir [http://www.mediawiki.org/wiki/Extension:Semantic_Forms Semantic Forms]', |
| 125 | + 'semanticformsinputs-wrongformat' => 'Verkeerde formaat.', |
| 126 | + 'semanticformsinputs-close' => 'Sluit', |
| 127 | + 'semanticformsinputs-prev' => 'Vorige', |
| 128 | + 'semanticformsinputs-next' => 'Volgende', |
| 129 | + 'semanticformsinputs-today' => 'Vandag', |
| 130 | +); |
| 131 | + |
| 132 | +/** Arabic (العربية) |
| 133 | + * @author OsamaK |
| 134 | + */ |
| 135 | +$messages['ar'] = array( |
| 136 | + 'semanticformsinputs-next' => 'التالي', |
| 137 | +); |
| 138 | + |
| 139 | +/** Aramaic (ܐܪܡܝܐ) |
| 140 | + * @author Basharh |
| 141 | + */ |
| 142 | +$messages['arc'] = array( |
| 143 | + 'semanticformsinputs-close' => 'ܣܟܘܪ', |
| 144 | + 'semanticformsinputs-prev' => 'ܩܕܡ', |
| 145 | + 'semanticformsinputs-next' => 'ܒܬܪ', |
| 146 | + 'semanticformsinputs-today' => 'ܝܘܡܢܐ', |
| 147 | +); |
| 148 | + |
| 149 | +/** Asturian (Asturianu) |
| 150 | + * @author Xuacu |
| 151 | + */ |
| 152 | +$messages['ast'] = array( |
| 153 | + 'semanticformsinputs-desc' => "Más tribes d'entrada pa los [http://www.mediawiki.org/wiki/Extension:Semantic_Forms Formularios Semánticos]", |
| 154 | + 'semanticformsinputs-wrongformat' => 'Formatu incorreutu.', |
| 155 | + 'semanticformsinputs-close' => 'Zarrar', |
| 156 | + 'semanticformsinputs-prev' => 'Anterior', |
| 157 | + 'semanticformsinputs-next' => 'Siguiente', |
| 158 | + 'semanticformsinputs-today' => 'Güei', |
| 159 | +); |
| 160 | + |
| 161 | +/** Azerbaijani (Azərbaycanca) |
| 162 | + * @author Cekli829 |
| 163 | + */ |
| 164 | +$messages['az'] = array( |
| 165 | + 'semanticformsinputs-next' => 'Növbəti', |
| 166 | + 'semanticformsinputs-today' => 'Bu gün', |
| 167 | +); |
| 168 | + |
| 169 | +/** Belarusian (Taraškievica orthography) (Беларуская (тарашкевіца)) |
| 170 | + * @author EugeneZelenko |
| 171 | + * @author Jim-by |
| 172 | + */ |
| 173 | +$messages['be-tarask'] = array( |
| 174 | + 'semanticformsinputs-desc' => 'Дадатковыя тыпы ўводу для [http://www.mediawiki.org/wiki/Extension:Semantic_Forms сэмантычных формаў]', |
| 175 | + 'semanticformsinputs-wrongformat' => 'Няслушны фармат.', |
| 176 | + 'semanticformsinputs-close' => 'Закрыць', |
| 177 | + 'semanticformsinputs-prev' => 'Папярэдняе', |
| 178 | + 'semanticformsinputs-next' => 'Наступнае', |
| 179 | + 'semanticformsinputs-today' => 'Сёньня', |
| 180 | +); |
| 181 | + |
| 182 | +/** Bulgarian (Български) |
| 183 | + * @author DCLXVI |
| 184 | + */ |
| 185 | +$messages['bg'] = array( |
| 186 | + 'semanticformsinputs-wrongformat' => 'Грешен формат.', |
| 187 | + 'semanticformsinputs-close' => 'Затваряне', |
| 188 | + 'semanticformsinputs-today' => 'Днес', |
| 189 | +); |
| 190 | + |
| 191 | +/** Bengali (বাংলা) |
| 192 | + * @author Bellayet |
| 193 | + * @author Wikitanvir |
| 194 | + */ |
| 195 | +$messages['bn'] = array( |
| 196 | + 'semanticformsinputs-wrongformat' => 'ভুল বিন্যাস', |
| 197 | + 'semanticformsinputs-close' => 'বন্ধ', |
| 198 | + 'semanticformsinputs-prev' => 'পূর্ববর্তী', |
| 199 | + 'semanticformsinputs-next' => 'পরবর্তী', |
| 200 | + 'semanticformsinputs-today' => 'আজ', |
| 201 | +); |
| 202 | + |
| 203 | +/** Breton (Brezhoneg) |
| 204 | + * @author Gwendal |
| 205 | + * @author Y-M D |
| 206 | + */ |
| 207 | +$messages['br'] = array( |
| 208 | + 'semanticformsinputs-desc' => 'Doareoù moned ouzhpenn evit [http://www.mediawiki.org/wiki/Extension:Semantic_Forms Semantic Forms]', |
| 209 | + 'semanticformsinputs-wrongformat' => 'Furmad fall.', |
| 210 | + 'semanticformsinputs-close' => 'Serriñ', |
| 211 | + 'semanticformsinputs-prev' => 'Kent', |
| 212 | + 'semanticformsinputs-next' => "War-lerc'h", |
| 213 | + 'semanticformsinputs-today' => 'Hiziv', |
| 214 | +); |
| 215 | + |
| 216 | +/** Bosnian (Bosanski) |
| 217 | + * @author CERminator |
| 218 | + */ |
| 219 | +$messages['bs'] = array( |
| 220 | + 'semanticformsinputs-desc' => 'Dodatne vrste unosa za [http://www.mediawiki.org/wiki/Extension:Semantic_Forms Semantičke forme]', |
| 221 | + 'semanticformsinputs-wrongformat' => 'Pogrešan format.', |
| 222 | + 'semanticformsinputs-close' => 'Zatvori', |
| 223 | + 'semanticformsinputs-prev' => 'Prethodno', |
| 224 | + 'semanticformsinputs-next' => 'Slijedeće', |
| 225 | + 'semanticformsinputs-today' => 'Danas', |
| 226 | +); |
| 227 | + |
| 228 | +/** Catalan (Català) |
| 229 | + * @author Toniher |
| 230 | + */ |
| 231 | +$messages['ca'] = array( |
| 232 | + 'semanticformsinputs-desc' => "Tipus d'entrada addicionals per al [http://www.mediawiki.org/wiki/Extension:Semantic_Forms Semantic Forms]", |
| 233 | + 'semanticformsinputs-wrongformat' => 'Format incorrecte.', |
| 234 | + 'semanticformsinputs-close' => 'Tanca', |
| 235 | + 'semanticformsinputs-prev' => 'Anterior', |
| 236 | + 'semanticformsinputs-next' => 'Següent', |
| 237 | + 'semanticformsinputs-today' => 'Avui', |
| 238 | +); |
| 239 | + |
| 240 | +/** Czech (Česky) */ |
| 241 | +$messages['cs'] = array( |
| 242 | + 'semanticformsinputs-close' => 'Zavřít', |
| 243 | + 'semanticformsinputs-prev' => 'Předchozí', |
| 244 | + 'semanticformsinputs-next' => 'Další', |
| 245 | +); |
| 246 | + |
| 247 | +/** German (Deutsch) |
| 248 | + * @author Kghbln |
| 249 | + */ |
| 250 | +$messages['de'] = array( |
| 251 | + 'semanticformsinputs-desc' => 'Ermöglicht zusätzliche Eingabearten für [http://www.mediawiki.org/wiki/Extension:Semantic_Forms Semantic Forms]', |
| 252 | + 'semanticformsinputs-wrongformat' => 'Falsches Format.', |
| 253 | + 'semanticformsinputs-close' => 'Schließen', |
| 254 | + 'semanticformsinputs-prev' => 'Voriger Monat', |
| 255 | + 'semanticformsinputs-next' => 'Nächster Monat', |
| 256 | + 'semanticformsinputs-today' => 'Heute', |
| 257 | + 'semanticformsinputs-dateformatlong' => 'd. MM yy', |
| 258 | + 'semanticformsinputs-dateformatshort' => 'dd.mm.yy', |
| 259 | + 'semanticformsinputs-firstdayofweek' => '1', |
| 260 | + 'semanticformsinputs-datepicker-dateformat' => 'Die Zeichenfolge des Datumsformats. Siehe hierzu die [http://www.mediawiki.org/w/index.php?title=Extension:Semantic_Forms_Inputs&fromsection=Date_picker#Parameters Online-Dokumentation] für weitere Informationen.', |
| 261 | + 'semanticformsinputs-datepicker-weekstart' => 'Der erste Tag der Woche (0 - Sonntag, 1 - Montag, usw.)', |
| 262 | + 'semanticformsinputs-datepicker-firstdate' => 'Das erste auswählbare Datum (im Format JJJJ/MM/TT).', |
| 263 | + 'semanticformsinputs-datepicker-lastdate' => 'Das letzte auswählbare Datum (im Format JJJJ/MM/TT).', |
| 264 | + 'semanticformsinputs-datepicker-disabledaysofweek' => 'Eine Liste der Tage, die nicht ausgewählt werden können (z. B. das Wochenende: 6,0).', |
| 265 | + 'semanticformsinputs-datepicker-highlightdaysofweek' => 'Eine Liste der Tage, die hervorgehoben angezeigt werden sollen (z. B. das Wochenende: 6,0).', |
| 266 | + 'semanticformsinputs-datepicker-disabledates' => 'Eine kommagetrennte Liste deaktivierter Tage/Zeiträume (Tage im Format JJJJ/MM/TT, Zeiträume im Format JJJJ/MM/TT-JJJJ/MM/TT).', |
| 267 | + 'semanticformsinputs-datepicker-highlightdates' => 'Eine kommagetrennte Liste von Tagen/Zeiträumen, die hervorgehoben angezeigt werden sollen (Tage im Format JJJJ/MM/TT, Zeiträume im Format JJJJ/MM/TT-JJJJ/MM/TT).', |
| 268 | + 'semanticformsinputs-datepicker-showweeknumbers' => 'Sollen die Wochennummern Links von der Woche angezeigt werden?', |
| 269 | + 'semanticformsinputs-datepicker-enableinputfield' => 'Sollen die Benutzer die Eingabefelder direkt bearbeiten können, oder nur über die Datumsauswahl?', |
| 270 | + 'semanticformsinputs-datepicker-showresetbutton' => 'Soll eine Schaltfläche zum Zurücksetzen angezeigt werden? Dies ist für die Benutzer die einzige Möglichkeit die Eingabe im Eingabefeld zu entfernen, sofern das direkte Bearbeiten deaktiviert wurde.', |
| 271 | + 'semanticformsinputs-timepicker-mintime' => 'Die früheste anzuzeigende Zeit (im Format hh:mm).', |
| 272 | + 'semanticformsinputs-timepicker-maxtime' => 'Die späteste anzuzeigende Zeit (im Format hh:mm).', |
| 273 | + 'semanticformsinputs-timepicker-interval' => 'Der Intervall zwischen den Minuten (Zahlen zwischen 1 und 60).', |
| 274 | + 'semanticformsinputs-timepicker-enableinputfield' => 'Sollen die Benutzer die Eingabefelder direkt bearbeiten können, oder nur über die Datumsauswahl?', |
| 275 | + 'semanticformsinputs-timepicker-showresetbutton' => 'Soll eine Schaltfläche zum Zurücksetzen angezeigt werden? Dies ist für die Benutzer die einzige Möglichkeit die Eingabe im Eingabefeld zu entfernen, sofern das direkte Bearbeiten deaktiviert wurde.', |
| 276 | + 'semanticformsinputs-regexp-regexp' => 'Der reguläre Ausdruck mit dem die Eingabe übereinstimmen muss, um gültig zu sein. Der Wert muss einschließlich der Schrägstriche angegeben werden. Der Standardwert ist „/.*/“ und bedeutet „alle Werte“.', |
| 277 | + 'semanticformsinputs-regexp-basetype' => 'Der Basiseingabetyp der verwendet werden soll. Dies kann jeder Eingabetyp sein, der ein HTML-Formularelement für die Typen Eingabe oder Auswahl generieren kann (z. B. „text“, „listbox“, „datepicker“), oder ein anderer regulärer Ausdruck. Der Standardwert ist „text“.', |
| 278 | + 'semanticformsinputs-regexp-baseprefix' => 'Das Präfix für die Parameter des Basiseingabetyps.', |
| 279 | + 'semanticformsinputs-regexp-orchar' => 'Das OR-Zeichen, das bei regulären Ausdrücken, anstatt von „|“ verwendet werden soll. Der Standardwert ist „!“.', |
| 280 | + 'semanticformsinputs-regexp-inverse' => 'Sofern festgelegt, darf die Eingabe nicht dem regulären Ausdruck entsprechen, um gültig zu sein. Dies bedeutet, dass der reguläre Ausdruck invertiert wird.', |
| 281 | + 'semanticformsinputs-regexp-message' => 'Die Fehlermeldung, die angezeigt werden soll, sofern der Vergleich scheitert. Der Standardwert ist „Das Format ist falsch.“, oder das Äquivalent der zutreffenden Übersetzung.', |
| 282 | + 'semanticformsinputs-menuselect-structure' => 'Die Menüstruktur als ungeordnete Liste.', |
| 283 | + 'semanticformsinputs-menuselect-enableinputfield' => 'Sollen die Benutzer die Eingabefelder direkt bearbeiten können?', |
| 284 | +); |
| 285 | + |
| 286 | +/** Lower Sorbian (Dolnoserbski) |
| 287 | + * @author Michawiki |
| 288 | + */ |
| 289 | +$messages['dsb'] = array( |
| 290 | + 'semanticformsinputs-desc' => 'Pśidatne zapódawańske typy [http://www.mediawiki.org/wiki/Extension:Semantic_Forms Semantic Forms]', |
| 291 | + 'semanticformsinputs-wrongformat' => 'Wopacny format', |
| 292 | + 'semanticformsinputs-close' => 'Zacyniś', |
| 293 | + 'semanticformsinputs-prev' => 'Pjerwjejšny', |
| 294 | + 'semanticformsinputs-next' => 'Pśiducy', |
| 295 | + 'semanticformsinputs-today' => 'Źinsa', |
| 296 | +); |
| 297 | + |
| 298 | +/** Spanish (Español) |
| 299 | + * @author Danke7 |
| 300 | + * @author Translationista |
| 301 | + */ |
| 302 | +$messages['es'] = array( |
| 303 | + 'semanticformsinputs-desc' => 'Tipos de entrada adicionales para [http://www.mediawiki.org/wiki/Extension:Semantic_Forms Formularios Semánticos]', |
| 304 | + 'semanticformsinputs-wrongformat' => 'Formato incorrecto.', |
| 305 | + 'semanticformsinputs-close' => 'Cerrar', |
| 306 | + 'semanticformsinputs-prev' => 'Anterior', |
| 307 | + 'semanticformsinputs-next' => 'Siguiente', |
| 308 | + 'semanticformsinputs-today' => 'Hoy', |
| 309 | +); |
| 310 | + |
| 311 | +/** French (Français) |
| 312 | + * @author F.trott |
| 313 | + * @author Gomoko |
| 314 | + * @author IAlex |
| 315 | + */ |
| 316 | +$messages['fr'] = array( |
| 317 | + 'semanticformsinputs-desc' => "Types d'entrées additionnelles pour [http://www.mediawiki.org/wiki/Extension:Semantic_Forms Formulaires sémantiques]", |
| 318 | + 'semanticformsinputs-wrongformat' => 'Format erroné.', |
| 319 | + 'semanticformsinputs-close' => 'Fermer', |
| 320 | + 'semanticformsinputs-prev' => 'Précédent', |
| 321 | + 'semanticformsinputs-next' => 'Suivant', |
| 322 | + 'semanticformsinputs-today' => "Aujourd'hui", |
| 323 | + 'semanticformsinputs-dateformatshort' => 'dd / mm / yy', |
| 324 | + 'semanticformsinputs-firstdayofweek' => '0', |
| 325 | + 'semanticformsinputs-datepicker-dateformat' => "La chaîne de format de date. Voyez la [http://www.mediawiki.org/w/index.php?title=Extension:Semantic_Forms_Inputs&fromsection=Date_picker#Parameters documentation en ligne] pour plus d'information.", |
| 326 | + 'semanticformsinputs-datepicker-weekstart' => 'Le premier jour de la semaine (0 - dimanche, 1 - lundi, ...).', |
| 327 | + 'semanticformsinputs-datepicker-firstdate' => 'La première date qui peut être choisie (au format aaaa/mm/jj).', |
| 328 | + 'semanticformsinputs-datepicker-lastdate' => 'La dernière date qui peut être choisie (au format aaaa/mm/jj).', |
| 329 | + 'semanticformsinputs-datepicker-disabledaysofweek' => 'Une liste de jours qui ne peuvent pas être sélectionnés (par ex. week-end: 6, 0).', |
| 330 | + 'semanticformsinputs-datepicker-highlightdaysofweek' => 'Une liste de jours qui doivent apparaître en surbrillance (par ex. week-end: 6, 0).', |
| 331 | + 'semanticformsinputs-datepicker-disabledates' => 'Une liste séparée par des virgules de plages de date ou dates désactivées (dates au format aaaa/mm/jj, plages au format aaaa/mm/jj-aaaa/mm/jj).', |
| 332 | + 'semanticformsinputs-datepicker-highlightdates' => 'Une liste séparée par des virgules de plages de dates ou dates qui doivent apparaître en surbrillance (dates au format aaaa/mm/jj, plages au format aaaa/mm/jj-aaaa/mm/jj).', |
| 333 | + 'semanticformsinputs-datepicker-showweeknumbers' => 'Les numéros de semaine doivent-ils être affichés à gauche de la semaine ?', |
| 334 | + 'semanticformsinputs-datepicker-enableinputfield' => "L'utilisateur doit-il pouvoir remplir le champ d'entrée directement ou seulement par l'intermédiaire du sélecteur de dates?", |
| 335 | + 'semanticformsinputs-datepicker-showresetbutton' => "Faut-il afficher un bouton de réinitialisation? C'est la seule manière pour l'utilisateur d'effacer le champ d'entrée s'il est désactivé pour la saisie directe.", |
| 336 | + 'semanticformsinputs-timepicker-mintime' => 'Le premier horaire à afficher. Format: hh:mm', |
| 337 | + 'semanticformsinputs-timepicker-maxtime' => 'Le dernier horaire à afficher. Format: hh:mm', |
| 338 | + 'semanticformsinputs-timepicker-interval' => 'Intervalle entre les minutes. Nombre entre 1 et 60.', |
| 339 | + 'semanticformsinputs-timepicker-enableinputfield' => "L'utilisateur doit-il pouvoir remplir le champ d'entrée directement ou seulement par l'intermédiaire du sélecteur de dates?", |
| 340 | + 'semanticformsinputs-timepicker-showresetbutton' => "Faut-il afficher un bouton de réinitialisation? C'est la seule manière pour l'utilisateur d'effacer le champ d'entrée s'il est désactivé pour la saisie directe.", |
| 341 | + 'semanticformsinputs-regexp-regexp' => "L'expression régulière que l'entrée doit respecter pour être valide. Cela doit comprendre les barres obliques ! Par défaut, \"/.*/\", c'est-à-dire n'importe quelle valeur.", |
| 342 | + 'semanticformsinputs-regexp-basetype' => 'Le type de base à utiliser. Peut être n\'importe quel type d\'entrée qui génère un élément de formulaire html de type input ou select (par ex., texte, liste déroulante, sélecteur de date) ou une autre expression régulière. Par défaut, "texte".', |
| 343 | + 'semanticformsinputs-regexp-baseprefix' => 'Préfixe pour les paramètres du type de base.', |
| 344 | + 'semanticformsinputs-regexp-orchar' => 'Le caractère OU à utiliser dans l\'expression régulière au lieu de |. Par défaut, "!"', |
| 345 | + 'semanticformsinputs-regexp-inverse' => "S'il est activé, l'entrée ne doit PAS correspondre à l'expression régulière pour être valide. C'est-à-dire que l'expression régulière est inversée.", |
| 346 | + 'semanticformsinputs-regexp-message' => "Le message d'erreur à afficher si la correspondance échoue. Par défaut, «Format incorrect!» (ou l'équivalent dans la langue locale)", |
| 347 | + 'semanticformsinputs-menuselect-structure' => 'La structure du menu sous forme de liste non ordonnée.', |
| 348 | + 'semanticformsinputs-menuselect-enableinputfield' => "L'utilisateur doit-il pouvoir remplir le champ d'entrée directement?", |
| 349 | +); |
| 350 | + |
| 351 | +/** Franco-Provençal (Arpetan) |
| 352 | + * @author ChrisPtDe |
| 353 | + */ |
| 354 | +$messages['frp'] = array( |
| 355 | + 'semanticformsinputs-wrongformat' => 'Crouyo format.', |
| 356 | + 'semanticformsinputs-close' => 'Cllôre', |
| 357 | + 'semanticformsinputs-prev' => 'Devant', |
| 358 | + 'semanticformsinputs-next' => 'Aprés', |
| 359 | + 'semanticformsinputs-today' => 'Houé', |
| 360 | +); |
| 361 | + |
| 362 | +/** Galician (Galego) |
| 363 | + * @author Toliño |
| 364 | + */ |
| 365 | +$messages['gl'] = array( |
| 366 | + 'semanticformsinputs-desc' => 'Tipos de entrada adicionais para os [http://www.mediawiki.org/wiki/Extension:Semantic_Forms formularios semánticos]', |
| 367 | + 'semanticformsinputs-wrongformat' => 'Formato incorrecto.', |
| 368 | + 'semanticformsinputs-close' => 'Pechar', |
| 369 | + 'semanticformsinputs-prev' => 'Anterior', |
| 370 | + 'semanticformsinputs-next' => 'Seguinte', |
| 371 | + 'semanticformsinputs-today' => 'Hoxe', |
| 372 | + 'semanticformsinputs-datepicker-dateformat' => 'A cadea de formato de data. Olle a [http://www.mediawiki.org/w/index.php?title=Extension:Semantic_Forms_Inputs&fromsection=Date_picker#Parameters documentación en liña] para obter máis información.', |
| 373 | + 'semanticformsinputs-datepicker-weekstart' => 'O primeiro día da semana (0 = domingo, 1 = luns...).', |
| 374 | + 'semanticformsinputs-datepicker-firstdate' => 'A primeira data que se pode elixir (en formato aaa/mm/dd).', |
| 375 | + 'semanticformsinputs-datepicker-lastdate' => 'A última data que se pode elixir (en formato aaa/mm/dd).', |
| 376 | + 'semanticformsinputs-datepicker-disabledaysofweek' => 'Unha lista de días que non se poden seleccionar (por exemplo, fin de semana: 6, 0).', |
| 377 | + 'semanticformsinputs-datepicker-highlightdaysofweek' => 'Unha lista de días que deberían aparecer destacados (por exemplo, fin de semana: 6, 0).', |
| 378 | + 'semanticformsinputs-datepicker-disabledates' => 'Unha lista de elementos separados por comas de rangos de data ou datas desactivados (datas en formato aaaa/mm/dd, rangos en formato aaaa/mm/dd-aaaa/mm/dd).', |
| 379 | + 'semanticformsinputs-datepicker-highlightdates' => 'Unha lista de elementos separados por comas de rangos de data ou datas que deberían aparecer destacados (datas en formato aaaa/mm/dd, rangos en formato aaaa/mm/dd-aaaa/mm/dd).', |
| 380 | + 'semanticformsinputs-datepicker-showweeknumbers' => 'Deben aparecer os números á esquerda da semana?', |
| 381 | + 'semanticformsinputs-datepicker-enableinputfield' => 'Debe o usuario ser capaz de encher o campo de entrada directamente ou unicamente a través do selector de datas?', |
| 382 | + 'semanticformsinputs-datepicker-showresetbutton' => 'Debe mostrarse un botón de restablecemento? Este é o único xeito que o usuario ten de limpar o campo de entrada se está desactivado para a entrada directa.', |
| 383 | + 'semanticformsinputs-timepicker-mintime' => 'A primeira hora a mostrar. Formato: hh:mm', |
| 384 | + 'semanticformsinputs-timepicker-maxtime' => 'A última hora a mostrar. Formato: hh:mm', |
| 385 | + 'semanticformsinputs-timepicker-interval' => 'Intervalo entre os minutos. Número entre 1 e 60.', |
| 386 | + 'semanticformsinputs-timepicker-enableinputfield' => 'Debe o usuario ser capaz de encher o campo de entrada directamente ou unicamente a través do selector de datas?', |
| 387 | + 'semanticformsinputs-timepicker-showresetbutton' => 'Debe mostrarse un botón de restablecemento? Este é o único xeito que o usuario ten de limpar o campo de entrada se está desactivado para a entrada directa.', |
| 388 | + 'semanticformsinputs-regexp-regexp' => 'A expresión regular que debe coincidir coa entrada para que sexa válida. Cómpre especificala coas barras inclunadas! Por defecto "/.*/", para calquera valor.', |
| 389 | + 'semanticformsinputs-regexp-basetype' => 'O tipo de base a usar. Pode ser calquera tipo de entrada que xere un elemento de formulario HTML do tipo "input" ou "select" (por exemplo, texto, caixa de listas, selector de data) ou outra expresión regular. Por defecto é "texto".', |
| 390 | + 'semanticformsinputs-regexp-baseprefix' => 'Prefixo para os parámetros do tipo de base.', |
| 391 | + 'semanticformsinputs-regexp-orchar' => 'O carácter OU a usar na expresión regular no canto de "|". Por defecto é "!".', |
| 392 | + 'semanticformsinputs-regexp-inverse' => 'En caso de estar definida, a entrada NON debe coincidir coa expresión regular para ser válida. Por exemplo, se a expresión regular está invertida.', |
| 393 | + 'semanticformsinputs-regexp-message' => 'A mensaxe de erro a mostrar se falla a coincidencia. Por defecto é "Formato incorrecto!" (ou a forma equivalente na lingua local)', |
| 394 | + 'semanticformsinputs-menuselect-structure' => 'A estrutura do menú como lista non ordenada.', |
| 395 | + 'semanticformsinputs-menuselect-enableinputfield' => 'Debe o usuario ser capaz de encher o campo de entrada directamente?', |
| 396 | +); |
| 397 | + |
| 398 | +/** Swiss German (Alemannisch) |
| 399 | + * @author Als-Holder |
| 400 | + */ |
| 401 | +$messages['gsw'] = array( |
| 402 | + 'semanticformsinputs-desc' => 'Mecht zuesätzligi Arte vu Yygabe megli fir [http://www.mediawiki.org/wiki/Extension:Semantic_Forms Semantic Forms]', |
| 403 | + 'semanticformsinputs-wrongformat' => 'Falsch Format.', |
| 404 | + 'semanticformsinputs-close' => 'Zuemache', |
| 405 | + 'semanticformsinputs-prev' => 'Vorigi', |
| 406 | + 'semanticformsinputs-next' => 'Negschti', |
| 407 | + 'semanticformsinputs-today' => 'Hit', |
| 408 | +); |
| 409 | + |
| 410 | +/** Hebrew (עברית) |
| 411 | + * @author YaronSh |
| 412 | + */ |
| 413 | +$messages['he'] = array( |
| 414 | + 'semanticformsinputs-desc' => 'סוגי קלט נוספים עבור [http://www.mediawiki.org/wiki/Extension:Semantic_Forms טפסים סמנטיים]', |
| 415 | + 'semanticformsinputs-wrongformat' => 'מבנה שגוי.', |
| 416 | + 'semanticformsinputs-close' => 'סגירה', |
| 417 | + 'semanticformsinputs-prev' => 'הקודם', |
| 418 | + 'semanticformsinputs-next' => 'הבא', |
| 419 | + 'semanticformsinputs-today' => 'היום', |
| 420 | +); |
| 421 | + |
| 422 | +/** Upper Sorbian (Hornjoserbsce) |
| 423 | + * @author Michawiki |
| 424 | + */ |
| 425 | +$messages['hsb'] = array( |
| 426 | + 'semanticformsinputs-desc' => 'Přidatne zapodawanske typy za [http://www.mediawiki.org/wiki/Extension:Semantic_Forms Semantic Forms]', |
| 427 | + 'semanticformsinputs-wrongformat' => 'Wopačny format', |
| 428 | + 'semanticformsinputs-close' => 'Začinić', |
| 429 | + 'semanticformsinputs-prev' => 'Předchadny', |
| 430 | + 'semanticformsinputs-next' => 'Přichodny', |
| 431 | + 'semanticformsinputs-today' => 'Dźensa', |
| 432 | +); |
| 433 | + |
| 434 | +/** Hungarian (Magyar) |
| 435 | + * @author Dani |
| 436 | + */ |
| 437 | +$messages['hu'] = array( |
| 438 | + 'semanticformsinputs-wrongformat' => 'Hibás formátum.', |
| 439 | + 'semanticformsinputs-close' => 'Bezárás', |
| 440 | + 'semanticformsinputs-prev' => 'Előző', |
| 441 | + 'semanticformsinputs-next' => 'Következő', |
| 442 | + 'semanticformsinputs-today' => 'Ma', |
| 443 | +); |
| 444 | + |
| 445 | +/** Interlingua (Interlingua) |
| 446 | + * @author McDutchie |
| 447 | + */ |
| 448 | +$messages['ia'] = array( |
| 449 | + 'semanticformsinputs-desc' => 'Additional typos de entrata pro [http://www.mediawiki.org/wiki/Extension:Semantic_Forms Formularios Semantic]', |
| 450 | + 'semanticformsinputs-wrongformat' => 'Formato incorrecte.', |
| 451 | + 'semanticformsinputs-close' => 'Clauder', |
| 452 | + 'semanticformsinputs-prev' => 'Precedente', |
| 453 | + 'semanticformsinputs-next' => 'Sequente', |
| 454 | + 'semanticformsinputs-today' => 'Hodie', |
| 455 | + 'semanticformsinputs-datepicker-dateformat' => 'Le specification del formato del data. Vide le [http://www.mediawiki.org/w/index.php?title=Extension:Semantic_Forms_Inputs&fromsection=Date_picker#Parameters documentation in linea] pro plus information.', |
| 456 | + 'semanticformsinputs-datepicker-weekstart' => 'Le prime die del septimana (0 - dominica, 1 - lunedi, ...).', |
| 457 | + 'semanticformsinputs-datepicker-firstdate' => 'Le prime data que pote esser seligite (in formato aaaa/mm/dd).', |
| 458 | + 'semanticformsinputs-datepicker-lastdate' => 'Le ultime data que pote esser seligite (in formato aaaa/mm/dd).', |
| 459 | + 'semanticformsinputs-datepicker-disabledaysofweek' => 'Un lista de dies que non pote esser seligite (p.ex. fin de septimana: 6, 0).', |
| 460 | + 'semanticformsinputs-datepicker-highlightdaysofweek' => 'Un lista de dies que debe apparer in forma accentuate (p.ex. fin de septimana: 6, 0).', |
| 461 | + 'semanticformsinputs-datepicker-disabledates' => 'Un lista separate per commas de datas disactivate, o intervallos de datas disactivate (datas in formato aaaa/mm/dd, intervallos in formato aaaa/mm/dd-aaaa/mm/dd).', |
| 462 | + 'semanticformsinputs-datepicker-highlightdates' => 'Un lista separate per commas de datas o intervallos de datas que debe apparer in forma accentuate (datas in formato aaaa/mm/dd, intervallos in formato aaaa/mm/dd-aaaa/mm/dd).', |
| 463 | + 'semanticformsinputs-datepicker-showweeknumbers' => 'Monstrar le numeros de septimana a sinistra del septimana?', |
| 464 | + 'semanticformsinputs-datepicker-enableinputfield' => 'Debe le usator poter plenar le campo de entrata directemente o solmente via le selector de data?', |
| 465 | + 'semanticformsinputs-datepicker-showresetbutton' => 'Monstrar un button de reinitialisation? Isto es le sol maniera in que le usator pote rader le campo de entrata si illo es disactivate pro entrata directe.', |
| 466 | + 'semanticformsinputs-timepicker-mintime' => 'Le prime hora a monstrar. Formato: hh:mm', |
| 467 | + 'semanticformsinputs-timepicker-maxtime' => 'Le ultime hora a monstrar. Formato: hh:mm', |
| 468 | + 'semanticformsinputs-timepicker-interval' => 'Intervallo inter minutas. Numero inter 1 e 60.', |
| 469 | + 'semanticformsinputs-timepicker-enableinputfield' => 'Debe le usator poter plenar le campo de entrata directemente o solmente via le selector de data?', |
| 470 | + 'semanticformsinputs-timepicker-showresetbutton' => 'Monstrar un button de reinitialisation? Isto es le sol maniera in que le usator pote rader le campo de entrata si illo es disactivate pro entrata directe.', |
| 471 | + 'semanticformsinputs-regexp-regexp' => 'Le expression regular a que le entrata debe corresponder pro esser valide. Isto debe esser specificate includente le barras oblique! Le predefinition es "/.*/", i.e. omne valor.', |
| 472 | + 'semanticformsinputs-regexp-basetype' => 'Le typo de base a usar. Pote esser omne typo de entrata que genera un elemento de formulario HTML del typo "input" o "select" (p.ex. texto, quadro de lista, selector de data) o un altere expression regular. Le predefinition es "text".', |
| 473 | + 'semanticformsinputs-regexp-baseprefix' => 'Prefixo pro le parametros del typo de base.', |
| 474 | + 'semanticformsinputs-regexp-orchar' => 'Le character pro separar alternativas a usar in le expression regular in loco de "|". Le predefinition es "!".', |
| 475 | + 'semanticformsinputs-regexp-inverse' => 'Si definite, le entrata NON debe corresponder al expression regular pro esser valide. Isto vole dicer, le expression regular es invertite.', |
| 476 | + 'semanticformsinputs-regexp-message' => 'Le message de error a presentar in caso de non-correspondentia. Le predefinition es "Formato incorrecte!" (o le equivalente in le lingua actualmente configurate)', |
| 477 | + 'semanticformsinputs-menuselect-structure' => 'Le structura de menu como un lista non ordinate.', |
| 478 | + 'semanticformsinputs-menuselect-enableinputfield' => 'Debe le usator poter plenar le campo de entrata directemente?', |
| 479 | +); |
| 480 | + |
| 481 | +/** Indonesian (Bahasa Indonesia) |
| 482 | + * @author Farras |
| 483 | + * @author IvanLanin |
| 484 | + */ |
| 485 | +$messages['id'] = array( |
| 486 | + 'semanticformsinputs-desc' => 'Jenis masukan tambahan untuk [http://www.mediawiki.org/wiki/Extension:Semantic_Forms Semantic Forms]', |
| 487 | + 'semanticformsinputs-wrongformat' => 'Format salah.', |
| 488 | + 'semanticformsinputs-close' => 'Penutup', |
| 489 | + 'semanticformsinputs-prev' => 'Sebelumnya', |
| 490 | + 'semanticformsinputs-next' => 'Selanjutnya', |
| 491 | + 'semanticformsinputs-today' => 'Hari ini', |
| 492 | +); |
| 493 | + |
| 494 | +/** Japanese (日本語) |
| 495 | + * @author Yanajin66 |
| 496 | + * @author 青子守歌 |
| 497 | + */ |
| 498 | +$messages['ja'] = array( |
| 499 | + 'semanticformsinputs-desc' => ' [http://www.mediawiki.org/wiki/Extension:Semantic_Forms Semantic Forms]のための追加の入力タイプ', |
| 500 | + 'semanticformsinputs-wrongformat' => '間違った形式です。', |
| 501 | + 'semanticformsinputs-close' => '閉じる', |
| 502 | + 'semanticformsinputs-prev' => '前へ', |
| 503 | + 'semanticformsinputs-next' => '次へ', |
| 504 | + 'semanticformsinputs-today' => '今日', |
| 505 | +); |
| 506 | + |
| 507 | +/** Khmer (ភាសាខ្មែរ) |
| 508 | + * @author គីមស៊្រុន |
| 509 | + * @author វ័ណថារិទ្ធ |
| 510 | + */ |
| 511 | +$messages['km'] = array( |
| 512 | + 'semanticformsinputs-close' => 'បិទ', |
| 513 | + 'semanticformsinputs-prev' => 'មុន', |
| 514 | + 'semanticformsinputs-next' => 'បន្ទាប់', |
| 515 | + 'semanticformsinputs-today' => 'ថ្ងៃនេះ', |
| 516 | +); |
| 517 | + |
| 518 | +/** Colognian (Ripoarisch) |
| 519 | + * @author Purodha |
| 520 | + */ |
| 521 | +$messages['ksh'] = array( |
| 522 | + 'semanticformsinputs-desc' => 'Zohsäzlejje Zoote Einjabe för „[http://www.mediawiki.org/wiki/Extension:Semantic_Forms Semantesch Fommulaare]“.', |
| 523 | + 'semanticformsinputs-wrongformat' => 'Dat Fommaat es verkiehrt', |
| 524 | + 'semanticformsinputs-close' => 'Zohmaache', |
| 525 | + 'semanticformsinputs-prev' => 'Vörijje', |
| 526 | + 'semanticformsinputs-next' => 'Nächste', |
| 527 | + 'semanticformsinputs-today' => 'Hück', |
| 528 | +); |
| 529 | + |
| 530 | +/** Kurdish (Latin script) (Kurdî (latînî)) |
| 531 | + * @author George Animal |
| 532 | + */ |
| 533 | +$messages['ku-latn'] = array( |
| 534 | + 'semanticformsinputs-today' => 'Îro', |
| 535 | +); |
| 536 | + |
| 537 | +/** Luxembourgish (Lëtzebuergesch) |
| 538 | + * @author Robby |
| 539 | + */ |
| 540 | +$messages['lb'] = array( |
| 541 | + 'semanticformsinputs-desc' => "Zousätzlech Manéieren fir d'Eraginn fir [http://www.mediawiki.org/wiki/Extension:Semantic_Forms Semantic Formulairen]", |
| 542 | + 'semanticformsinputs-wrongformat' => 'Falsche Format.', |
| 543 | + 'semanticformsinputs-close' => 'Zoumaachen', |
| 544 | + 'semanticformsinputs-prev' => 'Vireg', |
| 545 | + 'semanticformsinputs-next' => 'Nächst', |
| 546 | + 'semanticformsinputs-today' => 'Haut', |
| 547 | +); |
| 548 | + |
| 549 | +/** Macedonian (Македонски) |
| 550 | + * @author Bjankuloski06 |
| 551 | + * @author F.trott |
| 552 | + */ |
| 553 | +$messages['mk'] = array( |
| 554 | + 'semanticformsinputs-desc' => 'Дополнителни типови на внос за [http://www.mediawiki.org/wiki/Extension:Semantic_Forms Семантички обрасци]', |
| 555 | + 'semanticformsinputs-wrongformat' => 'Погрешен формат.', |
| 556 | + 'semanticformsinputs-close' => 'Затвори', |
| 557 | + 'semanticformsinputs-prev' => 'Претходно', |
| 558 | + 'semanticformsinputs-next' => 'Следно', |
| 559 | + 'semanticformsinputs-today' => 'Денес', |
| 560 | + 'semanticformsinputs-dateformatlong' => 'd MM yy', |
| 561 | + 'semanticformsinputs-dateformatshort' => 'dd/mm/yy', |
| 562 | + 'semanticformsinputs-datepicker-dateformat' => 'Низа за датумски формат. За повеќе информации, погледајте ја [http://www.mediawiki.org/w/index.php?title=Extension:Semantic_Forms_Inputs&fromsection=Date_picker#Parameters документацијата].', |
| 563 | + 'semanticformsinputs-datepicker-weekstart' => 'Прв ден во седмицата (0 - недела, 1 - понеделник, ...).', |
| 564 | + 'semanticformsinputs-datepicker-firstdate' => 'Првиот датум што ќе може да се избере (во форматот гггг/мм/дд).', |
| 565 | + 'semanticformsinputs-datepicker-lastdate' => 'Последниот датум што може да се обере (во форматот гггг/мм/дд).', |
| 566 | + 'semanticformsinputs-datepicker-disabledaysofweek' => 'Список на денови што не можат да се одберат (на пр. викенд, 6, 0).', |
| 567 | + 'semanticformsinputs-datepicker-highlightdaysofweek' => 'Список на денови што ќе се истакнуваат (на пр. викенд, 6, 0).', |
| 568 | + 'semanticformsinputs-datepicker-disabledates' => 'Список на оневозможени датуми/датумски опсези, одделени со запирка (датуми во форматот гггг/мм/дд, опсези во форматот гггг/мм/дд-гггг/мм/дд).', |
| 569 | + 'semanticformsinputs-datepicker-highlightdates' => 'Список на датуми/датумски опсези одделени со запирка кои ќе се прикажуваат истакнати, т.е. обележани (датуми во форматот гггг/мм/дд, опсези во форматот гггг/мм/дд-гггг/мм/дд).', |
| 570 | + 'semanticformsinputs-datepicker-showweeknumbers' => 'Дали лево од седмиците да стојат броеви (на седмици)?', |
| 571 | + 'semanticformsinputs-datepicker-enableinputfield' => 'Дали корисникот да може да го пополни полето за внос директно или преку одбирачот на датуми?', |
| 572 | + 'semanticformsinputs-datepicker-showresetbutton' => 'Дали да се прикажува копчето „одново“? Ова е единствениот начин корисникот да го избрише внесеното во полето ако за тоа поле е оневозможен директниот внос.', |
| 573 | + 'semanticformsinputs-timepicker-mintime' => 'Најрано време за приказ. Формат: чч:мм', |
| 574 | + 'semanticformsinputs-timepicker-maxtime' => 'Последно време за приказ. Формат: чч:мм', |
| 575 | + 'semanticformsinputs-timepicker-interval' => 'Интервал помеѓу минутите. Број помеѓу 1 и 60.', |
| 576 | + 'semanticformsinputs-timepicker-enableinputfield' => 'Дали корисникот да може да го пополни полето за внос директно или преку одбирачот на датуми?', |
| 577 | + 'semanticformsinputs-timepicker-showresetbutton' => 'Дали да се прикажува копчето „одново“? Ова е единствениот начин корисникот да го избрише внесеното во полето ако за тоа поле е оневозможен директниот внос.', |
| 578 | + 'semanticformsinputs-regexp-regexp' => 'Регуларниот израз на вносот мора да се совпаѓа за да биде важечки. Мора да се внесе заедно со косите црти. По основно: „/.*/“, т.е. било која вредност.', |
| 579 | + 'semanticformsinputs-regexp-basetype' => 'Основен тип за употреба. Може да биде било кој тип на внос што создава html-елемент за образец од типот на внос или одбирање (на пр. текст, список, одбирач на датум) или некој друг регуларен израз. По основно: „текст“.', |
| 580 | + 'semanticformsinputs-regexp-baseprefix' => 'Префикс за параметрите од основен тип.', |
| 581 | + 'semanticformsinputs-regexp-orchar' => 'Знакот за ИЛИ што ќе се користи во регуларниот израз наместо |. По основно „!“', |
| 582 | + 'semanticformsinputs-regexp-inverse' => 'Ако е зададено, вносот НЕ смее да се совпаѓа со регуларниот израз за да биде важечки, т.е. регуларниот израз станува обратен.', |
| 583 | + 'semanticformsinputs-regexp-message' => 'Пораката за грешка што ќе се прикаже ако нема совпаѓање. По основно: „Погрешен формат!“', |
| 584 | + 'semanticformsinputs-menuselect-structure' => 'Состав на менито како неподреден список.', |
| 585 | + 'semanticformsinputs-menuselect-enableinputfield' => 'Дали корисникот да може директно да го пополни полето за внос?', |
| 586 | +); |
| 587 | + |
| 588 | +/** Malayalam (മലയാളം) |
| 589 | + * @author Praveenp |
| 590 | + */ |
| 591 | +$messages['ml'] = array( |
| 592 | + 'semanticformsinputs-close' => 'അടയ്ക്കുക', |
| 593 | + 'semanticformsinputs-prev' => 'മുൻപത്തേത്', |
| 594 | + 'semanticformsinputs-next' => 'അടുത്തത്', |
| 595 | + 'semanticformsinputs-today' => 'ഇന്ന്', |
| 596 | +); |
| 597 | + |
| 598 | +/** Malay (Bahasa Melayu) |
| 599 | + * @author Anakmalaysia |
| 600 | + */ |
| 601 | +$messages['ms'] = array( |
| 602 | + 'semanticformsinputs-prev' => 'Sebelumnya', |
| 603 | + 'semanticformsinputs-next' => 'Berikutnya', |
| 604 | +); |
| 605 | + |
| 606 | +/** Dutch (Nederlands) |
| 607 | + * @author SPQRobin |
| 608 | + * @author Saruman |
| 609 | + * @author Siebrand |
| 610 | + */ |
| 611 | +$messages['nl'] = array( |
| 612 | + 'semanticformsinputs-desc' => 'Extra invoertypen voor [http://www.mediawiki.org/wiki/Extension:Semantic_Forms Semantic Forms]', |
| 613 | + 'semanticformsinputs-wrongformat' => 'Onjuiste opmaak.', |
| 614 | + 'semanticformsinputs-close' => 'Sluiten', |
| 615 | + 'semanticformsinputs-prev' => 'Vorige', |
| 616 | + 'semanticformsinputs-next' => 'Volgende', |
| 617 | + 'semanticformsinputs-today' => 'Vandaag', |
| 618 | + 'semanticformsinputs-datepicker-dateformat' => 'De datumopmaak. Zie de [http://www.mediawiki.org/w/index.php?title=Extension:Semantic_Forms_Inputs&fromsection=Date_picker#Parameters online documentatie] voor meer informatie.', |
| 619 | + 'semanticformsinputs-datepicker-weekstart' => 'De eerste dag van de week (0: zondag, 1: maandag, ...).', |
| 620 | + 'semanticformsinputs-datepicker-firstdate' => 'De eerste datum die gekozen kan worden (in de opmaak jjjj/mm/dd).', |
| 621 | + 'semanticformsinputs-datepicker-lastdate' => 'De laatste datum die gekozen kan worden (in de opmaak jjjj/mm/dd).', |
| 622 | + 'semanticformsinputs-datepicker-disabledaysofweek' => 'Een lijst van dagen die niet kunnen worden geselecteerd (bijvoorbeeld weekend: 6, 0).', |
| 623 | + 'semanticformsinputs-datepicker-highlightdaysofweek' => 'Een lijst van dagen die gemarkeerd worden (bijvoorbeeld weekend: 6, 0).', |
| 624 | + 'semanticformsinputs-datepicker-disabledates' => "Een door komma's gescheiden lijst van uitgeschakelde datums of datumreeksen (datums in de opmaak jjjj/mm/dd, reeksen in de opmaak jjjj/mm/dd-jjjj/mm/dd).", |
| 625 | + 'semanticformsinputs-datepicker-highlightdates' => "Een door komma's gescheiden lijst van datums of datumreeksen die gemarkeerd worden (datums in de opmaak jjjj/mm/dd formaat, reeksen in de opmaak jjjj/mm/dd-jjjj/mm/dd).", |
| 626 | + 'semanticformsinputs-datepicker-showweeknumbers' => 'Weeknummers links van de week weergeven?', |
| 627 | + 'semanticformsinputs-datepicker-enableinputfield' => 'Kan de gebruiker het invoerveld rechtstreeks bewerken, of alleen via de datumkiezer?', |
| 628 | + 'semanticformsinputs-datepicker-showresetbutton' => 'Knop voor leegmaken weergeven? Dit is de enige manier voor de gebruiker om het invoerveld te wissen als directe invoer voor het veld is uitgeschakeld.', |
| 629 | + 'semanticformsinputs-timepicker-mintime' => 'De vroegste tijd om weer te geven. Opmaak: uu:mm', |
| 630 | + 'semanticformsinputs-timepicker-maxtime' => 'De laatste tijd om weer te geven. Opmaak: uu:mm.', |
| 631 | + 'semanticformsinputs-timepicker-interval' => 'Interval tussen minuten. Getal tussen 1 en 60.', |
| 632 | + 'semanticformsinputs-timepicker-enableinputfield' => 'Kan de gebruiker het invoerveld rechtstreeks bewerken, of alleen via de datumkiezer?', |
| 633 | + 'semanticformsinputs-timepicker-showresetbutton' => 'Knop voor leegmaken weergeven? Dit is de enige manier voor de gebruiker om het invoerveld te wissen als directe invoer voor het veld is uitgeschakeld.', |
| 634 | + 'semanticformsinputs-regexp-regexp' => 'De reguliere expressie waarmee de invoer moet overeenkomen om geldig te zijn. Dit moet worden opgegeven met inbegrip van de schraptekens (slashes)! Standaard ingesteld op "/. * /", ofwel een willekeurige waarde.', |
| 635 | + 'semanticformsinputs-regexp-basetype' => 'Het basistype dat moet worden gebruikt. Dit kan elk invoertype zijn dat een HTML-formulierelement van het type "input" of "select" (bijvoorbeeld "text", "listbox" of "datepicker") of een andere reguliere expressie genereert. Standaard ingesteld op "text".', |
| 636 | + 'semanticformsinputs-regexp-baseprefix' => 'Voorvoegsel voor de parameters van het basistype.', |
| 637 | + 'semanticformsinputs-regexp-orchar' => 'Het OR-teken dat in de reguliere expressie wordt gebruikt in plaats van |. Standaard ingesteld op "!"', |
| 638 | + 'semanticformsinputs-regexp-inverse' => 'Als dit is ingesteld moet de invoer NIET overeen komen met de reguliere expressie om geldig te zijn. Dat wil zeggen, de reguliere expressie is omgekeerd.', |
| 639 | + 'semanticformsinputs-regexp-message' => 'Het foutbericht dat moet worden weergegeven als het vergelijken mislukt. De standaardinstelling is "Verkeerde opmaak!" (of het equivalent in de geldende landinstelling).', |
| 640 | + 'semanticformsinputs-menuselect-structure' => 'De menustructuur als een ongeordende lijst.', |
| 641 | + 'semanticformsinputs-menuselect-enableinputfield' => 'Moet de gebruiker het invoerveld rechtstreeks kunnen invullen?', |
| 642 | +); |
| 643 | + |
| 644 | +/** Norwegian (bokmål) (Norsk (bokmål)) |
| 645 | + * @author Nghtwlkr |
| 646 | + */ |
| 647 | +$messages['no'] = array( |
| 648 | + 'semanticformsinputs-desc' => 'Ekstra inndatatyper for [http://www.mediawiki.org/wiki/Extension:Semantic_Forms Semantic Forms]', |
| 649 | + 'semanticformsinputs-wrongformat' => 'Feil format.', |
| 650 | + 'semanticformsinputs-close' => 'Lukk', |
| 651 | + 'semanticformsinputs-prev' => 'Forrige', |
| 652 | + 'semanticformsinputs-next' => 'Neste', |
| 653 | + 'semanticformsinputs-today' => 'I dag', |
| 654 | +); |
| 655 | + |
| 656 | +/** Deitsch (Deitsch) |
| 657 | + * @author Xqt |
| 658 | + */ |
| 659 | +$messages['pdc'] = array( |
| 660 | + 'semanticformsinputs-next' => 'Neegschte', |
| 661 | +); |
| 662 | + |
| 663 | +/** Pälzisch (Pälzisch) |
| 664 | + * @author Xqt |
| 665 | + */ |
| 666 | +$messages['pfl'] = array( |
| 667 | + 'semanticformsinputs-prev' => 'Voriche', |
| 668 | + 'semanticformsinputs-next' => 'Negschte', |
| 669 | +); |
| 670 | + |
| 671 | +/** Polish (Polski) |
| 672 | + * @author Sp5uhe |
| 673 | + */ |
| 674 | +$messages['pl'] = array( |
| 675 | + 'semanticformsinputs-desc' => 'Dodatkowe typy wejściowe dla [http://www.mediawiki.org/wiki/Extension:Semantic_Forms Formularzy Semantycznych]', |
| 676 | + 'semanticformsinputs-wrongformat' => 'Niewłaściwy format.', |
| 677 | + 'semanticformsinputs-close' => 'Zamknij', |
| 678 | + 'semanticformsinputs-prev' => 'Poprzednie', |
| 679 | + 'semanticformsinputs-next' => 'Następne', |
| 680 | + 'semanticformsinputs-today' => 'Dziś', |
| 681 | +); |
| 682 | + |
| 683 | +/** Piedmontese (Piemontèis) |
| 684 | + * @author Borichèt |
| 685 | + * @author Dragonòt |
| 686 | + */ |
| 687 | +$messages['pms'] = array( |
| 688 | + 'semanticformsinputs-desc' => "Sòrt d'intrade adissionaj për [http://www.mediawiki.org/wiki/Extension:Semantic_Forms Formolari Semàntich]", |
| 689 | + 'semanticformsinputs-wrongformat' => 'Formà pa bon.', |
| 690 | + 'semanticformsinputs-close' => 'Sara', |
| 691 | + 'semanticformsinputs-prev' => 'Prima', |
| 692 | + 'semanticformsinputs-next' => 'Apress', |
| 693 | + 'semanticformsinputs-today' => 'Ancheuj', |
| 694 | +); |
| 695 | + |
| 696 | +/** Portuguese (Português) |
| 697 | + * @author Hamilton Abreu |
| 698 | + */ |
| 699 | +$messages['pt'] = array( |
| 700 | + 'semanticformsinputs-desc' => 'Tipos de entrada adicionais para [http://www.mediawiki.org/wiki/Extension:Semantic_Forms Formulários Semânticos]', |
| 701 | + 'semanticformsinputs-wrongformat' => 'Formato incorrecto.', |
| 702 | + 'semanticformsinputs-close' => 'Fechar', |
| 703 | + 'semanticformsinputs-prev' => 'Anterior', |
| 704 | + 'semanticformsinputs-next' => 'Seguinte', |
| 705 | + 'semanticformsinputs-today' => 'Hoje', |
| 706 | +); |
| 707 | + |
| 708 | +/** Brazilian Portuguese (Português do Brasil) |
| 709 | + * @author Giro720 |
| 710 | + */ |
| 711 | +$messages['pt-br'] = array( |
| 712 | + 'semanticformsinputs-desc' => 'Tipos de entrada adicionais para [http://www.mediawiki.org/wiki/Extension:Semantic_Forms Formulários Semânticos]', |
| 713 | + 'semanticformsinputs-wrongformat' => 'Formato incorreto.', |
| 714 | + 'semanticformsinputs-close' => 'Fechar', |
| 715 | + 'semanticformsinputs-prev' => 'Anterior', |
| 716 | + 'semanticformsinputs-next' => 'Seguinte', |
| 717 | + 'semanticformsinputs-today' => 'Hoje', |
| 718 | +); |
| 719 | + |
| 720 | +/** Tarandíne (Tarandíne) |
| 721 | + * @author Joetaras |
| 722 | + */ |
| 723 | +$messages['roa-tara'] = array( |
| 724 | + 'semanticformsinputs-desc' => 'Tipe de input aggiundive pe le [http://www.mediawiki.org/wiki/Extension:Semantic_Forms Module Semandece]', |
| 725 | + 'semanticformsinputs-wrongformat' => 'Formate sbagliate', |
| 726 | +); |
| 727 | + |
| 728 | +/** Russian (Русский) |
| 729 | + * @author F.trott |
| 730 | + * @author MaxSem |
| 731 | + * @author Александр Сигачёв |
| 732 | + * @author Сrower |
| 733 | + */ |
| 734 | +$messages['ru'] = array( |
| 735 | + 'semanticformsinputs-desc' => 'Дополнительные входящие типы для [http://www.mediawiki.org/wiki/Extension:Semantic_Forms Семантических Форм]', |
| 736 | + 'semanticformsinputs-wrongformat' => 'Неверный формат.', |
| 737 | + 'semanticformsinputs-close' => 'Закрыть', |
| 738 | + 'semanticformsinputs-prev' => 'Предыдущая', |
| 739 | + 'semanticformsinputs-next' => 'Следующая', |
| 740 | + 'semanticformsinputs-today' => 'Сегодня', |
| 741 | + 'semanticformsinputs-firstdayofweek' => '1', |
| 742 | +); |
| 743 | + |
| 744 | +/** Serbian (Cyrillic script) (Српски (ћирилица)) |
| 745 | + * @author Rancher |
| 746 | + */ |
| 747 | +$messages['sr-ec'] = array( |
| 748 | + 'semanticformsinputs-dateformatlong' => 'd MM yy', |
| 749 | + 'semanticformsinputs-dateformatshort' => 'dd/mm/yy', |
| 750 | + 'semanticformsinputs-firstdayofweek' => '1', |
| 751 | +); |
| 752 | + |
| 753 | +/** Telugu (తెలుగు) |
| 754 | + * @author Veeven |
| 755 | + */ |
| 756 | +$messages['te'] = array( |
| 757 | + 'semanticformsinputs-close' => 'మూసివేయి', |
| 758 | + 'semanticformsinputs-prev' => 'గత', |
| 759 | + 'semanticformsinputs-next' => 'తదుపరి', |
| 760 | + 'semanticformsinputs-today' => 'ఈరోజు', |
| 761 | +); |
| 762 | + |
| 763 | +/** Tagalog (Tagalog) |
| 764 | + * @author AnakngAraw |
| 765 | + */ |
| 766 | +$messages['tl'] = array( |
| 767 | + 'semanticformsinputs-desc' => 'Karagdagang mga tipo ng pagpasok para sa [http://www.mediawiki.org/wiki/Extension:Semantic_Forms Anyong Semantiko]', |
| 768 | + 'semanticformsinputs-wrongformat' => 'Maling anyo.', |
| 769 | + 'semanticformsinputs-close' => 'Isara', |
| 770 | + 'semanticformsinputs-prev' => 'Nakaraan', |
| 771 | + 'semanticformsinputs-next' => 'Susunod', |
| 772 | + 'semanticformsinputs-today' => 'Ngayon', |
| 773 | +); |
| 774 | + |
| 775 | +/** Ukrainian (Українська) |
| 776 | + * @author Тест |
| 777 | + */ |
| 778 | +$messages['uk'] = array( |
| 779 | + 'semanticformsinputs-close' => 'Закрити', |
| 780 | + 'semanticformsinputs-prev' => 'Попередня', |
| 781 | + 'semanticformsinputs-next' => 'Наступна', |
| 782 | +); |
| 783 | + |
| 784 | +/** Vietnamese (Tiếng Việt) |
| 785 | + * @author Minh Nguyen |
| 786 | + */ |
| 787 | +$messages['vi'] = array( |
| 788 | + 'semanticformsinputs-wrongformat' => 'Định dạng sai', |
| 789 | + 'semanticformsinputs-close' => 'Đóng', |
| 790 | + 'semanticformsinputs-prev' => 'Trước', |
| 791 | + 'semanticformsinputs-next' => 'Sau', |
| 792 | + 'semanticformsinputs-today' => 'Hôm nay', |
| 793 | +); |
| 794 | + |
| 795 | +/** Simplified Chinese (中文(简体)) |
| 796 | + * @author Liangent |
| 797 | + */ |
| 798 | +$messages['zh-hans'] = array( |
| 799 | + 'semanticformsinputs-desc' => '用于[http://www.mediawiki.org/wiki/Extension:Semantic_Forms Semantic Forms]的附加输入项类型', |
| 800 | + 'semanticformsinputs-wrongformat' => '格式错误。', |
| 801 | + 'semanticformsinputs-close' => '关闭', |
| 802 | + 'semanticformsinputs-prev' => '向前', |
| 803 | + 'semanticformsinputs-next' => '下一个', |
| 804 | + 'semanticformsinputs-today' => '今天', |
| 805 | +); |
| 806 | + |
| 807 | +/** Traditional Chinese (中文(繁體)) |
| 808 | + * @author Mark85296341 |
| 809 | + */ |
| 810 | +$messages['zh-hant'] = array( |
| 811 | + 'semanticformsinputs-wrongformat' => '格式不正確。', |
| 812 | + 'semanticformsinputs-close' => '關閉', |
| 813 | + 'semanticformsinputs-prev' => '上一個', |
| 814 | + 'semanticformsinputs-next' => '下一個', |
| 815 | + 'semanticformsinputs-today' => '今天', |
| 816 | +); |
| 817 | + |
Property changes on: tags/extensions/SemanticFormsInputs/REL_0_5/SemanticFormsInputs.i18n.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 818 | + native |
Index: tags/extensions/SemanticFormsInputs/REL_0_5/SemanticFormsInputs.php |
— | — | @@ -0,0 +1,105 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Additional input types for [http://www.mediawiki.org/wiki/Extension:SemanticForms Semantic Forms]. |
| 5 | + * |
| 6 | + * @defgroup SFI Semantic Forms Inputs |
| 7 | + * |
| 8 | + * @author Stephan Gambke |
| 9 | + * @author Yaron Koren |
| 10 | + * @author Jeroen de Dauw |
| 11 | + * @author Sanyam Goyal |
| 12 | + * |
| 13 | + * @version 0.5 |
| 14 | + */ |
| 15 | + |
| 16 | +/** |
| 17 | + * The main file of the Semantic Forms Inputs extension |
| 18 | + * |
| 19 | + * @file |
| 20 | + * @ingroup SFI |
| 21 | + */ |
| 22 | + |
| 23 | +if ( !defined( 'MEDIAWIKI' ) ) { |
| 24 | + die( 'This file is part of a MediaWiki extension, it is not a valid entry point.' ); |
| 25 | +} |
| 26 | + |
| 27 | +if ( !defined( 'SF_VERSION' ) ) { |
| 28 | + die( '<b>Error:</b> <a href="https://www.mediawiki.org/wiki/Extension:Semantic_Forms_Inputs">Semantic Forms Inputs</a> is a Semantic Forms extension. You need to install <a href="https://www.mediawiki.org/wiki/Extension:Semantic_Forms">Semantic Forms</a> first.' ); |
| 29 | +} |
| 30 | + |
| 31 | +if ( version_compare( '2.3.1', SF_VERSION ) != -1 ) { |
| 32 | + die( '<b>Error:</b> This version of <a href="https://www.mediawiki.org/wiki/Extension:Semantic_Forms_Inputs">Semantic Forms Inputs</a> is only compatible with Semantic Forms 2.3.1 or above. You need to upgrade <a href="https://www.mediawiki.org/wiki/Extension:Semantic_Forms">Semantic Forms</a> first.' ); |
| 33 | +} |
| 34 | + |
| 35 | +define( 'SFI_VERSION', '0.5' ); |
| 36 | + |
| 37 | +// create and initialize settings |
| 38 | +$sfigSettings = new SFISettings(); |
| 39 | + |
| 40 | +// register extension |
| 41 | +$wgExtensionCredits[defined( 'SEMANTIC_EXTENSION_TYPE' ) ? 'semantic' : 'other'][] = array( |
| 42 | + 'path' => __FILE__, |
| 43 | + 'name' => 'Semantic Forms Inputs', |
| 44 | + 'author' => array( '[http://www.mediawiki.org/wiki/User:F.trott Stephan Gambke]', 'others' ), |
| 45 | + 'url' => 'http://www.mediawiki.org/wiki/Extension:Semantic_Forms_Inputs', |
| 46 | + 'descriptionmsg' => 'semanticformsinputs-desc', |
| 47 | + 'version' => SFI_VERSION, |
| 48 | +); |
| 49 | + |
| 50 | +$dir = dirname( __FILE__ ); |
| 51 | + |
| 52 | +// load user settings |
| 53 | +require_once( $dir . '/includes/SFI_Settings.php' ); |
| 54 | + |
| 55 | +$wgExtensionMessagesFiles['SemanticFormsInputs'] = $dir . '/SemanticFormsInputs.i18n.php'; |
| 56 | +$wgHooks['ParserFirstCallInit'][] = 'wfSFISetup'; |
| 57 | + |
| 58 | +$wgAutoloadClasses['SFIUtils'] = $dir . '/includes/SFI_Utils.php'; |
| 59 | +$wgAutoloadClasses['SFIDatePicker'] = $dir . '/includes/SFI_DatePicker.php'; |
| 60 | +$wgAutoloadClasses['SFITimePicker'] = $dir . '/includes/SFI_TimePicker.php'; |
| 61 | +$wgAutoloadClasses['SFIDateTimePicker'] = $dir . '/includes/SFI_DateTimePicker.php'; |
| 62 | +$wgAutoloadClasses['SFIMenuSelect'] = $dir . '/includes/SFI_MenuSelect.php'; |
| 63 | +$wgAutoloadClasses['SFIRegExp'] = $dir . '/includes/SFI_RegExp.php'; |
| 64 | + |
| 65 | +/** |
| 66 | + * Class to encapsulate all settings |
| 67 | + */ |
| 68 | +class SFISettings { |
| 69 | + // general settings |
| 70 | + public $scriptPath; |
| 71 | + |
| 72 | + // settings for input type datepicker |
| 73 | + public $datePickerFirstDate; |
| 74 | + public $datePickerLastDate; |
| 75 | + public $datePickerDateFormat; |
| 76 | + public $datePickerWeekStart; |
| 77 | + public $datePickerShowWeekNumbers; |
| 78 | + public $datePickerDisableInputField; |
| 79 | + public $datePickerShowResetButton; |
| 80 | + public $datePickerDisabledDaysOfWeek; |
| 81 | + public $datePickerHighlightedDaysOfWeek; |
| 82 | + public $datePickerDisabledDates; |
| 83 | + public $datePickerHighlightedDates; |
| 84 | + public $datePickerMonthNames; |
| 85 | + public $datePickerDayNames; |
| 86 | +} |
| 87 | + |
| 88 | +/** |
| 89 | + * Registers the input types with Semantic Forms. |
| 90 | + */ |
| 91 | +function wfSFISetup() { |
| 92 | + global $sfgFormPrinter, $wgVersion; |
| 93 | + |
| 94 | + $sfgFormPrinter->registerInputType( 'SFIDatePicker' ); |
| 95 | + $sfgFormPrinter->registerInputType( 'SFITimePicker' ); |
| 96 | + $sfgFormPrinter->registerInputType( 'SFIDateTimePicker' ); |
| 97 | + $sfgFormPrinter->registerInputType( 'SFIMenuSelect' ); |
| 98 | + $sfgFormPrinter->registerInputType( 'SFIRegExp' ); |
| 99 | + |
| 100 | + // This function has been deprecated in 1.16, but needed for earlier versions. |
| 101 | + if ( version_compare( $wgVersion, '1.16', '<' ) ) { |
| 102 | + wfLoadExtensionMessages( 'SemanticFormsInputs' ); |
| 103 | + } |
| 104 | + |
| 105 | + return true; |
| 106 | +} |
Property changes on: tags/extensions/SemanticFormsInputs/REL_0_5/SemanticFormsInputs.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 107 | + native |
Index: tags/extensions/SemanticFormsInputs/REL_0_5/images/TimePickerResetButton.gif |
Cannot display: file marked as a binary type. |
svn:mime-type = image/gif |
Property changes on: tags/extensions/SemanticFormsInputs/REL_0_5/images/TimePickerResetButton.gif |
___________________________________________________________________ |
Added: svn:mime-type |
2 | 108 | + image/gif |
Index: tags/extensions/SemanticFormsInputs/REL_0_5/images/DatePickerButtonDisabled.gif |
Cannot display: file marked as a binary type. |
svn:mime-type = image/gif |
Property changes on: tags/extensions/SemanticFormsInputs/REL_0_5/images/DatePickerButtonDisabled.gif |
___________________________________________________________________ |
Added: svn:mime-type |
3 | 109 | + image/gif |
Index: tags/extensions/SemanticFormsInputs/REL_0_5/images/MenuSelectArrow.gif |
Cannot display: file marked as a binary type. |
svn:mime-type = image/gif |
Property changes on: tags/extensions/SemanticFormsInputs/REL_0_5/images/MenuSelectArrow.gif |
___________________________________________________________________ |
Added: svn:mime-type |
4 | 110 | + image/gif |
Index: tags/extensions/SemanticFormsInputs/REL_0_5/images/TimePickerButtonDisabled.gif |
Cannot display: file marked as a binary type. |
svn:mime-type = image/gif |
Property changes on: tags/extensions/SemanticFormsInputs/REL_0_5/images/TimePickerButtonDisabled.gif |
___________________________________________________________________ |
Added: svn:mime-type |
5 | 111 | + image/gif |
Index: tags/extensions/SemanticFormsInputs/REL_0_5/images/DateTimePickerResetButtonDisabled.gif |
Cannot display: file marked as a binary type. |
svn:mime-type = image/gif |
Property changes on: tags/extensions/SemanticFormsInputs/REL_0_5/images/DateTimePickerResetButtonDisabled.gif |
___________________________________________________________________ |
Added: svn:mime-type |
6 | 112 | + image/gif |
Index: tags/extensions/SemanticFormsInputs/REL_0_5/images/DatePickerResetButtonDisabled.gif |
Cannot display: file marked as a binary type. |
svn:mime-type = image/gif |
Property changes on: tags/extensions/SemanticFormsInputs/REL_0_5/images/DatePickerResetButtonDisabled.gif |
___________________________________________________________________ |
Added: svn:mime-type |
7 | 113 | + image/gif |
Index: tags/extensions/SemanticFormsInputs/REL_0_5/images/TimePickerResetButtonDisabled.gif |
Cannot display: file marked as a binary type. |
svn:mime-type = image/gif |
Property changes on: tags/extensions/SemanticFormsInputs/REL_0_5/images/TimePickerResetButtonDisabled.gif |
___________________________________________________________________ |
Added: svn:mime-type |
8 | 114 | + image/gif |
Index: tags/extensions/SemanticFormsInputs/REL_0_5/images/DatePickerButton.gif |
Cannot display: file marked as a binary type. |
svn:mime-type = image/gif |
Property changes on: tags/extensions/SemanticFormsInputs/REL_0_5/images/DatePickerButton.gif |
___________________________________________________________________ |
Added: svn:mime-type |
9 | 115 | + image/gif |
Index: tags/extensions/SemanticFormsInputs/REL_0_5/images/TimePickerButton.gif |
Cannot display: file marked as a binary type. |
svn:mime-type = image/gif |
Property changes on: tags/extensions/SemanticFormsInputs/REL_0_5/images/TimePickerButton.gif |
___________________________________________________________________ |
Added: svn:mime-type |
10 | 116 | + image/gif |
Index: tags/extensions/SemanticFormsInputs/REL_0_5/images/DateTimePickerResetButton.gif |
Cannot display: file marked as a binary type. |
svn:mime-type = image/gif |
Property changes on: tags/extensions/SemanticFormsInputs/REL_0_5/images/DateTimePickerResetButton.gif |
___________________________________________________________________ |
Added: svn:mime-type |
11 | 117 | + image/gif |
Index: tags/extensions/SemanticFormsInputs/REL_0_5/images/DatePickerResetButton.gif |
Cannot display: file marked as a binary type. |
svn:mime-type = image/gif |
Property changes on: tags/extensions/SemanticFormsInputs/REL_0_5/images/DatePickerResetButton.gif |
___________________________________________________________________ |
Added: svn:mime-type |
12 | 118 | + image/gif |
Index: tags/extensions/SemanticFormsInputs/REL_0_5/includes/SFI_DateTimePicker.php |
— | — | @@ -0,0 +1,230 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * File holding the SFI_DateTimePicker class |
| 6 | + * |
| 7 | + * @author Stephan Gambke |
| 8 | + * @file |
| 9 | + * @ingroup SemanticFormsInputs |
| 10 | + */ |
| 11 | +if ( !defined( 'SFI_VERSION' ) ) { |
| 12 | + die( 'This file is part of the SemanticFormsInputs extension, it is not a valid entry point.' ); |
| 13 | +} |
| 14 | + |
| 15 | +/** |
| 16 | + * The SFIDateTimePicker class. |
| 17 | + * |
| 18 | + * @ingroup SemanticFormsInputs |
| 19 | + */ |
| 20 | +class SFIDateTimePicker extends SFFormInput { |
| 21 | + |
| 22 | + protected $mDatePicker; |
| 23 | + protected $mTimePicker; |
| 24 | + |
| 25 | + /** |
| 26 | + * Constructor. |
| 27 | + * |
| 28 | + * @param String $input_number |
| 29 | + * The number of the input in the form. |
| 30 | + * @param String $cur_value |
| 31 | + * The current value of the input field. |
| 32 | + * @param String $input_name |
| 33 | + * The name of the input. |
| 34 | + * @param String $disabled |
| 35 | + * Is this input disabled? |
| 36 | + * @param Array $other_args |
| 37 | + * An associative array of other parameters that were present in the |
| 38 | + * input definition. |
| 39 | + */ |
| 40 | + public function __construct( $input_number, $cur_value, $input_name, $disabled, $other_args ) { |
| 41 | + |
| 42 | + parent::__construct( $input_number, $cur_value, $input_name, $disabled, $other_args ); |
| 43 | + |
| 44 | + self::setup(); |
| 45 | + |
| 46 | + // prepare sub-inputs |
| 47 | + |
| 48 | + $this->mOtherArgs["part of dtp"] = true; |
| 49 | + |
| 50 | + // find allowed values and keep only the date portion |
| 51 | + if ( array_key_exists( 'possible_values', $this->mOtherArgs ) && |
| 52 | + count( $this->mOtherArgs[ 'possible_values' ] ) ) { |
| 53 | + |
| 54 | + $this->mOtherArgs[ 'possible_values' ] = preg_replace( |
| 55 | + '/^\s*(\d{4}\/\d{2}\/\d{2}).*/', |
| 56 | + '$1', |
| 57 | + $this->mOtherArgs[ 'possible_values' ] |
| 58 | + ); |
| 59 | + } |
| 60 | + |
| 61 | + $dateTimeString = trim( $this->mCurrentValue ); |
| 62 | + $dateString = ''; |
| 63 | + $timeString = ''; |
| 64 | + |
| 65 | + $separatorPos = strpos($dateTimeString, " "); |
| 66 | + |
| 67 | + // does it have a separating whitespace? assume it's a date & time |
| 68 | + if ( $separatorPos ) { |
| 69 | + $dateString = substr( $dateTimeString, 0, $separatorPos ); |
| 70 | + $timeString = substr( $dateTimeString, $separatorPos + 1 ); |
| 71 | + |
| 72 | + // does it start with a time of some kind? |
| 73 | + } elseif ( preg_match( '/^\d?\d:\d\d/', $dateTimeString ) ) { |
| 74 | + $timeString = $dateTimeString; |
| 75 | + |
| 76 | + // if all else fails assume it's a date |
| 77 | + } else { |
| 78 | + $dateString = $dateTimeString; |
| 79 | + } |
| 80 | + |
| 81 | + $this->mDatePicker = new SFIDatePicker( $this->mInputNumber . '_dp', $dateString, $this->mInputName, $this->mIsDisabled, $this->mOtherArgs ); |
| 82 | + $this->mTimePicker = new SFITimePicker( $this->mInputNumber . '_tp', $timeString, $this->mInputName, $this->mIsDisabled, $this->mOtherArgs ); |
| 83 | + |
| 84 | + // add JS data |
| 85 | + $this->addJsInitFunctionData( 'SFI_DTP_init', $this->setupJsInitAttribs() ); |
| 86 | + |
| 87 | + } |
| 88 | + |
| 89 | + /** |
| 90 | + * Returns the name of the input type this class handles: menuselect. |
| 91 | + * |
| 92 | + * This is the name to be used in the field definition for the "input type" |
| 93 | + * parameter. |
| 94 | + * |
| 95 | + * @return String The name of the input type this class handles. |
| 96 | + */ |
| 97 | + public static function getName() { |
| 98 | + return 'datetimepicker'; |
| 99 | + } |
| 100 | + |
| 101 | + /** |
| 102 | + * Static setup method for input type "menuselect". |
| 103 | + * Adds the Javascript code and css used by all menuselects. |
| 104 | + */ |
| 105 | + static private function setup() { |
| 106 | + |
| 107 | + global $wgOut; |
| 108 | + global $sfigSettings; |
| 109 | + |
| 110 | + static $hasRun = false; |
| 111 | + |
| 112 | + if ( !$hasRun ) { |
| 113 | + $hasRun = true; |
| 114 | + |
| 115 | + $wgOut->addScript( '<script type="text/javascript" src="' . $sfigSettings->scriptPath . '/libs/datetimepicker.js"></script> ' ); |
| 116 | + |
| 117 | + } |
| 118 | + |
| 119 | + } |
| 120 | + |
| 121 | + protected function setupJsInitAttribs() { |
| 122 | + |
| 123 | + global $sfigSettings; |
| 124 | + |
| 125 | + $jsattribs = array(); |
| 126 | + |
| 127 | + // if we have to show a reset button |
| 128 | + if ( array_key_exists( 'show reset button', $this->mOtherArgs ) || |
| 129 | + ( !array_key_exists( 'hide reset button', $this->mOtherArgs ) && $sfigSettings->datetimePickerShowResetButton ) ) { |
| 130 | + |
| 131 | + // is the button disabled? |
| 132 | + $jsattribs['disabled'] = $this->mIsDisabled; |
| 133 | + |
| 134 | + // set the button image |
| 135 | + if ( $this->mIsDisabled ) { |
| 136 | + $jsattribs['resetButtonImage'] = $sfigSettings->scriptPath . '/images/DateTimePickerResetButtonDisabled.gif'; |
| 137 | + } else { |
| 138 | + $jsattribs['resetButtonImage'] = $sfigSettings->scriptPath . '/images/DateTimePickerResetButton.gif'; |
| 139 | + } |
| 140 | + |
| 141 | + // set user classes |
| 142 | + if ( array_key_exists( 'class', $this->mOtherArgs ) ) { |
| 143 | + $jsattribs['userClasses'] = $this->mOtherArgs['class']; |
| 144 | + } else { |
| 145 | + $jsattribs['userClasses'] = ''; |
| 146 | + } |
| 147 | + } |
| 148 | + |
| 149 | + $jsattribs['subinputs'] = |
| 150 | + $this->mDatePicker->getHtmlText() . " " . |
| 151 | + $this->mTimePicker->getHtmlText(); |
| 152 | + |
| 153 | + $jsattribs['subinputsInitData'] = array( |
| 154 | + 'input_' . $this->mInputNumber . '_dp' => $this->mDatePicker->getJsInitFunctionData(), |
| 155 | + 'input_' . $this->mInputNumber . '_tp' => $this->mTimePicker->getJsInitFunctionData() |
| 156 | + ); |
| 157 | + |
| 158 | + // build JS code from attributes array |
| 159 | + return Xml::encodeJsVar( $jsattribs ); |
| 160 | + } |
| 161 | + |
| 162 | + /** |
| 163 | + * Returns the HTML code to be included in the output page for this input. |
| 164 | + * |
| 165 | + * Ideally this HTML code should provide a basic functionality even if the |
| 166 | + * browser is not Javascript capable. I.e. even without Javascript the user |
| 167 | + * should be able to input values. |
| 168 | + * |
| 169 | + */ |
| 170 | + public function getHtmlText(){ |
| 171 | + |
| 172 | + global $sfigSettings; |
| 173 | + |
| 174 | + // should the input field be disabled? |
| 175 | + $inputFieldDisabled = |
| 176 | + array_key_exists( 'disable input field', $this->mOtherArgs ) |
| 177 | + || ( !array_key_exists( 'enable input field', $this->mOtherArgs ) && $sfigSettings->datePickerDisableInputField ) |
| 178 | + || $this->mIsDisabled ; |
| 179 | + |
| 180 | + $html = '<span class="inputSpan' . ( array_key_exists( 'mandatory', $this->mOtherArgs) ? ' mandatoryFieldSpan' : '') . '">' . |
| 181 | + SFIUtils::textHTML( $this->mCurrentValue, $this->mInputName, $inputFieldDisabled, $this->mOtherArgs, 'input_' . $this->mInputNumber ) . |
| 182 | + '</span>'; |
| 183 | + |
| 184 | + return $html; |
| 185 | + |
| 186 | + } |
| 187 | + |
| 188 | + /** |
| 189 | + * Returns the set of SMW property types which this input can |
| 190 | + * handle, but for which it isn't the default input. |
| 191 | + */ |
| 192 | + public static function getOtherPropTypesHandled() { |
| 193 | + return array( '_str', '_dat' ); |
| 194 | + } |
| 195 | + |
| 196 | + /** |
| 197 | + * Returns the set of parameters for this form input. |
| 198 | + * |
| 199 | + * TODO: Specify parameters specific for menuselect. |
| 200 | + */ |
| 201 | + public static function getParameters() { |
| 202 | + $params = parent::getParameters(); |
| 203 | + |
| 204 | + $params[] = array( |
| 205 | + 'name' => 'structure', |
| 206 | + 'type' => 'text', |
| 207 | + 'description' => wfMsg( 'semanticformsinputs-menuselect-structure' ), |
| 208 | + 'default' => "* item 1\n** item 11\n** item 12\n* item 2\n** item 21\n** item 22" |
| 209 | + ); |
| 210 | + $params[] = array( |
| 211 | + 'name' => $sfigSettings->menuSelectDisableInputField?'enable input field':'disable input field', |
| 212 | + 'type' => 'boolean', |
| 213 | + 'description' => wfMsg( 'semanticformsinputs-menuselect-enableinputfield' ), |
| 214 | + ); |
| 215 | + return $params; |
| 216 | + } |
| 217 | + |
| 218 | + /** |
| 219 | + * Returns the name and parameters for the validation JavaScript |
| 220 | + * functions for this input type, if any. |
| 221 | + */ |
| 222 | + public function getJsValidationFunctionData() { |
| 223 | + return array_merge( |
| 224 | + $this->mJsValidationFunctionData, |
| 225 | + $this->mDatePicker->getJsValidationFunctionData(), |
| 226 | + $this->mTimePicker->getJsValidationFunctionData() |
| 227 | + ); |
| 228 | + |
| 229 | + } |
| 230 | + |
| 231 | +} |
Property changes on: tags/extensions/SemanticFormsInputs/REL_0_5/includes/SFI_DateTimePicker.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 232 | + native |
Index: tags/extensions/SemanticFormsInputs/REL_0_5/includes/SFI_RegExp.php |
— | — | @@ -0,0 +1,249 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * File holding the SFIRegExp class |
| 6 | + * |
| 7 | + * @author Stephan Gambke |
| 8 | + * @file |
| 9 | + * @ingroup SemanticFormsInputs |
| 10 | + */ |
| 11 | +if ( !defined( 'SFI_VERSION' ) ) { |
| 12 | + die( 'This file is part of the SemanticFormsInputs extension, it is not a valid entry point.' ); |
| 13 | +} |
| 14 | + |
| 15 | +/** |
| 16 | + * This class represents the RegExp input. |
| 17 | + * |
| 18 | + * @ingroup SFI |
| 19 | + */ |
| 20 | +class SFIRegExp extends SFFormInput { |
| 21 | + |
| 22 | + /** @var SFFormInput */ |
| 23 | + protected $mBaseInput; |
| 24 | + |
| 25 | + /** |
| 26 | + * Constructor. |
| 27 | + * |
| 28 | + * @param String $input_number |
| 29 | + * The number of the input in the form. |
| 30 | + * @param String $cur_value |
| 31 | + * The current value of the input field. |
| 32 | + * @param String $input_name |
| 33 | + * The name of the input. |
| 34 | + * @param String $disabled |
| 35 | + * Is this input disabled? |
| 36 | + * @param Array $other_args |
| 37 | + * An associative array of other parameters that were present in the |
| 38 | + * input definition. |
| 39 | + */ |
| 40 | + public function __construct( $input_number, $cur_value, $input_name, $disabled, $other_args ) { |
| 41 | + |
| 42 | + global $sfgFormPrinter; |
| 43 | + |
| 44 | + parent::__construct( $input_number, $cur_value, $input_name, $disabled, $other_args ); |
| 45 | + |
| 46 | + // call static setup |
| 47 | + self::setup(); |
| 48 | + |
| 49 | + // set OR character |
| 50 | + if ( array_key_exists( 'or char', $this->mOtherArgs ) ) { |
| 51 | + $orChar = trim( $this->mOtherArgs['or char'] ); |
| 52 | + unset( $this->mOtherArgs['or char'] ); |
| 53 | + } else { |
| 54 | + $orChar = '!'; |
| 55 | + } |
| 56 | + |
| 57 | + |
| 58 | + // set regexp string |
| 59 | + if ( array_key_exists( 'regexp', $this->mOtherArgs ) ) { |
| 60 | + |
| 61 | + $this->mRegExp = str_replace( $orChar, '|', trim( $this->mOtherArgs['regexp'] ) ); |
| 62 | + unset( $this->mOtherArgs['regexp'] ); |
| 63 | + |
| 64 | + // check for leading/trailing delimiter and remove it (else reset regexp) |
| 65 | + if ( preg_match( "/^\/.*\/\$/", $this->mRegExp ) ) { |
| 66 | + |
| 67 | + $this->mRegExp = substr( $this->mRegExp, 1, strlen( $this->mRegExp ) - 2 ); |
| 68 | + } else { |
| 69 | + $this->mRegExp = '.*'; |
| 70 | + } |
| 71 | + } else { |
| 72 | + $this->mRegExp = '.*'; |
| 73 | + } |
| 74 | + |
| 75 | + // set inverse string |
| 76 | + if ( array_key_exists( 'inverse', $this->mOtherArgs ) ) { |
| 77 | + $invertRegexp = 'true'; |
| 78 | + unset( $this->mOtherArgs['inverse'] ); |
| 79 | + } else { |
| 80 | + $invertRegexp = 'false'; |
| 81 | + } |
| 82 | + |
| 83 | + // set failure message string |
| 84 | + if ( array_key_exists( 'message', $this->mOtherArgs ) ) { |
| 85 | + $this->mErrorMessage = trim( $this->mOtherArgs['message'] ); |
| 86 | + unset( $this->mOtherArgs['message'] ); |
| 87 | + } else { |
| 88 | + $this->mErrorMessage = wfMsg( 'semanticformsinputs-wrongformat' ); |
| 89 | + } |
| 90 | + |
| 91 | + // sanitize error message and regexp for JS |
| 92 | + $message = Xml::encodeJsVar( $this->mErrorMessage ); |
| 93 | + $regexp = Xml::encodeJsVar( $this->mRegExp ); |
| 94 | + |
| 95 | + // Finally set name and parameters for the validation function |
| 96 | + $this->addJsValidationFunctionData( 'SFI_RE_validate', "{retext: {$regexp}, inverse: {$invertRegexp}, message: {$message} }" ); |
| 97 | + |
| 98 | + |
| 99 | + // set base input type name |
| 100 | + if ( array_key_exists( 'base type', $this->mOtherArgs ) ) { |
| 101 | + |
| 102 | + $baseType = trim( $this->mOtherArgs['base type'] ); |
| 103 | + unset( $this->mOtherArgs['base type'] ); |
| 104 | + |
| 105 | + // if unknown set default base input type |
| 106 | + if ( !array_key_exists( $baseType, $sfgFormPrinter->mInputTypeClasses ) ) { |
| 107 | + $baseType = 'text'; |
| 108 | + } |
| 109 | + } else { |
| 110 | + $baseType = 'text'; |
| 111 | + } |
| 112 | + |
| 113 | + // create other_args array for base input type if base prefix was set |
| 114 | + if ( array_key_exists( 'base prefix', $this->mOtherArgs ) ) { |
| 115 | + |
| 116 | + // set base prefix |
| 117 | + $basePrefix = trim( $this->mOtherArgs['base prefix'] ) . "."; |
| 118 | + unset( $this->mOtherArgs['base prefix'] ); |
| 119 | + |
| 120 | + // create new other_args param |
| 121 | + $newOtherArgs = array(); |
| 122 | + |
| 123 | + foreach ( $this->mOtherArgs as $key => $value ) { |
| 124 | + if ( strpos( $key, $basePrefix ) === 0 ) { |
| 125 | + $newOtherArgs[substr( $key, strlen( $basePrefix ) )] = $value; |
| 126 | + } else { |
| 127 | + $newOtherArgs[$key] = $value; |
| 128 | + } |
| 129 | + } |
| 130 | + |
| 131 | + } else { |
| 132 | + $newOtherArgs = $this->mOtherArgs; |
| 133 | + } |
| 134 | + |
| 135 | + // create base input |
| 136 | + $this->mBaseInput = new $sfgFormPrinter->mInputTypeClasses[ $baseType ] ( |
| 137 | + $this->mInputNumber, $this->mCurrentValue, $this->mInputName, $this->mIsDisabled, $newOtherArgs |
| 138 | + ); |
| 139 | + |
| 140 | + } |
| 141 | + |
| 142 | + /** |
| 143 | + * Returns the name of the input type this class handles. |
| 144 | + * |
| 145 | + * This is the name to be used in the field definition for the "input type" |
| 146 | + * parameter. |
| 147 | + * |
| 148 | + * @return String The name of the input type this class handles. |
| 149 | + */ |
| 150 | + public static function getName() { |
| 151 | + return 'regexp'; |
| 152 | + } |
| 153 | + |
| 154 | + /** |
| 155 | + * Static setup method for input type "menuselect". |
| 156 | + * Adds the Javascript code and css used by all menuselects. |
| 157 | + */ |
| 158 | + static private function setup() { |
| 159 | + |
| 160 | + global $wgOut; |
| 161 | + global $sfigSettings; |
| 162 | + |
| 163 | + static $hasRun = false; |
| 164 | + |
| 165 | + if ( !$hasRun ) { |
| 166 | + $hasRun = true; |
| 167 | + $wgOut->addScript( '<script type="text/javascript" src="' . $sfigSettings->scriptPath . '/libs/regexp.js"></script> ' ); |
| 168 | + } |
| 169 | + } |
| 170 | + |
| 171 | + /** |
| 172 | + * Returns the set of parameters for this form input. |
| 173 | + */ |
| 174 | + public static function getParameters() { |
| 175 | + $params = parent::getParameters(); |
| 176 | + $params[] = array( |
| 177 | + 'name' => 'regexp', |
| 178 | + 'type' => 'string', |
| 179 | + 'description' => wfMsg( 'semanticformsinputs-regexp-regexp' ) |
| 180 | + ); |
| 181 | + $params[] = array( |
| 182 | + 'name' => 'base type', |
| 183 | + 'type' => 'string', |
| 184 | + 'description' => wfMsg( 'semanticformsinputs-regexp-basetype' ) |
| 185 | + ); |
| 186 | + $params[] = array( |
| 187 | + 'name' => 'base prefix', |
| 188 | + 'type' => 'string', |
| 189 | + 'description' => wfMsg( 'semanticformsinputs-regexp-baseprefix' ) |
| 190 | + ); |
| 191 | + $params[] = array( |
| 192 | + 'name' => 'or char', |
| 193 | + 'type' => 'string', |
| 194 | + 'description' => wfMsg( 'semanticformsinputs-regexp-orchar' ) |
| 195 | + ); |
| 196 | + $params[] = array( |
| 197 | + 'name' => 'inverse', |
| 198 | + 'type' => 'string', |
| 199 | + 'description' => wfMsg( 'semanticformsinputs-regexp-inverse' ) |
| 200 | + ); |
| 201 | + $params[] = array( |
| 202 | + 'name' => 'message', |
| 203 | + 'type' => 'string', |
| 204 | + 'description' => wfMsg( 'semanticformsinputs-regexp-message' ) |
| 205 | + ); |
| 206 | + |
| 207 | + |
| 208 | + return $params; |
| 209 | + } |
| 210 | + |
| 211 | + /** |
| 212 | + * Returns the HTML code to be included in the output page for this input. |
| 213 | + * |
| 214 | + * Ideally this HTML code should provide a basic functionality even if the |
| 215 | + * browser is not JavaScript capable. I.e. even without JavaScript the user |
| 216 | + * should be able to input values. |
| 217 | + * |
| 218 | + */ |
| 219 | + public function getHtmlText() { |
| 220 | + |
| 221 | + return $this->mBaseInput->getHtmlText(); |
| 222 | + } |
| 223 | + |
| 224 | + /** |
| 225 | + * Returns the set of SMW property types which this input can |
| 226 | + * handle, but for which it isn't the default input. |
| 227 | + * |
| 228 | + * @deprecated |
| 229 | + * @return Array of strings |
| 230 | + */ |
| 231 | + public static function getOtherPropTypesHandled() { |
| 232 | + return array('_str', '_num', '_dat', '_geo', '_ema', '_tel', '_wpg', '_tem', '_qty'); |
| 233 | + } |
| 234 | + |
| 235 | + /** |
| 236 | + * Returns the name and parameters for the initialization JavaScript |
| 237 | + * function for this input type, if any. |
| 238 | + */ |
| 239 | + public function getJsInitFunctionData() { |
| 240 | + return array_merge( $this->mJsInitFunctionData, $this->mBaseInput->getJsInitFunctionData() ); |
| 241 | + } |
| 242 | + |
| 243 | + /** |
| 244 | + * Returns the name and parameters for the validation JavaScript |
| 245 | + * functions for this input type, if any. |
| 246 | + */ |
| 247 | + public function getJsValidationFunctionData() { |
| 248 | + return array_merge( $this->mJsValidationFunctionData, $this->mBaseInput->getJsValidationFunctionData() ); |
| 249 | + } |
| 250 | +} |
Property changes on: tags/extensions/SemanticFormsInputs/REL_0_5/includes/SFI_RegExp.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 251 | + native |
Index: tags/extensions/SemanticFormsInputs/REL_0_5/includes/SFI_DatePicker.php |
— | — | @@ -0,0 +1,710 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * File holding the SFIDatePicker class |
| 6 | + * |
| 7 | + * @author Stephan Gambke |
| 8 | + * @file |
| 9 | + * @ingroup SemanticFormsInputs |
| 10 | + */ |
| 11 | +if ( !defined( 'SFI_VERSION' ) ) { |
| 12 | + die( 'This file is part of the SemanticFormsInputs extension, it is not a valid entry point.' ); |
| 13 | +} |
| 14 | + |
| 15 | +/** |
| 16 | + * The SFIDatePicker class. |
| 17 | + * |
| 18 | + * @ingroup SemanticFormsInputs |
| 19 | + */ |
| 20 | +class SFIDatePicker extends SFFormInput { |
| 21 | + |
| 22 | + /** |
| 23 | + * Constructor. |
| 24 | + * |
| 25 | + * @param String $input_number |
| 26 | + * The number of the input in the form. |
| 27 | + * @param String $cur_value |
| 28 | + * The current value of the input field. |
| 29 | + * @param String $input_name |
| 30 | + * The name of the input. |
| 31 | + * @param String $disabled |
| 32 | + * Is this input disabled? |
| 33 | + * @param Array $other_args |
| 34 | + * An associative array of other parameters that were present in the |
| 35 | + * input definition. |
| 36 | + */ |
| 37 | + public function __construct( $input_number, $cur_value, $input_name, $disabled, $other_args ) { |
| 38 | + |
| 39 | + parent::__construct( $input_number, $cur_value, $input_name, $disabled, $other_args ); |
| 40 | + |
| 41 | + // call static setup |
| 42 | + self::setup(); |
| 43 | + |
| 44 | + $this->addJsInitFunctionData( 'SFI_DP_init', $this->setupJsInitAttribs() ); |
| 45 | + } |
| 46 | + |
| 47 | + /** |
| 48 | + * Returns the name of the input type this class handles. |
| 49 | + * |
| 50 | + * This is the name to be used in the field definition for the "input type" |
| 51 | + * parameter. |
| 52 | + * |
| 53 | + * @return String The name of the input type this class handles. |
| 54 | + */ |
| 55 | + public static function getName() { |
| 56 | + return 'datepicker'; |
| 57 | + } |
| 58 | + |
| 59 | + /** |
| 60 | + * Static setup method for input type "menuselect". |
| 61 | + * Adds the Javascript code and css used by all menuselects. |
| 62 | + */ |
| 63 | + static private function setup() { |
| 64 | + |
| 65 | + global $wgOut, $wgLang; |
| 66 | + global $sfgScriptPath, $sfigSettings; |
| 67 | + |
| 68 | + static $hasRun = false; |
| 69 | + |
| 70 | + if ( !$hasRun ) { |
| 71 | + $hasRun = true; |
| 72 | + |
| 73 | + $wgOut->addExtensionStyle( $sfgScriptPath . '/skins/jquery-ui/base/jquery.ui.datepicker.css' ); |
| 74 | + $wgOut->addExtensionStyle( $sfgScriptPath . '/skins/jquery-ui/base/jquery.ui.theme.css' ); |
| 75 | + $wgOut->addScript( '<script type="text/javascript" src="' . $sfgScriptPath . '/libs/jquery-ui/jquery.ui.datepicker.min.js"></script> ' ); |
| 76 | + $wgOut->addScript( '<script type="text/javascript" src="' . $sfigSettings->scriptPath . '/libs/datepicker.js"></script> ' ); |
| 77 | + |
| 78 | + // set localized messages (use MW i18n, not jQuery i18n) |
| 79 | + $jstext = |
| 80 | + "jQuery(function(){\n" |
| 81 | + . " jQuery.datepicker.regional['wiki'] = {\n" |
| 82 | + . " closeText: '" . Xml::escapeJsString( wfMsg( 'semanticformsinputs-close' ) ) . "',\n" |
| 83 | + . " prevText: '" . Xml::escapeJsString( wfMsg( 'semanticformsinputs-prev' ) ) . "',\n" |
| 84 | + . " nextText: '" . Xml::escapeJsString( wfMsg( 'semanticformsinputs-next' ) ) . "',\n" |
| 85 | + . " currentText: '" . Xml::escapeJsString( wfMsg( 'semanticformsinputs-today' ) ) . "',\n" |
| 86 | + . " monthNames: ['" |
| 87 | + . Xml::escapeJsString( wfMsg( 'january' ) ) . "','" |
| 88 | + . Xml::escapeJsString( wfMsg( 'february' ) ) . "','" |
| 89 | + . Xml::escapeJsString( wfMsg( 'march' ) ) . "','" |
| 90 | + . Xml::escapeJsString( wfMsg( 'april' ) ) . "','" |
| 91 | + . Xml::escapeJsString( wfMsg( 'may_long' ) ) . "','" |
| 92 | + . Xml::escapeJsString( wfMsg( 'june' ) ) . "','" |
| 93 | + . Xml::escapeJsString( wfMsg( 'july' ) ) . "','" |
| 94 | + . Xml::escapeJsString( wfMsg( 'august' ) ) . "','" |
| 95 | + . Xml::escapeJsString( wfMsg( 'september' ) ) . "','" |
| 96 | + . Xml::escapeJsString( wfMsg( 'october' ) ) . "','" |
| 97 | + . Xml::escapeJsString( wfMsg( 'november' ) ) . "','" |
| 98 | + . Xml::escapeJsString( wfMsg( 'december' ) ) . "'],\n" |
| 99 | + . " monthNamesShort: ['" |
| 100 | + . Xml::escapeJsString( wfMsg( 'jan' ) ) . "','" |
| 101 | + . Xml::escapeJsString( wfMsg( 'feb' ) ) . "','" |
| 102 | + . Xml::escapeJsString( wfMsg( 'mar' ) ) . "','" |
| 103 | + . Xml::escapeJsString( wfMsg( 'apr' ) ) . "','" |
| 104 | + . Xml::escapeJsString( wfMsg( 'may' ) ) . "','" |
| 105 | + . Xml::escapeJsString( wfMsg( 'jun' ) ) . "','" |
| 106 | + . Xml::escapeJsString( wfMsg( 'jul' ) ) . "','" |
| 107 | + . Xml::escapeJsString( wfMsg( 'aug' ) ) . "','" |
| 108 | + . Xml::escapeJsString( wfMsg( 'sep' ) ) . "','" |
| 109 | + . Xml::escapeJsString( wfMsg( 'oct' ) ) . "','" |
| 110 | + . Xml::escapeJsString( wfMsg( 'nov' ) ) . "','" |
| 111 | + . Xml::escapeJsString( wfMsg( 'dec' ) ) . "'],\n" |
| 112 | + . " dayNames: ['" |
| 113 | + . Xml::escapeJsString( wfMsg( 'sunday' ) ) . "','" |
| 114 | + . Xml::escapeJsString( wfMsg( 'monday' ) ) . "','" |
| 115 | + . Xml::escapeJsString( wfMsg( 'tuesday' ) ) . "','" |
| 116 | + . Xml::escapeJsString( wfMsg( 'wednesday' ) ) . "','" |
| 117 | + . Xml::escapeJsString( wfMsg( 'thursday' ) ) . "','" |
| 118 | + . Xml::escapeJsString( wfMsg( 'friday' ) ) . "','" |
| 119 | + . Xml::escapeJsString( wfMsg( 'saturday' ) ) . "'],\n" |
| 120 | + . " dayNamesShort: ['" |
| 121 | + . Xml::escapeJsString( wfMsg( 'sun' ) ) . "','" |
| 122 | + . Xml::escapeJsString( wfMsg( 'mon' ) ) . "','" |
| 123 | + . Xml::escapeJsString( wfMsg( 'tue' ) ) . "','" |
| 124 | + . Xml::escapeJsString( wfMsg( 'wed' ) ) . "','" |
| 125 | + . Xml::escapeJsString( wfMsg( 'thu' ) ) . "','" |
| 126 | + . Xml::escapeJsString( wfMsg( 'fri' ) ) . "','" |
| 127 | + . Xml::escapeJsString( wfMsg( 'sat' ) ) . "'],\n" |
| 128 | + . " dayNamesMin: ['" |
| 129 | + . Xml::escapeJsString( $wgLang->firstChar( wfMsg( 'sun' ) ) ) . "','" |
| 130 | + . Xml::escapeJsString( $wgLang->firstChar( wfMsg( 'mon' ) ) ) . "','" |
| 131 | + . Xml::escapeJsString( $wgLang->firstChar( wfMsg( 'tue' ) ) ) . "','" |
| 132 | + . Xml::escapeJsString( $wgLang->firstChar( wfMsg( 'wed' ) ) ) . "','" |
| 133 | + . Xml::escapeJsString( $wgLang->firstChar( wfMsg( 'thu' ) ) ) . "','" |
| 134 | + . Xml::escapeJsString( $wgLang->firstChar( wfMsg( 'fri' ) ) ) . "','" |
| 135 | + . Xml::escapeJsString( $wgLang->firstChar( wfMsg( 'sat' ) ) ) . "'],\n" |
| 136 | + . " weekHeader: '',\n" |
| 137 | + . " dateFormat: '" . Xml::escapeJsString( wfMsg( 'semanticformsinputs-dateformatshort' ) ) . "',\n" |
| 138 | + . " firstDay: '" . Xml::escapeJsString( wfMsg( 'semanticformsinputs-firstdayofweek' ) ) . "',\n" |
| 139 | + . " isRTL: " . ( $wgLang->isRTL() ? "true" : "false" ) . ",\n" |
| 140 | + . " showMonthAfterYear: false,\n" |
| 141 | + . " yearSuffix: ''};\n" |
| 142 | + . " jQuery.datepicker.setDefaults(jQuery.datepicker.regional['wiki']);\n" |
| 143 | + . "});\n"; |
| 144 | + |
| 145 | + $wgOut->addScript( Html::inlineScript( $jstext ) ); |
| 146 | + |
| 147 | + } |
| 148 | + } |
| 149 | + |
| 150 | + /** |
| 151 | + * Set up JS attributes |
| 152 | + * |
| 153 | + * @return String |
| 154 | + */ |
| 155 | + protected function setupJsInitAttribs() { |
| 156 | + |
| 157 | + global $sfigSettings; |
| 158 | + global $wgAmericanDates; |
| 159 | + |
| 160 | + // store user class(es) for use with buttons |
| 161 | + $userClasses = array_key_exists( 'class', $this->mOtherArgs ) ? $this->mOtherArgs['class'] : ''; |
| 162 | + |
| 163 | + // set up attributes required for both enabled and disabled datepickers |
| 164 | + $jsattribs = array( |
| 165 | + 'currValue' => $this->mCurrentValue, |
| 166 | + 'disabled' => $this->mIsDisabled, |
| 167 | + 'userClasses' => $userClasses |
| 168 | + ); |
| 169 | + |
| 170 | + if ( array_key_exists( 'part of dtp', $this->mOtherArgs ) ) { |
| 171 | + $jsattribs['partOfDTP'] = $this->mOtherArgs['part of dtp']; |
| 172 | + } |
| 173 | + |
| 174 | + // set date format |
| 175 | + // SHORT and LONG are SFI specific acronyms and are translated here |
| 176 | + // into format strings, anything else is passed to the jQuery date picker |
| 177 | + // Americans need special treatment |
| 178 | + if ( $wgAmericanDates && $wgLang->getCode() == "en" ) { |
| 179 | + |
| 180 | + if ( array_key_exists( 'date format', $this->mOtherArgs ) ) { |
| 181 | + |
| 182 | + if ( $this->mOtherArgs['date format'] == 'SHORT' ) { |
| 183 | + $jsattribs['dateFormat'] = 'mm/dd/yy'; |
| 184 | + } elseif ( $this->mOtherArgs['date format'] == 'LONG' ) { |
| 185 | + $jsattribs['dateFormat'] = 'MM d, yy'; |
| 186 | + } else { |
| 187 | + $jsattribs['dateFormat'] = $this->mOtherArgs['date format']; |
| 188 | + } |
| 189 | + |
| 190 | + } elseif ( $sfigSettings->datePickerDateFormat ) { |
| 191 | + |
| 192 | + if ( $sfigSettings->datePickerDateFormat == 'SHORT' ) { |
| 193 | + $jsattribs['dateFormat'] = 'mm/dd/yy'; |
| 194 | + } elseif ( $sfigSettings->datePickerDateFormat == 'LONG' ) { |
| 195 | + $jsattribs['dateFormat'] = 'MM d, yy'; |
| 196 | + } else { |
| 197 | + $jsattribs['dateFormat'] = $sfigSettings->datePickerDateFormat; |
| 198 | + } |
| 199 | + |
| 200 | + } else $jsattribs['dateFormat'] = 'yy/mm/dd'; |
| 201 | + |
| 202 | + } else { |
| 203 | + |
| 204 | + if ( array_key_exists( 'date format', $this->mOtherArgs ) ) { |
| 205 | + |
| 206 | + if ( $this->mOtherArgs['date format'] == 'SHORT' ) { |
| 207 | + $jsattribs['dateFormat'] = wfMsg( 'semanticformsinputs-dateformatshort' ); |
| 208 | + } elseif ( $this->mOtherArgs['date format'] == 'LONG' ) { |
| 209 | + $jsattribs['dateFormat'] = wfMsg( 'semanticformsinputs-dateformatlong' ); |
| 210 | + } else { |
| 211 | + $jsattribs['dateFormat'] = $this->mOtherArgs['date format']; |
| 212 | + } |
| 213 | + |
| 214 | + } elseif ( $sfigSettings->datePickerDateFormat ) { |
| 215 | + |
| 216 | + if ( $sfigSettings->datePickerDateFormat == 'SHORT' ) { |
| 217 | + $jsattribs['dateFormat'] = wfMsg( 'semanticformsinputs-dateformatshort' ); |
| 218 | + } elseif ( $sfigSettings->datePickerDateFormat == 'LONG' ) { |
| 219 | + $jsattribs['dateFormat'] = wfMsg( 'semanticformsinputs-dateformatlong' ); |
| 220 | + } else { |
| 221 | + $jsattribs['dateFormat'] = $sfigSettings->datePickerDateFormat; |
| 222 | + } |
| 223 | + |
| 224 | + } else $jsattribs['dateFormat'] = 'yy/mm/dd'; |
| 225 | + |
| 226 | + } |
| 227 | + |
| 228 | + // setup attributes required only for either disabled or enabled datepickers |
| 229 | + if ( $this->mIsDisabled ) { |
| 230 | + |
| 231 | + $jsattribs['buttonImage'] = $sfigSettings->scriptPath . '/images/DatePickerButtonDisabled.gif'; |
| 232 | + |
| 233 | + if ( array_key_exists( 'show reset button', $this->mOtherArgs ) || |
| 234 | + ( !array_key_exists( 'hide reset button', $this->mOtherArgs ) && $sfigSettings->datePickerShowResetButton ) ) { |
| 235 | + |
| 236 | + $jsattribs['resetButtonImage'] = $sfigSettings->scriptPath . '/images/DatePickerResetButtonDisabled.gif'; |
| 237 | + |
| 238 | + } |
| 239 | + |
| 240 | + } else { |
| 241 | + |
| 242 | + $jsattribs['buttonImage'] = $sfigSettings->scriptPath . '/images/DatePickerButton.gif'; |
| 243 | + |
| 244 | + if ( array_key_exists( 'show reset button', $this->mOtherArgs ) || |
| 245 | + ( !array_key_exists( 'hide reset button', $this->mOtherArgs ) && $sfigSettings->datePickerShowResetButton ) ) { |
| 246 | + |
| 247 | + $jsattribs['resetButtonImage'] = $sfigSettings->scriptPath . '/images/DatePickerResetButton.gif'; |
| 248 | + |
| 249 | + } |
| 250 | + |
| 251 | + // find min date, max date and disabled dates |
| 252 | + |
| 253 | + // set first date |
| 254 | + if ( array_key_exists( 'first date', $this->mOtherArgs ) ) { |
| 255 | + $minDate = date_create( $this->mOtherArgs['first date'] ); |
| 256 | + } elseif ( $sfigSettings->datePickerFirstDate ) { |
| 257 | + $minDate = date_create( $sfigSettings->datePickerFirstDate ); |
| 258 | + } else { |
| 259 | + $minDate = null; |
| 260 | + } |
| 261 | + |
| 262 | + // set last date |
| 263 | + if ( array_key_exists( 'last date', $this->mOtherArgs ) ) { |
| 264 | + $maxDate = date_create( $this->mOtherArgs['last date'] ); |
| 265 | + } elseif ( $sfigSettings->datePickerLastDate ) { |
| 266 | + $maxDate = date_create( $sfigSettings->datePickerLastDate ); |
| 267 | + } else { |
| 268 | + $maxDate = null; |
| 269 | + } |
| 270 | + |
| 271 | + // find allowed values and invert them to get disabled values |
| 272 | + if ( array_key_exists( 'possible_values', $this->mOtherArgs ) && count( $this->mOtherArgs['possible_values'] ) ) { |
| 273 | + |
| 274 | + $enabledDates = self::sortAndMergeRanges( self::createRangesArray( $this->mOtherArgs['possible_values'] ) ); |
| 275 | + |
| 276 | + // correct min/max date to the first/last allowed value |
| 277 | + if ( !$minDate || $minDate < $enabledDates[0][0] ) { |
| 278 | + $minDate = $enabledDates[0][0]; |
| 279 | + } |
| 280 | + |
| 281 | + if ( !$maxDate || $maxDate > $enabledDates[count( $enabledDates ) - 1][1] ) { |
| 282 | + $maxDate = $enabledDates[count( $enabledDates ) - 1][1]; |
| 283 | + } |
| 284 | + |
| 285 | + $disabledDates = self::invertRangesArray( $enabledDates ); |
| 286 | + |
| 287 | + } else $disabledDates = array(); |
| 288 | + |
| 289 | + // add user-defined or default disabled values |
| 290 | + if ( array_key_exists( 'disable dates', $this->mOtherArgs ) ) { |
| 291 | + |
| 292 | + $disabledDates = |
| 293 | + self::sortAndMergeRanges( |
| 294 | + array_merge( $disabledDates, self::createRangesArray( explode( ',' , $this->mOtherArgs['disable dates'] ) ) ) ); |
| 295 | + |
| 296 | + } elseif ( $sfigSettings->datePickerDisabledDates ) { |
| 297 | + |
| 298 | + $disabledDates = |
| 299 | + self::sortAndMergeRanges( |
| 300 | + array_merge( $disabledDates, self::createRangesArray( explode( ',' , $sfigSettings->datePickerDisabledDates ) ) ) ); |
| 301 | + |
| 302 | + } |
| 303 | + |
| 304 | + // if a minDate is set, discard all disabled dates below the min date |
| 305 | + if ( $minDate ) { |
| 306 | + |
| 307 | + // discard all ranges of disabled dates that are entirely below the min date |
| 308 | + while ( $minDate && count( $disabledDates ) && $disabledDates[0][1] < $minDate ) array_shift( $disabledDates ); |
| 309 | + |
| 310 | + // if min date is in first disabled date range, discard that range and adjust min date |
| 311 | + if ( count( $disabledDates ) && $disabledDates[0][0] <= $minDate && $disabledDates[0][1] >= $minDate ) { |
| 312 | + $minDate = $disabledDates[0][1]; |
| 313 | + array_shift( $disabledDates ); |
| 314 | + $minDate->modify( "+1 day" ); |
| 315 | + } |
| 316 | + } |
| 317 | + |
| 318 | + // if a maxDate is set, discard all disabled dates above the max date |
| 319 | + if ( $maxDate ) { |
| 320 | + |
| 321 | + // discard all ranges of disabled dates that are entirely above the max date |
| 322 | + while ( count( $disabledDates ) && $disabledDates[count( $disabledDates ) - 1][0] > $maxDate ) array_pop( $disabledDates ); |
| 323 | + |
| 324 | + // if max date is in last disabled date range, discard that range and adjust max date |
| 325 | + if ( count( $disabledDates ) && $disabledDates[count( $disabledDates ) - 1][0] <= $maxDate && $disabledDates[count( $disabledDates ) - 1][1] >= $maxDate ) { |
| 326 | + $maxDate = $disabledDates[count( $disabledDates ) - 1][0]; |
| 327 | + array_pop( $disabledDates ); |
| 328 | + $maxDate->modify( "-1 day" ); |
| 329 | + } |
| 330 | + } |
| 331 | + // finished with disabled dates |
| 332 | + |
| 333 | + // find highlighted dates |
| 334 | + if ( array_key_exists( "highlight dates", $this->mOtherArgs ) ) { |
| 335 | + $highlightedDates = self::sortAndMergeRanges ( self::createRangesArray( explode( ',' , $this->mOtherArgs["highlight dates"] ) ) ) ; |
| 336 | + } elseif ( $sfigSettings->datePickerHighlightedDates ) { |
| 337 | + $highlightedDates = self::sortAndMergeRanges ( self::createRangesArray( explode( ',' , $sfigSettings->datePickerHighlightedDates ) ) ) ; |
| 338 | + } else { |
| 339 | + $highlightedDates = null; |
| 340 | + } |
| 341 | + |
| 342 | + |
| 343 | + // find disabled week days and mark them in an array |
| 344 | + if ( array_key_exists( "disable days of week", $this->mOtherArgs ) ) { |
| 345 | + $disabledDaysString = $this->mOtherArgs['disable days of week']; |
| 346 | + } else { |
| 347 | + $disabledDaysString = $sfigSettings->datePickerDisabledDaysOfWeek; |
| 348 | + } |
| 349 | + |
| 350 | + if ( $disabledDaysString != null ) { |
| 351 | + |
| 352 | + $disabledDays = array( false, false, false, false, false, false, false ); |
| 353 | + |
| 354 | + foreach ( explode( ',', $disabledDaysString ) as $day ) { |
| 355 | + |
| 356 | + if ( is_numeric( $day ) && $day >= 0 && $day <= 6 ) { |
| 357 | + $disabledDays[$day] = true; |
| 358 | + } |
| 359 | + |
| 360 | + } |
| 361 | + |
| 362 | + } else { |
| 363 | + $disabledDays = null; |
| 364 | + } |
| 365 | + |
| 366 | + // find highlighted week days and mark them in an array |
| 367 | + if ( array_key_exists( "highlight days of week", $this->mOtherArgs ) ) { |
| 368 | + $highlightedDaysString = $this->mOtherArgs['highlight days of week']; |
| 369 | + } else { |
| 370 | + $highlightedDaysString = $sfigSettings->datePickerHighlightedDaysOfWeek; |
| 371 | + } |
| 372 | + |
| 373 | + if ( $highlightedDaysString != null ) { |
| 374 | + |
| 375 | + $highlightedDays = array( false, false, false, false, false, false, false ); |
| 376 | + |
| 377 | + foreach ( explode( ',', $highlightedDaysString ) as $day ) { |
| 378 | + |
| 379 | + if ( is_numeric( $day ) && $day >= 0 && $day <= 6 ) { |
| 380 | + $highlightedDays[$day] = true; |
| 381 | + } |
| 382 | + |
| 383 | + } |
| 384 | + |
| 385 | + } else { |
| 386 | + $highlightedDays = null; |
| 387 | + } |
| 388 | + |
| 389 | + // set first day of the week |
| 390 | + if ( array_key_exists( 'week start', $this->mOtherArgs ) ) { |
| 391 | + $jsattribs['firstDay'] = $this->mOtherArgs['week start']; |
| 392 | + } elseif ( $sfigSettings->datePickerWeekStart != null ) { |
| 393 | + $jsattribs['firstDay'] = $sfigSettings->datePickerWeekStart; |
| 394 | + } else { |
| 395 | + $jsattribs['firstDay'] = wfMsg( 'semanticformsinputs-firstdayofweek' ); |
| 396 | + } |
| 397 | + |
| 398 | + // set show week number |
| 399 | + if ( array_key_exists( 'show week numbers', $this->mOtherArgs ) |
| 400 | + || ( !array_key_exists( 'hide week numbers', $this->mOtherArgs ) && $sfigSettings->datePickerShowWeekNumbers ) ) { |
| 401 | + |
| 402 | + $jsattribs['showWeek'] = true; |
| 403 | + } else { |
| 404 | + $jsattribs['showWeek'] = false; |
| 405 | + } |
| 406 | + |
| 407 | + // store min date as JS attrib |
| 408 | + if ( $minDate ) { |
| 409 | + $jsattribs['minDate'] = $minDate->format( 'Y/m/d' ); |
| 410 | + } |
| 411 | + |
| 412 | + // store max date as JS attrib |
| 413 | + if ( $maxDate ) { |
| 414 | + $jsattribs['maxDate'] = $maxDate->format( 'Y/m/d' ); |
| 415 | + } |
| 416 | + |
| 417 | + // register disabled dates with datepicker |
| 418 | + if ( count( $disabledDates ) > 0 ) { |
| 419 | + |
| 420 | + // convert the PHP array of date ranges into an array of numbers |
| 421 | + $jsattribs["disabledDates"] = array_map( create_function ( '$range', ' |
| 422 | + |
| 423 | + $y0 = $range[0]->format( "Y" ); |
| 424 | + $m0 = $range[0]->format( "m" ) - 1; |
| 425 | + $d0 = $range[0]->format( "d" ); |
| 426 | + |
| 427 | + $y1 = $range[1]->format( "Y" ); |
| 428 | + $m1 = $range[1]->format( "m" ) - 1; |
| 429 | + $d1 = $range[1]->format( "d" ); |
| 430 | + |
| 431 | + return array($y0, $m0, $d0, $y1, $m1, $d1); |
| 432 | + ' ) , $disabledDates ); |
| 433 | + } |
| 434 | + |
| 435 | + // register highlighted dates with datepicker |
| 436 | + if ( count( $highlightedDates ) > 0 ) { |
| 437 | + |
| 438 | + // convert the PHP array of date ranges into an array of numbers |
| 439 | + $jsattribs["highlightedDates"] = array_map( create_function ( '$range', ' |
| 440 | + |
| 441 | + $y0 = $range[0]->format( "Y" ); |
| 442 | + $m0 = $range[0]->format( "m" ) - 1; |
| 443 | + $d0 = $range[0]->format( "d" ); |
| 444 | + |
| 445 | + $y1 = $range[1]->format( "Y" ); |
| 446 | + $m1 = $range[1]->format( "m" ) - 1; |
| 447 | + $d1 = $range[1]->format( "d" ); |
| 448 | + |
| 449 | + return array($y0, $m0, $d0, $y1, $m1, $d1); |
| 450 | + ' ) , $highlightedDates ); |
| 451 | + } |
| 452 | + |
| 453 | + // register disabled days of week with datepicker |
| 454 | + if ( count( $disabledDays ) > 0 ) { |
| 455 | + $jsattribs["disabledDays"] = $disabledDays; |
| 456 | + } |
| 457 | + |
| 458 | + // register highlighted days of week with datepicker |
| 459 | + if ( count( $highlightedDays ) > 0 ) { |
| 460 | + $jsattribs["highlightedDays"] = $highlightedDays; |
| 461 | + } |
| 462 | + } |
| 463 | + |
| 464 | + // build JS code from attributes array |
| 465 | + return json_encode( $jsattribs ); |
| 466 | + |
| 467 | + } |
| 468 | + |
| 469 | + /** |
| 470 | + * Sort and merge time ranges in an array |
| 471 | + * |
| 472 | + * expects an array of arrays |
| 473 | + * the inner arrays must contain two dates representing the start and end |
| 474 | + * date of a time range |
| 475 | + * |
| 476 | + * returns an array of arrays with the date ranges sorted and overlapping |
| 477 | + * ranges merged |
| 478 | + * |
| 479 | + * @param array $ranges array of arrays of DateTimes |
| 480 | + * @return array of arrays of DateTimes |
| 481 | + */ |
| 482 | + static private function sortAndMergeRanges ( $ranges ) { |
| 483 | + |
| 484 | + // sort ranges, earliest date first |
| 485 | + sort( $ranges ); |
| 486 | + |
| 487 | + // stores the start of the current date range |
| 488 | + $currmin = FALSE; |
| 489 | + |
| 490 | + // stores the date the next ranges start date has to top to not overlap |
| 491 | + $nextmin = FALSE; |
| 492 | + |
| 493 | + // result array |
| 494 | + $mergedRanges = array(); |
| 495 | + |
| 496 | + foreach ( $ranges as $range ) { |
| 497 | + |
| 498 | + // ignore empty date ranges |
| 499 | + if ( !$range ) continue; |
| 500 | + |
| 501 | + if ( !$currmin ) { // found first valid range |
| 502 | + |
| 503 | + $currmin = $range[0]; |
| 504 | + $nextmin = $range[1]; |
| 505 | + $nextmin->modify( '+1 day' ); |
| 506 | + |
| 507 | + } elseif ( $range[0] <= $nextmin ) { // overlap detected |
| 508 | + |
| 509 | + $currmin = min( $currmin, $range[0] ); |
| 510 | + |
| 511 | + $range[1]->modify( '+1 day' ); |
| 512 | + $nextmin = max( $nextmin, $range[1] ); |
| 513 | + |
| 514 | + } else { // no overlap, store current range and continue with next |
| 515 | + |
| 516 | + $nextmin->modify( '-1 day' ); |
| 517 | + $mergedRanges[] = array( $currmin, $nextmin ); |
| 518 | + |
| 519 | + $currmin = $range[0]; |
| 520 | + $nextmin = $range[1]; |
| 521 | + $nextmin->modify( '+1 day' ); |
| 522 | + |
| 523 | + } |
| 524 | + |
| 525 | + } |
| 526 | + |
| 527 | + // store last range |
| 528 | + if ( $currmin ) { |
| 529 | + $nextmin->modify( '-1 day' ); |
| 530 | + $mergedRanges[] = array( $currmin, $nextmin ); |
| 531 | + } |
| 532 | + |
| 533 | + return $mergedRanges; |
| 534 | + |
| 535 | + } |
| 536 | + |
| 537 | + /** |
| 538 | + * Creates an array of arrays of dates from an array of strings |
| 539 | + * |
| 540 | + * expects an array of strings containing dates or date ranges in the format |
| 541 | + * "yyyy/mm/dd" or "yyyy/mm/dd-yyyy/mm/dd" |
| 542 | + * |
| 543 | + * returns an array of arrays, each of the latter consisting of two dates |
| 544 | + * representing the start and end date of the range |
| 545 | + * |
| 546 | + * The result array will contain null values for unparseable date strings |
| 547 | + * |
| 548 | + * @param array $rangesAsStrings array of strings with dates and date ranges |
| 549 | + * @return array of arrays of DateTimes |
| 550 | + */ |
| 551 | + static private function createRangesArray ( $rangesAsStrings ) { |
| 552 | + |
| 553 | + // transform array of strings into array of array of dates |
| 554 | + // have to use create_function to be PHP pre5.3 compatible |
| 555 | + return array_map( create_function( '$range', ' |
| 556 | + |
| 557 | + if ( strpos ( $range, "-" ) === FALSE ) { // single date |
| 558 | + $date = date_create( $range ); |
| 559 | + return ( $date ) ? array( $date, clone $date ):null; |
| 560 | + } else { // date range |
| 561 | + $dates = array_map( "date_create", explode( "-", $range ) ); |
| 562 | + return ( $dates[0] && $dates[1] ) ? $dates:null; |
| 563 | + } |
| 564 | + |
| 565 | + ' ), $rangesAsStrings ); |
| 566 | + |
| 567 | + } |
| 568 | + |
| 569 | + /** |
| 570 | + * Takes an array of date ranges and returns an array containing the gaps |
| 571 | + * |
| 572 | + * The very first and the very last date of the original string are lost in |
| 573 | + * the process, of course, as they do not delimit a gap. This means, after |
| 574 | + * repeated inversion the result will eventually be empty. |
| 575 | + * |
| 576 | + * @param array $ranges of arrays of DateTimes |
| 577 | + * @return array of arrays of DateTimes |
| 578 | + */ |
| 579 | + static private function invertRangesArray( $ranges ) { |
| 580 | + |
| 581 | + // the result (initially empty) |
| 582 | + $invRanges = null; |
| 583 | + |
| 584 | + // the minimum of the current gap (initially none) |
| 585 | + $min = null; |
| 586 | + |
| 587 | + foreach ( $ranges as $range ) { |
| 588 | + |
| 589 | + if ( $min ) { // if min date of current gap is known store gap |
| 590 | + $min->modify( "+1day " ); |
| 591 | + $range[0]->modify( "-1day " ); |
| 592 | + $invRanges[] = array( $min, $range[0] ); |
| 593 | + } |
| 594 | + |
| 595 | + $min = $range[1]; // store min date of next gap |
| 596 | + |
| 597 | + } |
| 598 | + |
| 599 | + return $invRanges; |
| 600 | + } |
| 601 | + |
| 602 | + /** |
| 603 | + * Returns the set of parameters for this form input. |
| 604 | + * |
| 605 | + * TODO: Add missing parameters |
| 606 | + */ |
| 607 | + public static function getParameters() { |
| 608 | + global $sfigSettings; |
| 609 | + |
| 610 | + $params = parent::getParameters(); |
| 611 | + $params[] = array( |
| 612 | + 'name' => 'date format', |
| 613 | + 'type' => 'string', |
| 614 | + 'description' => wfMsg( 'semanticformsinputs-datepicker-dateformat' ) |
| 615 | + ); |
| 616 | + $params[] = array( |
| 617 | + 'name' => 'week start', |
| 618 | + 'type' => 'int', |
| 619 | + 'description' => wfMsg( 'semanticformsinputs-datepicker-weekstart' ) |
| 620 | + ); |
| 621 | + $params[] = array( |
| 622 | + 'name' => 'first date', |
| 623 | + 'type' => 'string', |
| 624 | + 'description' => wfMsg( 'semanticformsinputs-datepicker-firstdate' ) |
| 625 | + ); |
| 626 | + $params[] = array( |
| 627 | + 'name' => 'last date', |
| 628 | + 'type' => 'string', |
| 629 | + 'description' => wfMsg( 'semanticformsinputs-datepicker-lastdate' ) |
| 630 | + ); |
| 631 | + $params[] = array( |
| 632 | + 'name' => 'disable days of week', |
| 633 | + 'type' => 'string', |
| 634 | + 'description' => wfMsg( 'semanticformsinputs-datepicker-disabledaysofweek' ) |
| 635 | + ); |
| 636 | + $params[] = array( |
| 637 | + 'name' => 'highlight days of week', |
| 638 | + 'type' => 'string', |
| 639 | + 'description' => wfMsg( 'semanticformsinputs-datepicker-highlightdaysofweek' ) |
| 640 | + ); |
| 641 | + $params[] = array( |
| 642 | + 'name' => 'disable dates', |
| 643 | + 'type' => 'string', |
| 644 | + 'description' => wfMsg( 'semanticformsinputs-datepicker-disabledates' ) |
| 645 | + ); |
| 646 | + $params[] = array( |
| 647 | + 'name' => 'highlight days of week', |
| 648 | + 'type' => 'string', |
| 649 | + 'description' => wfMsg( 'semanticformsinputs-datepicker-highlightdates' ) |
| 650 | + ); |
| 651 | + $params[] = array( |
| 652 | + 'name' => $sfigSettings->datePickerShowWeekNumbers?'hide week numbers':'show week numbers', |
| 653 | + 'type' => 'boolean', |
| 654 | + 'description' => wfMsg( 'semanticformsinputs-datepicker-showweeknumbers' ) |
| 655 | + ); |
| 656 | + $params[] = array( |
| 657 | + 'name' => $sfigSettings->datePickerDisableInputField?'enable input field':'disable input field', |
| 658 | + 'type' => 'boolean', |
| 659 | + 'description' => wfMsg( 'semanticformsinputs-datepicker-enableinputfield' ) |
| 660 | + ); |
| 661 | + $params[] = array( |
| 662 | + 'name' => $sfigSettings->datePickerShowResetButton?'hide reset button':'show reset button', |
| 663 | + 'type' => 'boolean', |
| 664 | + 'description' => wfMsg( 'semanticformsinputs-datepicker-showresetbutton' ) |
| 665 | + ); |
| 666 | + return $params; |
| 667 | + } |
| 668 | + |
| 669 | + /** |
| 670 | + * Returns the HTML code to be included in the output page for this input. |
| 671 | + * |
| 672 | + * Ideally this HTML code should provide a basic functionality even if the |
| 673 | + * browser is not JavaScript capable. I.e. even without JavaScript the user |
| 674 | + * should be able to input values. |
| 675 | + * |
| 676 | + */ |
| 677 | + public function getHtmlText() { |
| 678 | + |
| 679 | + global $sfigSettings; // SFI variables |
| 680 | + |
| 681 | + // should the input field be disabled? |
| 682 | + $inputFieldDisabled = |
| 683 | + array_key_exists( 'disable input field', $this->mOtherArgs ) |
| 684 | + || ( !array_key_exists( 'enable input field', $this->mOtherArgs ) && $sfigSettings->datePickerDisableInputField ) |
| 685 | + || $this->mIsDisabled ; |
| 686 | + |
| 687 | + // assemble HTML code |
| 688 | + $html = SFIUtils::textHTML( $this->mCurrentValue, $this->mInputName, $inputFieldDisabled, $this->mOtherArgs, 'input_' . $this->mInputNumber ); |
| 689 | + |
| 690 | + if ( ! array_key_exists( 'part of dtp', $this->mOtherArgs ) ) { |
| 691 | + |
| 692 | + // wrap in span (e.g. used for mandatory inputs) |
| 693 | + $class = array_key_exists( 'mandatory', $this->mOtherArgs ) ? 'inputSpan mandatoryFieldSpan' : 'inputSpan'; |
| 694 | + $html = Xml::tags('span', array('class'=> $class ), $html ); |
| 695 | + |
| 696 | + } |
| 697 | + |
| 698 | + return $html; |
| 699 | + } |
| 700 | + |
| 701 | + /** |
| 702 | + * Returns the set of SMW property types which this input can |
| 703 | + * handle, but for which it isn't the default input. |
| 704 | + * |
| 705 | + * @return Array of strings |
| 706 | + */ |
| 707 | + public static function getOtherPropTypesHandled() { |
| 708 | + return array('_str', '_dat'); |
| 709 | + } |
| 710 | +} |
| 711 | + |
Property changes on: tags/extensions/SemanticFormsInputs/REL_0_5/includes/SFI_DatePicker.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 712 | + native |
Index: tags/extensions/SemanticFormsInputs/REL_0_5/includes/SFI_TimePicker.php |
— | — | @@ -0,0 +1,246 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * File holding the SFI_TimePicker class |
| 6 | + * |
| 7 | + * @author Stephan Gambke |
| 8 | + * @file |
| 9 | + * @ingroup SemanticFormsInputs |
| 10 | + */ |
| 11 | +if ( !defined( 'SFI_VERSION' ) ) { |
| 12 | + die( 'This file is part of the SemanticFormsInputs extension, it is not a valid entry point.' ); |
| 13 | +} |
| 14 | + |
| 15 | +/** |
| 16 | + * The SFITimePicker class. |
| 17 | + * |
| 18 | + * @ingroup SemanticFormsInputs |
| 19 | + */ |
| 20 | +class SFITimePicker extends SFFormInput { |
| 21 | + |
| 22 | + /** |
| 23 | + * Constructor. |
| 24 | + * |
| 25 | + * @param String $input_number |
| 26 | + * The number of the input in the form. |
| 27 | + * @param String $cur_value |
| 28 | + * The current value of the input field. |
| 29 | + * @param String $input_name |
| 30 | + * The name of the input. |
| 31 | + * @param String $disabled |
| 32 | + * Is this input disabled? |
| 33 | + * @param Array $other_args |
| 34 | + * An associative array of other parameters that were present in the |
| 35 | + * input definition. |
| 36 | + */ |
| 37 | + public function __construct( $input_number, $cur_value, $input_name, $disabled, $other_args ) { |
| 38 | + |
| 39 | + parent::__construct( $input_number, $cur_value, $input_name, $disabled, $other_args ); |
| 40 | + |
| 41 | + // third: if the timepicker is not disabled set up JS attributes ans assemble JS call |
| 42 | + if ( !$this->mIsDisabled ) { |
| 43 | + |
| 44 | + self::setup(); |
| 45 | + } |
| 46 | + |
| 47 | + $this->addJsInitFunctionData( 'SFI_TP_init', $this->setupJsInitAttribs() ); |
| 48 | + |
| 49 | + } |
| 50 | + |
| 51 | + /** |
| 52 | + * Returns the name of the input type this class handles: menuselect. |
| 53 | + * |
| 54 | + * This is the name to be used in the field definition for the "input type" |
| 55 | + * parameter. |
| 56 | + * |
| 57 | + * @return String The name of the input type this class handles. |
| 58 | + */ |
| 59 | + public static function getName() { |
| 60 | + return 'timepicker'; |
| 61 | + } |
| 62 | + |
| 63 | + /** |
| 64 | + * Static setup method for input type "menuselect". |
| 65 | + * Adds the Javascript code and css used by all menuselects. |
| 66 | + */ |
| 67 | + static private function setup() { |
| 68 | + |
| 69 | + global $wgOut; |
| 70 | + global $sfigSettings; |
| 71 | + |
| 72 | + static $hasRun = false; |
| 73 | + |
| 74 | + if ( !$hasRun ) { |
| 75 | + $hasRun = true; |
| 76 | + |
| 77 | + $wgOut->addScript( '<script type="text/javascript" src="' . $sfigSettings->scriptPath . '/libs/timepicker.js"></script> ' ); |
| 78 | + $wgOut->addExtensionStyle( $sfigSettings->scriptPath . '/skins/SFI_Timepicker.css' ); |
| 79 | + |
| 80 | + } |
| 81 | + |
| 82 | + } |
| 83 | + |
| 84 | + /** |
| 85 | + * Set up JS attributes |
| 86 | + * |
| 87 | + * @return String |
| 88 | + */ |
| 89 | + protected function setupJsInitAttribs() { |
| 90 | + |
| 91 | + global $sfigSettings; |
| 92 | + |
| 93 | + // store user class(es) for use with buttons |
| 94 | + $userClasses = array_key_exists( 'class', $this->mOtherArgs ) ? $this->mOtherArgs['class'] : ''; |
| 95 | + |
| 96 | + // set min time if valid, else use default |
| 97 | + if ( array_key_exists( 'mintime', $this->mOtherArgs ) |
| 98 | + && ( preg_match( '/^\d+:\d\d$/', trim( $this->mOtherArgs['mintime'] ) ) == 1 ) ) { |
| 99 | + $minTime = trim( $this->mOtherArgs['mintime'] ); |
| 100 | + } elseif ( $sfigSettings->timePickerMinTime != null ) { |
| 101 | + $minTime = $sfigSettings->timePickerMinTime; |
| 102 | + } else { |
| 103 | + $minTime = '00:00'; |
| 104 | + } |
| 105 | + |
| 106 | + // set max time if valid, else use default |
| 107 | + if ( array_key_exists( 'maxtime', $this->mOtherArgs ) |
| 108 | + && ( preg_match( '/^\d+:\d\d$/', trim( $this->mOtherArgs['maxtime'] ) ) == 1 ) ) { |
| 109 | + $maxTime = trim( $this->mOtherArgs['maxtime'] ); |
| 110 | + } elseif ( $sfigSettings->timePickerMaxTime != null ) { |
| 111 | + $maxTime = $sfigSettings->timePickerMaxTime; |
| 112 | + } else { |
| 113 | + $maxTime = '23:59'; |
| 114 | + } |
| 115 | + |
| 116 | + // set interval if valid, else use default |
| 117 | + if ( array_key_exists( 'interval', $this->mOtherArgs ) |
| 118 | + && preg_match( '/^\d+$/', trim( $this->mOtherArgs['interval'] ) ) == 1 ) { |
| 119 | + $interval = trim( $this->mOtherArgs['interval'] ); |
| 120 | + } else { |
| 121 | + $interval = '15'; |
| 122 | + } |
| 123 | + |
| 124 | + // build JS code from attributes array |
| 125 | + $jsattribs = array( |
| 126 | + 'minTime' => $minTime, |
| 127 | + 'maxTime' => $maxTime, |
| 128 | + 'interval' => $interval, |
| 129 | + 'format' => 'hh:mm', |
| 130 | + 'currValue' => $this->mCurrentValue, |
| 131 | + 'disabled' => $this->mIsDisabled, |
| 132 | + 'userClasses' => $userClasses |
| 133 | + ); |
| 134 | + |
| 135 | + if ( array_key_exists( 'part of dtp', $this->mOtherArgs ) ) { |
| 136 | + $jsattribs['partOfDTP'] = $this->mOtherArgs['part of dtp']; |
| 137 | + } |
| 138 | + |
| 139 | + // setup attributes required only for either disabled or enabled datepickers |
| 140 | + if ( $this->mIsDisabled ) { |
| 141 | + |
| 142 | + $jsattribs['buttonImage'] = $sfigSettings->scriptPath . '/images/TimePickerButtonDisabled.gif'; |
| 143 | + |
| 144 | + if ( array_key_exists( 'show reset button', $this->mOtherArgs ) || |
| 145 | + ( !array_key_exists( 'hide reset button', $this->mOtherArgs ) && $sfigSettings->timePickerShowResetButton ) ) { |
| 146 | + |
| 147 | + $jsattribs['resetButtonImage'] = $sfigSettings->scriptPath . '/images/TimePickerResetButtonDisabled.gif'; |
| 148 | + |
| 149 | + } |
| 150 | + |
| 151 | + } else { |
| 152 | + |
| 153 | + $jsattribs['buttonImage'] = $sfigSettings->scriptPath . '/images/TimePickerButton.gif'; |
| 154 | + |
| 155 | + if ( array_key_exists( 'show reset button', $this->mOtherArgs ) || |
| 156 | + ( !array_key_exists( 'hide reset button', $this->mOtherArgs ) && $sfigSettings->timePickerShowResetButton ) ) { |
| 157 | + |
| 158 | + $jsattribs['resetButtonImage'] = $sfigSettings->scriptPath . '/images/TimePickerResetButton.gif'; |
| 159 | + |
| 160 | + } |
| 161 | + } |
| 162 | + |
| 163 | + return json_encode( $jsattribs ); |
| 164 | + } |
| 165 | + |
| 166 | + /** |
| 167 | + * Returns the HTML code to be included in the output page for this input. |
| 168 | + * |
| 169 | + * Ideally this HTML code should provide a basic functionality even if the |
| 170 | + * browser is not Javascript capable. I.e. even without Javascript the user |
| 171 | + * should be able to input values. |
| 172 | + * |
| 173 | + */ |
| 174 | + public function getHtmlText(){ |
| 175 | + |
| 176 | + global $sfigSettings; |
| 177 | + |
| 178 | + // The timepicker is created in four steps: |
| 179 | + // first: set up HTML attributes |
| 180 | + // second: assemble HTML |
| 181 | + |
| 182 | + |
| 183 | + // first: set up HTML attributes |
| 184 | + $inputFieldDisabled = |
| 185 | + array_key_exists( 'disable input field', $this->mOtherArgs ) |
| 186 | + || ( !array_key_exists( 'enable input field', $this->mOtherArgs ) && $sfigSettings->timePickerDisableInputField ) |
| 187 | + || $this->mIsDisabled ; |
| 188 | + |
| 189 | + // second: assemble HTML |
| 190 | + // create visible input field (for display) and invisible field (for data) |
| 191 | + $html = SFIUtils::textHTML( $this->mCurrentValue, $this->mInputName, $inputFieldDisabled, $this->mOtherArgs, 'input_' . $this->mInputNumber ); |
| 192 | + |
| 193 | + // wrap in span (e.g. used for mandatory inputs) |
| 194 | + if ( ! array_key_exists( 'part of dtp', $this->mOtherArgs ) ) { |
| 195 | + $html = '<span class="inputSpan' . ( array_key_exists( 'mandatory', $this->mOtherArgs )? ' mandatoryFieldSpan' : '') . '">' .$html . '</span>'; |
| 196 | + } |
| 197 | + |
| 198 | + return $html; |
| 199 | + } |
| 200 | + |
| 201 | + /** |
| 202 | + * Returns the set of SMW property types which this input can |
| 203 | + * handle, but for which it isn't the default input. |
| 204 | + */ |
| 205 | + public static function getOtherPropTypesHandled() { |
| 206 | + return array( '_str', '_dat' ); |
| 207 | + } |
| 208 | + |
| 209 | + /** |
| 210 | + * Returns the set of parameters for this form input. |
| 211 | + * |
| 212 | + * TODO: Specify parameters specific for menuselect. |
| 213 | + */ |
| 214 | + public static function getParameters() { |
| 215 | + |
| 216 | + global $sfigSettings; |
| 217 | + |
| 218 | + $params = parent::getParameters(); |
| 219 | + $params[] = array( |
| 220 | + 'name' => 'mintime', |
| 221 | + 'type' => 'string', |
| 222 | + 'description' => wfMsg( 'semanticformsinputs-timepicker-mintime' ), |
| 223 | + ); |
| 224 | + $params[] = array( |
| 225 | + 'name' => 'maxtime', |
| 226 | + 'type' => 'string', |
| 227 | + 'description' => wfMsg( 'semanticformsinputs-timepicker-maxtime' ), |
| 228 | + ); |
| 229 | + $params[] = array( |
| 230 | + 'name' => 'interval', |
| 231 | + 'type' => 'int', |
| 232 | + 'description' => wfMsg( 'semanticformsinputs-timepicker-interval' ), |
| 233 | + ); |
| 234 | + $params[] = array( |
| 235 | + 'name' => $sfigSettings->timePickerDisableInputField?'enable input field':'disable input field', |
| 236 | + 'type' => 'boolean', |
| 237 | + 'description' => wfMsg( 'semanticformsinputs-timepicker-enableinputfield' ), |
| 238 | + ); |
| 239 | + $params[] = array( |
| 240 | + 'name' => $sfigSettings->timePickerShowResetButton?'hide reset button':'show reset button', |
| 241 | + 'type' => 'boolean', |
| 242 | + 'description' => wfMsg( 'semanticformsinputs-timepicker-showresetbutton' ), |
| 243 | + ); |
| 244 | + |
| 245 | + return $params; |
| 246 | + } |
| 247 | +} |
Property changes on: tags/extensions/SemanticFormsInputs/REL_0_5/includes/SFI_TimePicker.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 248 | + native |
Index: tags/extensions/SemanticFormsInputs/REL_0_5/includes/SFI_Settings.php |
— | — | @@ -0,0 +1,165 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Settings for the Semantic Forms Inputs extension. |
| 5 | + * |
| 6 | + * @author Stephan Gambke |
| 7 | + * |
| 8 | + * To change the default settings you can uncomment (or copy) the |
| 9 | + * examples here and adjust them to your needs. You may as well |
| 10 | + * include them in your LocalSettings.php. |
| 11 | + */ |
| 12 | + |
| 13 | +if ( !defined( 'SFI_VERSION' ) ) { |
| 14 | + die( 'This file is part of the SemanticFormsInputs extension, it is not a valid entry point.' ); |
| 15 | +} |
| 16 | + |
| 17 | +## |
| 18 | +# This is the path to your installation of Semantic Forms Inputs as |
| 19 | +# seen from the web. No final slash. |
| 20 | +# |
| 21 | +$sfigSettings->scriptPath = $wgScriptPath . '/extensions/SemanticFormsInputs'; |
| 22 | + |
| 23 | +## Date Picker Settings |
| 24 | + |
| 25 | +## |
| 26 | +# This is the first selectable date (format yyyy/mm/dd) |
| 27 | +# Sample value: '2005/01/01' |
| 28 | +# |
| 29 | +$sfigSettings->datePickerFirstDate = null; |
| 30 | + |
| 31 | +## |
| 32 | +# This is the last selectable date (format yyyy/mm/dd) |
| 33 | +# Sample value: '2015/31/12' |
| 34 | +# |
| 35 | +$sfigSettings->datePickerLastDate = null; |
| 36 | + |
| 37 | +## |
| 38 | +# The date format string used for the user input. |
| 39 | +# The date sent back to the form is fixed to yyyy/mm/dd |
| 40 | +# (that is, yy/mm/dd in the format code below). |
| 41 | +# |
| 42 | +# The format can be combinations of the following: |
| 43 | +# |
| 44 | +# d - day of month (no leading zero) |
| 45 | +# dd - day of month (two digit) |
| 46 | +# o - day of the year (no leading zeros) |
| 47 | +# oo - day of the year (three digit) |
| 48 | +# D - day name short |
| 49 | +# DD - day name long |
| 50 | +# m - month of year (no leading zero) |
| 51 | +# mm - month of year (two digit) |
| 52 | +# M - month name short |
| 53 | +# MM - month name long |
| 54 | +# y - year (two digit) |
| 55 | +# yy - year (four digit) |
| 56 | +# @ - Unix timestamp (ms since 01/01/1970) |
| 57 | +# ! - Windows ticks (100ns since 01/01/0001) |
| 58 | +# '...' - literal text |
| 59 | +# '' - single quote |
| 60 | +# anything else - literal text |
| 61 | +# |
| 62 | +# There are also two predefined standard date formats available: |
| 63 | +# |
| 64 | +# SHORT - short date format localized to the wiki user language |
| 65 | +# LONG - long date format localized to the wiki user language |
| 66 | +# |
| 67 | +$sfigSettings->datePickerDateFormat = 'SHORT'; |
| 68 | + |
| 69 | +## |
| 70 | +# This determines the start of the week in the display. |
| 71 | +# Set it to: 0 (Zero) for Sunday, 1 (One) for Monday etc. |
| 72 | +# If set to null the day is localized to the wiki user language |
| 73 | +# Sample value: 1 |
| 74 | +# |
| 75 | +$sfigSettings->datePickerWeekStart = null; |
| 76 | + |
| 77 | +## |
| 78 | +# This determines if the number of the week shall be shown. |
| 79 | +# |
| 80 | +$sfigSettings->datePickerShowWeekNumbers = false; |
| 81 | + |
| 82 | +## |
| 83 | +# This determines if the input field shall be disabled. The user can |
| 84 | +# only set the date via the datepicker in this case. |
| 85 | +# |
| 86 | +$sfigSettings->datePickerDisableInputField = false; |
| 87 | + |
| 88 | +## |
| 89 | +# This determines if a reset button shall be shown. This is the only |
| 90 | +# way to erase the input field if it is disabled for direct input. |
| 91 | +# |
| 92 | +$sfigSettings->datePickerShowResetButton = false; |
| 93 | + |
| 94 | +## |
| 95 | +# This is a string of disabled days of the week, i.e. days the user can not |
| 96 | +# pick. The days must be given as comma-separated list of numbers starting |
| 97 | +# with 0 for Sunday. |
| 98 | +# Sample value: "6,0" |
| 99 | +# |
| 100 | +$sfigSettings->datePickerDisabledDaysOfWeek = null; |
| 101 | + |
| 102 | +## |
| 103 | +# This is a string of highlighted days of the week. The days must be given as |
| 104 | +# comma-separated list of numbers starting with 0 for Sunday. |
| 105 | +# Sample value: "6,0" |
| 106 | +# |
| 107 | +$sfigSettings->datePickerHighlightedDaysOfWeek = null; |
| 108 | + |
| 109 | +## |
| 110 | +# This is a string of disabled dates, i.e. days the user cannot pick. The |
| 111 | +# days must be given as comma-separated list of dates or date ranges. The |
| 112 | +# format for days is yyyy/mm/dd, for date ranges use yyyy/mm/dd-yyyy/mm/dd. |
| 113 | +# Spaces are permissible. |
| 114 | +# Sample value: "2010/12/25 - 2011/01/06, 2011/05/01" |
| 115 | +# |
| 116 | +$sfigSettings->datePickerDisabledDates = null; |
| 117 | + |
| 118 | +## |
| 119 | +# This is a string of highlighted dates. The days must be given as |
| 120 | +# comma-separated list of dates or date ranges. The format for days is |
| 121 | +# yyyy/mm/dd, for date ranges use yyyy/mm/dd-yyyy/mm/dd. Spaces are |
| 122 | +# permissible. |
| 123 | +# Sample value: "2010/12/25 - 2011/01/06, 2011/05/01" |
| 124 | +# |
| 125 | +$sfigSettings->datePickerHighlightedDates = null; |
| 126 | + |
| 127 | + |
| 128 | +## Time Picker Settings |
| 129 | + |
| 130 | +## |
| 131 | +# This is the first selectable time (format hh:mm) |
| 132 | +# Sample value: '00:00' |
| 133 | +# |
| 134 | +$sfigSettings->timePickerMinTime = null; |
| 135 | + |
| 136 | +## |
| 137 | +# This is the last selectable time (format hh:mm) |
| 138 | +# Sample value: '24:00' |
| 139 | +# |
| 140 | +$sfigSettings->timePickerMaxTime = null; |
| 141 | + |
| 142 | +## |
| 143 | +# This determines if the input field shall be disabled. The user can |
| 144 | +# only set the time via the timepicker in this case. |
| 145 | +# |
| 146 | +$sfigSettings->timePickerDisableInputField = false; |
| 147 | + |
| 148 | +## |
| 149 | +# This determines if a reset button shall be shown. This is the only |
| 150 | +# way to erase the input field if it is disabled for direct input. |
| 151 | +# |
| 152 | +$sfigSettings->timePickerShowResetButton = false; |
| 153 | + |
| 154 | + |
| 155 | +## |
| 156 | +# This determines if a reset button shall be shown. This is the only |
| 157 | +# way to erase the input field if it is disabled for direct input. |
| 158 | +# |
| 159 | +$sfigSettings->datetimePickerShowResetButton = false; |
| 160 | + |
| 161 | +## |
| 162 | +# This determines if the input field shall be disabled. The user can |
| 163 | +# only set the value via the menu in this case. |
| 164 | +# |
| 165 | +$sfigSettings->menuSelectDisableInputField = false; |
| 166 | + |
Property changes on: tags/extensions/SemanticFormsInputs/REL_0_5/includes/SFI_Settings.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 167 | + native |
Index: tags/extensions/SemanticFormsInputs/REL_0_5/includes/SFI_Utils.php |
— | — | @@ -0,0 +1,84 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Input definitions for the Semantic Forms Inputs extension. |
| 5 | + * |
| 6 | + * @author Stephan Gambke |
| 7 | + * @author Sanyam Goyal |
| 8 | + * @author Yaron Koren |
| 9 | + * |
| 10 | + */ |
| 11 | + |
| 12 | +if ( !defined( 'SFI_VERSION' ) ) { |
| 13 | + die( 'This file is part of a MediaWiki extension, it is not a valid entry point.' ); |
| 14 | +} |
| 15 | + |
| 16 | +class SFIUtils { |
| 17 | + |
| 18 | + /** |
| 19 | + * Creates the html text for an input. |
| 20 | + * |
| 21 | + * Common attributes for input types are set according to the parameters. |
| 22 | + * The parameters are the standard parameters set by Semantic Forms' |
| 23 | + * InputTypeHook plus some optional. |
| 24 | + * |
| 25 | + * @param string $currentValue |
| 26 | + * @param string $inputName |
| 27 | + * @param boolean $isDisabled |
| 28 | + * @param array $otherArgs |
| 29 | + * @param string $inputId (optional) |
| 30 | + * @param int $tabIndex (optional) |
| 31 | + * @param string $class |
| 32 | + * @return string the html text of an input element |
| 33 | + */ |
| 34 | + static function textHTML ( $currentValue, $inputName, $isDisabled, $otherArgs, $inputId = null, $tabIndex = null, $class = '' ) { |
| 35 | + |
| 36 | + global $sfgTabIndex; |
| 37 | + |
| 38 | + // array of attributes to pass to the input field |
| 39 | + $attribs = array( |
| 40 | + 'name' => $inputName, |
| 41 | + 'class' => $class, |
| 42 | + 'value' => $currentValue, |
| 43 | + 'type' => 'text' |
| 44 | + ); |
| 45 | + |
| 46 | + // set size attrib |
| 47 | + if ( array_key_exists( 'size', $otherArgs ) ) { |
| 48 | + $attribs['size'] = $otherArgs['size']; |
| 49 | + } |
| 50 | + |
| 51 | + // set maxlength attrib |
| 52 | + if ( array_key_exists( 'maxlength', $otherArgs ) ) { |
| 53 | + $attribs['maxlength'] = $otherArgs['maxlength']; |
| 54 | + } |
| 55 | + |
| 56 | + // modify class attribute for mandatory form fields |
| 57 | + if ( array_key_exists( 'mandatory', $otherArgs ) ) { |
| 58 | + $attribs['class'] .= ' mandatoryField'; |
| 59 | + } |
| 60 | + |
| 61 | + // add user class(es) to class attribute of input field |
| 62 | + if ( array_key_exists( 'class', $otherArgs ) ) { |
| 63 | + $attribs['class'] .= ' ' . $otherArgs['class']; |
| 64 | + } |
| 65 | + |
| 66 | + // set readonly attrib |
| 67 | + if ( $isDisabled ) { |
| 68 | + $attribs['readonly'] = '1'; |
| 69 | + } |
| 70 | + |
| 71 | + // if no special input id is specified set the Semantic Forms standard |
| 72 | + if ( $inputId !== null ) { |
| 73 | + $attribs[ 'id' ] = $inputId; |
| 74 | + } |
| 75 | + |
| 76 | + |
| 77 | + if ( $tabIndex == null ) $attribs[ 'tabindex' ] = $sfgTabIndex; |
| 78 | + else $attribs[ 'tabindex' ] = $tabIndex; |
| 79 | + |
| 80 | + $html = Xml::element( 'input', $attribs ); |
| 81 | + |
| 82 | + return $html; |
| 83 | + |
| 84 | + } |
| 85 | +} |
Property changes on: tags/extensions/SemanticFormsInputs/REL_0_5/includes/SFI_Utils.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 86 | + native |
Index: tags/extensions/SemanticFormsInputs/REL_0_5/includes/SFI_MenuSelect.php |
— | — | @@ -0,0 +1,164 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * File holding the SFIMenuSelect class. |
| 6 | + * |
| 7 | + * @author Stephan Gambke |
| 8 | + * |
| 9 | + * @file |
| 10 | + * @ingroup SFI |
| 11 | + */ |
| 12 | +if ( !defined( 'SFI_VERSION' ) ) { |
| 13 | + die( 'This file is part of the Semantic Forms Inputs extension, it is not a valid entry point.' ); |
| 14 | +} |
| 15 | + |
| 16 | +/** |
| 17 | + * This class represents the MenuSelect input. |
| 18 | + * |
| 19 | + * @ingroup SFI |
| 20 | + */ |
| 21 | +class SFIMenuSelect extends SFFormInput { |
| 22 | + |
| 23 | + |
| 24 | + /** |
| 25 | + * Constructor. |
| 26 | + * |
| 27 | + * @param String $input_number |
| 28 | + * The number of the input in the form. |
| 29 | + * @param String $cur_value |
| 30 | + * The current value of the input field. |
| 31 | + * @param String $input_name |
| 32 | + * The name of the input. |
| 33 | + * @param String $disabled |
| 34 | + * Is this input disabled? |
| 35 | + * @param Array $other_args |
| 36 | + * An associative array of other parameters that were present in the |
| 37 | + * input definition. |
| 38 | + */ |
| 39 | + public function __construct( $input_number, $cur_value, $input_name, $disabled, $other_args ) { |
| 40 | + |
| 41 | + parent::__construct( $input_number, $cur_value, $input_name, $disabled, $other_args ); |
| 42 | + |
| 43 | + self::setup(); |
| 44 | + |
| 45 | + $this->addJsInitFunctionData( 'SFI_MS_init', 'null' ); |
| 46 | + |
| 47 | + |
| 48 | + } |
| 49 | + |
| 50 | + /** |
| 51 | + * Returns the name of the input type this class handles: menuselect. |
| 52 | + * |
| 53 | + * This is the name to be used in the field definition for the "input type" |
| 54 | + * parameter. |
| 55 | + * |
| 56 | + * @return String The name of the input type this class handles. |
| 57 | + */ |
| 58 | + public static function getName() { |
| 59 | + return 'menuselect'; |
| 60 | + } |
| 61 | + |
| 62 | + /** |
| 63 | + * Static setup method for input type "menuselect". |
| 64 | + * Adds the Javascript code and css used by all menuselects. |
| 65 | + */ |
| 66 | + static private function setup() { |
| 67 | + |
| 68 | + global $wgOut; |
| 69 | + global $sfigSettings; |
| 70 | + |
| 71 | + static $hasRun = false; |
| 72 | + |
| 73 | + if ( !$hasRun ) { |
| 74 | + $hasRun = true; |
| 75 | + $wgOut->addScript( '<script type="text/javascript">sfigScriptPath="' . $sfigSettings->scriptPath . '";</script> ' ); |
| 76 | + $wgOut->addScript( '<script type="text/javascript" src="' . $sfigSettings->scriptPath . '/libs/menuselect.js"></script> ' ); |
| 77 | + $wgOut->addExtensionStyle( $sfigSettings->scriptPath . '/skins/SFI_Menuselect.css' ); |
| 78 | + } |
| 79 | + |
| 80 | + } |
| 81 | + |
| 82 | + /** |
| 83 | + * Returns the HTML code to be included in the output page for this input. |
| 84 | + * |
| 85 | + * Ideally this HTML code should provide a basic functionality even if the |
| 86 | + * browser is not Javascript capable. I.e. even without Javascript the user |
| 87 | + * should be able to input values. |
| 88 | + * |
| 89 | + */ |
| 90 | + public function getHtmlText(){ |
| 91 | + |
| 92 | + global $wgUser, $wgTitle; |
| 93 | + global $sfigSettings; |
| 94 | + |
| 95 | + // first: set up HTML attributes |
| 96 | + $inputFieldDisabled = |
| 97 | + array_key_exists( 'disable input field', $this->mOtherArgs ) |
| 98 | + || $this->mIsDisabled |
| 99 | + || ( $sfigSettings->menuSelectDisableInputField && !array_key_exists( 'enable input field', $this->mOtherArgs ) ); |
| 100 | + |
| 101 | + // second: assemble HTML |
| 102 | + // create visible input field (for display) and invisible field (for data) |
| 103 | + $html = SFIUtils::textHTML( $this->mCurrentValue, '', $inputFieldDisabled, $this->mOtherArgs, "input_{$this->mInputNumber}_show", null, "createboxInput" ) |
| 104 | + . Xml::element( "input", array( |
| 105 | + 'id' => "input_{$this->mInputNumber}", |
| 106 | + 'type' => 'hidden', |
| 107 | + 'name' => $this->mInputName, |
| 108 | + 'value' => $this->mCurrentValue |
| 109 | + ) ); |
| 110 | + |
| 111 | + |
| 112 | + $html .= "<span class='SFI_menuselect' id='span_{$this->mInputNumber}_tree'>"; |
| 113 | + |
| 114 | + |
| 115 | + // parse menu structure |
| 116 | + |
| 117 | + $parser = new Parser(); |
| 118 | + |
| 119 | + // FIXME: SF does not parse options correctly. Users have to replace | by {{!}} |
| 120 | + $structure = str_replace( '{{!}}', '|', $this->mOtherArgs['structure'] ); |
| 121 | + $options = ParserOptions::newFromUser( $wgUser ); |
| 122 | + |
| 123 | + $structure = $parser->parse( $structure, $wgTitle, $options )->getText(); |
| 124 | + |
| 125 | + $html .= str_replace( '<li', '<li class=\'ui-state-default\'', $structure ); |
| 126 | + |
| 127 | + $html .= "</span>"; |
| 128 | + |
| 129 | + // wrap in span (e.g. used for mandatory inputs) |
| 130 | + $html = '<span class="inputSpan' . ($this->mIsMandatory ? ' mandatoryFieldSpan' : '') . '">' .$html . '</span>'; |
| 131 | + |
| 132 | + return $html; |
| 133 | + |
| 134 | + |
| 135 | + } |
| 136 | + |
| 137 | + /** |
| 138 | + * Returns the set of SMW property types which this input can |
| 139 | + * handle, but for which it isn't the default input. |
| 140 | + */ |
| 141 | + public static function getOtherPropTypesHandled() { |
| 142 | + return array( '_str', '_wpg' ); |
| 143 | + } |
| 144 | + |
| 145 | + /** |
| 146 | + * Returns the set of parameters for this form input. |
| 147 | + * |
| 148 | + * TODO: Specify parameters specific for menuselect. |
| 149 | + */ |
| 150 | + public static function getParameters() { |
| 151 | + $params = parent::getParameters(); |
| 152 | + $params[] = array( |
| 153 | + 'name' => 'structure', |
| 154 | + 'type' => 'text', |
| 155 | + 'description' => wfMsg( 'semanticformsinputs-menuselect-structure' ), |
| 156 | + 'default' => "* item 1\n** item 11\n** item 12\n* item 2\n** item 21\n** item 22" |
| 157 | + ); |
| 158 | + $params[] = array( |
| 159 | + 'name' => $sfigSettings->menuSelectDisableInputField?'enable input field':'disable input field', |
| 160 | + 'type' => 'boolean', |
| 161 | + 'description' => wfMsg( 'semanticformsinputs-menuselect-enableinputfield' ), |
| 162 | + ); |
| 163 | + return $params; |
| 164 | + } |
| 165 | +} |
Property changes on: tags/extensions/SemanticFormsInputs/REL_0_5/includes/SFI_MenuSelect.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 166 | + native |
Index: tags/extensions/SemanticFormsInputs/REL_0_5/skins/SFI_Timepicker.css |
— | — | @@ -0,0 +1,34 @@ |
| 2 | +/** |
| 3 | + * Style sheet for the input type timepicker. |
| 4 | + * |
| 5 | + * @author Stephan Gambke |
| 6 | + */ |
| 7 | + |
| 8 | +.SFI_timepicker { |
| 9 | + position: absolute; |
| 10 | + cursor: default; |
| 11 | + margin-top: 22px; |
| 12 | +} |
| 13 | + |
| 14 | +.SFI_timepicker ul { /* hours and minutes lists */ |
| 15 | + margin: 0px; |
| 16 | + padding: 0px; |
| 17 | + list-style: none; |
| 18 | + position: absolute; |
| 19 | +} |
| 20 | + |
| 21 | +.SFI_timepicker ul ul { /* minutes lists only */ |
| 22 | + margin-left: 24px; |
| 23 | + margin-right: 24px; |
| 24 | + margin-top: -22px; |
| 25 | +} |
| 26 | + |
| 27 | + |
| 28 | +.SFI_timepicker li { /* hours and minutes entries */ |
| 29 | + margin: 1px 0px; |
| 30 | + padding: 0px; |
| 31 | + text-align: center; |
| 32 | + line-height: 22px; |
| 33 | + width: 22px; |
| 34 | +} |
| 35 | + |
Property changes on: tags/extensions/SemanticFormsInputs/REL_0_5/skins/SFI_Timepicker.css |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 36 | + native |
Index: tags/extensions/SemanticFormsInputs/REL_0_5/skins/SFI_Menuselect.css |
— | — | @@ -0,0 +1,55 @@ |
| 2 | +/** |
| 3 | + * Style sheet for the input type menuselect. |
| 4 | + * |
| 5 | + * @author Stephan Gambke |
| 6 | + */ |
| 7 | + |
| 8 | +.SFI_menuselect { |
| 9 | + visibility: hidden; /* will be shown by JS when setup is finished*/ |
| 10 | + display: block; |
| 11 | + cursor: default; |
| 12 | + position: absolute; |
| 13 | +} |
| 14 | + |
| 15 | +.SFI_menuselect a { |
| 16 | + cursor: default; |
| 17 | +} |
| 18 | + |
| 19 | +.SFI_menuselect ul { /* all lists */ |
| 20 | + margin: 0px; |
| 21 | + padding: 0px; |
| 22 | + list-style: none none outside; |
| 23 | + position: absolute; |
| 24 | + display: inline; |
| 25 | +} |
| 26 | + |
| 27 | +.SFI_menuselect ul ul { /* sub-item lists only */ |
| 28 | + margin-left: 3px; |
| 29 | + margin-right: 3px; |
| 30 | +} |
| 31 | + |
| 32 | + |
| 33 | +.SFI_menuselect li { /* all entries */ |
| 34 | + margin: 1px 0px; |
| 35 | + padding: 0px 0px; |
| 36 | + text-align: left; |
| 37 | + position: fixed; |
| 38 | + list-style-image: none; |
| 39 | +} |
| 40 | + |
| 41 | +.SFI_menuselect table { |
| 42 | + background: transparent; |
| 43 | + border-collapse: collapse; |
| 44 | + display: inline; |
| 45 | +} |
| 46 | + |
| 47 | +.SFI_menuselect .cont { |
| 48 | + padding:0px 2px; |
| 49 | + width: 100%; |
| 50 | + vertical-align: baseline; |
| 51 | +} |
| 52 | + |
| 53 | +.SFI_menuselect .arrow { |
| 54 | + padding: 0px; |
| 55 | +} |
| 56 | + |
Property changes on: tags/extensions/SemanticFormsInputs/REL_0_5/skins/SFI_Menuselect.css |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 57 | + native |
Index: tags/extensions/SemanticFormsInputs/REL_0_5/COPYING |
— | — | @@ -0,0 +1,350 @@ |
| 2 | +The license text below "----" applies to all files within this distribution, |
| 3 | +other than those that are in a directory which contains files named "LICENSE" |
| 4 | +or "COPYING", or a subdirectory thereof. For those files, the license text |
| 5 | +contained in said file overrides any license information contained in |
| 6 | +directories of smaller depth. Alternative licenses are typically used for |
| 7 | +software that is provided by external parties, and merely packaged with the |
| 8 | +Semantic Forms Inputs release for convenience. |
| 9 | + |
| 10 | +---- |
| 11 | + |
| 12 | + GNU GENERAL PUBLIC LICENSE |
| 13 | + Version 2, June 1991 |
| 14 | + |
| 15 | + Copyright (C) 1989, 1991 Free Software Foundation, Inc. |
| 16 | + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 | + Everyone is permitted to copy and distribute verbatim copies |
| 18 | + of this license document, but changing it is not allowed. |
| 19 | + |
| 20 | + Preamble |
| 21 | + |
| 22 | + The licenses for most software are designed to take away your |
| 23 | +freedom to share and change it. By contrast, the GNU General Public |
| 24 | +License is intended to guarantee your freedom to share and change free |
| 25 | +software--to make sure the software is free for all its users. This |
| 26 | +General Public License applies to most of the Free Software |
| 27 | +Foundation's software and to any other program whose authors commit to |
| 28 | +using it. (Some other Free Software Foundation software is covered by |
| 29 | +the GNU Library General Public License instead.) You can apply it to |
| 30 | +your programs, too. |
| 31 | + |
| 32 | + When we speak of free software, we are referring to freedom, not |
| 33 | +price. Our General Public Licenses are designed to make sure that you |
| 34 | +have the freedom to distribute copies of free software (and charge for |
| 35 | +this service if you wish), that you receive source code or can get it |
| 36 | +if you want it, that you can change the software or use pieces of it |
| 37 | +in new free programs; and that you know you can do these things. |
| 38 | + |
| 39 | + To protect your rights, we need to make restrictions that forbid |
| 40 | +anyone to deny you these rights or to ask you to surrender the rights. |
| 41 | +These restrictions translate to certain responsibilities for you if you |
| 42 | +distribute copies of the software, or if you modify it. |
| 43 | + |
| 44 | + For example, if you distribute copies of such a program, whether |
| 45 | +gratis or for a fee, you must give the recipients all the rights that |
| 46 | +you have. You must make sure that they, too, receive or can get the |
| 47 | +source code. And you must show them these terms so they know their |
| 48 | +rights. |
| 49 | + |
| 50 | + We protect your rights with two steps: (1) copyright the software, and |
| 51 | +(2) offer you this license which gives you legal permission to copy, |
| 52 | +distribute and/or modify the software. |
| 53 | + |
| 54 | + Also, for each author's protection and ours, we want to make certain |
| 55 | +that everyone understands that there is no warranty for this free |
| 56 | +software. If the software is modified by someone else and passed on, we |
| 57 | +want its recipients to know that what they have is not the original, so |
| 58 | +that any problems introduced by others will not reflect on the original |
| 59 | +authors' reputations. |
| 60 | + |
| 61 | + Finally, any free program is threatened constantly by software |
| 62 | +patents. We wish to avoid the danger that redistributors of a free |
| 63 | +program will individually obtain patent licenses, in effect making the |
| 64 | +program proprietary. To prevent this, we have made it clear that any |
| 65 | +patent must be licensed for everyone's free use or not licensed at all. |
| 66 | + |
| 67 | + The precise terms and conditions for copying, distribution and |
| 68 | +modification follow. |
| 69 | + |
| 70 | + GNU GENERAL PUBLIC LICENSE |
| 71 | + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION |
| 72 | + |
| 73 | + 0. This License applies to any program or other work which contains |
| 74 | +a notice placed by the copyright holder saying it may be distributed |
| 75 | +under the terms of this General Public License. The "Program", below, |
| 76 | +refers to any such program or work, and a "work based on the Program" |
| 77 | +means either the Program or any derivative work under copyright law: |
| 78 | +that is to say, a work containing the Program or a portion of it, |
| 79 | +either verbatim or with modifications and/or translated into another |
| 80 | +language. (Hereinafter, translation is included without limitation in |
| 81 | +the term "modification".) Each licensee is addressed as "you". |
| 82 | + |
| 83 | +Activities other than copying, distribution and modification are not |
| 84 | +covered by this License; they are outside its scope. The act of |
| 85 | +running the Program is not restricted, and the output from the Program |
| 86 | +is covered only if its contents constitute a work based on the |
| 87 | +Program (independent of having been made by running the Program). |
| 88 | +Whether that is true depends on what the Program does. |
| 89 | + |
| 90 | + 1. You may copy and distribute verbatim copies of the Program's |
| 91 | +source code as you receive it, in any medium, provided that you |
| 92 | +conspicuously and appropriately publish on each copy an appropriate |
| 93 | +copyright notice and disclaimer of warranty; keep intact all the |
| 94 | +notices that refer to this License and to the absence of any warranty; |
| 95 | +and give any other recipients of the Program a copy of this License |
| 96 | +along with the Program. |
| 97 | + |
| 98 | +You may charge a fee for the physical act of transferring a copy, and |
| 99 | +you may at your option offer warranty protection in exchange for a fee. |
| 100 | + |
| 101 | + 2. You may modify your copy or copies of the Program or any portion |
| 102 | +of it, thus forming a work based on the Program, and copy and |
| 103 | +distribute such modifications or work under the terms of Section 1 |
| 104 | +above, provided that you also meet all of these conditions: |
| 105 | + |
| 106 | + a) You must cause the modified files to carry prominent notices |
| 107 | + stating that you changed the files and the date of any change. |
| 108 | + |
| 109 | + b) You must cause any work that you distribute or publish, that in |
| 110 | + whole or in part contains or is derived from the Program or any |
| 111 | + part thereof, to be licensed as a whole at no charge to all third |
| 112 | + parties under the terms of this License. |
| 113 | + |
| 114 | + c) If the modified program normally reads commands interactively |
| 115 | + when run, you must cause it, when started running for such |
| 116 | + interactive use in the most ordinary way, to print or display an |
| 117 | + announcement including an appropriate copyright notice and a |
| 118 | + notice that there is no warranty (or else, saying that you provide |
| 119 | + a warranty) and that users may redistribute the program under |
| 120 | + these conditions, and telling the user how to view a copy of this |
| 121 | + License. (Exception: if the Program itself is interactive but |
| 122 | + does not normally print such an announcement, your work based on |
| 123 | + the Program is not required to print an announcement.) |
| 124 | + |
| 125 | +These requirements apply to the modified work as a whole. If |
| 126 | +identifiable sections of that work are not derived from the Program, |
| 127 | +and can be reasonably considered independent and separate works in |
| 128 | +themselves, then this License, and its terms, do not apply to those |
| 129 | +sections when you distribute them as separate works. But when you |
| 130 | +distribute the same sections as part of a whole which is a work based |
| 131 | +on the Program, the distribution of the whole must be on the terms of |
| 132 | +this License, whose permissions for other licensees extend to the |
| 133 | +entire whole, and thus to each and every part regardless of who wrote it. |
| 134 | + |
| 135 | +Thus, it is not the intent of this section to claim rights or contest |
| 136 | +your rights to work written entirely by you; rather, the intent is to |
| 137 | +exercise the right to control the distribution of derivative or |
| 138 | +collective works based on the Program. |
| 139 | + |
| 140 | +In addition, mere aggregation of another work not based on the Program |
| 141 | +with the Program (or with a work based on the Program) on a volume of |
| 142 | +a storage or distribution medium does not bring the other work under |
| 143 | +the scope of this License. |
| 144 | + |
| 145 | + 3. You may copy and distribute the Program (or a work based on it, |
| 146 | +under Section 2) in object code or executable form under the terms of |
| 147 | +Sections 1 and 2 above provided that you also do one of the following: |
| 148 | + |
| 149 | + a) Accompany it with the complete corresponding machine-readable |
| 150 | + source code, which must be distributed under the terms of Sections |
| 151 | + 1 and 2 above on a medium customarily used for software interchange; or, |
| 152 | + |
| 153 | + b) Accompany it with a written offer, valid for at least three |
| 154 | + years, to give any third party, for a charge no more than your |
| 155 | + cost of physically performing source distribution, a complete |
| 156 | + machine-readable copy of the corresponding source code, to be |
| 157 | + distributed under the terms of Sections 1 and 2 above on a medium |
| 158 | + customarily used for software interchange; or, |
| 159 | + |
| 160 | + c) Accompany it with the information you received as to the offer |
| 161 | + to distribute corresponding source code. (This alternative is |
| 162 | + allowed only for noncommercial distribution and only if you |
| 163 | + received the program in object code or executable form with such |
| 164 | + an offer, in accord with Subsection b above.) |
| 165 | + |
| 166 | +The source code for a work means the preferred form of the work for |
| 167 | +making modifications to it. For an executable work, complete source |
| 168 | +code means all the source code for all modules it contains, plus any |
| 169 | +associated interface definition files, plus the scripts used to |
| 170 | +control compilation and installation of the executable. However, as a |
| 171 | +special exception, the source code distributed need not include |
| 172 | +anything that is normally distributed (in either source or binary |
| 173 | +form) with the major components (compiler, kernel, and so on) of the |
| 174 | +operating system on which the executable runs, unless that component |
| 175 | +itself accompanies the executable. |
| 176 | + |
| 177 | +If distribution of executable or object code is made by offering |
| 178 | +access to copy from a designated place, then offering equivalent |
| 179 | +access to copy the source code from the same place counts as |
| 180 | +distribution of the source code, even though third parties are not |
| 181 | +compelled to copy the source along with the object code. |
| 182 | + |
| 183 | + 4. You may not copy, modify, sublicense, or distribute the Program |
| 184 | +except as expressly provided under this License. Any attempt |
| 185 | +otherwise to copy, modify, sublicense or distribute the Program is |
| 186 | +void, and will automatically terminate your rights under this License. |
| 187 | +However, parties who have received copies, or rights, from you under |
| 188 | +this License will not have their licenses terminated so long as such |
| 189 | +parties remain in full compliance. |
| 190 | + |
| 191 | + 5. You are not required to accept this License, since you have not |
| 192 | +signed it. However, nothing else grants you permission to modify or |
| 193 | +distribute the Program or its derivative works. These actions are |
| 194 | +prohibited by law if you do not accept this License. Therefore, by |
| 195 | +modifying or distributing the Program (or any work based on the |
| 196 | +Program), you indicate your acceptance of this License to do so, and |
| 197 | +all its terms and conditions for copying, distributing or modifying |
| 198 | +the Program or works based on it. |
| 199 | + |
| 200 | + 6. Each time you redistribute the Program (or any work based on the |
| 201 | +Program), the recipient automatically receives a license from the |
| 202 | +original licensor to copy, distribute or modify the Program subject to |
| 203 | +these terms and conditions. You may not impose any further |
| 204 | +restrictions on the recipients' exercise of the rights granted herein. |
| 205 | +You are not responsible for enforcing compliance by third parties to |
| 206 | +this License. |
| 207 | + |
| 208 | + 7. If, as a consequence of a court judgment or allegation of patent |
| 209 | +infringement or for any other reason (not limited to patent issues), |
| 210 | +conditions are imposed on you (whether by court order, agreement or |
| 211 | +otherwise) that contradict the conditions of this License, they do not |
| 212 | +excuse you from the conditions of this License. If you cannot |
| 213 | +distribute so as to satisfy simultaneously your obligations under this |
| 214 | +License and any other pertinent obligations, then as a consequence you |
| 215 | +may not distribute the Program at all. For example, if a patent |
| 216 | +license would not permit royalty-free redistribution of the Program by |
| 217 | +all those who receive copies directly or indirectly through you, then |
| 218 | +the only way you could satisfy both it and this License would be to |
| 219 | +refrain entirely from distribution of the Program. |
| 220 | + |
| 221 | +If any portion of this section is held invalid or unenforceable under |
| 222 | +any particular circumstance, the balance of the section is intended to |
| 223 | +apply and the section as a whole is intended to apply in other |
| 224 | +circumstances. |
| 225 | + |
| 226 | +It is not the purpose of this section to induce you to infringe any |
| 227 | +patents or other property right claims or to contest validity of any |
| 228 | +such claims; this section has the sole purpose of protecting the |
| 229 | +integrity of the free software distribution system, which is |
| 230 | +implemented by public license practices. Many people have made |
| 231 | +generous contributions to the wide range of software distributed |
| 232 | +through that system in reliance on consistent application of that |
| 233 | +system; it is up to the author/donor to decide if he or she is willing |
| 234 | +to distribute software through any other system and a licensee cannot |
| 235 | +impose that choice. |
| 236 | + |
| 237 | +This section is intended to make thoroughly clear what is believed to |
| 238 | +be a consequence of the rest of this License. |
| 239 | + |
| 240 | + 8. If the distribution and/or use of the Program is restricted in |
| 241 | +certain countries either by patents or by copyrighted interfaces, the |
| 242 | +original copyright holder who places the Program under this License |
| 243 | +may add an explicit geographical distribution limitation excluding |
| 244 | +those countries, so that distribution is permitted only in or among |
| 245 | +countries not thus excluded. In such case, this License incorporates |
| 246 | +the limitation as if written in the body of this License. |
| 247 | + |
| 248 | + 9. The Free Software Foundation may publish revised and/or new versions |
| 249 | +of the General Public License from time to time. Such new versions will |
| 250 | +be similar in spirit to the present version, but may differ in detail to |
| 251 | +address new problems or concerns. |
| 252 | + |
| 253 | +Each version is given a distinguishing version number. If the Program |
| 254 | +specifies a version number of this License which applies to it and "any |
| 255 | +later version", you have the option of following the terms and conditions |
| 256 | +either of that version or of any later version published by the Free |
| 257 | +Software Foundation. If the Program does not specify a version number of |
| 258 | +this License, you may choose any version ever published by the Free Software |
| 259 | +Foundation. |
| 260 | + |
| 261 | + 10. If you wish to incorporate parts of the Program into other free |
| 262 | +programs whose distribution conditions are different, write to the author |
| 263 | +to ask for permission. For software which is copyrighted by the Free |
| 264 | +Software Foundation, write to the Free Software Foundation; we sometimes |
| 265 | +make exceptions for this. Our decision will be guided by the two goals |
| 266 | +of preserving the free status of all derivatives of our free software and |
| 267 | +of promoting the sharing and reuse of software generally. |
| 268 | + |
| 269 | + NO WARRANTY |
| 270 | + |
| 271 | + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY |
| 272 | +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN |
| 273 | +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES |
| 274 | +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED |
| 275 | +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 276 | +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS |
| 277 | +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE |
| 278 | +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, |
| 279 | +REPAIR OR CORRECTION. |
| 280 | + |
| 281 | + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING |
| 282 | +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR |
| 283 | +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, |
| 284 | +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING |
| 285 | +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED |
| 286 | +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY |
| 287 | +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER |
| 288 | +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE |
| 289 | +POSSIBILITY OF SUCH DAMAGES. |
| 290 | + |
| 291 | + END OF TERMS AND CONDITIONS |
| 292 | + |
| 293 | + How to Apply These Terms to Your New Programs |
| 294 | + |
| 295 | + If you develop a new program, and you want it to be of the greatest |
| 296 | +possible use to the public, the best way to achieve this is to make it |
| 297 | +free software which everyone can redistribute and change under these terms. |
| 298 | + |
| 299 | + To do so, attach the following notices to the program. It is safest |
| 300 | +to attach them to the start of each source file to most effectively |
| 301 | +convey the exclusion of warranty; and each file should have at least |
| 302 | +the "copyright" line and a pointer to where the full notice is found. |
| 303 | + |
| 304 | + <one line to give the program's name and a brief idea of what it does.> |
| 305 | + Copyright (C) <year> <name of author> |
| 306 | + |
| 307 | + This program is free software; you can redistribute it and/or modify |
| 308 | + it under the terms of the GNU General Public License as published by |
| 309 | + the Free Software Foundation; either version 2 of the License, or |
| 310 | + (at your option) any later version. |
| 311 | + |
| 312 | + This program is distributed in the hope that it will be useful, |
| 313 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 314 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 315 | + GNU General Public License for more details. |
| 316 | + |
| 317 | + You should have received a copy of the GNU General Public License |
| 318 | + along with this program; if not, write to the Free Software |
| 319 | + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 320 | + |
| 321 | + |
| 322 | +Also add information on how to contact you by electronic and paper mail. |
| 323 | + |
| 324 | +If the program is interactive, make it output a short notice like this |
| 325 | +when it starts in an interactive mode: |
| 326 | + |
| 327 | + Gnomovision version 69, Copyright (C) year name of author |
| 328 | + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. |
| 329 | + This is free software, and you are welcome to redistribute it |
| 330 | + under certain conditions; type `show c' for details. |
| 331 | + |
| 332 | +The hypothetical commands `show w' and `show c' should show the appropriate |
| 333 | +parts of the General Public License. Of course, the commands you use may |
| 334 | +be called something other than `show w' and `show c'; they could even be |
| 335 | +mouse-clicks or menu items--whatever suits your program. |
| 336 | + |
| 337 | +You should also get your employer (if you work as a programmer) or your |
| 338 | +school, if any, to sign a "copyright disclaimer" for the program, if |
| 339 | +necessary. Here is a sample; alter the names: |
| 340 | + |
| 341 | + Yoyodyne, Inc., hereby disclaims all copyright interest in the program |
| 342 | + `Gnomovision' (which makes passes at compilers) written by James Hacker. |
| 343 | + |
| 344 | + <signature of Ty Coon>, 1 April 1989 |
| 345 | + Ty Coon, President of Vice |
| 346 | + |
| 347 | +This General Public License does not permit incorporating your program into |
| 348 | +proprietary programs. If your program is a subroutine library, you may |
| 349 | +consider it more useful to permit linking proprietary applications with the |
| 350 | +library. If this is what you want to do, use the GNU Library General |
| 351 | +Public License instead of this License. |
Property changes on: tags/extensions/SemanticFormsInputs/REL_0_5/COPYING |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 352 | + native |
Index: tags/extensions/SemanticFormsInputs/REL_0_5/libs/menuselect.js |
— | — | @@ -0,0 +1,274 @@ |
| 2 | +/** |
| 3 | + * Javascript code to be used with input type menuselect. |
| 4 | + * |
| 5 | + * @author Stephan Gambke |
| 6 | + * |
| 7 | + */ |
| 8 | + |
| 9 | +/** |
| 10 | + * Initializes a menuselect input |
| 11 | + * |
| 12 | + * @param inputID ( String ) the id of the input to initialize |
| 13 | + */ |
| 14 | +function SFI_MS_init( inputID, params ) { |
| 15 | + |
| 16 | + var inputShow = jQuery('#' + inputID + "_show"); |
| 17 | + |
| 18 | + inputShow.one('focus', function(){ |
| 19 | + |
| 20 | + var treeid = "#" + inputID.replace(/input/,"span") + "_tree" |
| 21 | + var tree = jQuery( treeid ); |
| 22 | + var treeRoot = tree.children( "ul" ); |
| 23 | + var treeAllLists = tree.find( "ul" ); |
| 24 | + |
| 25 | + // wrap content in table to separate content from sub-menus and to |
| 26 | + // support animating the list item width later; |
| 27 | + // ensure list items have constant width, |
| 28 | + // TODO: prevent layout changes when list item width is changed |
| 29 | + // set position static ( was set to fixed to calculate text width ) |
| 30 | + treeAllLists |
| 31 | + .each( function() { |
| 32 | + |
| 33 | + var maxwidth = 0; |
| 34 | + var listitems = jQuery(this).children("li"); |
| 35 | + |
| 36 | + listitems |
| 37 | + .each( function() { |
| 38 | + |
| 39 | + var item = jQuery( this ); |
| 40 | + var contents = item.contents()//.not( "ul" ); |
| 41 | + .filter(function() { |
| 42 | + return ! jQuery( this ).is('ul'); |
| 43 | + }); |
| 44 | + |
| 45 | + contents |
| 46 | + .wrapAll( '<table><tbody><tr><td class="cont"/>' ); |
| 47 | + |
| 48 | + // insert the arrows indicating submenus |
| 49 | + if ( item.children( "ul" ).length > 0 ) { |
| 50 | + contents.parent() |
| 51 | + .after( '<td class="arrow" ><img src="' + sfigScriptPath + '/images/MenuSelectArrow.gif" /></td>' ) |
| 52 | + } |
| 53 | + |
| 54 | + maxwidth = Math.max( item.outerWidth(false) + 10, maxwidth ); |
| 55 | + |
| 56 | + item.css('position', 'static'); |
| 57 | + |
| 58 | + } ) |
| 59 | + |
| 60 | + if ( jQuery.browser.msie && document.documentMode <= "7" ) { |
| 61 | + maxwidth = 100; |
| 62 | + jQuery( this ) |
| 63 | + .width( window.screen.width ) |
| 64 | + .height( window.screen.height ); |
| 65 | + } else if ( jQuery.browser.webkit || jQuery.browser.safari ) { |
| 66 | + maxwidth = 100; |
| 67 | + }; |
| 68 | + |
| 69 | + |
| 70 | + listitems |
| 71 | + .width( maxwidth ) |
| 72 | + .data( "width", maxwidth ); |
| 73 | + }) |
| 74 | + .fadeTo( 0, 0 ); |
| 75 | + |
| 76 | + |
| 77 | + // sanitize links |
| 78 | + tree.find( "a" ) |
| 79 | + .each( |
| 80 | + function() { |
| 81 | + |
| 82 | + var link = jQuery( this ); |
| 83 | + |
| 84 | + // find title of target page |
| 85 | + if ( link.hasClass( 'new' ) ) { // for red links get it from the href |
| 86 | + |
| 87 | + regexp = /.*title=([^&]*).*/; |
| 88 | + res = regexp.exec( link.attr( 'href' ) ); |
| 89 | + |
| 90 | + title = unescape( res[1] ); |
| 91 | + |
| 92 | + link.data( 'title', title ); // save title in data |
| 93 | + |
| 94 | + } else { // for normal links title is in the links title attribute |
| 95 | + link.data( 'title', link.attr( 'title' ) ); // save title in data |
| 96 | + } |
| 97 | + |
| 98 | + link |
| 99 | + .removeAttr( 'title' ) // remove title to prevent tooltips on links |
| 100 | + .bind( "click", function( event ) { |
| 101 | + event.preventDefault(); |
| 102 | + } ); // prevent following links |
| 103 | + |
| 104 | + } |
| 105 | + ); |
| 106 | + |
| 107 | + // attach event handlers |
| 108 | + |
| 109 | + // mouse entered list item |
| 110 | + tree.find( "li" ) |
| 111 | + .mouseenter( function( evt ) { |
| 112 | + |
| 113 | + var target = jQuery( evt.currentTarget ); |
| 114 | + |
| 115 | + // switch classes to change display style |
| 116 | + target |
| 117 | + .removeClass( "ui-state-default" ) |
| 118 | + .addClass( "ui-state-hover" ); |
| 119 | + |
| 120 | + // if list item has sub-items... |
| 121 | + if ( target.children( "ul" ).length > 0 ) { |
| 122 | + |
| 123 | + // if we reentered (i.e. moved mouse from item to sub-item) |
| 124 | + if ( target.data( "timeout" ) != null) { |
| 125 | + |
| 126 | + // clear any timeout that may still run on the list item |
| 127 | + // (i.e. do not fade out submenu) |
| 128 | + clearTimeout( target.data( "timeout" ) ); |
| 129 | + target.data( "timeout", null ); |
| 130 | + |
| 131 | + } else { |
| 132 | + |
| 133 | + // set timeout to show sub-items |
| 134 | + target |
| 135 | + .data( "timeout", setTimeout( |
| 136 | + function() { |
| 137 | + |
| 138 | + var pos = target.position(); |
| 139 | + |
| 140 | + // clear timeout data |
| 141 | + target |
| 142 | + .data( "timeout", null ) |
| 143 | + |
| 144 | + // animate list item width |
| 145 | + .animate( {"width": target.width() + 10}, 100, function(){ |
| 146 | + |
| 147 | + // fade in sub-menu |
| 148 | + // can not use fadeIn, it sets display:block |
| 149 | + target.children( "ul" ) |
| 150 | + .css( { |
| 151 | + "display":"inline", |
| 152 | + "z-index":100, |
| 153 | + "top" : pos.top, |
| 154 | + "left" : pos.left + target.width() |
| 155 | + } ) |
| 156 | + .fadeTo( 400, 100 ); |
| 157 | + } ); |
| 158 | + }, 400 ) |
| 159 | + ); |
| 160 | + } |
| 161 | + } |
| 162 | + |
| 163 | + } ) |
| 164 | + |
| 165 | + // mouse left list item |
| 166 | + .mouseleave( function( evt ) { |
| 167 | + |
| 168 | + var target = jQuery( evt.currentTarget ); |
| 169 | + |
| 170 | + // switch classes to change display style |
| 171 | + target |
| 172 | + .removeClass( "ui-state-hover" ) |
| 173 | + .addClass( "ui-state-default" ) |
| 174 | + |
| 175 | + // if list item has sub-items... |
| 176 | + if ( target.children( "ul" ).length > 0 ) { |
| 177 | + |
| 178 | + // if we just moved in and out of the item (without really hovering) |
| 179 | + if ( target.data( "timeout" ) != null ) { |
| 180 | + |
| 181 | + // clear any timeout that may still run on the list item |
| 182 | + // (i.e. do not fade in submenu) |
| 183 | + clearTimeout( target.data( "timeout" ) ); |
| 184 | + target.data( "timeout", null ); |
| 185 | + |
| 186 | + } else { |
| 187 | + |
| 188 | + // hide sub-items after a short pause |
| 189 | + target.data( "timeout", setTimeout( |
| 190 | + function() { |
| 191 | + |
| 192 | + // clear timeout data |
| 193 | + target.data( "timeout", null ) |
| 194 | + |
| 195 | + // fade out sub-menu |
| 196 | + // when finished set display:none and put list item back in |
| 197 | + // line ( i.e. animate to original width ) |
| 198 | + .children( "ul" ) |
| 199 | + .css( "z-index", 1 ) |
| 200 | + .fadeTo( 400, 0, |
| 201 | + function() { |
| 202 | + |
| 203 | + jQuery( this ) |
| 204 | + .css( "display", "none" ) |
| 205 | + |
| 206 | + // animate list item width |
| 207 | + .parent() |
| 208 | + .animate( {"width": jQuery( this ).parent().data( "width" )}, 100 ); |
| 209 | + } |
| 210 | + ); |
| 211 | + |
| 212 | + }, 400 ) |
| 213 | + ); |
| 214 | + } |
| 215 | + } |
| 216 | + |
| 217 | + } ) |
| 218 | + |
| 219 | + // clicked list item |
| 220 | + .mousedown( function() { |
| 221 | + |
| 222 | + var content = jQuery( this ).children( "table" ).find( ".cont" ); |
| 223 | + |
| 224 | + // set visible value and leave input |
| 225 | + inputShow |
| 226 | + .attr( "value", content.text() ) |
| 227 | + .blur(); |
| 228 | + |
| 229 | + // set hidden value that gets sent back to the server |
| 230 | + var link = content.children( "a" ); |
| 231 | + |
| 232 | + // if content is link |
| 233 | + if ( link.length == 1 ) { |
| 234 | + |
| 235 | + // use title set by MW |
| 236 | + jQuery( "#" + inputID ).attr( "value", link.data( "title" ) ); |
| 237 | + |
| 238 | + } else { |
| 239 | + |
| 240 | + // just use text of list item |
| 241 | + jQuery( "#" + inputID ).attr( "value", content.text() ); |
| 242 | + |
| 243 | + } |
| 244 | + return false; |
| 245 | + |
| 246 | + } ); |
| 247 | + |
| 248 | + // show top menu when input gets focus |
| 249 | + inputShow |
| 250 | + .focus( function() { |
| 251 | + treeRoot |
| 252 | + .css( "display", "inline" ) |
| 253 | + .fadeTo( 400, 1 ); |
| 254 | + } ) |
| 255 | + |
| 256 | + // hide all menus when input loses focus |
| 257 | + .blur( function() { |
| 258 | + |
| 259 | + treeAllLists |
| 260 | + .fadeTo( 400, 0, |
| 261 | + function() { |
| 262 | + jQuery( this ) |
| 263 | + .css( "display", "none" ); |
| 264 | + } ); |
| 265 | + } ); |
| 266 | + |
| 267 | + tree |
| 268 | + .css("visibility","visible"); |
| 269 | + |
| 270 | + treeRoot |
| 271 | + .css( "display", "inline" ) |
| 272 | + .fadeTo( 400, 1 ); |
| 273 | + |
| 274 | + }); |
| 275 | +} |
\ No newline at end of file |
Property changes on: tags/extensions/SemanticFormsInputs/REL_0_5/libs/menuselect.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 276 | + native |
Index: tags/extensions/SemanticFormsInputs/REL_0_5/libs/datetimepicker.js |
— | — | @@ -0,0 +1,88 @@ |
| 2 | +/** |
| 3 | + * Javascript code to be used with input type datepicker. |
| 4 | + * |
| 5 | + * @author Stephan Gambke |
| 6 | + * |
| 7 | + */ |
| 8 | + |
| 9 | + |
| 10 | +function SFI_DTP_init ( inputId, params ) { |
| 11 | + |
| 12 | + var input = jQuery( '#' + inputId ); |
| 13 | + |
| 14 | + var hiddenInput = jQuery( '<input type="hidden" >' ); |
| 15 | + |
| 16 | + hiddenInput.attr( { |
| 17 | + id: inputId, |
| 18 | + name: input.attr( 'name' ), |
| 19 | + value: input.val() |
| 20 | + } ); |
| 21 | + |
| 22 | + input.replaceWith( hiddenInput ); |
| 23 | + input = hiddenInput; |
| 24 | + |
| 25 | + // create and insert subinput elements |
| 26 | + var subinputs = jQuery( params.subinputs ); |
| 27 | + input.before( subinputs ); |
| 28 | + |
| 29 | + // call initialisation functions for subinputs |
| 30 | + for (var subinputId in params.subinputsInitData) { |
| 31 | + |
| 32 | + for ( var index in params.subinputsInitData[subinputId] ) { |
| 33 | + |
| 34 | + var fn = window[ params.subinputsInitData[subinputId][index]['name'] ]; |
| 35 | + var param = JSON.parse( params.subinputsInitData[subinputId][index]['param'] ); |
| 36 | + |
| 37 | + if ( typeof fn === 'function' ) { |
| 38 | + fn( subinputId, param ); |
| 39 | + } |
| 40 | + } |
| 41 | + } |
| 42 | + |
| 43 | + var dp = jQuery( '#' + inputId + '_dp_show' ); // datepicker element |
| 44 | + var tp = jQuery( '#' + inputId + '_tp_show' ); // timepicker element |
| 45 | + |
| 46 | + dp.add(tp) |
| 47 | + .change (function(){ |
| 48 | + |
| 49 | + var date; |
| 50 | + |
| 51 | + // try parsing the date value |
| 52 | + try { |
| 53 | + |
| 54 | + date = jQuery.datepicker.parseDate( dp.datepicker( 'option', 'dateFormat' ), dp.val(), null ); |
| 55 | + date = jQuery.datepicker.formatDate( dp.datepicker( 'option', 'altFormat' ), date ); |
| 56 | + |
| 57 | + } catch ( e ) { |
| 58 | + // value does not conform to specified format |
| 59 | + // just return the value as is |
| 60 | + date = dp.val(); |
| 61 | + } |
| 62 | + |
| 63 | + input.val( jQuery.trim( date + ' ' + tp.val() ) ); |
| 64 | + |
| 65 | + }); |
| 66 | + |
| 67 | + if ( params.resetButtonImage ) { |
| 68 | + |
| 69 | + if ( params.disabled ) { |
| 70 | + |
| 71 | + // append inert reset button if image is set |
| 72 | + tp.parent().append('<button type="button" class="ui-datetimepicker-trigger' + params.userClasses + '" disabled><img src="' + params.resetButtonImage + '" alt="..." title="..."></button>'); |
| 73 | + |
| 74 | + } else { |
| 75 | + |
| 76 | + var resetbutton = jQuery('<button type="button" class="ui-datetimepicker-trigger ' + params.userClasses + '" ><img src="' + params.resetButtonImage + '" alt="..." title="..."></button>'); |
| 77 | + input.before( resetbutton ); |
| 78 | + |
| 79 | + resetbutton.click( function(){ |
| 80 | + |
| 81 | + dp.datepicker( 'setDate', null); |
| 82 | + tp.val( '' ); |
| 83 | + input.val( '' ); |
| 84 | + |
| 85 | + }); |
| 86 | + } |
| 87 | + } |
| 88 | + |
| 89 | +} |
\ No newline at end of file |
Property changes on: tags/extensions/SemanticFormsInputs/REL_0_5/libs/datetimepicker.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 90 | + native |
Index: tags/extensions/SemanticFormsInputs/REL_0_5/libs/regexp.js |
— | — | @@ -0,0 +1,38 @@ |
| 2 | +/** |
| 3 | + * Javascript code to be used with input type regexp. |
| 4 | + * |
| 5 | + * @author Stephan Gambke |
| 6 | + * |
| 7 | + */ |
| 8 | + |
| 9 | +/** |
| 10 | + * Validates inputs of type regexp. |
| 11 | + * |
| 12 | + * @param input_id (String) the id string of the input to check |
| 13 | + * @param params (Object) the parameter object for the check, contains |
| 14 | + * retext: (String) regular expression the input's value has to match |
| 15 | + * inverse: (Boolean) if the check result shall be inverted |
| 16 | + * message: (String) the message too be printed if the input's value does not match |
| 17 | + * @return (Boolean) true, if the input's value matches the regular expression in |
| 18 | + * retext, false otherwise; the value is inverted if inverse is true |
| 19 | + */ |
| 20 | +function SFI_RE_validate ( input_id, params ) { //input_number, retext, inverse, message, multiple |
| 21 | + |
| 22 | + var match; |
| 23 | + var message; |
| 24 | + try { |
| 25 | + var re = new RegExp( jQuery( "<div/>" ).html( params.retext ).text() ); |
| 26 | + match = re.test( jQuery('#' + input_id).attr("value") ); |
| 27 | + message = params.message; |
| 28 | + } catch (e) { |
| 29 | + match = false; |
| 30 | + message = params.error.replace('$1', e ); |
| 31 | + } |
| 32 | + |
| 33 | + if ( ( match && ! params.inverse ) || ( ! match && params.inverse ) ) { |
| 34 | + return true; |
| 35 | + } else { |
| 36 | + jQuery( '#' + input_id ).parent().addErrorMessage( message ); |
| 37 | + return false; |
| 38 | + } |
| 39 | +} |
Property changes on: tags/extensions/SemanticFormsInputs/REL_0_5/libs/regexp.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 40 | + native |
Index: tags/extensions/SemanticFormsInputs/REL_0_5/libs/datepicker.js |
— | — | @@ -0,0 +1,221 @@ |
| 2 | +/** |
| 3 | + * Javascript code to be used with input type datepicker. |
| 4 | + * |
| 5 | + * @author Stephan Gambke |
| 6 | + * |
| 7 | + */ |
| 8 | + |
| 9 | +function SFI_DP_init ( input_id, params ) { |
| 10 | + |
| 11 | + var inputShow = jQuery( '#' + input_id ); |
| 12 | + inputShow.attr( 'id', input_id + '_show' ); |
| 13 | + |
| 14 | + var input; |
| 15 | + |
| 16 | + if ( ! params.partOfDTP ) { |
| 17 | + |
| 18 | + input = jQuery( '<input type="hidden" >' ); |
| 19 | + input.attr( { |
| 20 | + id: input_id, |
| 21 | + name: inputShow.attr( 'name' ), |
| 22 | + value: inputShow.val() |
| 23 | + } ); |
| 24 | + |
| 25 | + inputShow.after( input ); |
| 26 | + inputShow.removeAttr( 'name' ); |
| 27 | + } else { |
| 28 | + input = inputShow; |
| 29 | + } |
| 30 | + |
| 31 | + |
| 32 | + var re = /\d{4}\/\d{2}\/\d{2}/ |
| 33 | + |
| 34 | + if ( params.disabled ) { |
| 35 | + |
| 36 | + // append inert reset button if image is set |
| 37 | + if ( params.resetButtonImage && ! params.partOfDTP ) { |
| 38 | + inputShow.after( '<button type="button" class="ui-datepicker-trigger' + params.userClasses + '" disabled><img src="' + params.resetButtonImage + '" alt="..." title="..."></button>' ); |
| 39 | + } |
| 40 | + |
| 41 | + // append inert datepicker button |
| 42 | + inputShow.after( '<button type="button" class="ui-datepicker-trigger' + params.userClasses + '" disabled><img src="' + params.buttonImage + '" alt="..." title="..."></button>' ); |
| 43 | + |
| 44 | + // set value for input fields |
| 45 | + if ( re.test( params.currValue ) ) { |
| 46 | + inputShow.val( jQuery.datepicker.formatDate(params.dateFormat, jQuery.datepicker.parseDate( "yy/mm/dd", params.currValue, null ), null ) ); |
| 47 | + } else { |
| 48 | + inputShow.val( params.currValue ); |
| 49 | + } |
| 50 | + |
| 51 | + } else { |
| 52 | + |
| 53 | + // append reset button if image is set |
| 54 | + if ( params.resetButtonImage && ! params.partOfDTP ) { |
| 55 | + |
| 56 | + var resetbutton = jQuery( '<button type="button" class="ui-datepicker-trigger ' + params.userClasses + '" ><img src="' + params.resetButtonImage + '" alt="..." title="..."></button>' ); |
| 57 | + inputShow.after( resetbutton ); |
| 58 | + resetbutton.click( function(){ |
| 59 | + inputShow.datepicker( 'setDate', null); |
| 60 | + }); |
| 61 | + } |
| 62 | + |
| 63 | + inputShow.datepicker( { |
| 64 | + 'showOn': 'both', |
| 65 | + 'buttonImage': params.buttonImage, |
| 66 | + 'buttonImageOnly': false, |
| 67 | + 'changeMonth': true, |
| 68 | + 'changeYear': true, |
| 69 | + 'altFormat': 'yy/mm/dd', |
| 70 | + // Today button does not work (http://dev.jqueryui.com/ticket/4045) |
| 71 | + // do not show button panel for now |
| 72 | + // TODO: show date picker button panel when bug is fixed |
| 73 | + 'showButtonPanel': false, |
| 74 | + 'firstDay': params.firstDay, |
| 75 | + 'showWeek': params.showWeek, |
| 76 | + 'dateFormat': params.dateFormat, |
| 77 | + 'beforeShowDay': function ( date ) {return SFI_DP_checkDate( '#' + input_id + '_show', date );} |
| 78 | + } ); |
| 79 | + |
| 80 | + if ( params.minDate ) { |
| 81 | + inputShow.datepicker( 'option', 'minDate', |
| 82 | + jQuery.datepicker.parseDate( 'yy/mm/dd', params.minDate, null ) ); |
| 83 | + } |
| 84 | + |
| 85 | + if ( params.maxDate ) { |
| 86 | + inputShow.datepicker( 'option', 'maxDate', |
| 87 | + jQuery.datepicker.parseDate( 'yy/mm/dd', params.maxDate, null ) ); |
| 88 | + } |
| 89 | + |
| 90 | + if ( params.userClasses ) { |
| 91 | + inputShow.datepicker( 'widget' ).addClass( params.userClasses ); |
| 92 | + jQuery( '#' + input_id + ' + button' ).addClass( params.userClasses ); |
| 93 | + } |
| 94 | + |
| 95 | + if ( params.disabledDates ) { |
| 96 | + |
| 97 | + var disabledDates = new Array(); |
| 98 | + |
| 99 | + for (i in params.disabledDates) |
| 100 | + disabledDates.push([ |
| 101 | + new Date(params.disabledDates[i][0], params.disabledDates[i][1], params.disabledDates[i][2]), |
| 102 | + new Date(params.disabledDates[i][3], params.disabledDates[i][4], params.disabledDates[i][5]) |
| 103 | + ]); |
| 104 | + |
| 105 | + inputShow.datepicker( 'option', 'disabledDates', disabledDates ); |
| 106 | + |
| 107 | + delete disabledDates; |
| 108 | + } |
| 109 | + |
| 110 | + if ( params.highlightedDates ) { |
| 111 | + |
| 112 | + var highlightedDates = new Array(); |
| 113 | + |
| 114 | + for (i in params.highlightedDates) |
| 115 | + highlightedDates.push([ |
| 116 | + new Date(params.highlightedDates[i][0], params.highlightedDates[i][1], params.highlightedDates[i][2]), |
| 117 | + new Date(params.highlightedDates[i][3], params.highlightedDates[i][4], params.highlightedDates[i][5]) |
| 118 | + ]); |
| 119 | + |
| 120 | + inputShow.datepicker( 'option', 'highlightedDates', highlightedDates ); |
| 121 | + |
| 122 | + delete highlightedDates; |
| 123 | + } |
| 124 | + |
| 125 | + if (params.disabledDays) { |
| 126 | + inputShow.datepicker( 'option', 'disabledDays', params.disabledDays ); |
| 127 | + } |
| 128 | + |
| 129 | + if (params.highlightedDays) { |
| 130 | + inputShow.datepicker( 'option', 'highlightedDays', params.highlightedDays ); |
| 131 | + } |
| 132 | + |
| 133 | + if ( re.test( params.currValue ) ) { |
| 134 | + inputShow.datepicker( 'setDate', jQuery.datepicker.parseDate( 'yy/mm/dd', params.currValue, null ) ); |
| 135 | + } else { |
| 136 | + |
| 137 | + inputShow.val( params.currValue ); |
| 138 | + |
| 139 | + if (params.partOfDTP) { |
| 140 | + input.val( params.currValue ); |
| 141 | + } |
| 142 | + } |
| 143 | + |
| 144 | + if ( ! params.partOfDTP ) { |
| 145 | + |
| 146 | + inputShow.datepicker( 'option', 'altField', input ); |
| 147 | + |
| 148 | + // when the input loses focus set the date value |
| 149 | + inputShow.change( function(){ |
| 150 | + // try parsing the value |
| 151 | + try { |
| 152 | + var value = jQuery.datepicker.parseDate( params.dateFormat, this.value, null ); |
| 153 | + input.val( jQuery.datepicker.formatDate( 'yy/mm/dd', value ) ); |
| 154 | + } catch ( e ) { |
| 155 | + // value does not conform to specified format |
| 156 | + // just return the value as is |
| 157 | + input.val( this.value ); |
| 158 | + } |
| 159 | + }); |
| 160 | + } |
| 161 | + } |
| 162 | +} |
| 163 | + |
| 164 | +/** |
| 165 | + * Checks a date if it is to be enabled or highlighted |
| 166 | + * |
| 167 | + * This function is a callback function given to the jQuery datepicker to be |
| 168 | + * called for every date before it is displayed. |
| 169 | + * |
| 170 | + * @param input the input the datepicker works on |
| 171 | + * @param date the date object that is to be displayed |
| 172 | + * @return Array(Boolean enabled, Boolean highlighted, "") determining the style and behaviour |
| 173 | + */ |
| 174 | +function SFI_DP_checkDate( input, date ) { |
| 175 | + |
| 176 | + var jInput = jQuery( input ); |
| 177 | + |
| 178 | + var enable = true |
| 179 | + |
| 180 | + var disabledDays = jInput.datepicker( 'option', 'disabledDays' ); |
| 181 | + |
| 182 | + if ( disabledDays ) { |
| 183 | + enable = !disabledDays[ date.getDay() ]; |
| 184 | + } |
| 185 | + |
| 186 | + if ( enable ) { |
| 187 | + var disabledDates = jInput.datepicker( 'option', 'disabledDates' ); |
| 188 | + |
| 189 | + if ( disabledDates ) { |
| 190 | + for ( i = 0; i < disabledDates.length; ++i ) { |
| 191 | + if ( (date >= disabledDates[i][0] ) && ( date <= disabledDates[i][1] ) ) { |
| 192 | + enable = false; |
| 193 | + break; |
| 194 | + } |
| 195 | + } |
| 196 | + } |
| 197 | + } |
| 198 | + |
| 199 | + var highlight = ''; |
| 200 | + |
| 201 | + var highlightedDays = jInput.datepicker( 'option', 'highlightedDays' ); |
| 202 | + |
| 203 | + if ( highlightedDays && highlightedDays[ date.getDay() ] ) { |
| 204 | + |
| 205 | + highlight = 'ui-state-highlight'; |
| 206 | + |
| 207 | + } else { |
| 208 | + |
| 209 | + var highlightedDates = jInput.datepicker( 'option', 'highlightedDates' ); |
| 210 | + |
| 211 | + if ( highlightedDates ) { |
| 212 | + for ( var i = 0; i < highlightedDates.length; ++i ) { |
| 213 | + if ( ( date >= highlightedDates[i][0] ) && ( date <= highlightedDates[i][1] ) ) { |
| 214 | + highlight = 'ui-state-highlight'; |
| 215 | + break; |
| 216 | + } |
| 217 | + } |
| 218 | + } |
| 219 | + } |
| 220 | + |
| 221 | + return [ enable, highlight, '' ]; |
| 222 | +} |
Property changes on: tags/extensions/SemanticFormsInputs/REL_0_5/libs/datepicker.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 223 | + native |
Index: tags/extensions/SemanticFormsInputs/REL_0_5/libs/timepicker.js |
— | — | @@ -0,0 +1,253 @@ |
| 2 | +/** |
| 3 | + * Javascript code to be used with input type timepicker. |
| 4 | + * |
| 5 | + * @author Stephan Gambke |
| 6 | + * |
| 7 | + */ |
| 8 | + |
| 9 | +/** |
| 10 | + * Initializes a timepicker input |
| 11 | + * |
| 12 | + * @param inputID (String) the id of the input to initialize |
| 13 | + * @param params (Object) the parameter object for the timepicker, contains |
| 14 | + * minTime: (String) the minimum time to be shown (format hh:mm) |
| 15 | + * maxTime: (String) the maximum time to be shown (format hh:mm) |
| 16 | + * interval: (String) the interval between selectable times in minutes |
| 17 | + * format: (String) a format string (unused) (do we even need it?) |
| 18 | + * |
| 19 | + */ |
| 20 | +function SFI_TP_init( inputID, params ) { // minTime, maxTime, interval, format |
| 21 | + |
| 22 | + var inputIDshow = inputID + '_show'; |
| 23 | + |
| 24 | + var inputShow = jQuery( '#' + inputID ); |
| 25 | + inputShow.attr( 'id', inputIDshow ); |
| 26 | + |
| 27 | + var input; |
| 28 | + |
| 29 | + // set up hidden input if this timepicker is not part of a datetimepicker |
| 30 | + if ( ! params.partOfDTP ) { |
| 31 | + |
| 32 | + input = jQuery( '<input type="hidden" >'); |
| 33 | + input.attr( { |
| 34 | + id: inputID, |
| 35 | + name: inputShow.attr( 'name' ), |
| 36 | + value: inputShow.val() |
| 37 | + } ); |
| 38 | + |
| 39 | + inputShow.after( input ); |
| 40 | + inputShow.removeAttr( 'name' ); |
| 41 | + |
| 42 | + } else { |
| 43 | + input = inputShow; |
| 44 | + } |
| 45 | + |
| 46 | + // append time picker button |
| 47 | + var button = jQuery( '<button type="button" ></button>' ); |
| 48 | + button.attr({ |
| 49 | + 'class': params.userClasses, |
| 50 | + 'id': inputID + '_button' |
| 51 | + }); |
| 52 | + |
| 53 | + |
| 54 | + if ( params.disabled ) { |
| 55 | + |
| 56 | + button.attr( 'disabled', 'disabled' ); |
| 57 | + |
| 58 | + } else { |
| 59 | + |
| 60 | + button.click( function(){inputShow.focus();} ); |
| 61 | + |
| 62 | + } |
| 63 | + |
| 64 | + var img = jQuery( '<img>' ); |
| 65 | + img.attr( 'src', params.buttonImage ); |
| 66 | + |
| 67 | + button.append( img ); |
| 68 | + |
| 69 | + input.after( button ); |
| 70 | + |
| 71 | + // append inert reset button if image is set |
| 72 | + if ( params.resetButtonImage && ! params.partOfDTP ) { |
| 73 | + |
| 74 | + var resetbutton = jQuery('<button type="button" ></button>'); |
| 75 | + resetbutton.attr({ |
| 76 | + 'class': params.userClasses, |
| 77 | + 'id': inputID + '_resetbutton' |
| 78 | + }); |
| 79 | + |
| 80 | + if ( params.disabled ) { |
| 81 | + resetbutton.attr( 'disabled', 'disabled' ); |
| 82 | + } else { |
| 83 | + |
| 84 | + resetbutton.click( function(){ |
| 85 | + input.val(''); |
| 86 | + inputShow.val(''); |
| 87 | + } ); |
| 88 | + |
| 89 | + } |
| 90 | + |
| 91 | + img = jQuery( '<img>' ); |
| 92 | + img.attr( 'src', params.resetButtonImage ); |
| 93 | + |
| 94 | + resetbutton.append( img ); |
| 95 | + button.after( resetbutton ); |
| 96 | + } |
| 97 | + |
| 98 | + // sanitize inputs |
| 99 | + var re = /^\d+:\d\d$/; |
| 100 | + var minh = 0; |
| 101 | + var minm = 0; |
| 102 | + |
| 103 | + var maxh = 23; |
| 104 | + var maxm = 59; |
| 105 | + |
| 106 | + if ( re.test( params.minTime ) ) { |
| 107 | + |
| 108 | + var min = params.minTime.split( ':', 2 ); |
| 109 | + minh = Number( min[0] ); |
| 110 | + minm = Number( min[1] ); |
| 111 | + |
| 112 | + if ( minm > 59 ) minm = 59; |
| 113 | + } |
| 114 | + |
| 115 | + if ( re.test( params.maxTime ) ) { |
| 116 | + |
| 117 | + var max = params.maxTime.split( ':', 2 ); |
| 118 | + maxh = Number( max[0] ); |
| 119 | + maxm = Number( max[1] ); |
| 120 | + |
| 121 | + if ( maxm > 59 ) maxm = 59; |
| 122 | + } |
| 123 | + |
| 124 | + var interv = Number( params.interval ); |
| 125 | + |
| 126 | + if ( interv < 1 ) interv = 1; |
| 127 | + else if ( interv > 60 ) interv = 60; |
| 128 | + |
| 129 | + // build html structure |
| 130 | + var sp = jQuery( '<span class="SFI_timepicker" id="' + inputID + '_tree" ></span>' ).insertBefore( '#' + inputIDshow ); |
| 131 | + |
| 132 | + var ulh = jQuery( '<ul class="SFI_timepicker_hours" >' ).appendTo( sp ); |
| 133 | + |
| 134 | + |
| 135 | + for ( var h = minh; h <= maxh; ++h ) { |
| 136 | + |
| 137 | + var lih = jQuery( '<li class="ui-state-default SFI_timepicker_hour">' + ( ( h < 10 ) ? '0' : '' ) + h + '</li>' ).appendTo( ulh ); |
| 138 | + |
| 139 | + //TODO: Replace value for "show" by formatted string |
| 140 | + lih |
| 141 | + .data( 'value', ( ( h < 10 ) ? '0' : '' ) + h + ':00' ) |
| 142 | + .data( 'show', ( ( h < 10 ) ? '0' : '' ) + h + ':00' ); |
| 143 | + |
| 144 | + var ulm = jQuery( '<ul class="SFI_timepicker_minutes" >' ).appendTo( lih ); |
| 145 | + |
| 146 | + for ( var m = ( (h == minh) ? minm : 0 ) ; m <= ( (h == maxh) ? maxm : 59 ); m += interv ) { |
| 147 | + |
| 148 | + var lim = jQuery( '<li class="ui-state-default SFI_timepicker_minute">' + ( ( m < 10 ) ? '0' : '' ) + m + '</li>' ).appendTo( ulm ); |
| 149 | + |
| 150 | + //TODO: Replace value for "show" by formatted string |
| 151 | + lim |
| 152 | + .data( 'value', ( ( h < 10 ) ? '0' : '' ) + h + ':' + ( ( m < 10 ) ? '0' : "" ) + m ) |
| 153 | + .data( 'show', ( ( h < 10 ) ? '0' : '' ) + h + ':' + ( ( m < 10 ) ? '0' : "" ) + m ); |
| 154 | + |
| 155 | + } |
| 156 | + |
| 157 | + } |
| 158 | + |
| 159 | + // initially hide everything |
| 160 | + jQuery( '#' + inputID + '_tree ul' ) |
| 161 | + .hide(); |
| 162 | + |
| 163 | + // attach event handlers |
| 164 | + jQuery( '#' + inputID + '_tree li' ) // hours |
| 165 | + .mouseover(function(evt){ |
| 166 | + |
| 167 | + // clear any timeout that may still run on the last list item |
| 168 | + clearTimeout( jQuery( evt.currentTarget ).data( 'timeout' ) ); |
| 169 | + |
| 170 | + jQuery( evt.currentTarget ) |
| 171 | + |
| 172 | + // switch classes to change display style |
| 173 | + .removeClass( 'ui-state-default' ) |
| 174 | + .addClass( 'ui-state-hover' ) |
| 175 | + |
| 176 | + // set timeout to show minutes for selected hour |
| 177 | + .data( 'timeout', setTimeout( |
| 178 | + function(){ |
| 179 | + jQuery( evt.currentTarget ).children().fadeIn(); |
| 180 | + }, 400 ) ); |
| 181 | + |
| 182 | + }) |
| 183 | + |
| 184 | + .mouseout(function(evt){ |
| 185 | + |
| 186 | + // clear any timeout that may still run on this jQuery list item |
| 187 | + clearTimeout( jQuery( evt.currentTarget ).data( 'timeout' ) ); |
| 188 | + |
| 189 | + jQuery( evt.currentTarget ) |
| 190 | + |
| 191 | + // switch classes to change display style |
| 192 | + .removeClass( 'ui-state-hover' ) |
| 193 | + .addClass( 'ui-state-default' ) |
| 194 | + |
| 195 | + // hide minutes after a short pause |
| 196 | + .data( 'timeout', setTimeout( |
| 197 | + function(){ |
| 198 | + jQuery(evt.currentTarget).children().fadeOut(); |
| 199 | + }, 400 ) ); |
| 200 | + |
| 201 | + }); |
| 202 | + |
| 203 | + jQuery( '#' + inputID + '_tree li' ) // hours, minutes |
| 204 | + .mousedown(function(evt){ |
| 205 | + |
| 206 | + // set values and leave input |
| 207 | + jQuery( '#' + inputIDshow ) |
| 208 | + .attr( 'value', jQuery( this ).data( 'show' ) ) |
| 209 | + .blur() |
| 210 | + .change(); |
| 211 | + |
| 212 | + // clear any timeout that may still run on this jQuery list item |
| 213 | + clearTimeout( jQuery( evt.currentTarget ).data( 'timeout' ) ); |
| 214 | + |
| 215 | + jQuery( evt.currentTarget ) |
| 216 | + |
| 217 | + // switch classes to change display style |
| 218 | + .removeClass( 'ui-state-hover' ) |
| 219 | + .addClass( 'ui-state-default' ); |
| 220 | + |
| 221 | + // avoid propagation to parent list item (e.g. hours), |
| 222 | + // they would overwrite the input value |
| 223 | + return false; |
| 224 | + }); |
| 225 | + |
| 226 | + // show timepicker when input gets focus |
| 227 | + jQuery( '#' + inputIDshow ) |
| 228 | + .focus(function() { |
| 229 | + jQuery( '#' + inputID + '_tree>ul' ).fadeIn(); |
| 230 | + }); |
| 231 | + |
| 232 | + // hide timepicker when input loses focus |
| 233 | + jQuery( '#' + inputIDshow ) |
| 234 | + .blur(function() { |
| 235 | + jQuery( '#' + inputID + '_tree ul' ).fadeOut( 'normal', function() {jQuery(this).hide();}); |
| 236 | + }); |
| 237 | + |
| 238 | + if ( ! params.partOfDTP ) { |
| 239 | + jQuery( '#' + inputIDshow ) |
| 240 | + .change(function() { |
| 241 | + jQuery( '#' + inputID ).val( jQuery(this).val() ); |
| 242 | + }); |
| 243 | + } |
| 244 | + |
| 245 | + jQuery( '#' + inputID + '_show ~ button[name="button"]' ) |
| 246 | + .click( function() { |
| 247 | + jQuery( '#' + inputIDshow ).focus(); |
| 248 | + }); |
| 249 | + |
| 250 | + jQuery( '#' + inputID + '_show ~ button[name="resetbutton"]' ) |
| 251 | + .click( function() { |
| 252 | + jQuery( '#' + inputIDshow ).val(''); |
| 253 | + }); |
| 254 | +} |
\ No newline at end of file |
Property changes on: tags/extensions/SemanticFormsInputs/REL_0_5/libs/timepicker.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 255 | + native |
Index: tags/extensions/SemanticFormsInputs/REL_0_5/README |
— | — | @@ -0,0 +1,60 @@ |
| 2 | +Semantic Forms Inputs is an extension to MediaWiki that provides |
| 3 | +additional input types for the Semantic Forms extension. |
| 4 | + |
| 5 | +The Semantic Forms extension allows users to add, edit and query data |
| 6 | +of a Semantic MediaWiki-based wiki using forms. For every form field |
| 7 | +the input type specifies the type of input a field will have in the |
| 8 | +form. Semantic Forms comes with basic input types for all data |
| 9 | +types. This extension -- Semantic Forms Inputs -- aims to collect |
| 10 | +further, visually and/or functionally enhanced input types. |
| 11 | + |
| 12 | +For the full description, see the Semantic Forms Inputs homepage: |
| 13 | +http://www.mediawiki.org/wiki/Extension:Semantic_Forms_Inputs |
| 14 | + |
| 15 | +This software is licensed under the GNU General Public License (GPL). |
| 16 | +See the COPYING file for more information. |
| 17 | + |
| 18 | +== Installation == |
| 19 | + |
| 20 | +Having at least MediaWiki 1.16, Semantic MediaWiki 1.5.4 and Semantic |
| 21 | +Forms 2.3.1 installed is a precondition for the Semantic Forms Inputs |
| 22 | +extension version 0.5 and above; the code will not work without it. |
| 23 | + |
| 24 | +To install Semantic Forms Inputs, create a directory named |
| 25 | +SemanticFormsInputs in the extensions directory of your MediaWiki |
| 26 | +installation and copy the extension's files into it. Then add the |
| 27 | +following line to your LocalSettings.php below the inclusion of the |
| 28 | +Semantic Forms extension: |
| 29 | + |
| 30 | +require_once( "$IP/extensions/SemanticFormsInputs/SemanticFormsInputs.php" ); |
| 31 | + |
| 32 | +== Credits == |
| 33 | + |
| 34 | +Semantic Forms Inputs was written by Stephan Gambke with contributions |
| 35 | +from Yaron Koren, Jeroen de Dauw, Sanyam Goyal and others. |
| 36 | + |
| 37 | +The extenion uses the jQuery and jQuery UI libraries. |
| 38 | +See http://jquery.org/ and http://jqueryui.com/ . |
| 39 | + |
| 40 | +Button icons are derived from the Mini Icons 2 icon set from |
| 41 | +brandspankingnew.net. See |
| 42 | +http://www.brandspankingnew.net/archive/2006/12/hohoho.html |
| 43 | + |
| 44 | +Finally, internationalization was achieved through the work of the |
| 45 | +translatewiki community. See http://translatewiki.net |
| 46 | + |
| 47 | +== Contact == |
| 48 | + |
| 49 | +Bugs should preferably be reported on the Wikimedia bug tracker: |
| 50 | +http://bugzilla.wikimedia.org/ |
| 51 | + |
| 52 | +Comments, questions and suggestions can be sent or posted to: |
| 53 | + |
| 54 | +* the appropriate Semantic MediaWiki mailing list: |
| 55 | + http://lists.sourceforge.net/lists/listinfo/semediawiki-user |
| 56 | + |
| 57 | +* the Semantic Forms Inputs discussion page on mediawiki.org: |
| 58 | + http://www.mediawiki.org/wiki/Extension_talk:Semantic_Forms_Inputs |
| 59 | + |
| 60 | +* the author: |
| 61 | + http://www.mediawiki.org/wiki/Special:EmailUser/F.trott |
Property changes on: tags/extensions/SemanticFormsInputs/REL_0_5/README |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 62 | + native |