<?php
// +-----------------------------------------------------------------------+
// | Download From Thumbnail plugin for piwigo                             |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2015-2016 ddtddt               http://temmii.com/piwigo/ |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify  |
// | it under the terms of the GNU General Public License as published by  |
// | the Free Software Foundation                                          |
// |                                                                       |
// | This program is distributed in the hope that it will be useful, but   |
// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
// | General Public License for more details.                              |
// |                                                                       |
// | You should have received a copy of the GNU General Public License     |
// | along with this program; if not, write to the Free Software           |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA.                                                                  |
// +-----------------------------------------------------------------------+

defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');

class DownloadFromThumbnail_maintain extends PluginMaintain
{
  private $installed = false;

  function __construct($plugin_id){
    parent::__construct($plugin_id);
  }

  function install($plugin_version, &$errors=array()){
  }

  function activate($plugin_version, &$errors=array()){
	if(!in_array("dft_download", get_enums(HISTORY_TABLE, 'image_type')))
	  {
	  $image_type = "'".implode("','", get_enums(HISTORY_TABLE, 'image_type'))."','dft_download'";
   	  $query = "ALTER TABLE ". HISTORY_TABLE ." CHANGE `image_type` `image_type` ENUM( ".$image_type." ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL";
	  $result = pwg_query($query);
	  }
  }

  function update($old_version, $new_version, &$errors=array()){
  }
  
  function deactivate(){
  }

  function uninstall(){
  }
}
?>
