source: extensions/EStat/estat_aip.class.inc.php @ 17737

Last change on this file since 17737 was 17737, checked in by grum, 12 years ago

First commit for EStat files

  • Property svn:executable set to *
File size: 4.1 KB
Line 
1<?php
2/* -----------------------------------------------------------------------------
3  Plugin     : EStat
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  EStat_AIP : classe to manage plugin admin pages
13
14  --------------------------------------------------------------------------- */
15
16include_once('estat_root.class.inc.php');
17include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCTabSheet.class.inc.php');
18include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
19
20// need to load GPC language file for filterBox object translations
21load_language('plugin.lang', GPC_PATH);
22
23class EStat_AIP extends EStat_root
24{
25  protected $tabsheet;
26
27  public function __construct($prefixeTable, $filelocation)
28  {
29    parent::__construct($prefixeTable, $filelocation);
30
31    $this->loadConfig();
32
33    $this->initEvents();
34  }
35
36  public function __destruct()
37  {
38    unset($this->tabsheet);
39    parent::__destruct();
40  }
41
42  /**
43   * initialize events call for the plugin
44   */
45  public function initEvents()
46  {
47    parent::initEvents();
48  }
49
50  public function loadCSS()
51  {
52    global $template;
53
54    parent::loadCSS();
55    GPCCore::addUI('gpcCSS');
56    GPCCore::addHeaderCSS('estat.css', 'plugins/'.$this->getDirectory().'/'.$this->getPluginNameFiles().".css");
57    GPCCore::addHeaderCSS('estat.cssT', 'plugins/'.$this->getDirectory().'/'.$this->getPluginNameFiles().'_'.$template->get_themeconf('name').".css");
58  }
59
60  /**
61   * display the administration page
62   */
63  public function manage()
64  {
65    global $template;
66
67    GPCCore::addUI('categorySelector,inputList,dynamicTable,canvasDraw.graph,inputPath,inputTreeList,inputExportBox,download');
68    GPCCore::addHeaderJS('estat.PM', ESTAT_PATH.'js/estatPM.js', array('jquery'));
69    GPCCore::addHeaderJS('estat.IM', ESTAT_PATH.'js/estatIM.js', array('jquery'));
70
71    $template->set_filename('plugin_admin_content', dirname(__FILE__)."/admin/estat_admin.tpl");
72
73    $estatTabsheet = new GPCTabSheet('estatTabsheet', 'ESTAT_MAIN_TABSHEET', 'tabsheet gcBorder', 'eTab');
74/*
75    $estatTabsheet->add('synthesis',
76                        l10n('estat_synthesis'),
77                        '', true, "$.EStatManagePages('changePage', 'Synthesis');");
78*/
79    $estatTabsheet->add('stats_by_period',
80                        l10n('estat_by_period'),
81                        '', true, "$.EStatManagePages('changePage', 'Stats_by_period')");
82    $estatTabsheet->add('stats_by_category',
83                        l10n('estat_by_category'),
84                        '', false, "$.EStatManagePages('changePage', 'Stats_by_category')");
85    $estatTabsheet->add('stats_by_image',
86                        l10n('estat_by_image'),
87                        '', false, "$.EStatManagePages('changePage', 'Stats_by_image')");
88    $estatTabsheet->add('stats_by_ip',
89                        l10n('estat_by_ip'),
90                        '', false, "$.EStatManagePages('changePage', 'Stats_by_ip')");
91    $estatTabsheet->add('logs',
92                        l10n('estat_history'),
93                        '', false, "$.EStatManagePages('changePage', 'History')");
94/*
95    $estatTabsheet->add('config',
96                        l10n('estat_config'),
97                        '', false, "$.EStatManagePages('changePage', 'Config')");
98    $estatTabsheet->add('tools',
99                        l10n('estat_tools'),
100                        '', false, "$.EStatManagePages('changePage', 'Tools')");
101*/
102    $estatTabsheet->assign();
103
104    $template_plugin=Array(
105      'ESTAT_VERSION' => "<i>".$this->getPluginName()."</i> ".l10n('estat_release').ESTAT_VERSION,
106      'ESTAT_TITLE' => "",
107      'urlRequest' => $this->getAdminLink('ajax'),
108      'urlRequestExport' => $this->getAdminLink('ajaxExport'),
109      'token' => get_pwg_token()
110    );
111
112
113    $template->assign('plugin', $template_plugin);
114
115    $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
116
117
118    $this->checkBuildStatPeriod(true);
119  }
120
121} //class
122
123
124?>
Note: See TracBrowser for help on using the repository browser.