Ignore:
Timestamp:
04/01/10 21:03:36 (10 years ago)
Author:
grum
Message:

Update the plugin for compatibility with Piwigo 2.1

File:
1 edited

Legend:

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

    r5421 r5545  
    1616  include_once('amm_version.inc.php'); 
    1717  include_once('amm_root.class.inc.php'); 
    18   include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/tables.class.inc.php'); 
     18  include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCTables.class.inc.php'); 
    1919 
    2020 
    2121  class AMM_install extends AMM_root 
    2222  { 
    23     private $tablef; 
     23    private $tablesManager; 
    2424    private $exportfile; 
    2525 
     
    2727    { 
    2828      parent::__construct($prefixeTable, $filelocation); 
    29       $this->tablef= new manage_tables($this->tables); 
    30       $this->exportfile=dirname($this->filelocation).'/'.$this->plugin_name_files.'.sql'; 
     29      $this->tablesManager= new GPCTables($this->tables); 
     30      $this->exportfile=dirname($this->getFileLocation()).'/'.$this->getPluginNameFiles().'.sql'; 
    3131    } 
    3232 
     
    3737    public function install() 
    3838    { 
    39       $this->init_config(); 
    40       $this->load_config(); 
    41       $this->my_config['installed']=AMM_VERSION2; 
    42       $this->save_config(); 
     39      $this->initConfig(); 
     40      $this->loadConfig(); 
     41      $this->config['installed']=AMM_VERSION2; 
     42      $this->saveConfig(); 
    4343 
    4444      $tables_def=array( 
     
    6767      //$table_def array 
    6868      $tables_def = create_table_add_character_set($tables_def); 
    69       $result=$this->tablef->create_tables($tables_def); 
     69      $result=$this->tablesManager->create($tables_def); 
    7070      return($result); 
    7171    } 
     
    7777    public function uninstall() 
    7878    { 
    79       $this->tablef->export($this->exportfile); 
    80       $this->delete_config(); 
    81       $this->tablef->drop_tables(); 
     79      $this->tablesManager->export($this->exportfile); 
     80      $this->deleteConfig(); 
     81      $this->tablesManager->drop(); 
    8282    } 
    8383 
     
    8686      global $template; 
    8787 
    88       $this->init_config(); 
    89       $this->load_config(); 
     88      $this->initConfig(); 
     89      $this->loadConfig(); 
    9090 
    9191      $this->udpateTablesDef(); 
    9292 
    93       $this->my_config['installed']=AMM_VERSION2; //update the installed release number 
    94       $this->save_config(); 
     93      $this->config['installed']=AMM_VERSION2; //update the installed release number 
     94      $this->saveConfig(); 
    9595    } 
    9696 
     
    113113       * This function aim to import the old conf into the new conf property 
    114114      */ 
    115       if(isset($this->my_config['amm_sections_modspecials'])) 
     115      if(isset($this->config['amm_sections_modspecials'])) 
    116116      { 
    117         foreach($this->my_config['amm_sections_modspecials'] as $key=>$val) 
     117        foreach($this->config['amm_sections_modspecials'] as $key=>$val) 
    118118        { 
    119           $this->my_config['amm_sections_items'][$key]['visibility']=($val=="y")?"guest,generic,normal,admin/":"admin/"; 
     119          $this->config['amm_sections_items'][$key]['visibility']=($val=="y")?"guest,generic,normal,admin/":"admin/"; 
    120120        } 
    121         unset($this->my_config['amm_sections_modspecials']); 
     121        unset($this->config['amm_sections_modspecials']); 
    122122      } 
    123123 
    124       if(isset($this->my_config['amm_sections_modmenu'])) 
     124      if(isset($this->config['amm_sections_modmenu'])) 
    125125      { 
    126         foreach($this->my_config['amm_sections_modmenu'] as $key=>$val) 
     126        foreach($this->config['amm_sections_modmenu'] as $key=>$val) 
    127127        { 
    128           $this->my_config['amm_sections_items'][$key]['visibility']=($val=="y")?"guest,generic,normal,admin/":"admin/"; 
     128          $this->config['amm_sections_items'][$key]['visibility']=($val=="y")?"guest,generic,normal,admin/":"admin/"; 
    129129        } 
    130         unset($this->my_config['amm_sections_modmenu']); 
     130        unset($this->config['amm_sections_modmenu']); 
    131131      } 
    132132 
    133       if(!array_key_exists('installed', $this->my_config)) 
     133      if(!array_key_exists('installed', $this->config)) 
    134134      { 
    135135        /* 
     
    137137         * 2.2.0 release 
    138138         */ 
    139         $this->my_config['installed']="02.01.06"; 
     139        $this->config['installed']="02.01.06"; 
    140140      } 
    141141 
    142       if($this->my_config['installed']<="02.01.06") 
     142      if($this->config['installed']<="02.01.06") 
    143143      { 
    144144        /* 
     
    153153        pwg_query($sql); 
    154154 
    155         foreach($this->my_config['amm_sections_items'] as $key => $val) 
     155        foreach($this->config['amm_sections_items'] as $key => $val) 
    156156        { 
    157           $this->my_config['amm_sections_items'][$key]['translation'] = $this->defaultMenus[$key]['translation']; 
     157          $this->config['amm_sections_items'][$key]['translation'] = $this->defaultMenus[$key]['translation']; 
    158158        } 
    159159      } 
Note: See TracChangeset for help on using the changeset viewer.