Changeset 377
- Timestamp:
- 03/28/08 22:28:15 (16 years ago)
- Location:
- plugins/blocNotes
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/blocNotes/_admin.php
r368 r377 23 23 24 24 require_once(dirname(__FILE__).'/lib.blocNotes.php'); 25 26 # dashboard 27 if (isset($__dashboard_icons) && $core->auth->check('blocNotes',$core->blog->id)) { 28 $__dashboard_icons[] = array(__('Bloc-notes'),'plugin.php?p=blocNotes','index.php?pf=blocNotes/icon.png'); 29 } 25 30 $core->addBehavior('adminDashboardIcons',array('blocNotes','adminDashboardIcons')); 26 $core->addBehavior('adminPostForm',array('blocNotes','textarea')); 27 $core->addBehavior('adminAfterPostCreate',array('blocNotes','adminPost')); 28 $core->addBehavior('adminAfterPostUpdate',array('blocNotes','adminPost')); 29 $core->addBehavior('adminPostHeaders',array('blocNotes','adminpostHeaders')); 31 32 # post 33 $core->addBehavior('adminPostForm',array('blocNotes','form')); 34 $core->addBehavior('adminAfterPostCreate',array('blocNotes','putSettings')); 35 $core->addBehavior('adminAfterPostUpdate',array('blocNotes','putSettings')); 36 $core->addBehavior('adminPostHeaders',array('blocNotes','adminPostHeaders')); 30 37 31 38 $_menu['Plugins']->addItem(__('Bloc-notes'), -
plugins/blocNotes/_define.php
r368 r377 24 24 $this->registerModule( 25 25 /* Name */ "Bloc-Notes", 26 /* Description*/ "Display a notebookon the backend",26 /* Description*/ "Display notebooks on the backend", 27 27 /* Author */ "Moe (http://gniark.net/)", 28 /* Version */ '1.0-beta 2',28 /* Version */ '1.0-beta3', 29 29 /* Permissions */ 'usage,contentadmin' 30 30 ); 31 32 /*33 TODO :34 personal notebook35 -> global setting with username36 */37 31 ?> -
plugins/blocNotes/index.php
r375 r377 28 28 if (!empty($_POST['saveconfig'])) 29 29 { 30 $core->blog->settings->setNameSpace('blocnotes'); 31 # Bloc-Notes' text 32 $core->blog->settings->put('blocNotes_text', 33 $_POST['blocNotes_text'],'text','Bloc-Notes\' text'); 30 blocNotes::putSettings(); 34 31 http::redirect($p_url.'&saveconfig=1'); 35 32 } … … 64 61 <div id="settings" title="<?php echo __('settings'); ?>"> 65 62 <form method="post" action="<?php echo http::getSelfURI(); ?>"> 66 <fieldset> 67 <legend><?php echo(__('Personal text, writable by you only')); ?></legend> 68 <?php echo(blocNotes::textarea()); ?> 69 </fieldset> 70 <?php /* 71 <fieldset> 72 <legend><?php echo(__('Personal text, writable by you only')); ?></legend> 73 <?php echo(blocNotes::textarea('personal')); ?> 74 </fieldset> 75 <fieldset> 76 <legend><?php echo(__('Blog-specific text, all the users can edit it')); ?></legend> 77 <?php echo(blocNotes::textarea('blog')); ?> 78 </fieldset> 79 <p><?php echo __('These texts will be readable by all the users, don't write some'); ?></p> 80 */ ?> 63 <?php blocNotes::form(); ?> 64 81 65 82 66 <p><?php echo $core->formNonce(); ?></p> -
plugins/blocNotes/lib.blocNotes.php
r369 r377 30 30 } 31 31 32 public static function textarea(&$post='')32 public static function form() 33 33 { 34 34 global $core; 35 35 36 echo('<p class="area" id="blocNotes">'. 37 '<label for="blocNotes_text">'.__('Bloc-notes :').'</label>'. 38 form::textarea('blocNotes_text',80,20, 36 echo '<p class="area" id="blocNotes_personal">'. 37 '<label for="blocNotes_personal_text">'. 38 __('Personal notebook (other users can't edit it) :'). 39 '</label>'. 40 form::textarea('blocNotes_personal_text',80,10, 41 html::escapeHTML($core->blog->settings->{'blocNotes_text_'.$core->auth->userID()})). 42 '</p>'. 43 '<p class="area" id="blocNotes">'. 44 '<label for="blocNotes_text">'. 45 __('Blog-specific notebook (all the users of the blog can edit it) :'). 46 '</label>'. 47 form::textarea('blocNotes_text',80,10, 39 48 html::escapeHTML($core->blog->settings->blocNotes_text)). 40 '</p>'); 49 '</p>'. 50 '<p>'. 51 __('These notes may be read by anyone, don't write some sensitive information (password, personal information, etc.)'). 52 '</p>'; 41 53 } 42 54 43 public static function adminPost()55 public static function putSettings() 44 56 { 45 57 global $core; … … 49 61 $core->blog->settings->setNameSpace('blocnotes'); 50 62 # Bloc-Notes' text 63 $core->blog->settings->put('blocNotes_text_'.$core->auth->userID(), 64 $_POST['blocNotes_personal_text'],'text','Bloc-Notes\' personal text',true,true); 51 65 $core->blog->settings->put('blocNotes_text', 52 66 $_POST['blocNotes_text'],'text','Bloc-Notes\' text'); -
plugins/blocNotes/locales/fr/main.lang.php
r374 r377 3 3 // This file is generated by LangOmatic, a plugin for Dotclear 4 4 5 # _admin.php:31 6 # index.php:50 7 # index.php:58 5 # _admin.php:28 6 # _admin.php:38 7 # index.php:47 8 # index.php:55 8 9 # lib.blocNotes.php:28 9 10 $GLOBALS['__l10n']['Bloc-notes']='Bloc-notes'; 10 11 11 # index.php:4 412 # index.php:41 12 13 $GLOBALS['__l10n']['Configuration successfully updated.']='Configuration mise à jour avec succès.'; 13 14 14 # index.php:6 415 # index.php:61 15 16 $GLOBALS['__l10n']['settings']='paramètres'; 16 17 17 18 # index.php:67 18 $GLOBALS['__l10n']['Text']='Texte';19 20 # index.php:7221 19 $GLOBALS['__l10n']['Save configuration']='Enregistrer la configuration'; 22 20 23 # lib.blocNotes.php:37 24 $GLOBALS['__l10n']['Bloc-notes :']='Bloc-notes :'; 21 # lib.blocNotes.php:38 22 $GLOBALS['__l10n']['Personal notebook (other users can't edit it) :']='Bloc-notes personnel (les autres utilisateurs ne peuvent pas le modifier) :'; 23 24 # lib.blocNotes.php:45 25 $GLOBALS['__l10n']['Blog-specific notebook (all the users of the blog can edit it) :']='Bloc-notes spécifique à ce blog (tous les utilisateurs du blog peuvent le modifier) :'; 26 27 # lib.blocNotes.php:51 28 $GLOBALS['__l10n']['These notes may be read by anyone, don't write some sensitive information (password, personal information, etc.)']='Ces notes pourraientt être lues par n\'importe qui, n\'écrivez pas d\'information sensible (mot de passe, information personnelle, etc.)'; 25 29 26 30 ?> -
plugins/blocNotes/post.js
r376 r377 21 21 ***** END LICENSE BLOCK *****/ 22 22 $(function() { 23 /* from /dotclear/admin/js/_post.js */ 23 /* modified from /dotclear/admin/js/_post.js */ 24 $('#blocNotes_personal label').toggleWithLegend($('#blocNotes_personal').children().not('label'),{ 25 cookie: 'dcx_post_blocNotes_p' 26 27 }); 24 28 $('#blocNotes label').toggleWithLegend($('#blocNotes').children().not('label'),{ 25 cookie: 'dcx_post_blocNotes'/*, 26 hide: $('#blocNotes_text').val() == ''*/ 29 cookie: 'dcx_post_blocNotes' 27 30 }); 28 31 });
Note: See TracChangeset
for help on using the changeset viewer.