Changeset 26076


Ignore:
Timestamp:
Dec 21, 2013, 11:02:24 PM (10 years ago)
Author:
mistic100
Message:

update for Piwigo 2.6 + many code and logical cleaning

Location:
extensions/bbcode_bar
Files:
3 added
5 edited
1 moved

Legend:

Unmodified
Added
Removed
  • extensions/bbcode_bar/admin.php

    r10983 r26076  
    11<?php
    2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
     2defined('BBCODE_ID') or die('Hacking attempt!');
    33
    44global $conf, $template;
    5 load_language('plugin.lang', BBcode_PATH);
    65
    7 // Met à jour la configuration si necessaire
    8 if (strpos($conf['bbcode_bar'],',') !== false)
     6if (isset($_POST['submit']))
    97{
    10   include(BBcode_PATH .'maintain.inc.php');
    11   plugin_activate();
     8  $conf['bbcode_bar'] = array();
     9  foreach ($conf['bbcode_bar_codes'] as $key)
     10  {
     11    $conf['bbcode_bar'][$key] = isset($_POST[$key]);
     12  }
     13 
     14  conf_update_param('bbcode_bar', serialize($conf['bbcode_bar']));
     15  $page['infos'][] = l10n('Information data registered in database');
    1216}
    1317
    14 $conf_bbcode_bar = unserialize($conf['bbcode_bar']);
    15 
    16 // Enregistrement de la configuration
    17 if (isset($_POST['submit']))
    18 
    19   // nouveau tableau de config
    20   unset($conf_bbcode_bar);
    21   foreach(unserialize(BBcode_codes) as $key) {
    22     $conf_bbcode_bar[$key] = (isset($_POST[$key])) ? true : false;
    23   }
    24  
    25   // enregistrement
    26   conf_update_param('bbcode_bar', serialize($conf_bbcode_bar));
    27   array_push($page['infos'], l10n('Information data registered in database'));
     18foreach ($conf['bbcode_bar_codes'] as $key)
     19{
     20  $template->assign(strtoupper($key).'_STATUS', $conf['bbcode_bar'][$key] ? 'checked="checked"' : '');
    2821}
    2922
    30 // Parametrage du template
    31 foreach(unserialize(BBcode_codes) as $key) {
    32   $template->assign(strtoupper($key).'_STATUS', ($conf_bbcode_bar[$key] == 1) ? 'checked="checked"' : null);
    33 }
    34 
    35 $template->assign('BBCODE_PATH', BBcode_PATH);
    36 $template->set_filename('bbcode_bar_conf', dirname(__FILE__) . '/template/bbcode_bar_admin.tpl');
     23$template->assign('BBCODE_PATH', BBCODE_PATH);
     24$template->set_filename('bbcode_bar_conf', realpath(BBCODE_PATH . 'template/bbcode_bar_admin.tpl'));
    3725$template->assign_var_from_handle('ADMIN_CONTENT', 'bbcode_bar_conf');
    38 
    39 ?>
  • extensions/bbcode_bar/include/events.inc.php

    r24342 r26076  
    11<?php
    2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    3 
    4 // add BBCodeBar to textarea
    5 function set_bbcode_bar($prefilter='picture', $textarea_id='contentid')
     2defined('BBCODE_ID') or die('Hacking attempt!');
     3
     4function bbcode_bar_admin_menu($menu)
    65{
    7   global $template, $conf, $pwg_loaded_plugins, $page;
    8  
    9   load_language('plugin.lang', dirname(__FILE__) . '/');
    10   $conf_bbcode_bar = unserialize($conf['bbcode_bar']);
    11  
    12  
    13   // buttons
    14   $tpl_codes = array();
    15   foreach (unserialize(BBcode_codes) as $key)
    16   {
    17     $tpl_codes[$key] = (bool)$conf_bbcode_bar[$key];
    18   }
    19   $tpl_codes['smilies'] = isset($pwg_loaded_plugins['SmiliesSupport']);
    20  
     6  $menu[] = array(
     7    'NAME' => 'BBCode Bar',
     8    'URL' => BBCODE_ADMIN,
     9    );
     10  return $menu;
     11}
     12
     13function add_bbcode_bar()
     14{
     15  global $page, $pwg_loaded_plugins, $template, $conf;
     16 
     17  if (script_basename() == 'picture')
     18  {
     19    $prefilter = 'picture';
     20    $textarea_id = 'contentid';
     21  }
     22  else if (isset($page['section']))
     23  {
     24    if (
     25      script_basename() == 'index' and isset($pwg_loaded_plugins['Comments_on_Albums'])
     26      and $page['section'] == 'categories' and isset($page['category'])
     27      )
     28    {
     29      $prefilter = 'comments_on_albums';
     30      $textarea_id = 'contentid';
     31    }
     32    else if ($page['section'] == 'guestbook')
     33    {
     34      $prefilter = 'guestbook';
     35      $textarea_id = 'contentid';
     36    }
     37    else if ($page['section'] == 'contact')
     38    {
     39      $prefilter = 'contactform';
     40      $textarea_id = 'cf_content';
     41    }
     42  }
     43 
     44  if (!isset($prefilter))
     45  {
     46    return;
     47  }
     48 
     49  $conf['bbcode_bar']['smilies'] = isset($pwg_loaded_plugins['SmiliesSupport']);
    2150 
    2251  // calculate separators between groups
     
    3766    foreach ($groups[$i] as $code)
    3867    {
    39       if ($tpl_codes[$code]) $count++;
     68      if ($conf['bbcode_bar'][$code]) $count++;
    4069    }
    4170    if ($count>0)
     
    4372      foreach ($groups[$i+1] as $code)
    4473      {
    45         if ($tpl_codes[$code]) $separator = true;
     74        if ($conf['bbcode_bar'][$code]) $separator = true;
    4675      }
    4776    }
     
    5483 
    5584  $template->assign(array(
    56     'BBC' => $tpl_codes,
    57     'SEP' => $tpl_groups,
    58     'BBCODE_PATH' => BBcode_PATH,
    59     'BBCODE_ID' => $textarea_id,
     85    'BBCODE_PATH' => BBCODE_PATH,
     86    'BBCODE' => array(
     87      'codes' => $conf['bbcode_bar'],
     88      'separators' => $tpl_groups,
     89      'textarea_id' => $textarea_id,
     90      ),
    6091    ));
    61  
    62   $template->set_prefilter($prefilter, 'set_bbcode_bar_prefilter');   
    63 
    64   // smilies support > 2.3 ## must be parsed after bbcode_bar, because the javascript must be after bbc's one
    65   if (isset($pwg_loaded_plugins['SmiliesSupport']))
    66   {
    67     set_smiliessupport($prefilter, $textarea_id);
    68   } 
    69 }
    70 
    71 function set_bbcode_bar_prefilter($content, &$smarty)
    72 {
    73   $search = '#(<div id="guestbookAdd">|<div id="commentAdd">|<div class="contact">)#';
    74   $replace = file_get_contents(BBcode_PATH.'/template/bbcode_bar.tpl').'$1';
    75   return preg_replace($search, $replace, $content);
    76 }
    77 
    78 
    79 // check tags and eventually close malformed tags, return BBCoded String
    80 function CheckTags($str)
    81 {
    82   //storage stack
    83   $tags = array();
    84 
    85   for ($pos = 0; $pos<strlen($str); $pos++)
    86   {
    87     if ($str{$pos} == '[')
    88     {
    89       $end_pos = strpos($str, ']', $pos);
    90       $tag = substr($str, ++$pos, $end_pos-$pos);
    91       //deals with tags which contains arguments (ie quote)
    92       if ( ($equal_pos = strpos($tag, '=', 0)) !== FALSE)
    93       $tag = substr($tag, 0, $equal_pos);
    94       //check whether we have a defined tag or not.
    95       if (in_array(strtolower($tag),unserialize(BBcode_codes)) || in_array(strtolower(substr($tag,1)),unserialize(BBcode_codes)))
    96       {
    97         //closing tag
    98         if ($tag{0} == '/')
    99         {
    100           //cleaned tag
    101           $tag = substr($tag, 1);   
    102           $before_tag = substr($str, 0, $pos-1);
    103           $after_tag = substr($str, $end_pos+1); 
    104           //pop stack
    105           while (($temp = array_pop($tags)))
    106           {
    107             if ($temp != $tag) {
    108               $before_tag.='[/'.$temp.']';
    109             } else {
    110               $before_tag.='[/'.$tag.']';
    111               break;
    112             }
    113           }
    114           $end_pos += strlen($before_tag)+strlen($after_tag)-strlen($str);
    115           $str = $before_tag.$after_tag;
    116         } else { // push stack
    117           array_push($tags,$tag);
    118         }
    119       }
    120       $pos = $end_pos; 
    121     }
    122   }
    123   // empty stack and closing tags
    124   while ($temp = array_pop($tags))
    125   {   
    126     $str.='[/'.$temp.']';
    127   }
    128   return $str;
     92
     93  $template->set_filename('bbcodebar', realpath(BBCODE_PATH.'/template/bbcode_bar.tpl'));
     94  $template->parse('bbcodebar');
    12995}
    13096
     
    134100  global $conf;
    135101
    136   $conf_bbcode_bar = unserialize($conf['bbcode_bar']);
    137   $str = CheckTags(nl2br($str));
     102  $str = bbcode_checktags(nl2br($str));
    138103
    139104  $patterns = array();
    140105  $replacements = array();
    141106
    142   if ($conf_bbcode_bar['p'])
     107  if ($conf['bbcode_bar']['p'])
    143108  {
    144109    //Paragraph
     
    146111    $replacements[] = '<p>\\1</p>';
    147112  }
    148   if ($conf_bbcode_bar['b'])
     113  if ($conf['bbcode_bar']['b'])
    149114  {
    150115    // Bold
     
    152117    $replacements[] = '<b>\\1</b>';
    153118  }
    154   if ($conf_bbcode_bar['i'])
     119  if ($conf['bbcode_bar']['i'])
    155120  {
    156121    //Italic
     
    158123    $replacements[] = '<i>\\1</i>';
    159124  }
    160   if ($conf_bbcode_bar['u'])
     125  if ($conf['bbcode_bar']['u'])
    161126  {
    162127    //Underline 
     
    164129    $replacements[] = '<u>\\1</u>';
    165130  }
    166   if ($conf_bbcode_bar['s'])
     131  if ($conf['bbcode_bar']['s'])
    167132  {
    168133    //Strikethrough
     
    170135    $replacements[] = '<s>\\1</s>';
    171136  }
    172   if ($conf_bbcode_bar['center'])
     137  if ($conf['bbcode_bar']['center'])
    173138  {
    174139    //Center
    175140    $patterns[] = '#\[center\](.*?)\[/center\]#is';
    176     $replacements[] = '<div align="center"><p>\\1</p></div>';
    177   }
    178   if ($conf_bbcode_bar['right'])
     141    $replacements[] = '<div align="center">\\1</div>';
     142  }
     143  if ($conf['bbcode_bar']['right'])
    179144  {
    180145    //Right
    181146    $patterns[] = '#\[right\](.*?)\[/right\]#is';
    182     $replacements[] = '<div align="right"><p>\\1</p></div>';
    183   }
    184   if ($conf_bbcode_bar['ol'])
     147    $replacements[] = '<div align="right">\\1</div>';
     148  }
     149  if ($conf['bbcode_bar']['ol'])
    185150  {
    186151    //Olist
     
    188153    $replacements[] = '<ol>\\1</ol>';
    189154  }
    190   if ($conf_bbcode_bar['ul'])
     155  if ($conf['bbcode_bar']['ul'])
    191156  {
    192157    //Ulist
     
    194159    $replacements[] = '<ul>\\1</ul>';
    195160  }
    196   if ($conf_bbcode_bar['ol'] || $conf_bbcode_bar['ul'])
     161  if ($conf['bbcode_bar']['ol'] || $conf['bbcode_bar']['ul'])
    197162  {
    198163    //List
     
    200165    $replacements[] = '<li>\\1</li>';
    201166  }
    202   if ($conf_bbcode_bar['quote'])
     167  if ($conf['bbcode_bar']['quote'])
    203168  {
    204169    // Quotes
     
    214179    $replacements[] = '<blockquote><span style="font-size:11px;line-height:normal"><b>\\1 : </b><br/>\\2</span></blockquote>';
    215180  }
    216   if ($conf_bbcode_bar['img'])
     181  if ($conf['bbcode_bar']['img'])
    217182  {
    218183    //Images
     
    220185    $replacements[] = '<img src="\\1" />';
    221186  }
    222   if ($conf_bbcode_bar['url'])
     187  if ($conf['bbcode_bar']['url'])
    223188  {
    224189    //[url]xxxx://www.zzzz.yyy[/url]
     
    246211    $replacements[] = '<a href="\\1" target="_blank">\\2</a>';
    247212  }
    248   if ($conf_bbcode_bar['email'])
     213  if ($conf['bbcode_bar']['email'])
    249214  {
    250215    //[email]samvure@gmail.com[/email]
     
    252217    $replacements[] = '<a href="mailto:\\1">\\1</a>';
    253218  }
    254   if ($conf_bbcode_bar['size'])
     219  if ($conf['bbcode_bar']['size'])
    255220  {
    256221    //Size
     
    258223    $replacements[] = '<span style="font-size: \\1px; line-height: normal">\\2</span>';
    259224  }
    260   if ($conf_bbcode_bar['color'])
     225  if ($conf['bbcode_bar']['color'])
    261226  {
    262227    //Colours
     
    267232  return preg_replace($patterns, $replacements, $str);
    268233}
    269 
    270 ?>
  • extensions/bbcode_bar/main.inc.php

    r23278 r26076  
    88*/
    99
    10 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
     10defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
    1111
    12 define('BBcode_DIR' , basename(dirname(__FILE__)));
    13 define('BBcode_PATH' , PHPWG_PLUGINS_PATH . BBcode_DIR . '/');
    14 define('BBcode_codes', serialize(array('b','i','u','s','p','center','right','quote','ul','ol','img','url','email','size','color')));
     12define('BBCODE_ID' ,    basename(dirname(__FILE__)));
     13define('BBCODE_PATH' ,    PHPWG_PLUGINS_PATH . BBCODE_ID . '/');
     14define('BBCODE_ADMIN',    get_root_url() . 'admin.php?page=plugin-' . BBCODE_ID);
     15define('BBCODE_VERSION',  'auto');
    1516
    16 include_once(BBcode_PATH.'bbcode_bar.inc.php');
     17
     18include_once(BBCODE_PATH.'include/functions.inc.php');
     19include_once(BBCODE_PATH.'include/events.inc.php');
     20
     21
    1722add_event_handler('init', 'init_bbcode_bar');
     23
     24if (defined('IN_ADMIN'))
     25{
     26  add_event_handler('get_admin_plugin_menu_links', 'bbcode_bar_admin_menu');
     27}
     28else
     29{
     30  add_event_handler('loc_after_page_header', 'add_bbcode_bar', EVENT_HANDLER_PRIORITY_NEUTRAL+1);
     31}
     32
     33add_event_handler('render_comment_content', 'BBCodeParse');
     34add_event_handler('render_contact_content', 'BBCodeParse');
     35
    1836
    1937function init_bbcode_bar()
    2038{
     39  global $conf;
     40 
     41  include_once(BBCODE_PATH . 'maintain.inc.php');
     42  $maintain = new bbcode_bar_maintain(BBCODE_ID);
     43  $maintain->autoUpdate(BBCODE_VERSION, 'install');
     44 
     45  $conf['bbcode_bar'] = unserialize($conf['bbcode_bar']);
     46  $conf['bbcode_bar_codes'] = array('b','i','u','s','p','center','right','quote','ul','ol','img','url','email','size','color');
     47 
     48  load_language('plugin.lang', BBCODE_PATH);
     49 
    2150  remove_event_handler('render_comment_content', 'render_comment_content');
    22   add_event_handler('render_comment_content', 'BBCodeParse');
    23   add_event_handler('render_contact_content', 'BBCodeParse');
    24   add_event_handler('loc_after_page_header', 'add_bbcode_bar');
    2551}
    26 
    27 function add_bbcode_bar()
    28 {
    29   global $page, $pwg_loaded_plugins;
    30  
    31   if (isset($page['body_id']) AND $page['body_id'] == 'thePicturePage')
    32   {
    33     $prefilter = 'picture';
    34     $textarea_id = 'contentid';
    35   }
    36   else if (
    37     script_basename() == 'index' and isset($pwg_loaded_plugins['Comments_on_Albums'])
    38     and isset($page['section']) and $page['section'] == 'categories' and isset($page['category'])
    39     )
    40   {
    41     $prefilter = 'comments_on_albums';
    42     $textarea_id = 'contentid';
    43   }
    44   else if (isset($page['section']) and $page['section'] == 'guestbook')
    45   {
    46     $prefilter = 'index';
    47     $textarea_id = 'contentid';
    48   }
    49   else if (isset($page['section']) and $page['section'] == 'contact')
    50   {
    51     $prefilter = 'index';
    52     $textarea_id = 'cf_content';
    53   }
    54  
    55   if (isset($prefilter))
    56   {
    57     set_bbcode_bar($prefilter, $textarea_id);
    58   }
    59 }
    60 
    61 if (script_basename() == 'admin')
    62 {
    63   add_event_handler('get_admin_plugin_menu_links', 'bbcode_bar_admin_menu');
    64   function bbcode_bar_admin_menu($menu)
    65   {
    66     array_push($menu, array(
    67       'NAME' => 'BBCode Bar',
    68       'URL' => get_root_url().'admin.php?page=plugin-' . BBcode_DIR
    69     ));
    70     return $menu;
    71   }
    72 }
    73 
    74 ?>
  • extensions/bbcode_bar/maintain.inc.php

    r14525 r26076  
    11<?php
    2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
     2defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
    33
    4 function plugin_install()
    5 { 
    6   global $conf;
     4class bbcode_bar_maintain extends PluginMaintain
     5{
     6  private $installed = false;
    77 
    8   $BBcode_default = array(
     8  private $default_conf = array(
    99    'b' => true,
    1010    'i' => true,
     
    2222    'size' => true,
    2323    'color' => true,
    24   );
     24    );
    2525
    26   if (!isset($conf['bbcode_bar']))
     26  function install($plugin_version, &$errors=array())
    2727  {
    28     conf_update_param('bbcode_bar',serialize($BBcode_default));
     28    global $conf;
     29   
     30    if (isset($conf['bbcode_bar']))
     31    {
     32      $conf['bbcode_bar'] = serialize($this->default_conf);
     33
     34      conf_update_param('bbcode_bar', $conf['bbcode_bar']);
     35    }
     36   
     37    $this->installed = true;
     38  }
     39
     40  function activate($plugin_version, &$errors=array())
     41  {
     42    if (!$this->installed)
     43    {
     44      $this->install($plugin_version, $errors);
     45    }
     46  }
     47
     48  function deactivate()
     49  {
     50  }
     51
     52  function uninstall()
     53  {
     54    conf_delete_param('bbcode_bar');
    2955  }
    3056}
    31 
    32 function plugin_activate()
    33 {
    34   global $conf;
    35  
    36   if (strpos($conf['bbcode_bar'],',') !== false)
    37   {
    38     $conf_bbcode_bar = explode(',', $conf['bbcode_bar']);
    39    
    40     $new_bbcode_bar =  array(
    41       'b' => $conf_bbcode_bar[1] == '1' ? true : false,
    42       'i' => $conf_bbcode_bar[2] == '1' ? true : false,
    43       'u' => $conf_bbcode_bar[3] == '1' ? true : false,
    44       's' => $conf_bbcode_bar[4] == '1' ? true : false,
    45       'p' => $conf_bbcode_bar[0] == '1' ? true : false,
    46       'center' => $conf_bbcode_bar[5] == '1' ? true : false,
    47       'right' => $conf_bbcode_bar[6] == '1' ? true : false,
    48       'quote' => $conf_bbcode_bar[9] == '1' ? true : false,
    49       'ul' => $conf_bbcode_bar[7] == '1' ? true : false,
    50       'ol' => $conf_bbcode_bar[8] == '1' ? true : false,
    51       'img' => $conf_bbcode_bar[10] == '1' ? true : false,
    52       'url' => $conf_bbcode_bar[11] == '1' ? true : false,
    53       'email' => $conf_bbcode_bar[12] == '1' ? true : false,
    54       'size' => $conf_bbcode_bar[13] == '1' ? true : false,
    55       'color' => $conf_bbcode_bar[14] == '1' ? true : false,
    56     );
    57    
    58     conf_update_param('bbcode_bar', serialize($new_bbcode_bar));
    59   }
    60 }
    61 
    62 function plugin_uninstall()
    63 {
    64   pwg_query('DELETE FROM ' . CONFIG_TABLE . ' WHERE param="bbcode_bar";');
    65 }
    66 
    67 ?>
  • extensions/bbcode_bar/template/bbcode_bar.tpl

    r23489 r26076  
    1 {combine_script id='markitup' require='jquery' load='footer' path=$BBCODE_PATH|@cat:'template/markitup/jquery.markitup.js'}
    2 {combine_css path=$BBCODE_PATH|@cat:'template/markitup/style.markitup.css'}
     1{combine_script id='markitup' require='jquery' load='footer' path=$BBCODE_PATH|cat:'template/markitup/jquery.markitup.js'}
     2{combine_css id='markitup' order=20 path=$BBCODE_PATH|cat:'template/markitup/style.markitup.css'}
    33
    44{footer_script require='markitup'}
     
    77    {counter start=0 print=false assign=bbc_counter}
    88   
    9     {if $BBC.b}{counter}{ldelim}name:'{'Bold : [b]bold[/b]'|@translate}', key:'B', openWith:'[b]', closeWith:'[/b]', className:'miuIcon miuBold'},{/if}
    10     {if $BBC.i}{counter}{ldelim}name:'{'Italic : [i]italic[/i]'|@translate}', key:'I', openWith:'[i]', closeWith:'[/i]', className:'miuIcon miuItalic'},{/if}
    11     {if $BBC.u}{counter}{ldelim}name:'{'Underline : [u]underline[/u]'|@translate}', key:'U', openWith:'[u]', closeWith:'[/u]', className:'miuIcon miuUnderline'},{/if}
    12     {if $BBC.s}{counter}{ldelim}name:'{'Striped  : [s]striped[/s]'|@translate}', key:'S', openWith:'[s]', closeWith:'[/s]', className:'miuIcon miuStroke'},{/if}
     9    {if $BBCODE.codes.b}{counter}{ldelim}name:'{'Bold : [b]bold[/b]'|translate}', key:'B', openWith:'[b]', closeWith:'[/b]', className:'miuIcon miuBold'},{/if}
     10    {if $BBCODE.codes.i}{counter}{ldelim}name:'{'Italic : [i]italic[/i]'|translate}', key:'I', openWith:'[i]', closeWith:'[/i]', className:'miuIcon miuItalic'},{/if}
     11    {if $BBCODE.codes.u}{counter}{ldelim}name:'{'Underline : [u]underline[/u]'|translate}', key:'U', openWith:'[u]', closeWith:'[/u]', className:'miuIcon miuUnderline'},{/if}
     12    {if $BBCODE.codes.s}{counter}{ldelim}name:'{'Striped  : [s]striped[/s]'|translate}', key:'S', openWith:'[s]', closeWith:'[/s]', className:'miuIcon miuStroke'},{/if}
    1313   
    14     {if $SEP[0]}{counter}{ldelim}separator:'|'},{/if}
     14    {if $BBCODE.separators[0]}{counter}{ldelim}separator:'|'},{/if}
    1515   
    16     {if $BBC.p}{counter}{ldelim}name:'{'Paragraph : [p]Paragraph[/p]'|@translate}', openWith:'[p]', closeWith:'[/p]', className:'miuIcon miuParagraph'},{/if}
    17     {if $BBC.center}{counter}{ldelim}name:'{'Center : [center]center[/center]'|@translate}', openWith:'[center]', closeWith:'[/center]', className:'miuIcon miuCenter'},{/if}
    18     {if $BBC.right}{counter}{ldelim}name:'{'Right : [right]right[/right]'|@translate}', openWith:'[right]', closeWith:'[/right]', className:'miuIcon miuRight'},{/if}
    19     {if $BBC.quote}{counter}{ldelim}name:'{'Quote : [quote]quote[/quote]'|@translate}', openWith:'[quote]', closeWith:'[/quote]', className:'miuIcon miuQuote'},{/if}
     16    {if $BBCODE.codes.p}{counter}{ldelim}name:'{'Paragraph : [p]Paragraph[/p]'|translate}', openWith:'[p]', closeWith:'[/p]', className:'miuIcon miuParagraph'},{/if}
     17    {if $BBCODE.codes.center}{counter}{ldelim}name:'{'Center : [center]center[/center]'|translate}', openWith:'[center]', closeWith:'[/center]', className:'miuIcon miuCenter'},{/if}
     18    {if $BBCODE.codes.right}{counter}{ldelim}name:'{'Right : [right]right[/right]'|translate}', openWith:'[right]', closeWith:'[/right]', className:'miuIcon miuRight'},{/if}
     19    {if $BBCODE.codes.quote}{counter}{ldelim}name:'{'Quote : [quote]quote[/quote]'|translate}', openWith:'[quote]', closeWith:'[/quote]', className:'miuIcon miuQuote'},{/if}
    2020   
    21     {if $SEP[1]}{counter}{ldelim}separator:'|'},{/if}
     21    {if $BBCODE.separators[1]}{counter}{ldelim}separator:'|'},{/if}
    2222   
    23     {if $BBC.ul}{counter}{ldelim}name:'{'Unordered list : [ul][li]element[/li][/ul]'|@translate}', openWith:'[ul]\n', closeWith:'\n[/ul]', className:'miuIcon miuListUL'},{/if}
    24     {if $BBC.ol}{counter}{ldelim}name:'{'Ordered list : [ol][li]element[/li][/ol]'|@translate}', openWith:'[ol]\n', closeWith:'\n[/ol]', className:'miuIcon miuListOL'},{/if}
    25     {if $BBC.ul OR $BBC.ol}{counter}{ldelim}name:'{'List element : [li]element[/li]'|@translate}', multiline:true, openWith:'[li]', closeWith:'[/li]', className:'miuIcon miuListLI'},{/if}
     23    {if $BBCODE.codes.ul}{counter}{ldelim}name:'{'Unordered list : [ul][li]element[/li][/ul]'|translate}', openWith:'[ul]\n', closeWith:'\n[/ul]', className:'miuIcon miuListUL'},{/if}
     24    {if $BBCODE.codes.ol}{counter}{ldelim}name:'{'Ordered list : [ol][li]element[/li][/ol]'|translate}', openWith:'[ol]\n', closeWith:'\n[/ol]', className:'miuIcon miuListOL'},{/if}
     25    {if $BBCODE.codes.ul OR $BBCODE.codes.ol}{counter}{ldelim}name:'{'List element : [li]element[/li]'|translate}', multiline:true, openWith:'[li]', closeWith:'[/li]', className:'miuIcon miuListLI'},{/if}
    2626   
    27     {if $SEP[2]}{counter}{ldelim}separator:'|' },{/if}
     27    {if $BBCODE.separators[2]}{counter}{ldelim}separator:'|' },{/if}
    2828   
    29     {if $BBC.img}{counter}{ldelim}name:'{'Picture : [img]picture[/img]'|@translate}', key:'P', replaceWith:'[img][![Source:!:http://]!][/img]', className:'miuIcon miuPicture'},{/if}
    30     {if $BBC.url}{counter}{ldelim}name:'{'URL : [url=URL]Title[/url]'|@translate}', key:'L', openWith:'[url=[![Url:!:http://]!]]', closeWith:'[/url]', className:'miuIcon miuLink'},{/if}
    31     {if $BBC.email}{counter}{ldelim}name:'{'E-mail : [email]Email[/email]'|@translate}', key:'M', replaceWith:'[email][![Mail]!][/email]', className:'miuIcon miuMail'},{/if}
     29    {if $BBCODE.codes.img}{counter}{ldelim}name:'{'Picture : [img]picture[/img]'|translate}', key:'P', replaceWith:'[img][![Source:!:http://]!][/img]', className:'miuIcon miuPicture'},{/if}
     30    {if $BBCODE.codes.url}{counter}{ldelim}name:'{'URL : [url=URL]Title[/url]'|translate}', key:'L', openWith:'[url=[![Url:!:http://]!]]', closeWith:'[/url]', className:'miuIcon miuLink'},{/if}
     31    {if $BBCODE.codes.email}{counter}{ldelim}name:'{'E-mail : [email]Email[/email]'|translate}', key:'M', replaceWith:'[email][![Mail]!][/email]', className:'miuIcon miuMail'},{/if}
    3232   
    33     {if $SEP[3]}{counter}{ldelim}separator:'|'},{/if}
     33    {if $BBCODE.separators[3]}{counter}{ldelim}separator:'|'},{/if}
    3434   
    35     {if $BBC.size}{counter}
    36     {ldelim}name:'{'Font size : [size=X]text[/size]'|@translate}', className:'miuIcon miuSize',
     35    {if $BBCODE.codes.size}{counter}
     36    {ldelim}name:'{'Font size : [size=X]text[/size]'|translate}', className:'miuIcon miuSize',
    3737      dropMenu :[
    38         {ldelim}name:'{'tiny font'|@translate}', openWith:'[size=7]', closeWith:'[/size]', className:'miuSizeTiny' },
    39         {ldelim}name:'{'small font'|@translate}', openWith:'[size=9]', closeWith:'[/size]', className:'miuSizeSmall' },
    40         {ldelim}name:'{'normal font'|@translate}', openWith:'[size=12]', closeWith:'[/size]', className:'miuSizeNormal' },
    41         {ldelim}name:'{'large font'|@translate}', openWith:'[size=18]', closeWith:'[/size]', className:'miuSizeLarge' },
    42         {ldelim}name:'{'huge font'|@translate}', openWith:'[size=24]', closeWith:'[/size]', className:'miuSizeHuge' },
     38        {ldelim}name:'{'tiny font'|translate}', openWith:'[size=7]', closeWith:'[/size]', className:'miuSizeTiny' },
     39        {ldelim}name:'{'small font'|translate}', openWith:'[size=9]', closeWith:'[/size]', className:'miuSizeSmall' },
     40        {ldelim}name:'{'normal font'|translate}', openWith:'[size=12]', closeWith:'[/size]', className:'miuSizeNormal' },
     41        {ldelim}name:'{'large font'|translate}', openWith:'[size=18]', closeWith:'[/size]', className:'miuSizeLarge' },
     42        {ldelim}name:'{'huge font'|translate}', openWith:'[size=24]', closeWith:'[/size]', className:'miuSizeHuge' },
    4343      ]
    4444    },
    4545    {/if}
    46     {if $BBC.color}{counter}
    47     {ldelim}name:'{'Font color : [color=color]text[/color]'|@translate}', className:'miuIcon miuColors', openWith:'[color=[![Color]!]]', closeWith:'[/color]',
     46    {if $BBCODE.codes.color}{counter}
     47    {ldelim}name:'{'Font color : [color=color]text[/color]'|translate}', className:'miuIcon miuColors', openWith:'[color=[![Color]!]]', closeWith:'[/color]',
    4848      dropMenu: [
    49         {ldelim}name:'{'Yellow'|@translate}', openWith:'[color=yellow]', closeWith:'[/color]', className:"col1-1" },
    50         {ldelim}name:'{'Orange'|@translate}', openWith:'[color=orange]', closeWith:'[/color]', className:"col1-2" },
    51         {ldelim}name:'{'Red'|@translate}', openWith:'[color=red]', closeWith:'[/color]', className:"col1-3" },
     49        {ldelim}name:'{'Yellow'|translate}', openWith:'[color=yellow]', closeWith:'[/color]', className:"col1-1" },
     50        {ldelim}name:'{'Orange'|translate}', openWith:'[color=orange]', closeWith:'[/color]', className:"col1-2" },
     51        {ldelim}name:'{'Red'|translate}', openWith:'[color=red]', closeWith:'[/color]', className:"col1-3" },
    5252       
    53         {ldelim}name:'{'Blue'|@translate}', openWith:'[color=blue]', closeWith:'[/color]', className:"col2-1" },
    54         {ldelim}name:'{'Purple'|@translate}', openWith:'[color=purple]', closeWith:'[/color]', className:"col2-2" },
    55         {ldelim}name:'{'Green'|@translate}', openWith:'[color=green]', closeWith:'[/color]', className:"col2-3" },
     53        {ldelim}name:'{'Blue'|translate}', openWith:'[color=blue]', closeWith:'[/color]', className:"col2-1" },
     54        {ldelim}name:'{'Purple'|translate}', openWith:'[color=purple]', closeWith:'[/color]', className:"col2-2" },
     55        {ldelim}name:'{'Green'|translate}', openWith:'[color=green]', closeWith:'[/color]', className:"col2-3" },
    5656       
    57         {ldelim}name:'{'White'|@translate}', openWith:'[color=white]', closeWith:'[/color]', className:"col3-1" },
    58         {ldelim}name:'{'Grey'|@translate}', openWith:'[color=gray]', closeWith:'[/color]', className:"col3-2" },
    59         {ldelim}name:'{'Black'|@translate}', openWith:'[color=black]', closeWith:'[/color]', className:"col3-3" }
     57        {ldelim}name:'{'White'|translate}', openWith:'[color=white]', closeWith:'[/color]', className:"col3-1" },
     58        {ldelim}name:'{'Grey'|translate}', openWith:'[color=gray]', closeWith:'[/color]', className:"col3-2" },
     59        {ldelim}name:'{'Black'|translate}', openWith:'[color=black]', closeWith:'[/color]', className:"col3-3" }
    6060      ]
    6161    },
    6262    {/if}
    6363   
    64     {if $SEP[4]}{counter}{ldelim}separator:'|'},{/if}
     64    {if $BBCODE.separators[4]}{counter}{ldelim}separator:'|'},{/if}
    6565  ]
    6666};{/strip}
    6767
    6868
    69 jQuery('#{$BBCODE_ID}').markItUp(BBCodeBar);
     69jQuery('#{$BBCODE.textarea_id}').markItUp(BBCodeBar);
    7070jQuery('.markItUpHeader>ul').css('width', {$bbc_counter}*22);
    7171{/footer_script}
  • extensions/bbcode_bar/template/bbcode_bar_admin.tpl

    r23278 r26076  
    1 {html_style}{literal}
     1{html_style}
    22.miuIcon a {
    33  display:inline-block;
     
    99  border-radius:2px;
    1010}
    11 {/literal}{/html_style}
     11{/html_style}
    1212
    13 {combine_css path=$BBCODE_PATH|@cat:"template/markitup/style.markitup.css"}
     13{combine_css path=$BBCODE_PATH|cat:'template/markitup/style.markitup.css'}
    1414
    1515<div class="titrePage">
     
    1717</div>
    1818
    19 <form method="post" action="" class="properties" ENCTYPE="multipart/form-data">
     19<form method="post" action="" class="properties">
    2020  <fieldset>
    21     <legend>{'Available options'|@translate}</legend>
     21    <legend>{'Available options'|translate}</legend>
    2222    <ul class="markItUp">
    2323      <li><label>
    2424        <span class="miuIcon miuBold"><a>&nbsp;</a></span>
    2525        <input type="checkbox" name="b" {$B_STATUS} value="1"/>
    26         {'Bold : [b]bold[/b]'|@translate}
     26        {'Bold : [b]bold[/b]'|translate}
    2727      </label></li>
    2828      <li><label>
    2929        <span class="miuIcon miuItalic"><a>&nbsp;</a></span>
    3030        <input type="checkbox" name="i" {$I_STATUS} value="1"/>
    31         {'Italic : [i]italic[/i]'|@translate}
     31        {'Italic : [i]italic[/i]'|translate}
    3232      </label></li>
    3333      <li><label>
    3434        <span class="miuIcon miuUnderline"><a>&nbsp;</a></span>
    3535        <input type="checkbox" name="u" {$U_STATUS} value="1"/>
    36         {'Underline : [u]underline[/u]'|@translate}
     36        {'Underline : [u]underline[/u]'|translate}
    3737      </label></li>     
    3838      <li><label>
    3939        <span class="miuIcon miuStroke"><a>&nbsp;</a></span>
    4040        <input type="checkbox" name="s" {$S_STATUS} value="1"/>
    41         {'Striped  : [s]striped[/s]'|@translate}
     41        {'Striped  : [s]striped[/s]'|translate}
    4242      </label></li>
    4343      <li><label>
    4444        <span class="miuIcon miuParagraph"><a>&nbsp;</a></span>
    4545        <input type="checkbox" name="p" {$P_STATUS} value="1"/>
    46         {'Paragraph : [p]Paragraph[/p]'|@translate}
     46        {'Paragraph : [p]Paragraph[/p]'|translate}
    4747      </label></li>
    4848      <li><label>
    4949        <span class="miuIcon miuCenter"><a>&nbsp;</a></span>
    5050        <input type="checkbox" name="center" {$CENTER_STATUS} value="1"/>
    51         {'Center : [center]center[/center]'|@translate}
     51        {'Center : [center]center[/center]'|translate}
    5252      </label></li>
    5353      <li><label>
    5454        <span class="miuIcon miuRight"><a>&nbsp;</a></span>
    5555        <input type="checkbox" name="right" {$RIGHT_STATUS} value="1"/>
    56         {'Right : [right]right[/right]'|@translate}
     56        {'Right : [right]right[/right]'|translate}
    5757      </label></li>
    5858      <li><label>
    5959        <span class="miuIcon miuQuote"><a>&nbsp;</a></span>
    6060        <input type="checkbox" name="quote" {$QUOTE_STATUS} value="1"/>
    61         {'Quote : [quote]quote[/quote]'|@translate}
     61        {'Quote : [quote]quote[/quote]'|translate}
    6262      </label></li>
    6363      <li><label>
    6464        <span class="miuIcon miuListUL"><a>&nbsp;</a></span>
    6565        <input type="checkbox" name="ul" {$UL_STATUS} value="1"/>
    66         {'Unordered list : [ul][li]element[/li][/ul]'|@translate}
     66        {'Unordered list : [ul][li]element[/li][/ul]'|translate}
    6767      </label></li>
    6868      <li><label>
    6969        <span class="miuIcon miuListOL"><a>&nbsp;</a></span>
    7070        <input type="checkbox" name="ol" {$OL_STATUS} value="1"/>
    71         {'Ordered list : [ol][li]element[/li][/ol]'|@translate}
     71        {'Ordered list : [ol][li]element[/li][/ol]'|translate}
    7272      </label></li>
    7373      <li><label>
    7474        <span class="miuIcon miuPicture"><a>&nbsp;</a></span>
    7575        <input type="checkbox" name="img" {$IMG_STATUS} value="1"/>
    76         {'Picture : [img]picture[/img]'|@translate}
     76        {'Picture : [img]picture[/img]'|translate}
    7777      </label></li>
    7878      <li><label>
    7979        <span class="miuIcon miuLink"><a>&nbsp;</a></span>
    8080        <input type="checkbox" name="url" {$URL_STATUS} value="1"/>
    81         {'URL : [url=URL]Title[/url]'|@translate}
     81        {'URL : [url=URL]Title[/url]'|translate}
    8282      </label></li>
    8383      <li><label>
    8484        <span class="miuIcon miuMail"><a>&nbsp;</a></span>
    8585        <input type="checkbox" name="email" {$EMAIL_STATUS} value="1"/>
    86         {'E-mail : [email]Email[/email]'|@translate}
     86        {'E-mail : [email]Email[/email]'|translate}
    8787      </label></li>
    8888      <li><label>
    8989        <span class="miuIcon miuSize"><a>&nbsp;</a></span>
    9090        <input type="checkbox" name="size" {$SIZE_STATUS} value="1"/>
    91         {'Font size : [size=X]text[/size]'|@translate}
     91        {'Font size : [size=X]text[/size]'|translate}
    9292      </label></li>
    9393      <li><label>
    9494        <span class="miuIcon miuColors"><a>&nbsp;</a></span>
    9595        <input type="checkbox" name="color" {$COLOR_STATUS} value="1"/>
    96         {'Font color : [color=color]text[/color]'|@translate}
     96        {'Font color : [color=color]text[/color]'|translate}
    9797      </label></li>
    9898    </ul>
    9999  </fieldset>
    100100 
    101   <p class="formButtons"><input class="submit" type="submit" value="{'Submit'|@translate}" name="submit"/></p>
     101  <p class="formButtons"><input class="submit" type="submit" value="{'Submit'|translate}" name="submit"/></p>
    102102</form>
Note: See TracChangeset for help on using the changeset viewer.