source: extensions/GrumPluginClasses/gpc_aim.class.inc.php @ 5550

Last change on this file since 5550 was 5550, checked in by grum, 14 years ago

Release 3.0.0 : the plugin has been completely rewritten

File size: 2.6 KB
Line 
1<?php
2/* -----------------------------------------------------------------------------
3  Plugin     : Grum Plugin Classes - 3
4  Author     : Grum
5    email    : grum@piwigo.org
6    website  : http://photos.grum.fr
7
8    << May the Little SpaceFrog be with you ! >>
9  ------------------------------------------------------------------------------
10  See main.inc.php for release information
11
12  UserStat_AIM : classe to manage plugin integration into plugin menu
13
14  --------------------------------------------------------------------------- */
15
16if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); }
17
18include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php');
19include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCss.class.inc.php');
20
21class GPC_AIM extends CommonPlugin
22{
23  protected $css = null;
24
25  public function __construct($prefixeTable, $filelocation)
26  {
27    $this->setPluginName("Grum Plugin Classes");
28    $this->setPluginNameFiles("gpc");
29    parent::__construct($prefixeTable, $filelocation);
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();
37  }
38
39  /*
40    initialize events call for the plugin
41  */
42  function initEvents()
43  {
44    add_event_handler('get_admin_plugin_menu_links', array(&$this, 'pluginAdminMenu') );
45  }
46
47  /*
48    surchage of CommonPlugin->saveConfig function
49  */
50  function loadConfig()
51  {
52    parent::loadConfig();
53    if(!$this->css->fileExists())
54    {
55      $this->css->makeCSS($this->generate_CSS());
56    }
57  }
58
59  /*
60    surchage of CommonPlugin->saveConfig function
61  */
62  function saveConfig()
63  {
64    if(parent::saveConfig())
65    {
66      $this->css->makeCSS($this->generate_CSS());
67      return(true);
68    }
69    return(false);
70  }
71
72  /*
73    generate the css code
74  */
75  function generate_CSS()
76  {
77    $text = "
78.formtable, .formtable P { text-align:left; display:block; }
79.formtable tr { vertical-align:top; }
80.invisible { visibility:hidden; display:none; }
81.littlefont { font-size:90%; }
82table.table2.littlefont td { text-align:center;padding:0px;padding-left:3px;padding-right:3px; }
83.throw { line-height:auto; font-size:100%; }
84table.table2 tr.throw { height:26px; }
85table.table2 td.toLeft  { text-align:left; }
86div.table { margin-bottom:15px; }
87pointerHand { cursor:pointer; }
88    ";
89
90    return($text);
91  }
92
93  /* ---------------------------------------------------------------------------
94  Function needed for plugin activation
95  --------------------------------------------------------------------------- */
96
97
98
99} // GPC_AIM class
100
101
102?>
Note: See TracBrowser for help on using the repository browser.