source: extensions/GrumPluginClasses/gpc_aip.class.inc.php @ 11529

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

Release 3.0.0 : the plugin has been completely rewritten

File size: 3.0 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  AI classe => manage integration in administration interface
13
14  --------------------------------------------------------------------------- */
15if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); }
16
17include_once('gpc_aim.class.inc.php');
18include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
19include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCore.class.inc.php');
20
21class GPC_AIP extends GPC_AIM
22{
23  protected $tabsheet;
24
25  public function __construct($prefixeTable, $filelocation)
26  {
27    parent::__construct($prefixeTable, $filelocation);
28
29    $this->loadConfig();
30    $this->initEvents();
31
32    $this->tabsheet = new tabsheet();
33    $this->tabsheet->add('infos',
34                          l10n('Infos'),
35                          '');
36  }
37
38  public function __destruct()
39  {
40    parent::__destruct();
41  }
42
43  /*
44    initialize events call for the plugin
45  */
46  function initEvents()
47  {
48    add_event_handler('loc_end_page_header', array(&$this->css, 'applyCSS'));
49  }
50
51
52  /* ---------------------------------------------------------------------------
53  Public classe functions
54  --------------------------------------------------------------------------- */
55
56  /*
57    manage plugin integration into piwigo's admin interface
58  */
59  public function manage()
60  {
61    global $template;
62
63    $template->set_filename('plugin_admin_content', dirname(__FILE__)."/admin/gpc_admin.tpl");
64
65    $this->displayStats();
66
67    $this->tabsheet->select('infos');
68    $this->tabsheet->assign();
69    $selected_tab=$this->tabsheet->get_selected();
70    $template->assign($this->tabsheet->get_titlename(), "[".$selected_tab['caption']."]");
71
72    $template_plugin["GPC_VERSION"] = "<i>".$this->getPluginName()."</i> ".l10n('version').GPC_VERSION;
73
74    $template->assign('plugin', $template_plugin);
75    $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
76  }
77
78  /* ---------------------------------------------------------------------------
79  Private classe functions
80  --------------------------------------------------------------------------- */
81
82
83  private function displayStats()
84  {
85    global $template;
86
87    $template->set_filename('body_page', dirname(__FILE__)."/admin/gpc_infos.tpl");
88
89    $template_datas = array();
90
91    $template_datas['modules']=GPCCore::getModulesInfos();
92    $template_datas['plugins']=GPCCore::getRegistered();
93
94    $template->assign('datas', $template_datas);
95    $template->assign_var_from_handle('GPC_BODY_PAGE', 'body_page');
96  }
97
98  /* ---------------------------------------------------------------------------
99   * AJAX functions
100   * ------------------------------------------------------------------------- */
101
102} // GPC_AIP class
103
104
105?>
Note: See TracBrowser for help on using the repository browser.