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

Update the plugin for compatibility with Piwigo 2.1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/UserStat/userstat_aim.class.inc.php

    r4270 r5549  
    1616if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); }
    1717
    18 include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/common_plugin.class.inc.php');
    19 include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/css.class.inc.php');
     18include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php');
     19include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCss.class.inc.php');
    2020
    21 class UserStat_AIM extends common_plugin
     21class UserStat_AIM extends CommonPlugin
    2222{
    2323  protected $css = null;
    2424
    25   function UserStat_AIM($prefixeTable, $filelocation)
     25  public function __construct($prefixeTable, $filelocation)
    2626  {
    27     $this->plugin_name="UserStat";
    28     $this->plugin_name_files="userstat";
     27    $this->setPluginName("UserStat");
     28    $this->setPluginNameFiles("userstat");
    2929    parent::__construct($prefixeTable, $filelocation);
    30     $this->css = new css(dirname($this->filelocation).'/'.$this->plugin_name_files.".css");
     30    $this->css = new GPCCss(dirname($this->getFileLocation()).'/'.$this->getPluginNameFiles().".css");
     31  }
     32
     33  public function __destruct()
     34  {
     35    unset($this->css);
     36    parent::__destruct();
    3137  }
    3238
     
    3440    initialize events call for the plugin
    3541  */
    36   function init_events()
     42  function initEvents()
    3743  {
    38     add_event_handler('get_admin_plugin_menu_links', array(&$this, 'plugin_admin_menu') );
     44    add_event_handler('get_admin_plugin_menu_links', array(&$this, 'pluginAdminMenu') );
    3945  }
    4046
     
    4349    initialization of config properties
    4450  */
    45   function init_config()
     51  function initConfig()
    4652  {
    47     $this->my_config=array(
     53    $this->config=array(
    4854      'UserStat_MouseOverColor' => '303030',
    4955      /*'AStat_BarColor_Pages' => '6666ff',
     
    6975
    7076  /*
    71     surchage of common_plugin->save_config function
     77    surchage of CommonPlugin->saveConfig function
    7278  */
    73   function load_config()
     79  function loadConfig()
    7480  {
    75     parent::load_config();
    76     if(!$this->css->css_file_exists())
     81    parent::loadConfig();
     82    if(!$this->css->fileExists())
    7783    {
    78       $this->css->make_CSS($this->generate_CSS());
     84      $this->css->makeCSS($this->generate_CSS());
    7985    }
    8086  }
    8187
    8288  /*
    83     surchage of common_plugin->save_config function
     89    surchage of CommonPlugin->saveConfig function
    8490  */
    85   function save_config()
     91  function saveConfig()
    8692  {
    87     if(parent::save_config())
     93    if(parent::saveConfig())
    8894    {
    89       $this->css->make_CSS($this->generate_CSS());
     95      $this->css->makeCSS($this->generate_CSS());
    9096      return(true);
    9197    }
     
    99105  {
    100106    $text = "
    101 .StatTableRow:hover { background-color:#".$this->my_config['UserStat_MouseOverColor']."; }
     107.StatTableRow:hover { background-color:#".$this->config['UserStat_MouseOverColor']."; }
    102108.formtable, .formtable P { text-align:left; display:block; }
    103109.formtable tr { vertical-align:top; }
Note: See TracChangeset for help on using the changeset viewer.