From d8beb6f5301204cac3b74a827dbbc3082324de6f Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Mon, 9 Nov 2009 13:54:55 -0800 Subject: First cut at replacing swfupload with uploadify. Probably need to review the css and remove extra swfupload selectors. Also changed the dialog so tags can be entered for all the files being uploaded. Probably need to add better start processing so the batch is started before the first image is loaded. Maybe add a module variable so the number of simultaneous uploads can be initiated (currently hard ocded to 10. --- modules/gallery/controllers/simple_uploader.php | 9 + modules/gallery/css/gallery.css | 23 +- modules/gallery/helpers/gallery_theme.php | 1 + modules/gallery/views/simple_uploader.html.php | 287 ++++++------------------ 4 files changed, 96 insertions(+), 224 deletions(-) (limited to 'modules/gallery') diff --git a/modules/gallery/controllers/simple_uploader.php b/modules/gallery/controllers/simple_uploader.php index bc508319..36464e24 100644 --- a/modules/gallery/controllers/simple_uploader.php +++ b/modules/gallery/controllers/simple_uploader.php @@ -66,6 +66,15 @@ class Simple_Uploader_Controller extends Controller { log::success("content", t("Added a photo"), html::anchor("photos/$item->id", t("view photo"))); } + $tags = $this->input->post("tags"); + if (!empty($tags)) { + foreach (split(",", $tags) as $tag_name) { + $tag_name = trim($tag_name); + if ($tag_name) { + $tag = tag::add($item, $tag_name); + } + } + } } catch (Exception $e) { Kohana::log("alert", $e->__toString()); if (file_exists($temp_filename)) { diff --git a/modules/gallery/css/gallery.css b/modules/gallery/css/gallery.css index 3262dee2..077b21bc 100644 --- a/modules/gallery/css/gallery.css +++ b/modules/gallery/css/gallery.css @@ -73,6 +73,7 @@ #g-add-photos button { float: right; margin-bottom: .5em; + margin-left: .5em; } #g-uploadqueue-infobar { @@ -116,6 +117,14 @@ border: 1px solid #beb; } +#g-add-photos p { + margin: 0 +} + +#g-add-photos .g-breadcrumbs li { + padding-top: .5em; +} + /** ******************************************************************* * 2) Admin **********************************************************************/ @@ -129,23 +138,23 @@ } #g-languages-form table { - width: 40%; - margin: 0 3em 1em 0; + width: 40%; + margin: 0 3em 1em 0; } #g-languages-form input { - clear: both; + clear: both; } #g-translations ol { - margin: 0 0 1em 2em; + margin: 0 0 1em 2em; } #g-translations ol li { list-style-type: decimal; - line-height: 150%; + line-height: 150%; } #g-translations .g-button { - padding: .5em; - margin-bottom: 1em; + padding: .5em; + margin-bottom: 1em; } diff --git a/modules/gallery/helpers/gallery_theme.php b/modules/gallery/helpers/gallery_theme.php index ab3e7eb5..0018fd9a 100644 --- a/modules/gallery/helpers/gallery_theme.php +++ b/modules/gallery/helpers/gallery_theme.php @@ -49,6 +49,7 @@ class gallery_theme_Core { $theme->script("l10n_client.js"); } + $theme->css("uploadify/uploadify.css"); return $buf; } diff --git a/modules/gallery/views/simple_uploader.html.php b/modules/gallery/views/simple_uploader.html.php index b9c33d32..014919c3 100644 --- a/modules/gallery/views/simple_uploader.html.php +++ b/modules/gallery/views/simple_uploader.html.php @@ -1,15 +1,62 @@ - - - + + + -
">
html::purify($item->title))) ?> -
-
+
+

    - - parents() as $parent): ?> + parents() as $i => $parent): ?> > title) ?> -
  • title) ?>
+
-
- - - for_html_attr() ?>" onclick="swfu.cancelQueue();"> + +
+ +
-
-
-
+ + +
+
- - -
- - +
+ -- cgit v1.2.3