summaryrefslogtreecommitdiff
path: root/modules/organize
diff options
context:
space:
mode:
Diffstat (limited to 'modules/organize')
-rw-r--r--modules/organize/controllers/organize.php6
-rw-r--r--modules/organize/js/organize.js2
-rw-r--r--modules/organize/views/organize_tree.html.php11
3 files changed, 11 insertions, 8 deletions
diff --git a/modules/organize/controllers/organize.php b/modules/organize/controllers/organize.php
index 9d9da65e..c92d711f 100644
--- a/modules/organize/controllers/organize.php
+++ b/modules/organize/controllers/organize.php
@@ -127,7 +127,7 @@ class Organize_Controller extends Controller {
"sort_order" => $album->sort_order));
}
- function sort_order($album_id, $col, $dir) {
+ public function sort_order($album_id, $col, $dir) {
access::verify_csrf();
$album = ORM::factory("item", $album_id);
@@ -149,10 +149,10 @@ class Organize_Controller extends Controller {
"sort_order" => $album->sort_order));
}
- private static function _get_micro_thumb_grid($album, $offset) {
+ private static function _get_micro_thumb_grid(Item_Model $album, $offset) {
$v = new View("organize_thumb_grid.html");
$v->album = $album;
- $v->offset = $offset;
+ $v->offset = (int) $offset;
return $v;
}
diff --git a/modules/organize/js/organize.js b/modules/organize/js/organize.js
index 5b90f402..5a483caf 100644
--- a/modules/organize/js/organize.js
+++ b/modules/organize/js/organize.js
@@ -270,7 +270,7 @@
if ($(event.currentTarget).hasClass("ui-state-focus")) {
return;
}
- var parent = $(event.currentTarget).parents(".g-organize-branch");
+ var parent = $(event.currentTarget).parents(".g-organize-album");
if ($(parent).hasClass("g-view-only")) {
return;
}
diff --git a/modules/organize/views/organize_tree.html.php b/modules/organize/views/organize_tree.html.php
index 33d7b4c9..044b6858 100644
--- a/modules/organize/views/organize_tree.html.php
+++ b/modules/organize/views/organize_tree.html.php
@@ -3,24 +3,27 @@
ref="<?= $album->id ?>">
<span class="ui-icon ui-icon-minus g-left">
</span>
- <span class="g-organize-album-text g-left <?= $selected && $album->id == $selected->id ? "ui-state-focus" : "" ?>"
+ <span class="g-organize-album-text <?= $selected && $album->id == $selected->id ? "ui-state-focus" : "" ?>"
ref="<?= $album->id ?>">
<?= html::clean($album->title) ?>
</span>
- <ul class="g-left">
- <? foreach ($album->children(null, null, array(array("type", "=", "album"))) as $child): ?>
+ <? $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 g-left <?= $selected && $child->id == $selected->id ? "ui-state-focus" : "" ?>" ref="<?= $child->id ?>">
+ <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>