summaryrefslogtreecommitdiff
path: root/modules/server_add
diff options
context:
space:
mode:
Diffstat (limited to 'modules/server_add')
-rw-r--r--modules/server_add/controllers/admin_server_add.php2
-rw-r--r--modules/server_add/controllers/server_add.php11
-rw-r--r--modules/server_add/helpers/server_add.php2
-rw-r--r--modules/server_add/helpers/server_add_event.php2
-rw-r--r--modules/server_add/helpers/server_add_installer.php2
-rw-r--r--modules/server_add/helpers/server_add_theme.php20
-rw-r--r--modules/server_add/models/server_add_entry.php2
7 files changed, 18 insertions, 23 deletions
diff --git a/modules/server_add/controllers/admin_server_add.php b/modules/server_add/controllers/admin_server_add.php
index 2e743c81..90a60c73 100644
--- a/modules/server_add/controllers/admin_server_add.php
+++ b/modules/server_add/controllers/admin_server_add.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
- * Copyright (C) 2000-2010 Bharat Mediratta
+ * Copyright (C) 2000-2011 Bharat Mediratta
*
* 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
diff --git a/modules/server_add/controllers/server_add.php b/modules/server_add/controllers/server_add.php
index 71688605..2afa93a7 100644
--- a/modules/server_add/controllers/server_add.php
+++ b/modules/server_add/controllers/server_add.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
- * Copyright (C) 2000-2010 Bharat Mediratta
+ * Copyright (C) 2000-2011 Bharat Mediratta
*
* 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
@@ -95,7 +95,7 @@ class Server_Add_Controller extends Admin_Controller {
if (server_add::is_valid_path($path)) {
$entry = ORM::factory("server_add_entry");
$entry->path = $path;
- $entry->is_directory = 1;
+ $entry->is_directory = intval(is_dir($path));
$entry->parent_id = null;
$entry->task_id = $task->id;
$entry->save();
@@ -162,14 +162,9 @@ class Server_Add_Controller extends Admin_Controller {
->find();
if ($entry->loaded()) {
- // Ignore the staging directories as directories to be imported.
- if (!empty($paths[$entry->path])) {
- $entry->delete();
- }
-
$child_paths = glob(preg_quote($entry->path) . "/*");
if (!$child_paths) {
- $child_paths = glob("$path/*");
+ $child_paths = glob("{$entry->path}/*");
}
foreach ($child_paths as $child_path) {
if (!is_dir($child_path)) {
diff --git a/modules/server_add/helpers/server_add.php b/modules/server_add/helpers/server_add.php
index 03869f2d..a412cb38 100644
--- a/modules/server_add/helpers/server_add.php
+++ b/modules/server_add/helpers/server_add.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
- * Copyright (C) 2000-2010 Bharat Mediratta
+ * Copyright (C) 2000-2011 Bharat Mediratta
*
* 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
diff --git a/modules/server_add/helpers/server_add_event.php b/modules/server_add/helpers/server_add_event.php
index fd4ade71..c12ac288 100644
--- a/modules/server_add/helpers/server_add_event.php
+++ b/modules/server_add/helpers/server_add_event.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
- * Copyright (C) 2000-2010 Bharat Mediratta
+ * Copyright (C) 2000-2011 Bharat Mediratta
*
* 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
diff --git a/modules/server_add/helpers/server_add_installer.php b/modules/server_add/helpers/server_add_installer.php
index 320e205e..4d8b66cd 100644
--- a/modules/server_add/helpers/server_add_installer.php
+++ b/modules/server_add/helpers/server_add_installer.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
- * Copyright (C) 2000-2010 Bharat Mediratta
+ * Copyright (C) 2000-2011 Bharat Mediratta
*
* 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
diff --git a/modules/server_add/helpers/server_add_theme.php b/modules/server_add/helpers/server_add_theme.php
index 53f78772..50c050a8 100644
--- a/modules/server_add/helpers/server_add_theme.php
+++ b/modules/server_add/helpers/server_add_theme.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
- * Copyright (C) 2000-2010 Bharat Mediratta
+ * Copyright (C) 2000-2011 Bharat Mediratta
*
* 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
@@ -20,24 +20,24 @@
class server_add_theme_Core {
static function head($theme) {
if (identity::active_user()->admin) {
- $theme->css("server_add.css");
- $theme->script("server_add.js");
+ return $theme->css("server_add.css")
+ . $theme->script("server_add.js");
}
}
static function admin_head($theme) {
- $head = array();
+ $buf = "";
if (strpos(Router::$current_uri, "admin/server_add") !== false) {
- $theme->css("server_add.css");
- $theme->css("jquery.autocomplete.css");
+ $buf .= $theme->css("server_add.css")
+ . $theme->css("jquery.autocomplete.css");
$base = url::site("__ARGS__");
$csrf = access::csrf_token();
- $head[] = "<script type=\"text/javascript\"> var base_url = \"$base\"; var csrf = \"$csrf\";</script>";
+ $buf .= "<script type=\"text/javascript\"> var base_url = \"$base\"; var csrf = \"$csrf\";</script>";
- $theme->script("jquery.autocomplete.js");
- $theme->script("admin.js");
+ $buf .= $theme->script("jquery.autocomplete.js")
+ . $theme->script("admin.js");
}
- return implode("\n", $head);
+ return $buf;
}
} \ No newline at end of file
diff --git a/modules/server_add/models/server_add_entry.php b/modules/server_add/models/server_add_entry.php
index dfeb05a2..6e64031a 100644
--- a/modules/server_add/models/server_add_entry.php
+++ b/modules/server_add/models/server_add_entry.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
- * Copyright (C) 2000-2010 Bharat Mediratta
+ * Copyright (C) 2000-2011 Bharat Mediratta
*
* 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