Changeset 1123
- Timestamp:
- 04/30/09 02:03:53 (14 years ago)
- Location:
- plugins/example
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/example/_define.php
r1122 r1123 41 41 /* Description */ 'This is an example', 42 42 /* Author */ 'Dotclear Lab contributors', 43 /* Version */ '0. 2',43 /* Version */ '0.3', 44 44 /* Permissions */ 'usage,contentadmin' 45 45 ); -
plugins/example/_prepend.php
r1120 r1123 40 40 $__autoload['example'] = dirname(__FILE__).'/lib.example.php'; 41 41 42 # register the 'example'URL42 # register the "example" URL 43 43 $core->url->register('example','example', 44 44 '^example(?:/(.+))?$',array('exampleDocument','page')); 45 45 46 # load the widget, on administration and on the blog46 # load the widget, in administration and on the blog 47 47 require_once(dirname(__FILE__).'/_widget.php'); 48 48 -
plugins/example/_public.php
r1120 r1123 54 54 $_ctx =& $GLOBALS['_ctx']; 55 55 56 # if the URL is example/hello56 # if the URL is "example/hello" 57 57 if ($args == 'hello') 58 58 { 59 59 $_ctx->example = __('Hello World!'); 60 60 } 61 # else, if the URL is example61 # else, if the URL is "example" 62 62 else 63 63 { -
plugins/example/index.php
r1122 r1123 37 37 if (!defined('DC_CONTEXT_ADMIN')) {return;} 38 38 39 function line($line) 40 { 41 return(' '.sprintf( 42 __('(line %s of the <strong>index.php</strong> file)'), 43 $line).' '); 44 } 45 39 46 # default tab 40 $default_tab = 'settings'; 47 $default_tab = 'administration'; 48 49 if (!empty($_REQUEST['tab'])) 50 { 51 switch ($_REQUEST['tab']) 52 { 53 case 'settings' : 54 $default_tab = 'settings'; 55 break; 56 } 57 } 58 59 $rs = $core->blog->getPosts(array( 60 'order' => 'post_dt DESC', 61 'limit' => 1 62 )); 63 64 $post_link = $core->getPostAdminURL('post',$rs->post_id); 65 66 unset($rs); 41 67 42 68 # forms 69 # define_combo_values 43 70 $combo_values = array( 44 71 # group values … … 68 95 69 96 # redirect to the page, avoid conflicts with old settings 70 http::redirect($p_url.'& saveconfig=1');97 http::redirect($p_url.'&tab=settings&saveconfig=1'); 71 98 } 72 99 } … … 106 133 <?php if (!empty($msg)) {echo '<p class="message">'.$msg.'</p>';} ?> 107 134 108 <div class="multi-part" id="settings"109 title="<?php echo __('Settings'); ?>">110 <form method="post" action="<?php echo($p_url); ?>">111 <fieldset>112 <legend><?php echo(__('General settings')); ?></legend>113 <p>114 <?php echo(115 form::checkbox('setting_active',1,116 $settings->setting_active)); ?>117 <label class="classic" for="setting_active">118 <?php echo(__('Enable this setting')); ?>119 </label>120 </p>121 </fieldset>122 <p><?php echo $core->formNonce(); ?></p>123 <p><input type="submit" name="saveconfig"124 value="<?php echo __('Save configuration'); ?>" /></p>125 </form>126 </div>127 128 135 <div class="multi-part" id="administration" 129 136 title="<?php echo __('Administration'); ?>"> 130 137 <p> 131 <?php echo(__('If you edit an entry, you will see a new text in the right menu, this is due to a behavior, declared in the <strong>_admin.php</strong> file.')); ?> 138 <?php echo(__('If you edit an entry, you will see a new text in the right menu, this is due to a behavior, declared in the <strong>_admin.php</strong> file.'). 139 ' <a href="'.$post_link.'">'.__('example').'</a>'); ?> 132 140 </p> 133 141 <p> 134 142 <?php echo(__('We can call the <code>example::HelloWorld()</code> function, defined in the <strong>lib.example.php</strong> file:')); ?> 135 <?php echo(example::HelloWorld() ); ?>143 <?php echo(example::HelloWorld().line(__LINE__)); ?></p> 136 144 </p> 137 145 138 146 <h3><?php echo(__('Forms')); ?></h3> 139 147 140 <h4><?php echo(__('Combo') ); ?></h4>148 <h4><?php echo(__('Combo').line(__LINE__)); ?></h4> 141 149 <p><label><?php echo(__('Title:'). 142 150 form::combo( 143 151 # name and id 144 152 'combo', 145 # combo values, se e the beginning ofthis file153 # combo values, search "define_combo_values" in this file 146 154 $combo_values, 147 # default value, se e the beginning ofthis file155 # default value, search "define_combo_values" in this file 148 156 $combo_default_value)); ?> 149 157 </label></p> 150 158 151 <h4><?php echo(__('Radio') ); ?></h4>159 <h4><?php echo(__('Radio').line(__LINE__)); ?></h4> 152 160 <p> 153 161 <label class="classic"><?php echo( … … 174 182 </p> 175 183 176 <h4><?php echo(__('Checkbox') ); ?></h4>184 <h4><?php echo(__('Checkbox').line(__LINE__)); ?></h4> 177 185 <p> 178 186 <label class="classic"> … … 209 217 </p> 210 218 211 <h4><?php echo(__('Field') ); ?></h4>219 <h4><?php echo(__('Field').line(__LINE__)); ?></h4> 212 220 <p><label><?php echo(__('Title:'). 213 221 form::field( … … 221 229 __('default value'))); ?></label></p> 222 230 223 <h4><?php echo(__('Password') ); ?></h4>231 <h4><?php echo(__('Password').line(__LINE__)); ?></h4> 224 232 <p><label><?php echo(__('Title:'). 225 233 form::password( … … 233 241 __('default value'))); ?></label></p> 234 242 235 <h4><?php echo(__('Textarea') ); ?></h4>243 <h4><?php echo(__('Textarea').line(__LINE__)); ?></h4> 236 244 <p class="area"><label><?php echo(__('Title:'). 237 245 form::textarea( … … 245 253 __('default value'))); ?></label></p> 246 254 247 <h4><?php echo(__('Hidden') ); ?></h4>255 <h4><?php echo(__('Hidden').line(__LINE__)); ?></h4> 248 256 <p><?php echo(form::hidden( 249 257 # name … … 253 261 <p><?php echo(__('(see the source of the page)')); ?></p> 254 262 255 <h4><?php echo(__('Button') ); ?></h4>263 <h4><?php echo(__('Button').line(__LINE__)); ?></h4> 256 264 <p><input type="submit" name="saveconfig" 257 265 value="<?php echo __('Save configuration'); ?>" /> … … 259 267 value="<?php echo __('Send'); ?>" /></p> 260 268 261 <h4><?php echo(__('Fieldset') ); ?></h4>269 <h4><?php echo(__('Fieldset').line(__LINE__)); ?></h4> 262 270 263 271 <fieldset> … … 278 286 279 287 <p><?php printf(__('We can use the %1$s CSS class to have %2$s columns:'), 280 '<code>two-cols</code>',__('two')); ?></p> 288 '<code>two-cols</code>',__('two')); 289 echo(line(__LINE__)); ?></p> 281 290 282 291 <div class="two-cols"> … … 290 299 291 300 <p><?php printf(__('We can use the %1$s CSS class to have %2$s columns:'), 292 '<code>three-cols</code>',__('three')); ?></p> 301 '<code>three-cols</code>',__('three')); 302 echo(line(__LINE__)); ?></p> 293 303 294 304 <div class="three-cols class"> … … 330 340 </p> 331 341 </div> 342 343 <div class="multi-part" id="settings" 344 title="<?php echo __('Settings'); ?>"> 345 <form method="post" action="<?php echo($p_url); ?>"> 346 <fieldset> 347 <legend><?php echo(__('General settings')); ?></legend> 348 <p> 349 <?php echo( 350 form::checkbox('setting_active',1, 351 $settings->setting_active)); ?> 352 <label class="classic" for="setting_active"> 353 <?php echo(__('Enable this setting')); ?> 354 </label> 355 </p> 356 </fieldset> 357 <p><?php echo $core->formNonce(); ?></p> 358 <p><input type="submit" name="saveconfig" 359 value="<?php echo __('Save configuration'); ?>" /></p> 360 </form> 361 </div> 332 362 333 363 </body> -
plugins/example/locales/fr/main.po
r1122 r1123 3 3 "Project-Id-Version: Example\n" 4 4 "Report-Msgid-Bugs-To: \n" 5 "POT-Creation-Date: 2009-04-30 0 0:54+0100\n"6 "PO-Revision-Date: 2009-04-30 0 0:55+0100\n"5 "POT-Creation-Date: 2009-04-30 02:00+0100\n" 6 "PO-Revision-Date: 2009-04-30 02:00+0100\n" 7 7 "Last-Translator: Moe <poedit@gniark.net>\n" 8 8 "Language-Team: Moe <poedit@gniark.net>\n" … … 20 20 #: lib.example.php:50 21 21 #: _widget.php:70 22 #: index.php:2 6223 #: index.php:2 6524 #: index.php: 27425 #: index.php: 27726 #: index.php: 28022 #: index.php:293 23 #: index.php:296 24 #: index.php:306 25 #: index.php:309 26 #: index.php:312 27 27 msgid "Hello World!" 28 msgstr "Bonjour le monde :!"28 msgstr "Bonjour le monde !" 29 29 30 30 #: _public.php:64 … … 35 35 #: _widget.php:94 36 36 #: _admin.php:42 37 #: index.php: 8638 #: index.php:1 0439 #: index.php: 28940 #: index.php: 29641 #: index.php:3 0037 #: index.php:113 38 #: index.php:131 39 #: index.php:321 40 #: index.php:328 41 #: index.php:332 42 42 msgid "Example" 43 43 msgstr "Exemple" … … 55 55 msgstr "" 56 56 57 #: index.php:45 57 #: index.php:42 58 #, php-format 59 msgid "(line %s of the <strong>index.php</strong> file)" 60 msgstr "(ligne %s du fichier <strong>index.php</strong>)" 61 62 #: index.php:72 58 63 msgid "Numbers" 59 64 msgstr "Nombres" 60 65 61 #: index.php: 4662 #: index.php:1 6263 #: index.php:1 8766 #: index.php:73 67 #: index.php:170 68 #: index.php:195 64 69 msgid "one" 65 70 msgstr "un" 66 71 67 #: index.php: 4768 #: index.php:1 6569 #: index.php: 19870 #: index.php:2 5872 #: index.php:74 73 #: index.php:173 74 #: index.php:206 75 #: index.php:288 71 76 msgid "two" 72 77 msgstr "deux" 73 78 74 #: index.php: 5079 #: index.php:77 75 80 msgid "A text value" 76 81 msgstr "Une valeur textuelle" 77 82 78 #: index.php: 8083 #: index.php:107 79 84 msgid "Configuration successfully updated." 80 85 msgstr "Configuration mise à jour avec succès." 81 86 82 #: index.php: 9187 #: index.php:118 83 88 msgid "Are you sure you want to save the configuration?" 84 89 msgstr "Êtes-vous certain de vouloir sauvegarder la configuration ?" 85 90 86 #: index.php:109 91 #: index.php:136 92 msgid "Administration" 93 msgstr "" 94 95 #: index.php:138 96 msgid "If you edit an entry, you will see a new text in the right menu, this is due to a behavior, declared in the <strong>_admin.php</strong> file." 97 msgstr "Si vous modifiez un billet, vous verrez un nouveau texte dans le menu de droite, il est dû à un <em>behavior</em> (comportement), déclaré dans le fichier <strong>_admin.php</strong>." 98 99 #: index.php:139 100 msgid "example" 101 msgstr "exemple" 102 103 #: index.php:142 104 msgid "We can call the <code>example::HelloWorld()</code> function, defined in the <strong>lib.example.php</strong> file:" 105 msgstr "Nous pouvons appeler la fonction <code>example::HelloWorld()</code>, définie dans le fichier <strong>lib.example.php</strong> :" 106 107 #: index.php:146 108 msgid "Forms" 109 msgstr "Formulaires" 110 111 #: index.php:148 112 #: index.php:273 113 msgid "Combo" 114 msgstr "Combo" 115 116 #: index.php:149 117 #: index.php:220 118 #: index.php:232 119 #: index.php:244 120 #: index.php:274 121 #: index.php:278 122 msgid "Title:" 123 msgstr "" 124 125 #: index.php:159 126 msgid "Radio" 127 msgstr "Radio" 128 129 #: index.php:176 130 msgid "Checked by default" 131 msgstr "Cochée par défaut" 132 133 #: index.php:181 134 msgid "Disabled" 135 msgstr "Désactivé" 136 137 #: index.php:184 138 msgid "Checkbox" 139 msgstr "Case à cocher" 140 141 #: index.php:210 142 msgid "Checked by default checkbox" 143 msgstr "Case à cocher cochée par défaut" 144 145 #: index.php:215 146 msgid "Disabled checkbox" 147 msgstr "Case à cocher désactivée" 148 149 #: index.php:219 150 msgid "Field" 151 msgstr "Champ" 152 153 #: index.php:229 154 #: index.php:241 155 #: index.php:253 156 #: index.php:280 157 msgid "default value" 158 msgstr "valeur par défaut" 159 160 #: index.php:231 161 msgid "Password" 162 msgstr "" 163 164 #: index.php:243 165 msgid "Textarea" 166 msgstr "Zone de texte" 167 168 #: index.php:255 169 msgid "Hidden" 170 msgstr "" 171 172 #: index.php:260 173 msgid "value" 174 msgstr "valeur" 175 176 #: index.php:261 177 msgid "(see the source of the page)" 178 msgstr "(voir la source de la page)" 179 180 #: index.php:263 181 msgid "Button" 182 msgstr "" 183 184 #: index.php:265 185 #: index.php:359 186 msgid "Save configuration" 187 msgstr "Sauvegarder la configuration" 188 189 #: index.php:267 190 #: index.php:282 191 msgid "Send" 192 msgstr "" 193 194 #: index.php:269 195 msgid "Fieldset" 196 msgstr "" 197 198 #: index.php:272 199 msgid "Fieldset legend" 200 msgstr "" 201 202 #: index.php:285 203 msgid "Columns" 204 msgstr "Colonnes" 205 206 #: index.php:287 207 #: index.php:300 208 #, php-format 209 msgid "We can use the %1$s CSS class to have %2$s columns:" 210 msgstr "Nous pouvons utiliser la classe CSS %1$s pour avoir %2$s colonnes :" 211 212 #: index.php:301 213 msgid "three" 214 msgstr "trois" 215 216 #: index.php:318 217 msgid "Public" 218 msgstr "" 219 220 #: index.php:320 221 #, php-format 222 msgid "URL of the %s page, defined in the <strong>_prepend.php</strong> file:" 223 msgstr "URL de la page %s, définie dans le fichier <strong>_prepend.php</strong> :" 224 225 #: index.php:327 226 #, php-format 227 msgid "View the %s page" 228 msgstr "Voir la page %s" 229 230 #: index.php:331 231 #, php-format 232 msgid "View the %s page with an argument in its URL" 233 msgstr "Voir la page %s avec un argument dans l'URL" 234 235 #: index.php:336 236 msgid "Widget" 237 msgstr "" 238 239 #: index.php:338 240 msgid "An example widget is available on the widgets page." 241 msgstr "Un widget d'exemple est disponible sur la page des widgets." 242 243 #: index.php:339 244 msgid "It is defined in the <strong>_widget.php</strong> file." 245 msgstr "Il est défini dans le fichier <strong>_widget.php</strong>." 246 247 #: index.php:344 87 248 msgid "Settings" 88 249 msgstr "Paramètres" 89 250 90 #: index.php: 112251 #: index.php:347 91 252 msgid "General settings" 92 253 msgstr "Paramètres généraux" 93 254 94 #: index.php: 118255 #: index.php:353 95 256 msgid "Enable this setting" 96 257 msgstr "Activer ce paramètre" 97 258 98 #: index.php:12499 msgid "Save configuration"100 msgstr "Sauvegarder la configuration"101 102 #: index.php:129103 msgid "Administration"104 msgstr ""105 106 #: index.php:131107 msgid "If you edit an entry, you will see a new text in the right menu, this is due to a behavior, declared in the <strong>_admin.php</strong> file."108 msgstr "Si vous modifiez un billet, vous verrez un nouveau texte dans le menu de droite, il est dû à un <em>behavior</em> (comportement), déclaré dans le fichier <strong>_admin.php</strong>."109 110 #: index.php:134111 msgid "We can call the <code>example::HelloWorld()</code> function, defined in the <strong>lib.example.php</strong> file:"112 msgstr "Nous pouvons appeler la fonction <code>example::HelloWorld()</code>, définie dans le fichier <strong>lib.example.php</strong> :"113 114 #: index.php:138115 msgid "Forms"116 msgstr "Formulaires"117 118 #: index.php:140119 msgid "Combo"120 msgstr "Combo"121 122 #: index.php:141123 #: index.php:212124 #: index.php:224125 #: index.php:236126 msgid "Title:"127 msgstr ""128 129 #: index.php:151130 msgid "Radio"131 msgstr "Radio"132 133 #: index.php:168134 msgid "Checked by default"135 msgstr "Cochée par défaut"136 137 #: index.php:173138 msgid "Disabled"139 msgstr "Désactivé"140 141 #: index.php:176142 msgid "Checkbox"143 msgstr "Case à cocher"144 145 #: index.php:202146 msgid "Checked by default checkbox"147 msgstr "Case à cocher cochée par défaut"148 149 #: index.php:207150 msgid "Disabled checkbox"151 msgstr "Case à cocher désactivée"152 153 #: index.php:211154 msgid "Field"155 msgstr ""156 157 #: index.php:221158 #: index.php:233159 #: index.php:245160 msgid "default value"161 msgstr "valeur par défaut"162 163 #: index.php:223164 msgid "Password"165 msgstr ""166 167 #: index.php:235168 msgid "Textarea"169 msgstr ""170 171 #: index.php:247172 msgid "Hidden"173 msgstr ""174 175 #: index.php:252176 msgid "value"177 msgstr ""178 179 #: index.php:253180 msgid "(see the source of the page)"181 msgstr "(voir la source de la page)"182 183 #: index.php:255184 msgid "Columns"185 msgstr "Colonnes"186 187 #: index.php:257188 #: index.php:269189 #, php-format190 msgid "We can use the %1$s CSS class to have %2$s columns:"191 msgstr "Nous pouvons utiliser la classe CSS %1$s pour avoir %2$s colonnes :"192 193 #: index.php:270194 msgid "three"195 msgstr "trois"196 197 #: index.php:286198 msgid "Public"199 msgstr ""200 201 #: index.php:288202 #, php-format203 msgid "URL of the %s page, defined in the <strong>_prepend.php</strong> file:"204 msgstr "URL de la page %s, définie dans le fichier <strong>_prepend.php</strong> :"205 206 #: index.php:295207 #, php-format208 msgid "View the %s page"209 msgstr "Voir la page %s"210 211 #: index.php:299212 #, php-format213 msgid "View the %s page with an argument in its URL"214 msgstr "Voir la page %s avec un argument dans l'URL"215 216 #: index.php:304217 msgid "Widget"218 msgstr ""219 220 #: index.php:306221 msgid "An example widget is available on the widgets page."222 msgstr "Un widget d'exemple est disponible sur la page des widgets."223 224 #: index.php:307225 msgid "It is defined in the <strong>_widget.php</strong> file."226 msgstr "Il est défini dans le fichier <strong>_widget.php</strong>."227
Note: See TracChangeset
for help on using the changeset viewer.