Changeset 11295 for extensions/bbcode_bar/bbcode_bar.inc.php
- Timestamp:
- Jun 10, 2011, 9:03:17 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/bbcode_bar/bbcode_bar.inc.php
r10983 r11295 5 5 { 6 6 global $template, $conf, $pwg_loaded_plugins, $page; 7 7 8 load_language('plugin.lang', dirname(__FILE__) . '/'); 8 9 $conf_bbcode_bar = unserialize($conf['bbcode_bar']); 9 10 10 11 // buttons 11 foreach(unserialize(BBcode_codes) as $key) { 12 foreach(unserialize(BBcode_codes) as $key) 13 { 12 14 if ($conf_bbcode_bar[$key]) $template->assign('BBC_'.$key, true); 13 15 } … … 18 20 // OR (isset($page['body_id']) AND $page['body_id'] == 'theCommentsPage') 19 21 // ) { 20 // $template->assign(' form_name', 'editComment');22 // $template->assign('bbcode_texarea', 'contenteditid'); 21 23 // } else { 22 // $template->assign(' form_name', 'addComment');24 // $template->assign('bbcode_texarea', 'contentid'); 23 25 // } 24 $template->assign('form_name', 'addComment'); 25 26 if (isset($pwg_loaded_plugins['SmiliesSupport'])) { 26 $template->assign('bbcode_texarea', 'contentid'); 27 28 // smilies 29 if (isset($pwg_loaded_plugins['SmiliesSupport'])) 30 { 27 31 $template->assign('BBC_smilies', true); 28 32 } 29 33 30 34 $template->assign('BBCODE_PATH', BBcode_PATH); 31 $template->set_filename('bbcode_bar', dirname(__FILE__).'/template/bbcode_bar.tpl'); 32 $template->parse('bbcode_bar', true); 33 34 // smilies support >2.2.a ## must be parsed after bbcode_bar, because the javascript must be after bbc's one 35 if (isset($pwg_loaded_plugins['SmiliesSupport']) AND strcmp($pwg_loaded_plugins['SmiliesSupport']['version'], '2.2.a') != -1) { 35 $template->set_prefilter('picture', 'set_bbcode_bar_prefilter'); 36 37 // smilies support > 2.2.f ## must be parsed after bbcode_bar, because the javascript must be after bbc's one 38 if (isset($pwg_loaded_plugins['SmiliesSupport']) AND strcmp($pwg_loaded_plugins['SmiliesSupport']['version'], '2.2.f') != -1) { 36 39 set_smiliessupport(); 37 40 } 41 } 42 43 function set_bbcode_bar_prefilter($content, &$smarty) 44 { 45 $search = "<label>{'Comment'|@translate}"; 46 $replace = file_get_contents(BBcode_PATH.'/template/bbcode_bar.tpl').$search; 47 return str_replace($search, $replace, $content); 38 48 } 39 49
Note: See TracChangeset
for help on using the changeset viewer.