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

Update the plugin for compatibility with Piwigo 2.1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/AStat/astat_aim.class.inc.php

    r5423 r5546  
    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');
    20 
    21 class AStat_AIM extends common_plugin
     18include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php');
     19include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCss.class.inc.php');
     20
     21class AStat_AIM extends CommonPlugin
    2222{
    2323  protected $css = null;
     
    2525  function AStat_AIM($prefixeTable, $filelocation)
    2626  {
    27     $this->plugin_name="AStat.2";
    28     $this->plugin_name_files="astat";
     27    $this->setPluginName("AStat.2");
     28    $this->setPluginNameFiles("astat");
    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");
    3131  }
    3232
     
    3434    initialize events call for the plugin
    3535  */
    36   function init_events()
    37   {
    38     add_event_handler('get_admin_plugin_menu_links', array(&$this, 'plugin_admin_menu') );
     36  function initEvents()
     37  {
     38    add_event_handler('get_admin_plugin_menu_links', array(&$this, 'pluginAdminMenu') );
    3939  }
    4040
     
    4343    initialization of config properties
    4444  */
    45   function init_config()
    46   {
    47     $this->my_config=array(
     45  function initConfig()
     46  {
     47    $this->config=array(
    4848      'AStat_BarColor_Pages' => '6666ff',
    4949      'AStat_BarColor_Img' => '66ff66',
     
    6969
    7070  /*
    71     surchage of common_plugin->save_config function
    72   */
    73   function load_config()
    74   {
    75     parent::load_config();
    76     if(!$this->css->css_file_exists())
    77     {
    78       $this->css->make_CSS($this->generate_CSS());
    79     }
    80   }
    81 
    82   /*
    83     surchage of common_plugin->save_config function
    84   */
    85   function save_config()
    86   {
    87     if(parent::save_config())
    88     {
    89       $this->css->make_CSS($this->generate_CSS());
     71    surchage of CommonPlugin->saveConfig function
     72  */
     73  function loadConfig()
     74  {
     75    parent::loadConfig();
     76    if(!$this->css->fileExists())
     77    {
     78      $this->css->makeCSS($this->generate_CSS());
     79    }
     80  }
     81
     82  /*
     83    surchage of CommonPlugin->saveConfig function
     84  */
     85  function saveConfig()
     86  {
     87    if(parent::saveConfig())
     88    {
     89      $this->css->makeCSS($this->generate_CSS());
    9090      return(true);
    9191    }
     
    114114      padding:0px;
    115115      }
    116        .AStatBar1 { background-color:#".$this->my_config['AStat_BarColor_Pages']."; top:5px;  }
    117        .AStatBar2 { background-color:#".$this->my_config['AStat_BarColor_Img']."; top:-3px; }
    118        .AStatBar3 { background-color:#".$this->my_config['AStat_BarColor_IP']."; top:-3px;}
    119        .AStatBar4 { background-color:#".$this->my_config['AStat_BarColor_Cat']."; top:-3px;}
     116       .AStatBar1 { background-color:#".$this->config['AStat_BarColor_Pages']."; top:5px;  }
     117       .AStatBar2 { background-color:#".$this->config['AStat_BarColor_Img']."; top:-3px; }
     118       .AStatBar3 { background-color:#".$this->config['AStat_BarColor_IP']."; top:-3px;}
     119       .AStatBar4 { background-color:#".$this->config['AStat_BarColor_Cat']."; top:-3px;}
    120120       .AStatBarX { background-color:transparent; top:-3px; height:1px; }
    121        .MiniSquare1 { color:#".$this->my_config['AStat_BarColor_Pages'].";   }
    122        .MiniSquare2 { color:#".$this->my_config['AStat_BarColor_Img'].";  }
    123        .MiniSquare3 { color:#".$this->my_config['AStat_BarColor_IP']."; }
    124        .MiniSquare4 { color:#".$this->my_config['AStat_BarColor_Cat']."; }
    125        .StatTableRow:hover { background-color:#".$this->my_config['AStat_MouseOverColor']."; }
     121       .MiniSquare1 { color:#".$this->config['AStat_BarColor_Pages'].";   }
     122       .MiniSquare2 { color:#".$this->config['AStat_BarColor_Img'].";  }
     123       .MiniSquare3 { color:#".$this->config['AStat_BarColor_IP']."; }
     124       .MiniSquare4 { color:#".$this->config['AStat_BarColor_Cat']."; }
     125       .StatTableRow:hover { background-color:#".$this->config['AStat_MouseOverColor']."; }
    126126       .formtable, .formtable P { text-align:left; display:block; }
    127127       .formtable tr { vertical-align:top; }
Note: See TracChangeset for help on using the changeset viewer.