Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Convert the old organize to the new flex based organize

  • Loading branch information...
commit 67a8ef427798d37a9629c2f3d9672c03520b9987 1 parent 7e9eca7
@talmdal talmdal authored
View
163 modules/organize/controllers/organize.php
@@ -19,159 +19,30 @@
*/
class Organize_Controller extends Controller {
function dialog($album_id) {
+ $input = Input::instance();
+
$album = ORM::factory("item", $album_id);
access::required("view", $album);
access::required("edit", $album);
$v = new View("organize_dialog.html");
$v->album = $album;
- $v->album_tree = self::_expanded_tree(ORM::factory("item", 1), $album);
- $v->micro_thumb_grid = self::_get_micro_thumb_grid($album, 0);
- print $v;
- }
-
- function album($album_id, $offset) {
- $album = ORM::factory("item", $album_id);
- access::required("view", $album);
- access::required("edit", $album);
-
- print json_encode(
- array("grid" => (string)self::_get_micro_thumb_grid($album, $offset),
- "sort_column" => $album->sort_column,
- "sort_order" => $album->sort_order));
- }
-
- function move_to($target_album_id) {
- access::verify_csrf();
-
- $target_album = ORM::factory("item", $target_album_id);
- access::required("view", $target_album);
- access::required("add", $target_album);
-
- $source_album = null;
- foreach (Input::instance()->post("source_ids") as $source_id) {
- $source = ORM::factory("item", $source_id);
- if (empty($source_album)) { // get the source_album
- $source_album = $source->parent();
- }
- if (!$source->contains($target_album)) {
- access::required("edit", $source);
- item::move($source, $target_album);
- }
+ // @todo turn this into an api call.
+ $v->file_filter = json_encode(array("Images" => "*.jpg; *.jpeg; *.gif; *.png",
+ "Movies" => "*.flv; *.mp4"));
+ $v->domain = $input->server("SERVER_NAME");
+ // @todo figure out how to connect this w/o a dependency
+ $v->base_url = url::abs_site("rest") . "/";
+
+ $v->sort_order = json_encode(array("ASC" => (string)t("Ascending"), "DESC" => (string)t("Descending")));
+ $sort_fields = array();
+ foreach (album::get_sort_order_options() as $field => $description) {
+ $sort_fields[$field] = (string)$description;
}
+ $v->sort_fields = json_encode($sort_fields);
- print json_encode(
- array("tree" => (string)self::_expanded_tree(ORM::factory("item", 1), $source_album),
- "grid" => (string)self::_get_micro_thumb_grid($source_album, 0)));
- }
-
- function rearrange($target_id, $before_or_after) {
- access::verify_csrf();
-
- $target = ORM::factory("item", $target_id);
- $album = $target->parent();
- access::required("view", $album);
- access::required("edit", $album);
-
- //if (locales::is_rtl()) { // invert the position if the locale is rtl
- // $before_or_after = $before_or_after == "after" ? "before" : "after";
- //}
-
- $source_ids = Input::instance()->post("source_ids", array());
-
- if ($album->sort_column != "weight") {
- $i = 0;
- foreach ($album->children() as $child) {
- // Do this directly in the database to avoid sending notifications
- db::build()
- ->update("items")
- ->set("weight", ++$i)
- ->where("id", "=", $child->id)
- ->execute();
- }
- $album->sort_column = "weight";
- $album->sort_order = "ASC";
- $album->save();
- $target->reload();
- }
-
- // Find the insertion point
- $target_weight = $target->weight;
- if ($before_or_after == "after") {
- $target_weight++;
- }
-
- // Make a hole
- $count = count($source_ids);
- db::build()
- ->update("items")
- ->set("weight", new Database_Expression("`weight` + $count"))
- ->where("weight", ">=", $target_weight)
- ->where("parent_id", "=", $album->id)
- ->execute();
-
- // Insert source items into the hole
- foreach ($source_ids as $source_id) {
- db::build()
- ->update("items")
- ->set("weight", $target_weight++)
- ->where("id", "=", $source_id)
- ->execute();
- }
-
- module::event("album_rearrange", $album);
-
- print json_encode(
- array("grid" => (string)self::_get_micro_thumb_grid($album, 0),
- "sort_column" => $album->sort_column,
- "sort_order" => $album->sort_order));
- }
-
- public function sort_order($album_id, $col, $dir) {
- access::verify_csrf();
-
- $album = ORM::factory("item", $album_id);
- access::required("view", $album);
- access::required("edit", $album);
-
- $options = album::get_sort_order_options();
- if (!isset($options[$col])) {
- return;
- }
-
- $album->sort_column = $col;
- $album->sort_order = $dir;
- $album->save();
-
- print json_encode(
- array("grid" => (string)self::_get_micro_thumb_grid($album, 0),
- "sort_column" => $album->sort_column,
- "sort_order" => $album->sort_order));
- }
-
- private static function _get_micro_thumb_grid(Item_Model $album, $offset) {
- $v = new View("organize_thumb_grid.html");
- $v->album = $album;
- $v->offset = (int) $offset;
- return $v;
- }
-
- public function tree($album_id) {
- $album = ORM::factory("item", $album_id);
- access::required("view", $album);
-
- print self::_expanded_tree($album);
- }
-
- /**
- * Create an HTML representation of the tree from the root down to the selected album. We only
- * include albums along the descendant hierarchy that includes the selected album, and the
- * immediate child albums.
- */
- private static function _expanded_tree($root, $selected_album=null) {
- $v = new View("organize_tree.html");
- $v->album = $root;
- $v->selected = $selected_album;
- return $v;
+ $user = identity::active_user();
+ $v->api_key = rest::get_access_token($user->id)->access_key;
+ print $v;
}
}
View
156 modules/organize/css/organize.css
@@ -1,156 +0,0 @@
-/*******************************************************************
- * Dialog wide styles
- */
-
-#g-organize {
- margin: 0 !important;
- min-height: auto;
- padding: 0 !important;
- position: relative;
- width: 100%;
-}
-
-#g-organize-content-pane {
- height: 100%;
- margin: 0 !important;
- padding: 0 !important;
- position: absolute;
- width: 100%;
-}
-
-/*******************************************************************
- * Album Tree styles
- */
-
-#g-organize #g-organize-tree-container {
- margin: 0;
- min-height: 100%;
- padding: 0;
- position: relative;
- width: 20%;
-}
-
-#g-organize #g-organize-tree-container h3 {
- margin-bottom: 0.1em;
-}
-
-#g-organize-album-tree {
- overflow: auto;
-}
-
-#g-organize-album-tree ul li {
- padding: 0 0 .2em 1.2em;
- width: 90%;
-}
-
-.rtl #g-organize-album-tree ul li {
- padding: 0 1.2em .2em 0;
- width: 90%;
-}
-
-.g-organize-album span {
- cursor: pointer;
-}
-
-.g-organize-album-text {
- cursor: pointer;
- display: block;
- margin: 2px 0px 1px 2px;
- width: auto;
-}
-
-.rtl .g-organize-album-text {
- cursor: pointer;
- display: block;
- margin: 2px 2px 1px 1px;
- width: auto;
-}
-
-.g-organize-album-text:hover {
- border-width: 1px;
- border-style: dotted;
-}
-
-/*******************************************************************
- * Album panel styles
- */
-
-#g-organize #g-organize-detail {
- margin: 0 !important;
- min-height: 100%;
- padding: 0 !important;
- position: relative;
- width: 80%;
-}
-
-#g-organize #g-organize-detail .g-message-block {
- margin: 0;
-}
-
-#g-organize #g-organize-detail .g-message-block li {
- padding-bottom: .2em;
- padding-top: .2em;
- width: auto;
-}
-
-#g-organize-microthumb-grid {
- border-width: 1px;
- border-style: solid;
- bottom: 1.8em;
- left: 0;
- margin: 0 !important;
- overflow-x: hidden;
- overflow-y: auto;
- padding: .4em !important;
- position: absolute;
- right: 0;
- top: 1.6em;
-}
-.g-organize-microthumb-grid-cell {
- display: block;
- height: 100px;
- margin: 6px;
- padding: .4em 0 !important;
- position: relative;
- text-align: center;
- width: 110px;
-}
-
-.ui-selectable-helper {
- z-index: 2000 !important;
-}
-
-.g-organize-microthumb-grid-cell .ui-icon {
- bottom: 0;
- left: 0;
- position: absolute;
- z-index: 4000;
-}
-
-/****************************************************************
- * Controls styles
- */
-
-#g-organize-controls {
- bottom: 0;
- height: 1.9em;
- left: 0;
- margin: 0 !important;
- padding: .1em .4em;
- position: absolute;
- right: 0;
-}
-
-#g-organize-controls #g-organize-sort-order-text {
- padding: .2em 0 0 0;
-}
-
-
-#g-organize-controls select {
- margin-left: .42em;
- display: inline;
-}
-
-#g-organize-close {
- margin-right: 12px;
-}
View
18 modules/organize/css/organize_theme.css
@@ -1,16 +1,18 @@
/** *******************************************************************
* Organize styles that are theme overrideable
*********************************************************************/
-.g-organize-microthumb-grid-cell.ui-selected {
- background: #DFEFFC !important;
+#g-organize {
+ background-color: #FFFFFF;
+ border: 0px solid #000000;
+ color: #0E2B52;
}
-#g-organize-microthumb-grid,
-#g-organize-drop-target-marker,
-.g-organize-album-text:hover {
- border-color: #79B7E7;
+#g-organize-hover {
+ background-color: #CFDEFF;
+ display: none;
}
-#g-organize-drop-target-marker {
- background-color: #79B7E7;
+#g-organize-active {
+ background-color: #6699CC;
+ display: none;
}
View
6 modules/organize/helpers/organize_theme.php
@@ -21,12 +21,6 @@ class organize_theme {
static function head($theme) {
$item = $theme->item();
if ($item && access::can("edit", $item) && $item->is_album()) {
- // @todo: Defer loading js/css until we're loading the organize dialog as <script> and
- // <link> elements so that we're not forcing them to be downloaded on every page view (which
- // is expensive in terms of browser latency). When we do that, we'll have to figure out an
- // approach that lets us continue to use the Kohana cascading filesystem.
- $theme->script("organize.js");
- $theme->css("organize.css");
$theme->css("organize_theme.css");
}
}
View
317 modules/organize/js/organize.js
@@ -1,317 +0,0 @@
-(function($) {
- $.organize = {
- micro_thumb_draggable: {
- handle: ".ui-selected",
- distance: 10,
- cursorAt: { left: -10, top: -10},
- appendTo: "#g-organize-content-pane",
- helper: function(event, ui) {
- var selected = $(".ui-selected");
- var set = $('<div class="g-drag-helper"></div>')
- .css({
- zIndex: 2000,
- width: 80,
- height: Math.ceil(selected.length / 5) * 16
- });
-
- selected.each(function(i) {
- var row = parseInt(i / 5);
- var j = i - (row * 5);
- var img = $("img", this);
- var o = img.offset();
- var copy = img.clone()
- .css({
- width: img.width(), height: img.height(), display: "block",
- margin: 0, position: 'absolute', outline: '5px solid #fff',
- left: o.left - event.pageX, top: o.top - event.pageY
- })
- .appendTo(set)
- .animate({ width: 10, height: 10, outlineWidth: 1, margin: 1,
- left: (20 * j), top: (row * 20) }, 500);
- });
- return set;
- },
-
- start: function(event, ui) {
- $("#g-organize-microthumb-grid .ui-selected").hide();
- },
-
- drag: function(event, ui) {
- var top = $("#g-organize-microthumb-grid").offset().top;
- var height = $("#g-organize-microthumb-grid").height();
- var scrollTop = $("#g-organize-microthumb-grid").scrollTop();
- if (ui.offset.top > height + top - 20) {
- scrollTop += 100;
- } else if (ui.offset.top < top + 20) {
- scrollTop = Math.max(0, scrollTop - 100);
- }
- $("#g-organize-microthumb-grid").scrollTop(scrollTop);
- }
- },
-
- content_droppable: {
- accept: "*",
- tolerance: "pointer",
- greedy: true,
- drop: function(event, ui) {
- $(".g-mouse-drag-over").removeClass("g-mouse-drag-over");
- var target = $("#g-organize-drop-target-marker").data("drop_position");
- if (target == null) {
- target = {
- position: false,
- id: $(".g-organize-microthumb-grid-cell:visible:last").attr("ref")
- };
- }
- $.organize.do_drop({
- url: rearrange_url
- .replace("__TARGET_ID__", target.id)
- .replace("__BEFORE__", target.position ? "before" : "after"),
- source: $(ui.helper).children("img")
- });
- }
- },
-
- branch_droppable: {
- accept: "*",
- tolerance: "pointer",
- greedy: true,
- drop: function(event, ui) {
- if ($(event.target).hasClass("g-view-only")) {
- $("#g-organize-drop-target-marker").remove();
- $(".ui-selected").show();
- } else {
- $.organize.do_drop({
- url: move_url.replace("__ALBUM_ID__", $(event.target).attr("ref")),
- source: $(ui.helper).children("img")
- });
- }
- }
- },
-
- do_drop: function(options) {
- $("#g-organize-microthumb-grid").selectable("destroy");
- var source_ids = [];
- $(options.source).each(function(i) {
- source_ids.push($(this).attr("ref"));
- });
-
- if (source_ids.length) {
- var loading = $('<div class="g-dialog-loading-large">&nbsp;</div>')
- .css({bottom: 5,
- opacity: .5,
- left: 0,
- position: "absolute",
- right: 0,
- top: 0,
- zIndex: 2000
- });
- $("#g-organize-microthumb-grid").append(loading);
-
- $.post(options.url,
- { "source_ids[]": source_ids },
- function(data) {
- $.organize._refresh(data);
- $(".g-dialog-loading-large").remove();
- },
- "json");
- }
- },
-
- _refresh: function(data) {
- if (data.tree) {
- $("#g-organize-album-tree").html(data.tree);
- }
- if (data.grid) {
- $("#g-organize-microthumb-grid").html(data.grid);
- $("#g-organize-sort-column").attr("value", data.sort_column);
- $("#g-organize-sort-order").attr("value", data.sort_order);
- }
- $.organize.set_handlers();
- },
-
- grid_mouse_leave_handler: function(event) {
- if ($(".g-drag-helper").length && $("#g-organize-drop-target-marker").length) {
- $("#g-organize-drop-target-marker").remove();
- }
- },
-
- grid_mouse_move_handler: function(event) {
- var continue_events = true;
- if ($(".g-drag-helper").length) {
- var organizeData = $("#g-organize").data("organizeData");
- var thumbGrid = $("#g-organize-microthumb-grid");
- var visibleCells = $(".g-organize-microthumb-grid-cell:visible");
- var scrollTop = thumbGrid.scrollTop();
-
- var item = $(".g-mouse-drag-over");
- if (item.length == 0) {
- var itemColumn = Math.floor((event.pageX - thumbGrid.offset().left) / organizeData.width);
- itemColumn = organizeData.rtl ? organizeData.width - itemColumn : itemColumn;
- var itemRow = Math.floor((event.pageY + scrollTop - thumbGrid.offset().top) / organizeData.height);
- var itemIndex = Math.min(itemRow * organizeData.columns + itemColumn, visibleCells.length - 1);
- item = visibleCells.get(itemIndex);
- }
-
- var before = event.pageX < ($(item).offset().left + $(item).width() / 2);
- var left = $(item).position().left + (before ? 0 : organizeData.width) - 3;
- var top = $(item).position().top + 6 + scrollTop;
-
- if ($("#g-organize-drop-target-marker").length) {
- $("#g-organize-drop-target-marker").remove();
- }
-
- var set = $('<div id="g-organize-drop-target-marker"></div>')
- .css({zIndex: 2000,
- width: 2,
- height: 112,
- borderWidth: 1,
- borderStyle: "solid",
- position: "absolute",
- top: top, left: left
- })
- .data("drop_position", {id: $(item).attr("ref"),
- position: organizeData.rtl ? !before : before});
- thumbGrid.append(set);
- if ($.browser.msie) {
- $(".g-drag-helper").offset({top: event.pageY, left: event.PageX});
- event.preventDefault();
- continue_events = false;
- }
- }
- return continue_events;
- },
-
- /**
- * Dynamically initialize the organize dialog when it is displayed
- */
- init: function(data) {
- var self = this;
- // Deal with ui.jquery bug: http://dev.jqueryui.com/ticket/4475 (target 1.8?)
- $(".sf-menu li.sfHover ul").css("z-index", 68);
- $("#g-dialog").dialog("option", "zIndex", 70);
- $("#g-dialog").bind("dialogopen", function(event, ui) {
- var outerHeight = $(".g-organize-microthumb-grid-cell").outerHeight(true);
- var outerWidth = $(".g-organize-microthumb-grid-cell").outerWidth(true);
- var gridInnerWidth = $("#g-organize-microthumb-grid").innerWidth() - 2 * parseFloat($("#g-organize-microthumb-grid").css("paddingLeft"));
- $("#g-organize")
- .height($("#g-dialog").innerHeight() - 20)
- .data("organizeData", {
- rtl: $("body").hasClass("rtl"),
- height: outerHeight,
- width: outerWidth,
- columns: Math.floor(gridInnerWidth / outerWidth)
- });
- });
-
- $("#g-dialog").bind("dialogclose", function(event, ui) {
- window.location.reload();
- });
-
- $("#g-organize-close").click(function(event) {
- $("#g-dialog").dialog("close");
- });
-
- $("#g-organize-sort-column,#g-organize-sort-order").change(function(event) {
- $.organize.resort($("#g-organize-sort-column").attr("value"),
- $("#g-organize-sort-order").attr("value"));
- });
-
- $.organize.set_handlers();
- },
-
- set_handlers: function() {
- $("#g-organize-microthumb-grid")
- .selectable({filter: ".g-organize-microthumb-grid-cell"})
- .mousemove($.organize.grid_mouse_move_handler)
- .mouseleave($.organize.grid_mouse_leave_handler)
- .droppable($.organize.content_droppable);
- $(".g-organize-microthumb-grid-cell")
- // need to manually add this class in case we care calling with additional elements
- .addClass("ui-selectee")
- .mouseleave(function(event) {
- if ($(".g-drag-helper").length) {
- $(this).removeClass("g-mouse-drag-over");
- }
- })
- .mouseenter(function(event) {
- $(".g-mouse-drag-over").removeClass("g-mouse-drag-over");
- if ($(".g-drag-helper").length) {
- $(this).addClass("g-mouse-drag-over");
- }
- })
- .draggable($.organize.micro_thumb_draggable);
- $(".g-organize-album").droppable($.organize.branch_droppable);
- $(".g-organize-album-text").click($.organize.show_album);
- $("#g-organize-album-tree .ui-icon-plus,#g-organize-album-tree .ui-icon-minus").click($.organize.toggle_branch);
- },
-
- toggle_branch: function(event) {
- event.preventDefault();
- var target = $(event.currentTarget);
- var branch = $(target).parent();
- var id = $(event.currentTarget).parent().attr("ref");
-
- if ($(target).hasClass("ui-icon-plus")) {
- // Expanding
- if (!branch.find("ul").length) {
- $.get(tree_url.replace("__ALBUM_ID__", id), { }, function(data) {
- branch.replaceWith(data);
- $.organize.set_handlers();
- });
- } else {
- branch.find("ul:eq(0)").slideDown();
- }
- } else {
- // Contracting
- branch.find("ul:eq(0)").slideUp();
- }
- $(target).toggleClass("ui-icon-plus");
- $(target).toggleClass("ui-icon-minus");
- },
-
- /**
- * When the text of a selection is clicked, then show that albums contents
- */
- show_album: function(event) {
- event.preventDefault();
- if ($(event.currentTarget).hasClass("ui-state-focus")) {
- return;
- }
- var parent = $(event.currentTarget).parents(".g-organize-album");
- if ($(parent).hasClass("g-view-only")) {
- return;
- }
- $("#g-organize-microthumb-grid").selectable("destroy");
- var id = $(event.currentTarget).attr("ref");
- $(".g-organize-album-text.ui-state-focus").removeClass("ui-state-focus");
- $(".g-organize-album-text[ref=" + id + "]").addClass("ui-state-focus");
- var url = $("#g-organize-microthumb-grid").attr("ref").replace("__ITEM_ID__", id).replace("__OFFSET__", 0);
- $.get(url, {},
- function(data) {
- $("#g-organize-microthumb-grid").html(data.grid);
- $("#g-organize-sort-column").attr("value", data.sort_column);
- $("#g-organize-sort-order").attr("value", data.sort_order);
- $.organize.set_handlers();
- },
- "json");
- },
-
- /**
- * Change the sort order.
- */
- resort: function(column, dir) {
- var url = sort_order_url
- .replace("__ALBUM_ID__", $("#g-organize-album-tree .ui-state-focus").attr("ref"))
- .replace("__COL__", column)
- .replace("__DIR__", dir);
- $.get(url, {},
- function(data) {
- $("#g-organize-microthumb-grid").html(data.grid);
- $("#g-organize-sort-column").attr("value", data.sort_column);
- $("#g-organize-sort-order").attr("value", data.sort_order);
- $.organize.set_handlers();
- },
- "json");
- }
- };
-})(jQuery);
View
160 modules/organize/views/organize_dialog.html.php
@@ -1,48 +1,124 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
+<script type="text/javascript" src="<?= url::file("lib/swfobject.js") ?>"></script>
+<script type="text/javascript" src="<?= url::file("modules/organize/lib/history/history.js") ?>"></script>
+<link rel="stylesheet" type="text/css" href="<?= url::file("modules/organize/lib/history/history.css") ?>" />
+<style type="text/css" media="screen">
+ #flashContent {
+ display:none;
+ }
+
+ .g-organize {
+ padding: 0;
+ margins: 0;
+ }
+
+ object {
+ display: block;
+ outline: none;
+ }
+
+ #g-dialog {
+ padding: 0;
+ }
+
+</style>
+
<script type="text/javascript">
- var move_url = "<?= url::site("organize/move_to/__ALBUM_ID__?csrf=$csrf") ?>";
- var rearrange_url = "<?= url::site("organize/rearrange/__TARGET_ID__/__BEFORE__?csrf=$csrf") ?>";
- var sort_order_url = "<?= url::site("organize/sort_order/__ALBUM_ID__/__COL__/__DIR__?csrf=$csrf") ?>";
- var tree_url = "<?= url::site("organize/tree/__ALBUM_ID__") ?>";
+ $("#g-dialog").bind("dialogclose", function(event, ui) {
+ window.location.reload();
+ });
+
+ function closeOrganizeDialog() {
+ $("#g-dialog").dialog("close");
+ }
+
+ function getOrganizeStyles() {
+ var styles = {
+ "color": colorToHex($("#g-organize").css("color")),
+ "backgroundColor": colorToHex($("#g-organize").css("backgroundColor")),
+ "borderColor": colorToHex($("#g-organize").css("borderLeftColor")),
+ "rollOverColor": colorToHex($("#g-organize-hover").css("backgroundColor")),
+ "selectionColor": colorToHex($("#g-organize-active").css("backgroundColor"))
+ };
+ console.dir(styles);
+ return styles;
+ }
+
+ function colorToHex(color) {
+ console.log("color: " + color);
+ var digits = /(.*?)rgb\((\d+), (\d+), (\d+)\)/.exec(color);
+
+ var red = parseInt(digits[2]);
+ var green = parseInt(digits[3]);
+ var blue = parseInt(digits[4]);
+
+ var rgb = blue | (green << 8) | (red << 16);
+ return digits[1] + '0x' + rgb.toString(16);
+ }
+
+ function getTextStrings() {
+ var strings = {
+ "statusText": <?= t("Drag and drop photos to re-order or move between album")->for_js() ?>,
+ "addToolTip": <?= t("Add")->for_js() ?>,
+ "deleteToolTip": <?= t("Delete")->for_js() ?>,
+ "uploadedText": <?= t("Uploaded {0}")->for_js() ?>,
+ "removeFileText": <?= t("Remove")->for_js() ?>,
+ "totalFiles": <?= t("Total Files: {0}")->for_js() ?>,
+ "totalSize": <?= t("Total Size: {0}")->for_js() ?>,
+ "bytes": <?= t("{0} bytes")->for_js() ?>,
+ "kilobytes": <?= t("{0} KB")->for_js() ?>,
+ "megabytes": <?= t("{0} MB")->for_js() ?>,
+ "gigabytes": <?= t("{0} GB")->for_js() ?>,
+ };
+ return strings;
+ }
+
+ /*
+ For version detection, set to min. required Flash Player version, or 0 (or 0.0.0),
+ for no version detection.
+ */
+ var swfVersionStr = "0.0.0";
+ /* To use express install, set to playerProductInstall.swf, otherwise the empty string.*/
+ var xiSwfUrlStr = "modules/organize/lib/playerProductInstall.swf";
+ var flashvars = {
+ selectedAlbum: "<?= $album->id?>",
+ fileFilter: '<?= $file_filter ?>',
+ domains: '["<?= $domain ?>"]',
+ sortOrder: '<?= $sort_order ?>',
+ sortFields: '<?= $sort_fields ?>',
+ baseUrl: '<?= $base_url ?>',
+ apiKey: '<?= $api_key ?>'
+ };
+
+ var size = $.gallery_get_viewport_size();
+
+ var params = {};
+ params.quality = "high";
+ params.bgcolor = "#ffffff";
+ params.allowNetworking = "all";
+ params.allowscriptaccess = "sameDomain";
+ params.allowfullscreen = "true";
+ var attributes = {};
+ attributes.id = "g-organize-object";
+ attributes.name = "organize";
+ attributes.align = "middle";
+ swfobject.embedSWF("<?= url::file("modules/organize/lib/organize.swf") ?>",
+ "flashContent", size.width() - 100, size.height() - 135,
+ swfVersionStr, xiSwfUrlStr, flashvars, params, attributes);
+ /*
+ JavaScript enabled so display the flashContent div in case it is not replaced with a swf object.
+ */
+ swfobject.createCSS("#flashContent", "display:block;text-align:left;");
</script>
+<?
+/*
+ SWFObject's dynamic embed method replaces this alternative HTML content with Flash content when
+ enough JavaScript and Flash plug-in support is available. The div is initially hidden so that
+ it doesn't show when JavaScript is disabled.
+*/
+?>
<div id="g-organize" class="g-dialog-panel">
+ <span id="g-organize-hover" /><span id="g-organize-active" />
<h1 style="display:none"><?= t("Organize %name", array("name" => html::purify($album->title))) ?></h1>
- <div id="g-organize-content-pane">
- <div id="g-organize-tree-container" class="g-left ui-helper-clearfix">
- <h3><?= t("Albums") ?></h3>
- <ul id="g-organize-album-tree">
- <?= $album_tree ?>
- </ul>
- </div>
- <div id="g-organize-detail" class="g-left ui-helper-clearfix">
- <ul id="g-action-status" class="g-message-block">
- <li class="g-info"><?= t("Drag and drop photos to re-order or move between albums") ?></li>
- </ul>
- <div id="g-organize-microthumb-grid" class="ui-widget"
- ref="<?= url::site("organize/album/__ITEM_ID__/__OFFSET__") ?>">
- <?= $micro_thumb_grid ?>
- </div>
- <div id="g-organize-controls" class="ui-widget-header">
- <a id="g-organize-close" href="#" ref="done"
- class="g-button g-right ui-corner-all ui-state-default"><?= t("Close") ?></a>
- <form>
- <ul>
- <li id="g-organize-sort-order-text" class="g-left"><?= t("Sort order") ?></li>
- <li class="g-left">
- <?= form::dropdown(array("id" => "g-organize-sort-column"),
- album::get_sort_order_options(), $album->sort_column) ?>
- </li>
- <li class="g-left">
- <?= form::dropdown(array("id" => "g-organize-sort-order"),
- array("ASC" => t("Ascending"), "DESC" => t("Descending")), $album->sort_order) ?>
- </li>
- </ul>
- </form>
- </div>
- </div>
- </div>
+ <div id="flashContent">&nbsp;</div>
</div>
-
-<script type="text/javascript">
- $("#g-organize").ready($.organize.init);
-</script>
View
22 modules/organize/views/organize_thumb_grid.html.php
@@ -1,22 +0,0 @@
-<?php defined("SYSPATH") or die("No direct script access.") ?>
-<? foreach ($album->children(25, $offset) as $child): ?>
-<div class="g-organize-microthumb-grid-cell g-left ui-state-default ui-state-active <?= $child->is_album() ? "g-album" : "g-photo" ?>"
- ref="<?= $child->id ?>">
- <?= $child->thumb_img(array("class" => "g-thumbnail", "ref" => $child->id), 90, true) ?>
- <span<?= $child->is_album() ? " class=\"ui-icon ui-icon-note\"" : "" ?>></span>
-</div>
-<? endforeach ?>
-
-<? if ($album->children_count() > $offset): ?>
-<script type="text/javascript">
- setTimeout(function() {
- $.get("<?= url::site("organize/album/$album->id/" . ($offset + 25)) ?>",
- {},
- function(data) {
- $("#g-organize-microthumb-grid").append(data.grid);
- $.organize.set_handlers();
- },
- "json");
- }, 50);
-</script>
-<? endif ?>
View
29 modules/organize/views/organize_tree.html.php
@@ -1,29 +0,0 @@
-<?php defined("SYSPATH") or die("No direct script access.") ?>
-<li class="g-organize-album ui-icon-left <?= access::can("edit", $album) ? "" : "g-view-only" ?>"
- ref="<?= $album->id ?>">
- <span class="ui-icon ui-icon-minus g-left">
- </span>
- <span class="g-organize-album-text <?= $selected && $album->id == $selected->id ? "ui-state-focus" : "" ?>"
- ref="<?= $album->id ?>">
- <?= html::clean($album->title) ?>
- </span>
- <? $child_albums = $album->viewable()->children(null, null, array(array("type", "=", "album"))); ?>
- <? if (!empty($child_albums)): ?>
- <ul>
- <? foreach ($child_albums as $child): ?>
- <? if ($selected && $child->contains($selected)): ?>
- <?= View::factory("organize_tree.html", array("selected" => $selected, "album" => $child)); ?>
- <? else: ?>
- <li class="g-organize-album ui-icon-left <?= access::can("edit", $child) ? "" : "g-view-only" ?>"
- ref="<?= $child->id ?>">
- <span class="ui-icon ui-icon-plus g-left"></span>
- <span class="g-organize-album-text <?= $selected && $child->id == $selected->id ? "ui-state-focus" : "" ?>" ref="<?= $child->id ?>">
- <?= html::clean($child->title) ?>
- </span>
- </li>
- <? endif ?>
- <? endforeach ?>
- </ul>
- <? endif ?>
-</li>
-
Please sign in to comment.
Something went wrong with that request. Please try again.