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

Update the plugin for compatibility with Piwigo 2.1

File:
1 edited

Legend:

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

    r5433 r5549  
    1717include_once('userstat_aim.class.inc.php');
    1818include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
    19 include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/ajax.class.inc.php');
     19include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCAjax.class.inc.php');
    2020
    2121class UserStat_AIP extends UserStat_AIM
    2222{
    2323  protected $tabsheet;
    24   protected $ajax;
    25 
    26   function UserStat_AIP($prefixeTable, $filelocation)
     24
     25  public function __construct($prefixeTable, $filelocation)
    2726  {
    2827    parent::__construct($prefixeTable, $filelocation);
    2928
    30     $this->load_config();
    31     $this->init_events();
     29    $this->loadConfig();
     30    $this->initEvents();
    3231
    3332    $this->tabsheet = new tabsheet();
    3433    $this->tabsheet->add('global_stats',
    3534                          l10n('us_tsGlobal'),
    36                           $this->page_link.'&fUserStat_tabsheet=global_stats');
     35                          $this->getAdminLink().'&fUserStat_tabsheet=global_stats');
    3736    $this->tabsheet->add('users_stats',
    3837                          l10n('us_tsUsers'),
    39                           $this->page_link.'&fUserStat_tabsheet=users_stats');
    40 
    41     $this->ajax = new Ajax();
     38                          $this->getAdminLink().'&fUserStat_tabsheet=users_stats');
     39  }
     40
     41  public function __destruct()
     42  {
     43    unset($this->tabsheet);
     44    parent::__destruct();
    4245  }
    4346
     
    4548    initialize events call for the plugin
    4649  */
    47   function init_events()
    48   {
    49     add_event_handler('loc_end_page_header', array(&$this->css, 'apply_CSS'));
     50  function initEvents()
     51  {
     52    add_event_handler('loc_end_page_header', array(&$this->css, 'applyCSS'));
    5053  }
    5154
     
    112115          break;
    113116      }
    114       //$template->
    115       $this->ajax->return_result($result);
     117      GPCAjax::returnResult($result);
    116118    }
    117119  }
     
    154156    $template_datas = array();
    155157
    156     $template_datas["ajaxUrl"] = $this->page_link;
     158    $template_datas["ajaxUrl"] = $this->getAdminLink();
    157159    $template_datas["users"] = $this->getUsersGlobalStats();
    158160
     
    526528    $local_tpl = new Template(USERSTAT_PATH."admin/", "");
    527529    $local_tpl->set_filename('body_page',
    528                   dirname($this->filelocation).'/admin/userstat_userstat.tpl');
     530                  dirname($this->getFileLocation()).'/admin/userstat_userstat.tpl');
    529531
    530532    $template_datas["list"] = $this->makeUserStats($userId);
Note: See TracChangeset for help on using the changeset viewer.