Changeset 16009


Ignore:
Timestamp:
Jun 24, 2012, 9:15:52 PM (12 years ago)
Author:
grum
Message:

feature:2636- compatibility with Piwigo 2.4

Location:
extensions/AStat
Files:
1 added
4 edited

Legend:

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

    r10264 r16009  
    1717
    1818include_once('astat_root.class.inc.php');
    19 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCss.class.inc.php');
    2019
    2120class AStat_AIM extends AStat_root
    2221{
    23   protected $css = null;
    24 
    25   function __construct($prefixeTable, $filelocation)
     22  public function __construct($prefixeTable, $filelocation)
    2623  {
    2724    parent::__construct($prefixeTable, $filelocation);
     
    3128    initialize events call for the plugin
    3229  */
    33   function initEvents()
     30  public function initEvents()
    3431  {
     32    parent::initEvents();
    3533    add_event_handler('get_admin_plugin_menu_links', array(&$this, 'pluginAdminMenu') );
    3634  }
  • extensions/AStat/astat_aip.class.inc.php

    r15342 r16009  
    6060  }
    6161
    62   /*
    63     initialize events call for the plugin
    64   */
    65   function initEvents()
    66   {
    67     add_event_handler('loc_end_page_header', array(&$this, 'applyCSS'));
    68   }
    69 
    70 
    7162
    7263  /* ---------------------------------------------------------------------------
    7364  Public classe functions
    7465  --------------------------------------------------------------------------- */
    75 
    76   public function applyCSS()
    77   {
    78     GPCCore::addHeaderCSS(basename(dirname($this->getPluginNameFiles())), PHPWG_ROOT_PATH.PWG_LOCAL_DIR.'css/'.$this->getPluginNameFiles().".css");
    79   }
    8066
    8167
  • extensions/AStat/astat_root.class.inc.php

    r10264 r16009  
    1717
    1818include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php');
    19 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCss.class.inc.php');
    20 
    2119
    2220class AStat_root extends CommonPlugin
    2321{
    24   protected $css;   //the css object
    25 
    2622  public function __construct($prefixeTable, $filelocation)
    2723  {
     
    3127    $this->setPluginNameFiles("astat");
    3228    parent::__construct($prefixeTable, $filelocation);
    33     $this->css = new GPCCss(PHPWG_ROOT_PATH.PWG_LOCAL_DIR.'css/'.$this->getPluginNameFiles().".css");
    34   }
    35 
    36   public function __destruct()
    37   {
    38     unset($this->css);
    39     parent::__destruct();
    4029  }
    4130
     
    7059  }
    7160
    72   /*
    73     surchage of CommonPlugin->saveConfig function
    74   */
    75   function loadConfig()
     61  public function loadCSS()
    7662  {
    77     parent::loadConfig();
    78     if(!$this->css->fileExists())
    79     {
    80       $this->css->makeCSS($this->generate_CSS());
    81     }
    82   }
     63    parent::loadCSS();
     64    GPCCore::addHeaderCSS('astat.css', 'plugins/'.$this->getDirectory().'/'.$this->getPluginNameFiles().".css");
     65    GPCCore::addHeaderContent('css',
     66"
     67.AStatBar1 { background-color:#".$this->config['AStat_BarColor_Pages']."; }
     68.AStatBar2 { background-color:#".$this->config['AStat_BarColor_Img']."; }
     69.AStatBar3 { background-color:#".$this->config['AStat_BarColor_IP']."; }
     70.AStatBar4 { background-color:#".$this->config['AStat_BarColor_Cat']."; }
    8371
    84   /*
    85     surchage of CommonPlugin->saveConfig function
    86   */
    87   function saveConfig()
    88   {
    89     if(parent::saveConfig())
    90     {
    91       $this->css->makeCSS($this->generate_CSS());
    92       return(true);
    93     }
    94     return(false);
    95   }
     72.MiniSquare1 { color:#".$this->config['AStat_BarColor_Pages'].";   }
     73.MiniSquare2 { color:#".$this->config['AStat_BarColor_Img'].";  }
     74.MiniSquare3 { color:#".$this->config['AStat_BarColor_IP']."; }
     75.MiniSquare4 { color:#".$this->config['AStat_BarColor_Cat']."; }
    9676
    97   /*
    98     generate the css code
    99   */
    100   function generate_CSS()
    101   {
    102     $text = ".AStatBar1, .AStatBar2, .AStatBar3, .AStatBar4, .AStatBarX {
    103       border:0px;
    104       height:8px;
    105       display: block;
    106       margin:0px;
    107       padding:0px;
    108       left:0;
    109       position:relative;
    110       }
    111        .MiniSquare1, .MiniSquare2, .MiniSquare3, .MiniSquare4 {
    112       border:0px;
    113       height:8px;
    114       width:8px;
    115       margin:0px;
    116       padding:0px;
    117       }
    118        .AStatBar1 { background-color:#".$this->config['AStat_BarColor_Pages']."; top:5px;  }
    119        .AStatBar2 { background-color:#".$this->config['AStat_BarColor_Img']."; top:-3px; }
    120        .AStatBar3 { background-color:#".$this->config['AStat_BarColor_IP']."; top:-3px;}
    121        .AStatBar4 { background-color:#".$this->config['AStat_BarColor_Cat']."; top:-3px;}
    122        .AStatBarX { background-color:transparent; top:-3px; height:1px; }
    123        .MiniSquare1 { color:#".$this->config['AStat_BarColor_Pages'].";   }
    124        .MiniSquare2 { color:#".$this->config['AStat_BarColor_Img'].";  }
    125        .MiniSquare3 { color:#".$this->config['AStat_BarColor_IP']."; }
    126        .MiniSquare4 { color:#".$this->config['AStat_BarColor_Cat']."; }
    127        .StatTableRow:hover { background-color:#".$this->config['AStat_MouseOverColor']."; }
    128        .formtable, .formtable P { text-align:left; display:block; }
    129        .formtable tr { vertical-align:top; }
    130        .window_thumb {
    131       position:absolute;
    132       border: none;
    133       background: none;
    134       left:0;
    135       top:0;
    136       margin:0px;
    137       padding:0px;
    138       z-index:100;
    139       overflow:hidden;
    140       visibility:hidden; }
    141         .img_thumb {
    142       border: solid 3px #ffffff;
    143       background: #000000;
    144       margin:0px;
    145       padding:0px; }
    146         .time_request {
    147       font-size:83%;
    148       text-align:right; }
    149         .invisible { visibility:hidden; display:none; }
    150       .littlefont { font-size:90%; }
    151       table.littlefont th { padding:3px; }
    152       table.littlefont td { padding:0px;padding-left:3px;padding-right:3px; }
    153       #iplist { visibility:hidden; position:absolute; width:200px; z-index:1000; }
    154       .iipsellistitem { float:right; }
    155       #iipsellist { width:100%; font-family:monospace; }
    156     ";
    157 
    158     return($text);
     77.StatTableRow:hover { background-color:#".$this->config['AStat_MouseOverColor']."; }
     78"
     79    );
    15980  }
    16081
  • extensions/AStat/main.inc.php

    r15342 r16009  
    100100
    101101//AStat loaded and active only if in admin page
    102 if(basename($_SERVER["PHP_SELF"])=='admin.php')
     102if(defined('IN_ADMIN') && !defined('AJAX_CALL'))
    103103{
    104104  include_once("astat_aim.class.inc.php");
Note: See TracChangeset for help on using the changeset viewer.