Changeset 584
- Timestamp:
- 12/08/08 19:12:59 (14 years ago)
- google:author:
- forxer
- Location:
- plugins/acronyms/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/acronyms/trunk/_admin.php
r583 r584 16 16 $_menu['Blog']->addItem(__('Acronyms Manager'),'plugin.php?p=acronyms','index.php?pf=acronyms/icon.png', 17 17 preg_match('/plugin.php\?p=acronyms(&.*)?$/',$_SERVER['REQUEST_URI']), 18 $core->auth->check('usage,contentadmin',$core->blog->id)); 18 $core->auth->check('acronyms',$core->blog->id)); 19 20 $core->auth->setPermissionType('acronyms',__('manage acronyms')); 19 21 20 22 $core->addBehavior('coreInitWikiPost',array('acronymsBehaviors','coreInitWikiPost')); … … 29 31 30 32 $core->wiki2xhtml->setOpt('acronyms_file',$acronyms->file); 31 $core->wiki2xhtml->acro_table = $ core->wiki2xhtml->__getAcronyms();33 $core->wiki2xhtml->acro_table = $acronyms->getList(); 32 34 } 33 35 } -
plugins/acronyms/trunk/_define.php
r583 r584 16 16 /* Description*/ "Add, remove and modify acronyms for the wiki syntax.", 17 17 /* Author */ "Vincent Garnier", 18 /* Version */ '0. 1',19 /* Permissions */ ' usage,contentadmin'18 /* Version */ '0.2', 19 /* Permissions */ 'acronyms' 20 20 ); 21 ?> -
plugins/acronyms/trunk/index.php
r583 r584 19 19 20 20 # modfication de la liste des acronymes 21 if ( isset($_POST['p_edit']))21 if (!empty($_POST['p_edit'])) 22 22 { 23 $p ost_array = array_map('trim', $_POST);23 $p_acronyms = !empty($_POST['p_acronyms']) && is_array($_POST['p_acronyms']) ? array_map('trim', $_POST['p_acronyms']) : array(); 24 24 25 25 $acronyms_list = array(); 26 foreach ($p ost_arrayas $nk=>$nv)26 foreach ($p_acronyms as $nk=>$nv) 27 27 { 28 $prefix = substr($nk, 0, 8); 29 if (($prefix == 'acronym_') && ($nv != '')) { 30 $acronyms_list[substr($nk, 8)] = $nv; 28 if ($nv != '') { 29 $acronyms_list[$nk] = $nv; 30 } 31 else { 32 unset($acronyms_list[$nk]); 31 33 } 32 34 } … … 44 46 $a_acro = !empty($_POST['a_acro']) ? trim($_POST['a_acro']) : ''; 45 47 $a_title = !empty($_POST['a_title']) ? trim($_POST['a_title']) : ''; 46 48 47 49 if ($a_acro == '') { 48 50 throw new Exception(__('You must give an acronym')); 49 51 } 50 52 51 53 if ($a_title == '') { 52 54 throw new Exception(__('You must give a title')); 53 55 } 54 56 55 57 if (isset($acronyms_list[$a_acro])) { 56 58 throw new Exception(__('This acronym already exists')); 57 59 } 58 60 59 61 $acronyms_list[$a_acro] = $a_title; 60 62 ksort($acronyms_list); 61 63 62 64 $acronyms->writeFile($acronyms_list); 63 65 http::redirect($p_url.'&added=1'); … … 97 99 <p class="acroleft"><label for="a_acro"><?php echo __('Acronym'); ?></label> 98 100 <?php echo form::field('a_acro',10,'',$a_acro,'',''); ?></p> 99 101 100 102 <p class="acroright"><label for="a_title"><?php echo __('Title'); ?></label> 101 103 <?php echo form::field('a_title',60,'',$a_title,'',''); ?></p> … … 113 115 <div id="listacro"> 114 116 <?php 117 $i = 1; 115 118 foreach ($acronyms_list as $k=>$v) 116 119 { 117 120 echo 118 121 '<p class="field">'."\n". 119 '<label for="acronym_'.$ k.'"><acronym title="'.$v.'">'.html::escapeHTML($k).'</acronym></label>'."\n".120 form::field( 'acronym_'.$k,60,'',html::escapeHTML($v))."\n".122 '<label for="acronym_'.$i.'"><acronym title="'.$v.'">'.html::escapeHTML($k).'</acronym></label>'."\n". 123 form::field(array('p_acronyms['.$k.']','acronym_'.$i),60,'',html::escapeHTML($v))."\n". 121 124 '</p>'."\n\n"; 125 126 ++$i; 122 127 } 123 128 ?> 129 </div><!-- #listacro --> 124 130 </fieldset> 125 131 <p class="clear"><?php echo form::hidden('p_edit', '1'); -
plugins/acronyms/trunk/locales/fr/main.po
r583 r584 4 4 msgid "Add, remove and modify acronyms for the wiki syntax." 5 5 msgstr "Ajouter, supprimer et modifier les acromymes pour la syntaxe wiki." 6 7 msgid "manage acronyms" 8 msgstr "gérer les acronymes" 6 9 7 10 msgid "Add an acronym"
Note: See TracChangeset
for help on using the changeset viewer.