Ignore:
Timestamp:
May 22, 2011, 12:23:03 PM (13 years ago)
Author:
mistic100
Message:

code cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/bbcode_bar/main.inc.php

    r10597 r10983  
    1919function init_bbcode_bar()
    2020{
    21         remove_event_handler('render_comment_content', 'render_comment_content');
    22         add_event_handler('render_comment_content', 'BBCodeParse');
    23         add_event_handler('loc_after_page_header', 'add_bbcode_bar');
     21  remove_event_handler('render_comment_content', 'render_comment_content');
     22  add_event_handler('render_comment_content', 'BBCodeParse');
     23  add_event_handler('loc_after_page_header', 'add_bbcode_bar');
    2424}
    2525
    2626function add_bbcode_bar() {
    27         global $page;
    28        
    29         if (isset($page['body_id']) AND $page['body_id'] == 'thePicturePage') {
    30                 set_bbcode_bar();
    31         }
     27  global $page;
     28 
     29  if (isset($page['body_id']) AND $page['body_id'] == 'thePicturePage') {
     30    set_bbcode_bar();
     31  }
    3232}
    3333
    3434if (script_basename() == 'admin')
    3535{
    36         add_event_handler('get_admin_plugin_menu_links', 'bbcode_bar_admin_menu');
    37         function bbcode_bar_admin_menu($menu)
    38         {
    39                 array_push($menu, array(
    40                         'NAME' => 'BBCode Bar',
    41                         'URL' => get_root_url().'admin.php?page=plugin-' . BBcode_DIR
    42                 ));
    43                 return $menu;
    44         }
    45        
    46         // version 2.2.a or greater of SmiliesSupport is required
    47         add_event_handler('loc_end_admin', 'bbcode_bar_check_smilies');
    48         function bbcode_bar_check_smilies() {
    49                 global $page, $template, $pwg_loaded_plugins;
     36  add_event_handler('get_admin_plugin_menu_links', 'bbcode_bar_admin_menu');
     37  function bbcode_bar_admin_menu($menu)
     38  {
     39    array_push($menu, array(
     40      'NAME' => 'BBCode Bar',
     41      'URL' => get_root_url().'admin.php?page=plugin-' . BBcode_DIR
     42    ));
     43    return $menu;
     44  }
     45 
     46  // version 2.2.a or greater of SmiliesSupport is required
     47  add_event_handler('loc_end_admin', 'bbcode_bar_check_smilies');
     48  function bbcode_bar_check_smilies() {
     49    global $page, $template, $pwg_loaded_plugins;
    5050
    51                 if (
    52                         ((isset($_GET['page']) AND $_GET['page'] == 'plugins_list') OR (isset($_GET['section']) AND $_GET['section'] == 'bbcode_bar/admin.php'))
    53                         AND isset($pwg_loaded_plugins['SmiliesSupport'])
    54                         AND strcmp($pwg_loaded_plugins['SmiliesSupport']['version'], '2.2.a') == -1
    55                 ) {
    56                         $page['warnings'][] = "BBCode Bar : SmiliesSupport has been detected, but is not up to date. Version 2.2.a or greater is required. Please update.";
    57                         $template->assign('warnings', $page['warnings']);
    58                 }
    59         }
    60        
     51    if (
     52      ((isset($_GET['page']) AND $_GET['page'] == 'plugins_list') OR (isset($_GET['section']) AND $_GET['section'] == 'bbcode_bar/admin.php'))
     53      AND isset($pwg_loaded_plugins['SmiliesSupport'])
     54      AND strcmp($pwg_loaded_plugins['SmiliesSupport']['version'], '2.2.a') == -1
     55    ) {
     56      $page['warnings'][] = "BBCode Bar : SmiliesSupport has been detected, but is not up to date. Version 2.2.a or greater is required. Please update.";
     57      $template->assign('warnings', $page['warnings']);
     58    }
     59  }
     60 
    6161}
    6262
Note: See TracChangeset for help on using the changeset viewer.