summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/controllers/quick.php23
-rw-r--r--core/helpers/core_theme.php4
-rw-r--r--core/js/quick.js2
-rw-r--r--core/views/quick_pane.html.php23
4 files changed, 34 insertions, 18 deletions
diff --git a/core/controllers/quick.php b/core/controllers/quick.php
index 1b6e2bf8..d62f3af0 100644
--- a/core/controllers/quick.php
+++ b/core/controllers/quick.php
@@ -26,6 +26,7 @@ class Quick_Controller extends Controller {
$view = new View("quick_pane.html");
$view->item = $item;
+ $view->page_type = Input::instance()->get("page_type");
print $view;
}
@@ -66,10 +67,17 @@ class Quick_Controller extends Controller {
}
}
- print json_encode(
- array("src" => $item->thumb_url() . "?rnd=" . rand(),
- "width" => $item->thumb_width,
- "height" => $item->thumb_height));
+ if (Input::instance()->get("page_type") == "album") {
+ print json_encode(
+ array("src" => $item->thumb_url() . "?rnd=" . rand(),
+ "width" => $item->thumb_width,
+ "height" => $item->thumb_height));
+ } else {
+ print json_encode(
+ array("src" => $item->resize_url() . "?rnd=" . rand(),
+ "width" => $item->resize_width,
+ "height" => $item->resize_height));
+ }
}
public function make_album_cover($id) {
@@ -116,7 +124,12 @@ class Quick_Controller extends Controller {
$item->delete();
message::success($msg);
- print json_encode(array("result" => "success", "reload" => 1));
+ if (Input::instance()->get("page_type") == "album") {
+ print json_encode(array("result" => "success", "reload" => 1));
+ } else {
+ print json_encode(array("result" => "success",
+ "location" => url::site("albums/$parent->id")));
+ }
}
public function form_edit($id) {
diff --git a/core/helpers/core_theme.php b/core/helpers/core_theme.php
index 03018d48..9eb56f0e 100644
--- a/core/helpers/core_theme.php
+++ b/core/helpers/core_theme.php
@@ -54,7 +54,7 @@ class core_theme_Core {
static function resize_top($theme, $item) {
if (access::can("edit", $item)) {
- $edit_link = url::site("quick/pane/$item->id");
+ $edit_link = url::site("quick/pane/$item->id?page_type=photo");
return "<div class=\"gQuick\" href=\"$edit_link\">";
}
}
@@ -67,7 +67,7 @@ class core_theme_Core {
static function thumb_top($theme, $child) {
if (access::can("edit", $child)) {
- $edit_link = url::site("quick/pane/$child->id");
+ $edit_link = url::site("quick/pane/$child->id?page_type=album");
return "<div class=\"gQuick\" href=\"$edit_link\">";
}
}
diff --git a/core/js/quick.js b/core/js/quick.js
index 15297c03..984d3ae5 100644
--- a/core/js/quick.js
+++ b/core/js/quick.js
@@ -13,7 +13,7 @@ var show_quick = function() {
var quick = $(this).find(".gQuick");
$("#gQuickPane").remove();
cont.append("<div id=\"gQuickPane\"></div>");
- var img = cont.find(".gThumbnail");
+ var img = cont.find(".gThumbnail,.gResize");
var pos = cont.position();
$("#gQuickPane").css({
"position": "absolute",
diff --git a/core/views/quick_pane.html.php b/core/views/quick_pane.html.php
index 9bdff325..1dba206f 100644
--- a/core/views/quick_pane.html.php
+++ b/core/views/quick_pane.html.php
@@ -1,27 +1,27 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<? if ($item->type == "photo" || $item->type == "resize"): ?>
+<? if ($item->type == "photo"): ?>
<? $title = t("Edit this photo") ?>
<? elseif ($item->type == "movie"): ?>
<? $title = t("Edit this movie") ?>
<? elseif ($item->type == "album"): ?>
<? $title = t("Edit this album") ?>
<? endif ?>
-<a class="gDialogLink gButtonLink ui-corner-all ui-state-default" href="<?= url::site("quick/form_edit/$item->id") ?>"
+<a class="gDialogLink gButtonLink ui-corner-all ui-state-default" href="<?= url::site("quick/form_edit/$item->id?page_type=$page_type") ?>"
title="<?= $title ?>">
<span class="ui-icon ui-icon-pencil">
<?= $title ?>
</span>
</a>
-<? if (($item->is_photo() || $item->type == "resize") && graphics::can("rotate")): ?>
-<a class="gButtonLink ui-corner-all ui-state-default" href="<?= url::site("quick/rotate/$item->id/ccw?csrf=$csrf") ?>"
+<? if ($item->is_photo() && graphics::can("rotate")): ?>
+<a class="gButtonLink ui-corner-all ui-state-default" href="<?= url::site("quick/rotate/$item->id/ccw?csrf=$csrf&page_type=$page_type") ?>"
title="<?= t("Rotate 90 degrees counter clockwise") ?>">
<span class="ui-icon ui-icon-rotate-ccw">
<?= t("Rotate 90 degrees counter clockwise") ?>
</span>
</a>
-<a class="gButtonLink ui-corner-all ui-state-default" href="<?= url::site("quick/rotate/$item->id/cw?csrf=$csrf") ?>"
+<a class="gButtonLink ui-corner-all ui-state-default" href="<?= url::site("quick/rotate/$item->id/cw?csrf=$csrf&page_type=$page_type") ?>"
title="<?= t("Rotate 90 degrees clockwise") ?>">
<span class="ui-icon ui-icon-rotate-cw">
<?= t("Rotate 90 degrees clockwise") ?>
@@ -29,7 +29,9 @@
</a>
<? endif ?>
-<? if ($item->type == "photo" || $item->type == "resize"): ?>
+<? // Don't move photos from the photo page; we don't yet have a good way of redirecting after move ?>
+<? if ($page_type == "album"): ?>
+<? if ($item->type == "photo"): ?>
<? $title = t("Move this photo to another album") ?>
<? elseif ($item->type == "movie"): ?>
<? $title = t("Move this movie to another album") ?>
@@ -42,30 +44,31 @@
<?= $title ?>
</span>
</a>
+<? endif ?>
<? if (access::can("edit", $item->parent())): ?>
-<? if ($item->type == "photo" || $item->type == "resize"): ?>
+<? if ($item->type == "photo"): ?>
<? $title = t("Choose this photo as the album cover") ?>
<? elseif ($item->type == "movie"): ?>
<? $title = t("Choose this movie as the album cover") ?>
<? elseif ($item->type == "album"): ?>
<? $title = t("Choose this album as the album cover") ?>
<? endif ?>
-<a class="gButtonLink ui-corner-all ui-state-default" href="<?= url::site("quick/make_album_cover/$item->id?csrf=$csrf") ?>"
+<a class="gButtonLink ui-corner-all ui-state-default" href="<?= url::site("quick/make_album_cover/$item->id?csrf=$csrf&page_type=$page_type") ?>"
title="<?= $title ?>">
<span class="ui-icon ui-icon-star">
<?= $title ?>
</span>
</a>
-<? if ($item->type == "photo" || $item->type == "resize"): ?>
+<? if ($item->type == "photo"): ?>
<? $title = t("Delete this photo") ?>
<? elseif ($item->type == "movie"): ?>
<? $title = t("Delete this movie") ?>
<? elseif ($item->type == "album"): ?>
<? $title = t("Delete this album") ?>
<? endif ?>
-<a class="gButtonLink ui-corner-all ui-state-default" href="<?= url::site("quick/delete/$item->id?csrf=$csrf") ?>"
+<a class="gButtonLink ui-corner-all ui-state-default" href="<?= url::site("quick/delete/$item->id?csrf=$csrf&page_type=$page_type") ?>"
title="<?= $title ?>">
<span class="ui-icon ui-icon-trash">
<?= $title ?>