diff --git a/core/config/routes.php b/core/config/routes.php index 9e36f881..9a802a27 100644 --- a/core/config/routes.php +++ b/core/config/routes.php @@ -19,10 +19,12 @@ */ // The abstract REST_Controller is not directly routable. -$config['^rest\b.*'] = null; +$config["^rest\b.*"] = null; // Redirect /form/add and /form/edit to REST_Controller. -$config['^form/(edit|add)/(\w+)/(.*)$'] = '$2/form_$1/$3'; +$config["^form/(edit|add)/(\w+)/(.*)$"] = "$2/form_$1/$3"; + +$config["^admin/(\w+)/(.*)$"] = "$1_admin/$2"; // For now our default page is the scaffolding. -$config['_default'] = 'welcome'; +$config["_default"] = "welcome"; diff --git a/core/controllers/welcome.php b/core/controllers/welcome.php index dacaa87f..bddca606 100644 --- a/core/controllers/welcome.php +++ b/core/controllers/welcome.php @@ -36,6 +36,11 @@ class Welcome_Controller extends Template_Controller { $this->template->album_tree = $this->_load_album_tree(); $this->template->rearrange_html = new View("rearrange.html"); $this->template->add_photo_html = $this->_get_add_photo_html(); + if (module::is_installed("local_import")) { + $this->template->local_import_html = $this->_get_local_import_html(); + } else { + $this->template->local_import_html = ""; + } } catch (Exception $e) { $this->template->album_count = 0; $this->template->photo_count = 0; @@ -43,6 +48,7 @@ class Welcome_Controller extends Template_Controller { $this->template->album_tree = array(); $this->template->rearrange_html = ""; $this->template->add_photo_html = ""; + $this->template->local_import_html = ""; } $this->_load_user_info(); @@ -513,4 +519,9 @@ class Welcome_Controller extends Template_Controller { $parent = ORM::factory("item", $parent_id); return photo::get_add_form($parent); } + + public function _get_local_import_html($user_name="admin") { + $user = ORM::factory("user")->where("name", $user_name)->find(); + return local_import::get_admin_page($user); + } } diff --git a/core/views/welcome.html.php b/core/views/welcome.html.php index 47d9bd84..c8352592 100644 --- a/core/views/welcome.html.php +++ b/core/views/welcome.html.php @@ -148,11 +148,18 @@ margin-left: -1.5em; list-style-type: none; } + + .gHide { + display: none; + } = html::script("lib/jquery.js") ?> = html::script("lib/jquery.form.js") ?> = html::script("lib/jquery.cookie.js") ?> = html::script("lib/jquery.MultiFile.js") ?> + if (class_exists("local_import_block")): ?> + = local_import_block::head(null) ?> + endif ?> if (class_exists("rearrange_block")): ?> = rearrange_block::head(null) ?> endif ?> @@ -256,6 +263,10 @@ ] tags
= $add_photo_html ?> +