[10344] | 1 | <?php |
---|
| 2 | /* ----------------------------------------------------------------------------- |
---|
| 3 | Plugin : UserStat |
---|
| 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 | --------------------------------------------------------------------------- */ |
---|
| 13 | include_once('userstat_version.inc.php'); |
---|
| 14 | include_once('userstat_root.class.inc.php'); |
---|
| 15 | |
---|
| 16 | class UserStat_install extends UserStat_root |
---|
| 17 | { |
---|
| 18 | public function __construct($prefixeTable, $filelocation) |
---|
| 19 | { |
---|
| 20 | parent::__construct($prefixeTable, $filelocation); |
---|
| 21 | } |
---|
| 22 | |
---|
| 23 | /** |
---|
| 24 | * function for installation process |
---|
| 25 | * |
---|
| 26 | * @return Bool : true if install process is ok, otherwise false |
---|
| 27 | */ |
---|
| 28 | public function install() |
---|
| 29 | { |
---|
| 30 | $this->initConfig(); |
---|
| 31 | $this->loadConfig(); |
---|
| 32 | $this->config['installed']=USERSTAT_VERSION2; |
---|
| 33 | $this->config['newInstall']='y'; |
---|
| 34 | $this->saveConfig(); |
---|
| 35 | |
---|
| 36 | GPCCore::register($this->getPluginName(), USERSTAT_VERSION, USERSTAT_GPC_NEEDED); |
---|
| 37 | |
---|
| 38 | return(true); |
---|
| 39 | } |
---|
| 40 | |
---|
| 41 | |
---|
| 42 | /** |
---|
| 43 | * function for uninstall process |
---|
| 44 | */ |
---|
| 45 | public function uninstall() |
---|
| 46 | { |
---|
| 47 | $this->deleteConfig(); |
---|
| 48 | GPCCore::unregister($this->getPluginName()); |
---|
| 49 | } |
---|
| 50 | |
---|
| 51 | public function activate() |
---|
| 52 | { |
---|
| 53 | global $template; |
---|
| 54 | |
---|
| 55 | $this->initConfig(); |
---|
| 56 | $this->loadConfig(); |
---|
| 57 | |
---|
| 58 | $this->config['newInstall']='n'; |
---|
[16462] | 59 | $this->config['installed']=USERSTAT_VERSION2; //update the installed release number |
---|
[10344] | 60 | $this->saveConfig(); |
---|
| 61 | |
---|
[16462] | 62 | GPCCore::register($this->getPluginName(), USERSTAT_VERSION, USERSTAT_GPC_NEEDED); |
---|
[10344] | 63 | } |
---|
| 64 | |
---|
| 65 | public function deactivate() |
---|
| 66 | { |
---|
| 67 | } |
---|
| 68 | |
---|
| 69 | } //class |
---|
| 70 | |
---|
| 71 | ?> |
---|