2009-07-24 02:21:49 +00:00
|
|
|
<?php defined("SYSPATH") or die("No direct script access.");
|
|
|
|
/**
|
|
|
|
* Gallery - a web based photo album viewer and editor
|
2011-01-22 07:12:44 +00:00
|
|
|
* Copyright (C) 2000-2011 Bharat Mediratta
|
2009-07-24 02:21:49 +00:00
|
|
|
*
|
|
|
|
* 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; either version 2 of the License, or (at
|
|
|
|
* your option) any later version.
|
|
|
|
*
|
|
|
|
* 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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
class tagsmap_installer {
|
|
|
|
static function install() {
|
2009-07-25 05:17:24 +00:00
|
|
|
// Create a table to store GPS data in.
|
2009-07-24 02:21:49 +00:00
|
|
|
$db = Database::instance();
|
|
|
|
$db->query("CREATE TABLE IF NOT EXISTS {tags_gpses} (
|
|
|
|
`id` int(9) NOT NULL auto_increment,
|
|
|
|
`tag_id` int(9) NOT NULL,
|
|
|
|
`latitude` varchar(128) NOT NULL,
|
|
|
|
`longitude` varchar(128) NOT NULL,
|
|
|
|
`description` varchar(2048) default NULL,
|
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
KEY(`tag_id`, `id`))
|
2009-09-17 05:15:17 +00:00
|
|
|
DEFAULT CHARSET=utf8;");
|
2009-07-24 02:21:49 +00:00
|
|
|
|
2009-12-24 20:53:35 +00:00
|
|
|
// Set the default to Australia (homage to rWatcher)
|
|
|
|
module::set_var("tagsmap", "googlemap_latitude", -26.11);
|
|
|
|
module::set_var("tagsmap", "googlemap_longitude", 134);
|
|
|
|
module::set_var("tagsmap", "googlemap_zoom", 5);
|
|
|
|
module::set_var("tagsmap", "googlemap_type", "G_NORMAL_MAP");
|
|
|
|
module::set_version("tagsmap", 2);
|
2009-07-24 02:21:49 +00:00
|
|
|
}
|
|
|
|
|
2009-07-25 04:34:05 +00:00
|
|
|
static function deactivate() {
|
|
|
|
site_status::clear("tagsmap_needs_tag");
|
|
|
|
}
|
|
|
|
|
2011-06-07 15:53:49 +00:00
|
|
|
static function can_activate() {
|
|
|
|
$messages = array();
|
|
|
|
if (!module::is_active("tag")) {
|
|
|
|
$messages["warn"][] = t("The TagsMap module requires the Tags module.");
|
|
|
|
}
|
|
|
|
return $messages;
|
|
|
|
}
|
|
|
|
|
2009-07-24 02:21:49 +00:00
|
|
|
static function uninstall() {
|
2009-07-25 05:17:24 +00:00
|
|
|
// Delete the GPS table before uninstalling.
|
2009-07-24 02:21:49 +00:00
|
|
|
$db = Database::instance();
|
|
|
|
$db->query("DROP TABLE IF EXISTS {tags_gpses};");
|
2009-10-14 20:43:19 +00:00
|
|
|
module::delete("tagsmap");
|
2009-07-24 02:21:49 +00:00
|
|
|
}
|
|
|
|
}
|