Index: extensions/bbcode_bar/admin.php =================================================================== --- extensions/bbcode_bar/admin.php (revision 9787) +++ extensions/bbcode_bar/admin.php (revision 9965) @@ -4,5 +4,13 @@ global $conf, $template; load_language('plugin.lang', BBcode_PATH); -$conf_bbcode_bar = explode("," , $conf['bbcode_bar']); + +// Met à jour la configuration si necessaire +if (strpos($conf['bbcode_bar'],',') !== false) +{ + include(BBcode_PATH .'maintain.inc.php'); + plugin_activate(); +} + +$conf_bbcode_bar = unserialize($conf['bbcode_bar']); // Enregistrement de la configuration @@ -11,14 +19,12 @@ // nouveau tableau de config unset($conf_bbcode_bar); - for ($i=0; $i<=15; $i++) { - $conf_bbcode_bar[] = (isset($_POST['chkb'.sprintf("%02d", $i)])) ? $_POST['chkb'.sprintf("%02d", $i)] : 0; + foreach(unserialize(BBcode_codes) as $key) { + $conf_bbcode_bar[$key] = (isset($_POST[$key])) ? true : false; } - $conf_bbcode_bar[] = (isset($_POST['text17'])) ? rtrim($_POST['text17'],'/') : 'plugins/bbcode_bar/icon'; // enregistrement - $new_value_bbcode_bar = implode ("," , $conf_bbcode_bar); - $query = 'UPDATE ' . CONFIG_TABLE . ' - SET value="' . $new_value_bbcode_bar . '" - WHERE param="bbcode_bar"'; + $query = "UPDATE " . CONFIG_TABLE . " + SET value='" . serialize($conf_bbcode_bar) . "' + WHERE param='bbcode_bar'"; pwg_query($query); array_push($page['infos'], l10n('Information data registered in database')); @@ -26,8 +32,7 @@ // Parametrage du template -for ($i=0; $i<=15; $i++) { - $template->assign('CHKB'.sprintf("%02d", $i).'_STATUS', ($conf_bbcode_bar[$i] == 1) ? 'checked="checked"' : null); +foreach(unserialize(BBcode_codes) as $key) { + $template->assign(strtoupper($key).'_STATUS', ($conf_bbcode_bar[$key] == 1) ? 'checked="checked"' : null); } -$template->assign('TEXT17_STATUS', $conf_bbcode_bar[16]); $template->assign('BBCODE_PATH', BBcode_PATH); Index: extensions/bbcode_bar/bbcode_bar.inc.php =================================================================== --- extensions/bbcode_bar/bbcode_bar.inc.php (revision 9787) +++ extensions/bbcode_bar/bbcode_bar.inc.php (revision 9965) @@ -6,30 +6,31 @@ global $template, $conf, $lang, $user, $pwg_loaded_plugins, $page; load_language('plugin.lang', dirname(__FILE__) . '/'); - $conf_bbcode_bar = explode("," , $conf['bbcode_bar']); + $conf_bbcode_bar = unserialize($conf['bbcode_bar']); // buttons - for ($i=0; $i<=15; $i++) { - if ($conf_bbcode_bar[$i] == 1) $template->assign('BBCode_bar_button_'.sprintf("%02d", $i), true); - } - $template->assign('repicon', $conf_bbcode_bar[16]); + foreach(unserialize(BBcode_codes) as $key) { + if ($conf_bbcode_bar[$key]) $template->assign('BBC_'.$key, true); + } // edit field has different id - if ( - (isset($_GET['action']) AND $_GET['action'] == 'edit_comment') - OR (isset($page['body_id']) AND $page['body_id'] == 'theCommentsPage') - ) { - $template->assign('form_name', 'editComment'); - } else { - $template->assign('form_name', 'addComment'); - } - - // smilies support - if (isset($pwg_loaded_plugins['SmiliesSupport'])) { - $template->assign('BBCode_bar_SmiliesSupport', array('SMILIESSUPPORT_PAGE' => SmiliesTable())); - } + // if ( + // (isset($_GET['action']) AND $_GET['action'] == 'edit_comment') + // OR (isset($page['body_id']) AND $page['body_id'] == 'theCommentsPage') + // ) { + // $template->assign('form_name', 'editComment'); + // } else { + // $template->assign('form_name', 'addComment'); + // } + $template->assign('form_name', 'addComment'); $template->assign('BBCODE_PATH', BBcode_PATH); $template->set_filename('bbcode_bar', dirname(__FILE__).'/template/bbcode_bar.tpl'); - $lang['Comment'] .= $template->parse('bbcode_bar', true); + $template->parse('bbcode_bar', true); + + // smilies support ## must be parsed avec bbcode_bar, because the javascript must be after bbc's one + if (isset($pwg_loaded_plugins['SmiliesSupport'])) + { + set_smiliessupport(); + } } @@ -38,6 +39,4 @@ function CheckTags($str) { - //array of known tags - $known = array('p','b','i','u','s','center','right','ol','ul','li','quote', 'img','url','email','color', 'size'); //storage stack $tags = array(); @@ -53,5 +52,5 @@ $tag = substr($tag, 0, $equal_pos); //check whether we have a defined tag or not. - if (in_array(strtolower($tag),$known) || in_array(strtolower(substr($tag,1)),$known)) + if (in_array(strtolower($tag),unserialize(BBcode_codes)) || in_array(strtolower(substr($tag,1)),unserialize(BBcode_codes))) { //closing tag @@ -94,5 +93,5 @@ global $conf; - $conf_bbcode_bar = explode("," , $conf['bbcode_bar']); + $conf_bbcode_bar = unserialize($conf['bbcode_bar']); $str = CheckTags(nl2br($str)); @@ -100,5 +99,5 @@ $replacements = array(); - if ( $conf_bbcode_bar[0] == 1 ) + if ($conf_bbcode_bar['p']) { //Paragraph @@ -106,17 +105,17 @@ $replacements[] = '
\\1
'; } - if ( $conf_bbcode_bar[1] == 1 ) + if ($conf_bbcode_bar['b']) { // Bold $patterns[] = '#\[b\](.*?)\[/b\]#is'; - $replacements[] = '\\1'; - } - if ( $conf_bbcode_bar[2] == 1 ) + $replacements[] = '\\1'; + } + if ($conf_bbcode_bar['i']) { //Italic $patterns[] = '#\[i\](.*?)\[/i\]#is'; - $replacements[] = '\\1'; - } - if ( $conf_bbcode_bar[3] == 1 ) + $replacements[] = '\\1'; + } + if ($conf_bbcode_bar['u']) { //Underline @@ -124,11 +123,11 @@ $replacements[] = '\\1'; } - if ( $conf_bbcode_bar[4] == 1 ) + if ($conf_bbcode_bar['s']) { //Strikethrough $patterns[] = '#\[s\](.*?)\[/s\]#is'; - $replacements[] = '\\1
\\1
\\1'; + $replacements[] = '
\\1'; //Quotes with "user" $patterns[] = "#\[quote="(.*?)"\](.*?)\[/quote\]#is"; - $replacements[] = '
\\1 :'; + $replacements[] = '
\\2
\\1 :'; //Quotes with user $patterns[] = "#\[quote=(.*?)\](.*?)\[/quote\]#is"; - $replacements[] = '
\\2
\\1 :'; - } - if ( $conf_bbcode_bar[10] == 1 ) + $replacements[] = '
\\2
\\1 :'; + } + if ($conf_bbcode_bar['img']) { //Images @@ -180,5 +179,5 @@ $replacements[] = ''; } - if ( $conf_bbcode_bar[11] == 1 ) + if ($conf_bbcode_bar['url']) { //[url]xxxx://www.zzzz.yyy[/url] @@ -194,9 +193,9 @@ $replacements[] = '\\2'; - // [url=www.zzzzz.yyy]zZzZz[/url] + //[url=www.zzzzz.yyy]zZzZz[/url] $patterns[] = "#\[url=((www|ftp)\.[^ \"\n\r\t<]*?)\](.*?)\[/url\]#is"; $replacements[] = '\\2'; - // [url="www.zzzzz.yyy"]zZzZz[/url] + //[url="www.zzzzz.yyy"]zZzZz[/url] $patterns[] = "#\[url="((www|ftp)\.[^ \n\r\t<]*?)"\](.*?)\[/url\]#is"; $replacements[] = '\\3'; @@ -206,5 +205,5 @@ $replacements[] = '\\2'; } - if ( $conf_bbcode_bar[12] == 1 ) + if ($conf_bbcode_bar['email']) { //[email]samvure@gmail.com[/email] @@ -212,5 +211,5 @@ $replacements[] = '\\1'; } - if ( $conf_bbcode_bar[13] == 1 ) + if ($conf_bbcode_bar['size']) { //Size @@ -218,5 +217,5 @@ $replacements[] = '\\2'; } - if ( $conf_bbcode_bar[14] == 1 ) + if ($conf_bbcode_bar['color']) { //Colours Index: extensions/bbcode_bar/language/cs_CZ/plugin.lang.php =================================================================== --- extensions/bbcode_bar/language/cs_CZ/plugin.lang.php (revision 9787) +++ extensions/bbcode_bar/language/cs_CZ/plugin.lang.php (revision 9965) @@ -11,4 +11,5 @@ $lang['ul_help'] = "Jednoduchý seznam : [ul][li]element[/li][/ul]"; $lang['ol_help'] = "Číslovaný seznam: [ol][li]element[/li][/ol]"; + $lang['li_help'] = "List element : [li]element[/li]"; $lang['quote_help'] = "Citace : [quote]citát[/quote]"; @@ -24,24 +25,14 @@ $lang['huge'] = "Obří"; - $lang['fc_help'] = "Barva písma : [color=color]text[/color]"; - $lang['default_help'] = "Defaultní"; - $lang['maroon_help'] = "Tmavě červená"; + $lang['color_help'] = "Barva písma : [color=color]text[/color]"; $lang['red_help'] = "Červená"; $lang['orange_help'] = "Oranžová"; - $lang['brown_help'] = "Hnědá"; $lang['yellow_help'] = "Žlutá"; $lang['green_help'] = "Zelená"; - $lang['olive_help'] = "Olivová"; - $lang['cyan_help'] = "Azurová"; $lang['blue_help'] = "Modrá"; - $lang['darkblue_help'] = "Tmavá modrá"; - $lang['indigo_help'] = "Indigo"; - $lang['violet_help'] = "Fialková"; + $lang['purple_help'] = "Fialková"; $lang['white_help'] = "Bílá"; + $lang['grey_help'] = "Grey"; $lang['black_help'] = "Černá"; - - $lang['help'] = "Nejjednodušeji: formátování může být aplikováno jen na označený text."; - - $lang['repicon'] = "Složka ikon."; ?> Index: extensions/bbcode_bar/language/de_DE/plugin.lang.php =================================================================== --- extensions/bbcode_bar/language/de_DE/plugin.lang.php (revision 9787) +++ extensions/bbcode_bar/language/de_DE/plugin.lang.php (revision 9965) @@ -11,4 +11,5 @@ $lang['ul_help'] = "Un-nummerierte Liste : [ul][li]Element[/li][/ul]"; $lang['ol_help'] = "Nummerierte Liste : [ol][li]Element[/li][/ol]"; + $lang['li_help'] = "List element : [li]element[/li]"; $lang['quote_help'] = "Zitat : [quote]Zitat[/quote]"; @@ -24,24 +25,14 @@ $lang['huge'] = "Riesig"; - $lang['fc_help'] = "Textfarbe : [color=farbe]Text[/color]"; - $lang['default_help'] = "Standard"; - $lang['maroon_help'] = "Dunkelrot"; + $lang['color_help'] = "Textfarbe : [color=farbe]Text[/color]"; $lang['red_help'] = "Rot"; $lang['orange_help'] = "Orange"; - $lang['brown_help'] = "Braun"; $lang['yellow_help'] = "Gelb"; $lang['green_help'] = "Grün"; - $lang['olive_help'] = "Olive"; - $lang['cyan_help'] = "Cyan"; $lang['blue_help'] = "Blau"; - $lang['darkblue_help'] = "Dunkelblau"; - $lang['indigo_help'] = "Indigo"; - $lang['violet_help'] = "Violett"; + $lang['purple_help'] = "Violett"; $lang['white_help'] = "Weiß"; + $lang['grey_help'] = "Grey"; $lang['black_help'] = "Schwarz"; - - $lang['help'] = "Ein Kniff: Das Format kann dem ausgewählten Text zugewiesen werden."; - - $lang['repicon'] = "Iconverzeichnis."; ?> Index: extensions/bbcode_bar/language/en_UK/plugin.lang.php =================================================================== --- extensions/bbcode_bar/language/en_UK/plugin.lang.php (revision 9787) +++ extensions/bbcode_bar/language/en_UK/plugin.lang.php (revision 9965) @@ -5,13 +5,14 @@ $lang['i_help'] = "Italic : [i]italic[/i]"; $lang['u_help'] = "Underline : [u]underline[/u]"; - $lang['s_help'] = "Striped : [s]striped [/s]"; + $lang['s_help'] = "Striped : [s]striped[/s]"; $lang['center_help'] = "Center : [center]center[/center]"; $lang['right_help'] = "Right : [right]right[/right]"; - $lang['ul_help'] = "Unordered List : [ul][li]element[/li][/ul]"; - $lang['ol_help'] = "Ordered List : [ol][li]element[/li][/ol]"; + $lang['ul_help'] = "Unordered list : [ul][li]element[/li][/ul]"; + $lang['ol_help'] = "Ordered list : [ol][li]element[/li][/ol]"; + $lang['li_help'] = "List element : [li]element[/li]"; $lang['quote_help'] = "Quote : [quote]quote[/quote]"; - $lang['img_help'] = "Img : [img]img[/img]"; + $lang['img_help'] = "Picture : [img]picture[/img]"; $lang['url_help'] = "URL : [url=URL]Title[/url]"; $lang['mail_help'] = "E-mail : [email]Email[/email]"; @@ -24,24 +25,14 @@ $lang['huge'] = "Huge"; - $lang['fc_help'] = "Font color : [color=color]text[/color]"; - $lang['default_help'] = "Default"; - $lang['maroon_help'] = "Maroon"; + $lang['color_help'] = "Font color : [color=color]text[/color]"; $lang['red_help'] = "Red"; $lang['orange_help'] = "Orange"; - $lang['brown_help'] = "Brown"; $lang['yellow_help'] = "Yellow"; $lang['green_help'] = "Green"; - $lang['olive_help'] = "Olive"; - $lang['cyan_help'] = "Cyan"; $lang['blue_help'] = "Blue"; - $lang['darkblue_help'] = "Dark Blue"; - $lang['indigo_help'] = "Indigo"; - $lang['violet_help'] = "Violet"; + $lang['purple_help'] = "Purple"; $lang['white_help'] = "White"; + $lang['grey_help'] = "Grey"; $lang['black_help'] = "Black"; - - $lang['help'] = "Easy way: A formatting can be applied to the selected text."; - - $lang['repicon'] = "Icons directory."; ?> Index: extensions/bbcode_bar/language/es_ES/plugin.lang.php =================================================================== --- extensions/bbcode_bar/language/es_ES/plugin.lang.php (revision 9787) +++ extensions/bbcode_bar/language/es_ES/plugin.lang.php (revision 9965) @@ -11,4 +11,5 @@ $lang['ul_help'] = "Lista : [ul][li]elemento[/li][/ul]"; $lang['ol_help'] = "Lista Numerada : [ol][li]elemento[/li][/ol]"; + $lang['li_help'] = "List element : [li]element[/li]"; $lang['quote_help'] = "Citada : [quote]Citación[/quote]"; @@ -24,24 +25,14 @@ $lang['huge'] = "Muy grande"; - $lang['fc_help'] = "Color de los carácteres : [color=color]texto[/color]"; - $lang['default_help'] = "Defecto"; - $lang['maroon_help'] = "Rojo oscuro"; + $lang['color_help'] = "Color de los carácteres : [color=color]texto[/color]"; $lang['red_help'] = "Rojo"; $lang['orange_help'] = "Naranja"; - $lang['brown_help'] = "Castaño"; $lang['yellow_help'] = "amarillo"; $lang['green_help'] = "Verde"; - $lang['olive_help'] = "Aceituna"; - $lang['cyan_help'] = "Cian"; $lang['blue_help'] = "Azul"; - $lang['darkblue_help']= "Azul oscuro"; - $lang['indigo_help'] = "Índigo"; - $lang['violet_help'] = "Morado"; + $lang['purple_help'] = "Morado"; $lang['white_help'] = "Blanco"; + $lang['grey_help'] = "Grey"; $lang['black_help'] = "Negro"; - $lang['help'] = "Astucia: un formato puede ser aplicado sobre el texto seleccionado."; - - $lang['repicon'] = "Repertorio de los iconos."; - ?> Index: extensions/bbcode_bar/language/fr_FR/plugin.lang.php =================================================================== --- extensions/bbcode_bar/language/fr_FR/plugin.lang.php (revision 9787) +++ extensions/bbcode_bar/language/fr_FR/plugin.lang.php (revision 9965) @@ -11,4 +11,5 @@ $lang['ul_help'] = "Liste : [ul][li]élément[/li][/ul]"; $lang['ol_help'] = "Liste Numéroté : [ol][li]élément[/li][/ol]"; + $lang['li_help'] = "Element de liste : [li]élément[/li]"; $lang['quote_help'] = "Citation : [quote]Citation[/quote]"; @@ -24,24 +25,14 @@ $lang['huge'] = "Très grand"; - $lang['fc_help'] = "Couleur des caractères : [color=couleur]texte[/color]"; - $lang['default_help'] = "Défaut"; - $lang['maroon_help'] = "Rouge foncé"; + $lang['color_help'] = "Couleur : [color=couleur]texte[/color]"; $lang['red_help'] = "Rouge"; $lang['orange_help'] = "Orange"; - $lang['brown_help'] = "Marron"; $lang['yellow_help'] = "Jaune"; $lang['green_help'] = "Vert"; - $lang['olive_help'] = "Olive"; - $lang['cyan_help'] = "Cyan"; $lang['blue_help'] = "Bleu"; - $lang['darkblue_help'] = "Bleu Foncé"; - $lang['indigo_help'] = "Indigo"; - $lang['violet_help'] = "Violet"; + $lang['purple_help'] = "Violet"; $lang['white_help'] = "Blanc"; + $lang['grey_help'] = "Gris"; $lang['black_help'] = "Noir"; - - $lang['help'] = "Astuce : Une mise en forme peut être appliquée au texte sélectionné."; - - $lang['repicon'] = "Répertoire des icônes."; ?> Index: extensions/bbcode_bar/language/hu_HU/plugin.lang.php =================================================================== --- extensions/bbcode_bar/language/hu_HU/plugin.lang.php (revision 9787) +++ extensions/bbcode_bar/language/hu_HU/plugin.lang.php (revision 9965) @@ -11,4 +11,5 @@ $lang['ul_help'] = "Számozatlan lista : [ul][li]elem[/li][/ul]"; $lang['ol_help'] = "Számozott lista : [ol][li]elem[/li][/ol]"; + $lang['li_help'] = "List element : [li]element[/li]"; $lang['quote_help'] = "Idézet : [quote]idézett szöveg[/quote]"; @@ -24,24 +25,14 @@ $lang['huge'] = "Nagy"; - $lang['fc_help'] = "Betűszín : [color=szín]betű színe[/color]"; - $lang['default_help'] = "Alapértelmezett"; - $lang['maroon_help'] = "Gesztenyebarna"; + $lang['color_help'] = "Betűszín : [color=szín]betű színe[/color]"; $lang['red_help'] = "Piros"; $lang['orange_help'] = "Narancssárga"; - $lang['brown_help'] = "Barna"; $lang['yellow_help'] = "Sárga"; $lang['green_help'] = "Zöld"; - $lang['olive_help'] = "Olajzöld"; - $lang['cyan_help'] = "Ciánkék"; $lang['blue_help'] = "Kék"; - $lang['darkblue_help'] = "Sötétkék"; - $lang['indigo_help'] = "Indigó"; - $lang['violet_help'] = "Ibolya"; + $lang['purple_help'] = "Ibolya"; $lang['white_help'] = "Fehér"; + $lang['grey_help'] = "Grey"; $lang['black_help'] = "Fekete"; - - $lang['help'] = "Automatikus használat: A kód a kijelölt szövegre alkalmazható."; - - $lang['repicon'] = "Ikon könyvtár."; ?> Index: extensions/bbcode_bar/language/it_IT/plugin.lang.php =================================================================== --- extensions/bbcode_bar/language/it_IT/plugin.lang.php (revision 9787) +++ extensions/bbcode_bar/language/it_IT/plugin.lang.php (revision 9965) @@ -11,4 +11,5 @@ $lang['ul_help'] = "Elenco : [ul][li]elemento[/li][/ul]"; $lang['ol_help'] = "Elenco Numerica : [ol][li]elemento[/li][/ol]"; + $lang['li_help'] = "List element : [li]element[/li]"; $lang['quote_help'] = "Citazione : [quote]citazione[/quote]"; @@ -24,24 +25,14 @@ $lang['huge'] = "Grandissimo"; - $lang['fc_help'] = "Colore del testo : [color=couleur]testo[/color]"; - $lang['default_help'] = "Default"; - $lang['maroon_help'] = "Rosso scuro"; + $lang['color_help'] = "Colore del testo : [color=couleur]testo[/color]"; $lang['red_help'] = "Rosso"; $lang['orange_help'] = "Arancione"; - $lang['brown_help'] = "Marrone"; $lang['yellow_help'] = "Giallo"; $lang['green_help'] = "Verde"; - $lang['olive_help'] = "Oliva"; - $lang['cyan_help'] = "Ciano"; $lang['blue_help'] = "Blu"; - $lang['darkblue_help'] = "Blu Scuro"; - $lang['indigo_help'] = "Indaco"; - $lang['violet_help'] = "Viola"; + $lang['purple_help'] = "Viola"; $lang['white_help'] = "Bianco"; + $lang['grey_help'] = "Grey"; $lang['black_help'] = "Nero"; - - $lang['help'] = "Trucco : Un formattaggio può essere applicato ad un testo selezionato."; - - $lang['repicon'] = "Directory delle icone"; ?> Index: extensions/bbcode_bar/language/lv_LV/plugin.lang.php =================================================================== --- extensions/bbcode_bar/language/lv_LV/plugin.lang.php (revision 9787) +++ extensions/bbcode_bar/language/lv_LV/plugin.lang.php (revision 9965) @@ -11,4 +11,5 @@ $lang['ul_help'] = "Nesakārtots saraksts : [ul][li]element[/li][/ul]"; $lang['ol_help'] = "Sakārtots Saraksts : [ol][li]element[/li][/ol]"; + $lang['li_help'] = "List element : [li]element[/li]"; $lang['quote_help'] = "Pēdiņas : [quote]quote[/quote]"; @@ -24,24 +25,14 @@ $lang['huge'] = "Milzīgs"; - $lang['fc_help'] = "Fonta krāsa : [color=color]text[/color]"; - $lang['default_help'] = "Pēc noklusējuma"; - $lang['maroon_help'] = "Kastaņbrūna"; + $lang['color_help'] = "Fonta krāsa : [color=color]text[/color]"; $lang['red_help'] = "Sarkana"; $lang['orange_help'] = "Oranža"; - $lang['brown_help'] = "Brūna"; $lang['yellow_help'] = "Dzeltena"; $lang['green_help'] = "Zaļa"; - $lang['olive_help'] = "Olīva"; - $lang['cyan_help'] = "Ciāna"; $lang['blue_help'] = "Zila"; - $lang['darkblue_help'] = "Tumši Zila"; - $lang['indigo_help'] = "Indigo"; - $lang['violet_help'] = "Violēta"; + $lang['purple_help'] = "Violēta"; $lang['white_help'] = "Balta"; + $lang['grey_help'] = "Grey"; $lang['black_help'] = "Melna"; - $lang['help'] = "Pavisam viegli: Formatējumu iespējams pielietot tieši izvēlētajam tekstam."; - - $lang['repicon'] = "Ikonu mape."; - ?> Index: extensions/bbcode_bar/language/no_NO/plugin.lang.php =================================================================== --- extensions/bbcode_bar/language/no_NO/plugin.lang.php (revision 9787) +++ extensions/bbcode_bar/language/no_NO/plugin.lang.php (revision 9965) @@ -11,4 +11,5 @@ $lang['ul_help'] = "Uordnet Liste : [ul][li]element[/li][/ul]"; $lang['ol_help'] = "Ordnet Liste : [ol][li]element[/li][/ol]"; + $lang['li_help'] = "List element : [li]element[/li]"; $lang['quote_help'] = "Spørring : [quote]spørring[/quote]"; @@ -24,24 +25,14 @@ $lang['huge'] = "Mega"; - $lang['fc_help'] = "Font farge : [color=color]tekst[/color]"; - $lang['default_help'] = "Standard"; - $lang['maroon_help'] = "Maroon"; + $lang['color_help'] = "Font farge : [color=color]tekst[/color]"; $lang['red_help'] = "Rød"; $lang['orange_help'] = "Orange"; - $lang['brown_help'] = "Brun"; $lang['yellow_help'] = "Gul"; $lang['green_help'] = "Grønn"; - $lang['olive_help'] = "Oliven"; - $lang['cyan_help'] = "Cyan"; $lang['blue_help'] = "Blå"; - $lang['darkblue_help'] = "Mørk Blå"; - $lang['indigo_help'] = "Indigo"; - $lang['violet_help'] = "Fiolett"; + $lang['purple_help'] = "Fiolett"; $lang['white_help'] = "Vit"; + $lang['grey_help'] = "Grey"; $lang['black_help'] = "Svart"; - $lang['help'] = "Enkel måte: En formatering kan gjøres på den valgte teksten."; - - $lang['repicon'] = "Ikon mappe."; - ?> Index: extensions/bbcode_bar/language/ru_RU/plugin.lang.php =================================================================== --- extensions/bbcode_bar/language/ru_RU/plugin.lang.php (revision 9787) +++ extensions/bbcode_bar/language/ru_RU/plugin.lang.php (revision 9965) @@ -11,4 +11,5 @@ $lang['ul_help'] = "Список ненумерованный: [ul][li]элемент[/li][/ul]"; $lang['ol_help'] = "Список нумерованный: [ol][li]элемент[/li][/ol]"; + $lang['li_help'] = "List element : [li]element[/li]"; $lang['quote_help'] = "Цитата: [quote]цитата[/quote]"; @@ -24,24 +25,14 @@ $lang['huge'] = "Громадный"; - $lang['fc_help'] = "Цвет шрифта : [color=color]текст[/color]"; - $lang['default_help'] = "По умолчанию"; - $lang['maroon_help'] = "Бордовый"; + $lang['color_help'] = "Цвет шрифта : [color=color]текст[/color]"; $lang['red_help'] = "Красный"; $lang['orange_help'] = "Оранжевый"; - $lang['brown_help'] = "Коричневый"; $lang['yellow_help'] = "Желтый"; $lang['green_help'] = "Зеленый"; - $lang['olive_help'] = "Оливковый"; - $lang['cyan_help'] = "Небесно голубой"; $lang['blue_help'] = "Голубой"; - $lang['darkblue_help'] = "Синий"; - $lang['indigo_help'] = "Индиго"; - $lang['violet_help'] = "Фиолетовый"; + $lang['purple_help'] = "Фиолетовый"; $lang['white_help'] = "Белый"; + $lang['grey_help'] = "Grey"; $lang['black_help'] = "Черный"; - - $lang['help'] = "Легко: Форматирование может быть применено к выбранному тексту."; - - $lang['repicon'] = "Директория с иконками"; ?> Index: extensions/bbcode_bar/language/sk_SK/plugin.lang.php =================================================================== --- extensions/bbcode_bar/language/sk_SK/plugin.lang.php (revision 9787) +++ extensions/bbcode_bar/language/sk_SK/plugin.lang.php (revision 9965) @@ -11,4 +11,5 @@ $lang['ul_help'] = "Nezoradený zoznam : [ul][li]element[/li][/ul]"; $lang['ol_help'] = "Zoradený zoznam : [ol][li]element[/li][/ol]"; + $lang['li_help'] = "List element : [li]element[/li]"; $lang['quote_help'] = "Citácia : [quote]Citácia[/quote]"; @@ -24,24 +25,14 @@ $lang['huge'] = "Najväčšie"; - $lang['fc_help'] = "Farba písma : [color=couleur]text[/color]"; - $lang['default_help'] = "Predvolená"; - $lang['maroon_help'] = "Gaštanovo hnedá"; + $lang['color_help'] = "Farba písma : [color=couleur]text[/color]"; $lang['red_help'] = "Červená"; $lang['orange_help'] = "Oranžová"; - $lang['brown_help'] = "Hnedá"; $lang['yellow_help'] = "Žltá"; $lang['green_help'] = "Zelená"; - $lang['olive_help'] = "Olivová"; - $lang['cyan_help'] = "Zelenomodrá"; $lang['blue_help'] = "Modrá"; - $lang['darkblue_help'] = "Dark Blue"; - $lang['indigo_help'] = "InTmavomodrá"; - $lang['violet_help'] = "Fialová"; + $lang['purple_help'] = "Fialová"; $lang['white_help'] = "Biela"; + $lang['grey_help'] = "Grey"; $lang['black_help'] = "Čierna"; - - $lang['help'] = "Ľahko: Formátovanie môže byť použité na označený text."; - - $lang['repicon'] = "Adresár ikon."; - + ?> Index: extensions/bbcode_bar/main.inc.php =================================================================== --- extensions/bbcode_bar/main.inc.php (revision 9787) +++ extensions/bbcode_bar/main.inc.php (revision 9965) @@ -12,4 +12,5 @@ define('BBcode_DIR' , basename(dirname(__FILE__))); define('BBcode_PATH' , PHPWG_PLUGINS_PATH . BBcode_DIR . '/'); +define('BBcode_codes', serialize(array('b','i','u','s','p','center','right','quote','ul','ol','img','url','email','size','color'))); include_once(BBcode_PATH.'bbcode_bar.inc.php'); @@ -25,5 +26,6 @@ function add_bbcode_bar() { global $page; - if ($page['body_id'] == 'theCommentsPage' OR $page['body_id'] == 'thePicturePage') { + + if (isset($page['body_id']) AND $page['body_id'] == 'thePicturePage') { set_bbcode_bar(); } @@ -43,3 +45,4 @@ } + ?> Index: extensions/bbcode_bar/maintain.inc.php =================================================================== --- extensions/bbcode_bar/maintain.inc.php (revision 9787) +++ extensions/bbcode_bar/maintain.inc.php (revision 9965) @@ -1,14 +1,64 @@ true, + 'i' => true, + 'u' => true, + 's' => true, + 'p' => true, + 'center' => true, + 'right' => true, + 'quote' => true, + 'ul' => true, + 'ol' => true, + 'img' => true, + 'url' => true, + 'email' => true, + 'size' => true, + 'color' => true, + ); if (!isset($conf['bbcode_bar'])) { - $q = 'INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment) - VALUES ("bbcode_bar","1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,plugins/bbcode_bar/icon","Parametres BBCode_bar");'; + $q = "INSERT INTO " . CONFIG_TABLE . " (param,value,comment) + VALUES ('bbcode_bar','" . serialize($BBcode_default) . "','Parametres BBCode Bar');"; + pwg_query($q); + } +} + +function plugin_activate() +{ + global $conf; + + if (strpos($conf['bbcode_bar'],',') !== false) + { + $conf_bbcode_bar = explode(',', $conf['bbcode_bar']); + + $new_bbcode_bar = array( + 'b' => $conf_bbcode_bar[1] == '1' ? true : false, + 'i' => $conf_bbcode_bar[2] == '1' ? true : false, + 'u' => $conf_bbcode_bar[3] == '1' ? true : false, + 's' => $conf_bbcode_bar[4] == '1' ? true : false, + 'p' => $conf_bbcode_bar[0] == '1' ? true : false, + 'center' => $conf_bbcode_bar[5] == '1' ? true : false, + 'right' => $conf_bbcode_bar[6] == '1' ? true : false, + 'quote' => $conf_bbcode_bar[9] == '1' ? true : false, + 'ul' => $conf_bbcode_bar[7] == '1' ? true : false, + 'ol' => $conf_bbcode_bar[8] == '1' ? true : false, + 'img' => $conf_bbcode_bar[10] == '1' ? true : false, + 'url' => $conf_bbcode_bar[11] == '1' ? true : false, + 'email' => $conf_bbcode_bar[12] == '1' ? true : false, + 'size' => $conf_bbcode_bar[13] == '1' ? true : false, + 'color' => $conf_bbcode_bar[14] == '1' ? true : false, + ); + + $q = "UPDATE " . CONFIG_TABLE . " + SET value='" . serialize($new_bbcode_bar) . "' + WHERE param='bbcode_bar';"; pwg_query($q); } @@ -21,5 +71,5 @@ if (isset($conf['bbcode_bar'])) { - pwg_query('DELETE FROM ' . CONFIG_TABLE . ' WHERE param="bbcode_bar" LIMIT 1;'); + pwg_query('DELETE FROM ' . CONFIG_TABLE . ' WHERE param="bbcode_bar";'); } } Index: extensions/bbcode_bar/template/bbcode.js =================================================================== --- extensions/bbcode_bar/template/bbcode.js (revision 9787) +++ (revision ) @@ -1,117 +1,0 @@ -var bbcode = new Array(); -var theSelection = false; - -function BBCfs(form, field, box) { - BBCwrite(form, field, "[size="+ box.value +"]", "[/size]", true); - box.selectedIndex = 2; -} -function BBCfc(form, field, box) { - BBCfont(form, field, "color", box); - box.selectedIndex = 0; -} - -function BBCfont(form, field, code, box) { - BBCwrite(form, field, "["+code+"="+box.value+"]", "[/"+code+"]", true); -} - -function BBCwmi(form, field, type) { - if (type == 'img') { var URL = prompt("Please enter image URL","http://"); } - else { var URL = prompt("Enter the Email Address",""); } - if (URL == null) { return; } - if (!URL) { return alert("Error : You didn't write the Address"); } - BBCwrite(form, field, '', "["+type+"]"+URL+"[/"+type+"]", true); -} - -function BBCcode(form, field, img) { - var code = img.name; - if (BBCwrite(form, field, "["+code+"]", "[/"+code+"]")) { return; } - if (bbcode[form+field+code] == null) { - ToAdd = "["+code+"]"; - re = new RegExp(code+".(\\w+)$"); - img.src = img.src.replace(re, code+"1.$1"); - bbcode[form+field+code] = 1; - } else { - ToAdd = "[/"+code+"]"; - re = new RegExp(code+"1.(\\w+)$"); - img.src = img.src.replace(re, code+".$1"); - bbcode[form+field+code] = null; - } - BBCwrite(form, field, '', ToAdd, true); -} - -function BBClist(form, field, img) { - var code = img.name; - if (BBCwrite(form, field, "["+code+"]\n[li]", "\n[/"+code+"]")) { return; } - if (bbcode[form+field+code] == null) { - ToAdd = "["+code+"]\n[li]"; - re = new RegExp(code+".(\\w+)$"); - img.src = img.src.replace(re, code+"1.$1"); - bbcode[form+field+code] = 1; - } else { - ToAdd = "[/li]\n[/"+code+"]\n"; - re = new RegExp(code+"1.(\\w+)$"); - img.src = img.src.replace(re, code+".$1"); - bbcode[form+field+code] = null; - } - BBCwrite(form, field, '', ToAdd, true); -} - -function BBCurl(form, field) { - var URL = prompt("Enter the URL", "http://"); - if (URL == null) { return; } - if (!URL) { return alert("Error: You didn't write the URL "); } - if (BBCwrite(form, field, "[url="+URL+"]", "[/url]")) { return; } - var TITLE = prompt("Enter the page name", "Web Page Name"); - if (TITLE == null) { return; } - var Add = "]"+URL; - if (TITLE) { Add = "="+URL+"]"+TITLE; } - BBCwrite(form, field, '', "[url"+Add+"[/url]", true); -} - -function BBCwrite(form, field, start, end, force) { - var textarea = document.forms[form].elements[field]; - - storeCaret(textarea); - - if (textarea.caretPos) { - textarea.focus(); - // Attempt to create a text range (IE). - theSelection = document.selection.createRange().text; - if (force || theSelection != '') { - document.selection.createRange().text = start + theSelection + end; - textarea.focus(); - return true; - } - } else if (typeof(textarea.selectionStart) != "undefined") { - // Mozilla text range replace. - var text = new Array(); - text[0] = textarea.value.substr(0, textarea.selectionStart); - text[1] = textarea.value.substr(textarea.selectionStart, textarea.selectionEnd-textarea.selectionStart); - text[2] = textarea.value.substr(textarea.selectionEnd); - caretPos = textarea.selectionEnd+start.length+end.length; - if (force || text[1] != '') { - textarea.value = text[0]+start+text[1]+end+text[2]; - if (textarea.setSelectionRange) { - textarea.focus(); - textarea.setSelectionRange(caretPos, caretPos); - } - return true; - } - } else if (force) { - // Just put it on the end. - textarea.value += start+end; - textarea.focus(textarea.value.length-1); - return true; - } - return false; -} - -function storeCaret(text) { - if (text.createTextRange) text.caretPos = document.selection.createRange().duplicate(); -} - -function helpline ( form, field, text ) { - if ( typeof(document.forms[form].elements[field]) != "undefined") { - document.forms[form].elements[field].value = text; - } -} Index: extensions/bbcode_bar/template/bbcode_bar.css =================================================================== --- extensions/bbcode_bar/template/bbcode_bar.css (revision 9787) +++ (revision ) @@ -1,29 +1,0 @@ -.outils { - margin-left: 0pt; - margin-right: auto; - margin-top:-0.25em; -} - -.bbcbutton { - background: buttonface; - border: 1px solid buttonface; - margin: 1; -} - -.over { - background: buttonface; - border-top: 1px solid; - border-left: 1px solid; - border-bottom: 1px solid; - border-right: 1px solid; - margin: 1; -} - -.genmed { - color:#000000; - background-color:#fff; -} - -.helpline{ - border:0pt solid; -} Index: extensions/bbcode_bar/template/bbcode_bar.tpl =================================================================== --- extensions/bbcode_bar/template/bbcode_bar.tpl (revision 9787) +++ extensions/bbcode_bar/template/bbcode_bar.tpl (revision 9965) @@ -1,101 +1,69 @@ -{combine_script id="bbcodebar" path=$BBCODE_PATH|@cat:"template/bbcode.js"} -{combine_css path=$BBCODE_PATH|@cat:"template/bbcode_bar.css"} +{combine_script id="markitup" require='jquery' path=$BBCODE_PATH|@cat:"template/markitup/jquery.markitup.js"} +{combine_css path=$BBCODE_PATH|@cat:"template/markitup/style.markitup.css"} -
\\2
- {/if} - {if isset($BBCode_bar_button_01)} - | - {/if} - {if isset($BBCode_bar_button_02)} - | - {/if} - {if isset($BBCode_bar_button_03)} - | - {/if} - {if isset($BBCode_bar_button_04)} - | - {/if} - - {if isset($BBCode_bar_button_05) OR isset($BBCode_bar_button_06) OR isset($BBCode_bar_button_07) OR isset($BBCode_bar_button_08)} - | - {/if} - - {if isset($BBCode_bar_button_05)} - | - {/if} - {if isset($BBCode_bar_button_06)} - | - {/if} - {if isset($BBCode_bar_button_07)} - | - {/if} - {if isset($BBCode_bar_button_08)} - | - {/if} - - {if isset($BBCode_bar_SmiliesSupport)} - | - | {$BBCode_bar_SmiliesSupport.SMILIESSUPPORT_PAGE} | - {/if} - - {if isset($BBCode_bar_button_09) OR isset($BBCode_bar_button_10) OR isset($BBCode_bar_button_11) OR isset($BBCode_bar_button_12)} -- {/if} - - {if isset($BBCode_bar_button_09)} - | - {/if} - {if isset($BBCode_bar_button_10)} - | - {/if} - {if isset($BBCode_bar_button_11)} - | - {/if} - {if isset($BBCode_bar_button_12)} - | - {/if} - - {if isset($BBCode_bar_button_13) OR isset($BBCode_bar_button_14)} - | - {/if} - - {if isset($BBCode_bar_button_13)} - | - | - {/if} - {if isset($BBCode_bar_button_14)} -- | - {/if} -