Ignore:
Timestamp:
11/29/09 18:53:32 (10 years ago)
Author:
grum
Message:

[AMM] import config from releases earlier than 2.1.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/AMenuManager/amm_install.class.inc.php

    r3681 r4391  
    3030    } 
    3131 
    32     /*  
    33         function for installation process  
    34         return true if install process is ok, otherwise false  
    35     */  
     32    /* 
     33        function for installation process 
     34        return true if install process is ok, otherwise false 
     35    */ 
    3636    public function install() 
    3737    { 
     
    8383      $this->init_config(); 
    8484      $this->load_config(); 
     85      /* AMM release earlier than the 2.1.3 uses two parameters to manage the display 
     86       * of the menu items ("amm_sections_modspecials" and "amm_sections_modmenu") 
     87       * 
     88       * These two parameters are replaced by a single parameter "amm_sections_items" 
     89       * 
     90       * This function aim to import the old conf into the new conf property 
     91      */ 
     92      if(isset($this->my_config['amm_sections_modspecials'])) 
     93      { 
     94        foreach($this->my_config['amm_sections_modspecials'] as $key=>$val) 
     95        { 
     96          $this->my_config['amm_sections_items'][$key]['visibility']=($val=="y")?"guest,generic,normal,admin/":"admin/"; 
     97        } 
     98        unset($this->my_config['amm_sections_modspecials']); 
     99      } 
     100 
     101      if(isset($this->my_config['amm_sections_modmenu'])) 
     102      { 
     103        foreach($this->my_config['amm_sections_modmenu'] as $key=>$val) 
     104        { 
     105          $this->my_config['amm_sections_items'][$key]['visibility']=($val=="y")?"guest,generic,normal,admin/":"admin/"; 
     106        } 
     107        unset($this->my_config['amm_sections_modmenu']); 
     108      } 
     109 
    85110      $this->save_config(); 
    86111    } 
Note: See TracChangeset for help on using the changeset viewer.