Changeset 9765
- Timestamp:
- Mar 19, 2011, 10:35:08 AM (13 years ago)
- Location:
- extensions/bbcode_bar
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/bbcode_bar/admin.php
r9682 r9765 11 11 // nouveau tableau de config 12 12 unset($conf_bbcode_bar); 13 for ($i=0; $i<=15; $i++) 14 { 13 for ($i=0; $i<=15; $i++) { 15 14 $conf_bbcode_bar[] = (isset($_POST['chkb'.sprintf("%02d", $i)])) ? $_POST['chkb'.sprintf("%02d", $i)] : 0; 16 15 } … … 24 23 pwg_query($query); 25 24 array_push($page['infos'], l10n('Information data registered in database')); 26 27 25 } 28 26 29 27 // Parametrage du template 30 for ($i=0; $i<=15; $i++) 31 { 28 for ($i=0; $i<=15; $i++) { 32 29 $template->assign('CHKB'.sprintf("%02d", $i).'_STATUS', ($conf_bbcode_bar[$i] == 1) ? 'checked="checked"' : null); 33 30 } -
extensions/bbcode_bar/bbcode.js
r9682 r9765 49 49 bbcode[form+field+code] = 1; 50 50 } else { 51 ToAdd = " \n[/"+code+"]\n";51 ToAdd = "[/li]\n[/"+code+"]\n"; 52 52 re = new RegExp(code+"1.(\\w+)$"); 53 53 img.src = img.src.replace(re, code+".$1"); -
extensions/bbcode_bar/bbcode_bar.inc.php
r9682 r9765 4 4 function set_bbcode_bar() 5 5 { 6 global $template, $conf, $lang, $user, $pwg_loaded_plugins ;6 global $template, $conf, $lang, $user, $pwg_loaded_plugins, $page; 7 7 load_language('plugin.lang', dirname(__FILE__) . '/'); 8 8 $conf_bbcode_bar = explode("," , $conf['bbcode_bar']); … … 10 10 11 11 // buttons 12 for ($i=0; $i<=15; $i++) 13 { 12 for ($i=0; $i<=15; $i++) { 14 13 if ($conf_bbcode_bar[$i] == 1) $template->assign('BBCode_bar_button_'.sprintf("%02d", $i), true); 15 14 } 16 15 $template->assign('repicon', $conf_bbcode_bar[16]); 17 16 18 // edit field has a different id 19 if (isset($_GET['action']) AND $_GET['action'] == 'edit_comment') 20 { 17 // edit field has different id 18 if ( 19 (isset($_GET['action']) AND $_GET['action'] == 'edit_comment') 20 OR (isset($page['body_id']) AND $page['body_id'] == 'theCommentsPage') 21 ) { 21 22 $template->assign('form_name', 'editComment'); 22 } 23 else 24 { 23 } else { 25 24 $template->assign('form_name', 'addComment'); 26 25 } 27 26 28 27 // smilies support 29 if (isset($pwg_loaded_plugins['SmiliesSupport'])) 30 { 28 if (isset($pwg_loaded_plugins['SmiliesSupport'])) { 31 29 $template->assign('BBCode_bar_SmiliesSupport', array('SMILIESSUPPORT_PAGE' => SmiliesTable())); 32 30 } … … 66 64 while (($temp = array_pop($tags))) 67 65 { 68 if ($temp != $tag) 69 { 66 if ($temp != $tag) { 70 67 $before_tag.='[/'.$temp.']'; 71 } 72 else 73 { 68 } else { 74 69 $before_tag.='[/'.$tag.']'; 75 70 break; … … 78 73 $end_pos += strlen($before_tag)+strlen($after_tag)-strlen($str); 79 74 $str = $before_tag.$after_tag; 80 } 81 else 82 { // push stack 75 } else { // push stack 83 76 array_push($tags,$tag); 84 77 } … … 233 226 return preg_replace($patterns, $replacements, $str); 234 227 } 228 235 229 ?> -
extensions/bbcode_bar/bbcode_bar_admin.tpl
r9682 r9765 7 7 <form method="post" action="" class="properties" ENCTYPE="multipart/form-data"> 8 8 <fieldset> 9 <legend>{'Parameters'|@translate}</legend> 9 10 <ul> 10 11 <li> … … 61 62 </li> 62 63 <li> 63 64 </li>65 <li>66 64 <span class="property">{'size_help'|@translate}</span> 67 65 <input type="checkbox" name="chkb13" {$CHKB13_STATUS} value="1" /> -
extensions/bbcode_bar/main.inc.php
r9682 r9765 2 2 /* 3 3 Plugin Name: BBCode Bar 4 Version: 2.2. 04 Version: 2.2.a 5 5 Description: Allow use BBCode for comments and descriptions. 6 6 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=140 … … 20 20 remove_event_handler('render_comment_content', 'render_comment_content'); 21 21 add_event_handler('render_comment_content', 'BBCodeParse'); 22 add_event_handler('loc_begin_picture', 'set_bbcode_bar'); 22 add_event_handler('loc_after_page_header', 'add_bbcode_bar'); 23 } 24 25 function add_bbcode_bar() { 26 global $page; 27 if ($page['body_id'] == 'theCommentsPage' OR $page['body_id'] == 'thePicturePage') { 28 set_bbcode_bar(); 29 } 23 30 } 24 31 … … 35 42 } 36 43 } 44 37 45 ?>
Note: See TracChangeset
for help on using the changeset viewer.