> * * ----------------------------------------------------------------------------- * See main.inc.php for release information * * AIPInstall class => install process page when the plugin is used for the * first time * ----------------------------------------------------------------------------- */ if(!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCTabSheet.class.inc.php'); include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); include_once('estat_root.class.inc.php'); class EStat_AIPInstall extends EStat_root { protected $tabsheet; public function __construct($prefixeTable, $filelocation) { parent::__construct($prefixeTable, $filelocation); $this->loadConfig(); $this->initEvents(); $this->tabsheet = new tabsheet(); if($this->config['plugin.newInstall']=='y') { $this->tabsheet->add('install', l10n('estat_install'), $this->getAdminLink()."-install"); } else { $this->tabsheet->add('update', l10n('estat_update'), $this->getAdminLink()."-update"); } } public function __destruct() { unset($this->tabsheet); parent::__destruct(); } public function loadCSS() { global $template; parent::loadCSS(); GPCCore::addUI('gpcCSS'); GPCCore::addHeaderCSS('estat.css', 'plugins/'.$this->getDirectory().'/'.$this->getPluginNameFiles().".css"); GPCCore::addHeaderCSS('estat.cssT', 'plugins/'.$this->getDirectory().'/'.$this->getPluginNameFiles().'_'.$template->get_themeconf('name').".css"); } /* display administration page */ public function manage() { global $template, $lang; // load JS scripts GPCCore::setTemplateToken(); GPCCore::addUI('inputCheckbox,progressArea'); GPCCore::addHeaderJS('estat.im', ESTAT_PATH.'js/estatIM.js', array('gpc.progressArea')); $template->set_filename('plugin_admin_content', dirname($this->getFileLocation())."/admin/estat_install_page.tpl"); // set tabsheet $this->tabsheet->select('install'); $this->tabsheet->assign(); $selected_tab=$this->tabsheet->get_selected(); $template->assign($this->tabsheet->get_titlename(), "[".$selected_tab['caption']."]"); // load IP country file properties $dbCountry=new StatDBCountry($this->fileStatDir, self::FILE_COUNTRY); $ipFileInfo=$dbCountry->getIpFileInfo(ESTAT_PATH.'data/ipCountry.bin'); // get Piwigo history table properties $piwigoHistory=$this->getPiwigoHistoryInfo(); $periods=array(); foreach($piwigoHistory['periods'] as $period=>$nbEvents) { $year=substr($period, 0, 4); $month=substr($period, 5); $periods[$period]=array( 'label' => $lang['month'][$month*1].' '.$year, 'nbEvents' => $nbEvents ); } // set template var $pluginInfo=array( 'ESTAT_VERSION' => "".$this->getPluginName()." ".l10n('estat_release').ESTAT_VERSION, 'ESTAT_PAGE' => 'install', 'PATH' => ESTAT_PATH, 'urlRequest' => $this->getAdminLink('ajax'), 'importLog' => ($this->config['plugin.newInstall']=='y')?true:false, 'ipNbRecords' => $ipFileInfo['nbRecords'], 'l10n_piwigoHistory' => sprintf(l10n('estat_piwigo_history_size'), $piwigoHistory['nbLogs'], $piwigoHistory['dateMin'], $piwigoHistory['dateMax']), 'piwigoHistoryPeriods' => $periods, 'l10n_logImportInProgress' => str_replace('%s', '', l10n('estat_log_import_period')) ); $template->assign('plugin', $pluginInfo); $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); } } //class ?>