Changeset 9823


Ignore:
Timestamp:
03/22/11 15:58:01 (9 years ago)
Author:
patdenice
Message:

Compatibility fixed with AMM 2.x

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/AdditionalPages/branch/2.1/admin/config.inc.php

    r9546 r9823  
    4545  conf_update_param('additional_pages', pwg_db_real_escape_string(serialize($conf['AP']))); 
    4646 
    47   if (isset($_POST['show_menu']) xor (!isset($mb_conf['mbAdditionalPages']) or $mb_conf['mbAdditionalPages'] > 0)) 
     47  if (!defined('AMM_VERSION') or version_compare(AMM_VERSION, '3.0.0', '<')) 
    4848  { 
    49     if (!isset($mb_conf['mbAdditionalPages'])) 
     49    if (isset($_POST['show_menu']) xor (!isset($mb_conf['mbAdditionalPages']) or $mb_conf['mbAdditionalPages'] > 0)) 
    5050    { 
    51       $last = @abs(end($mb_conf)); 
    52       $mb_conf['mbAdditionalPages'] = $last + 50; 
     51      if (!isset($mb_conf['mbAdditionalPages'])) 
     52      { 
     53        $last = @abs(end($mb_conf)); 
     54        $mb_conf['mbAdditionalPages'] = $last + 50; 
     55      } 
     56      $mb_conf['mbAdditionalPages'] = (isset($_POST['show_menu']) ? +1 : -1) * abs($mb_conf['mbAdditionalPages']); 
     57      conf_update_param('blk_menubar', pwg_db_real_escape_string(serialize($mb_conf))); 
    5358    } 
    54     $mb_conf['mbAdditionalPages'] = (isset($_POST['show_menu']) ? +1 : -1) * abs($mb_conf['mbAdditionalPages']); 
    55     conf_update_param('blk_menubar', pwg_db_real_escape_string(serialize($mb_conf))); 
    5659  } 
    5760 
     
    8083  'ap_conf' => $conf['AP'], 
    8184  'SHOW_MENU' => (!isset($mb_conf['mbAdditionalPages']) or $mb_conf['mbAdditionalPages'] > 0), 
    82   'AMM_INSTALLED' => defined('AMM_PATH'), 
     85  'AMM_INSTALLED' => (defined('AMM_VERSION') and version_compare(AMM_VERSION, '3.0.0', '>=')), 
    8386  ) 
    8487); 
    8588 
    86 if (defined('AMM_PATH')) 
     89if (defined('AMM_VERSION') and version_compare(AMM_VERSION, '3.0.0', '>=')) 
    8790{ 
    8891  load_language('plugin.lang', AMM_PATH); 
Note: See TracChangeset for help on using the changeset viewer.