Ignore:
Timestamp:
Apr 1, 2010, 9:03:36 PM (14 years ago)
Author:
grum
Message:

Update the plugin for compatibility with Piwigo 2.1

File:
1 edited

Legend:

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

    r5426 r5545  
    1717if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); }
    1818
    19 include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/common_plugin.class.inc.php');
    20 include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/users_groups.class.inc.php');
    21 include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/css.class.inc.php');
    22 
    23 
    24 class AMM_root extends common_plugin
     19include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php');
     20include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCUsersGroups.class.inc.php');
     21include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCss.class.inc.php');
     22
     23
     24class AMM_root extends CommonPlugin
    2525{
    2626  protected $css;   //the css object
     
    4141  );
    4242
    43   function AMM_root($prefixeTable, $filelocation)
    44   {
    45     $this->plugin_name="Advanced Menu Manager";
    46     $this->plugin_name_files="amm";
     43  public function __construct($prefixeTable, $filelocation)
     44  {
     45    $this->setPluginName("Advanced Menu Manager");
     46    $this->setPluginNameFiles("amm");
    4747    parent::__construct($prefixeTable, $filelocation);
    4848
    4949    $list=array('urls', 'personalised');
    50     $this->set_tables_list($list);
     50    $this->setTablesList($list);
     51  }
     52
     53  public function __destruct()
     54  {
     55    unset($this->css);
     56    unset($this->defaultMenus);
     57    parent::__destruct();
    5158  }
    5259
     
    5663
    5764  /* this function initialize var $my_config with default values */
    58   public function init_config()
    59   {
    60     $this->my_config=array(
     65  public function initConfig()
     66  {
     67    $this->config=array(
    6168      'amm_links_show_icons' => 'y',
    6269      'amm_links_title' => array(),
     
    7481      if($key=='fr_FR')
    7582      {
    76         $this->my_config['amm_links_title'][$key]=base64_encode('Liens');
    77         $this->my_config['amm_randompicture_title'][$key]=base64_encode('Une image au hasard');
     83        $this->config['amm_links_title'][$key]=base64_encode('Liens');
     84        $this->config['amm_randompicture_title'][$key]=base64_encode('Une image au hasard');
    7885      }
    7986      else
    8087      {
    81         $this->my_config['amm_links_title'][$key]=base64_encode('Links');
    82         $this->my_config['amm_randompicture_title'][$key]=base64_encode('A random picture');
    83       }
    84     }
    85   }
    86 
    87   public function load_config()
    88   {
    89     parent::load_config();
    90   }
    91 
    92   public function init_events()
     88        $this->config['amm_links_title'][$key]=base64_encode('Links');
     89        $this->config['amm_randompicture_title'][$key]=base64_encode('A random picture');
     90      }
     91    }
     92  }
     93
     94  public function loadConfig()
     95  {
     96    parent::loadConfig();
     97  }
     98
     99  public function initEvents()
    93100  {
    94101    add_event_handler('blockmanager_register_blocks', array(&$this, 'register_blocks') );
     
    204211  protected function sortSectionsItems()
    205212  {
    206     uasort($this->my_config['amm_sections_items'], array($this, "sortSectionsItemsCompare"));
     213    uasort($this->config['amm_sections_items'], array($this, "sortSectionsItemsCompare"));
    207214  }
    208215
Note: See TracChangeset for help on using the changeset viewer.