summaryrefslogtreecommitdiff
path: root/modules/g2_import/helpers
diff options
context:
space:
mode:
authorChad Kieffer <ckieffer@gmail.com>2009-06-23 23:56:05 -0600
committerChad Kieffer <ckieffer@gmail.com>2009-06-23 23:56:05 -0600
commitc37fc39152ceeb5f4d51f9b297b313847bb445e5 (patch)
treeb27850ad7eff09217f4a9a34379ff3780cd1a19e /modules/g2_import/helpers
parent200e17c884df8c2a265fab828be2ef869e580e35 (diff)
parentf9dbd4eb2feede5381d481f473bf7f0a77b49e4a (diff)
Merge branch 'master' of git@github.com:gallery/gallery3
Diffstat (limited to 'modules/g2_import/helpers')
-rw-r--r--modules/g2_import/helpers/g2_import.php2
-rw-r--r--modules/g2_import/helpers/g2_import_installer.php21
-rw-r--r--modules/g2_import/helpers/g2_import_task.php8
3 files changed, 17 insertions, 14 deletions
diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php
index 2eee564a..91ca1e63 100644
--- a/modules/g2_import/helpers/g2_import.php
+++ b/modules/g2_import/helpers/g2_import.php
@@ -113,11 +113,13 @@ class g2_import_Core {
"require_once(dirname(__FILE__) . '/modules/core/classes/GalleryDataCache.class');",
"define('GALLERY_CONFIG_DIR', dirname(__FILE__));",
"\$gallery =& new Gallery();",
+ "\$GLOBALS['gallery'] =& new Gallery();",
"\$gallery = new Gallery();"),
array("require_once(dirname(__FILE__) . '/Gallery.class');",
"require_once('$base_dir/modules/core/classes/GalleryDataCache.class');",
"define('GALLERY_CONFIG_DIR', '$config_dir');",
"\$gallery =& new G2_Gallery();",
+ "\$GLOBALS['gallery'] =& new G2_Gallery();",
"\$gallery = new G2_Gallery();"),
array_merge(array("<?php defined(\"SYSPATH\") or die(\"No direct script access.\") ?>\n"),
file("$base_dir/bootstrap.inc"))));
diff --git a/modules/g2_import/helpers/g2_import_installer.php b/modules/g2_import/helpers/g2_import_installer.php
index 5f414d42..0f87da6c 100644
--- a/modules/g2_import/helpers/g2_import_installer.php
+++ b/modules/g2_import/helpers/g2_import_installer.php
@@ -20,19 +20,16 @@
class g2_import_installer {
static function install() {
$db = Database::instance();
- $version = module::get_version("g2_import");
- if ($version == 0) {
- $db->query("CREATE TABLE IF NOT EXISTS {g2_maps} (
- `id` int(9) NOT NULL auto_increment,
- `g2_id` int(9) NOT NULL,
- `g3_id` int(9) NOT NULL,
- PRIMARY KEY (`id`),
- KEY (`g2_id`))
- ENGINE=InnoDB DEFAULT CHARSET=utf8;");
+ $db->query("CREATE TABLE IF NOT EXISTS {g2_maps} (
+ `id` int(9) NOT NULL auto_increment,
+ `g2_id` int(9) NOT NULL,
+ `g3_id` int(9) NOT NULL,
+ PRIMARY KEY (`id`),
+ KEY (`g2_id`))
+ ENGINE=InnoDB DEFAULT CHARSET=utf8;");
- module::set_version("g2_import", 1);
- mkdir(VARPATH . "modules/g2_import");
- }
+ module::set_version("g2_import", 1);
+ mkdir(VARPATH . "modules/g2_import");
}
static function uninstall() {
diff --git a/modules/g2_import/helpers/g2_import_task.php b/modules/g2_import/helpers/g2_import_task.php
index 4cd95581..3961097d 100644
--- a/modules/g2_import/helpers/g2_import_task.php
+++ b/modules/g2_import/helpers/g2_import_task.php
@@ -21,15 +21,19 @@ class g2_import_task_Core {
static function available_tasks() {
if (g2_import::is_configured()) {
g2_import::init();
+ }
+
+
+ if (class_exists("GalleryCoreApi")) {
return array(Task_Definition::factory()
->callback("g2_import_task::import")
->name(t("Import from Gallery 2"))
->description(
t("Gallery %version detected", array("version" => g2_import::version())))
->severity(log::SUCCESS));
- } else {
- return array();
}
+
+ return array();
}
static function import($task) {