Skip to content

Commit

Permalink
Remove unused Item::move(). To move an item, just change its parent_i…
Browse files Browse the repository at this point in the history
…d and let

Model_Item and the item_moved event do the dirty work.  The only place I found
that references this function is the defunkt gwtorganize contrib module, so it
seems safe to go.
  • Loading branch information
shadlaws committed Jul 11, 2013
1 parent aa0ce72 commit 5460d64
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions modules/gallery/classes/Gallery/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,38 +18,6 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class Gallery_Item {
static function move($source, $target) {
Access::required("view", $source);
Access::required("view", $target);
Access::required("edit", $source);
Access::required("edit", $target);

$orig_name = $source->name;
$source->parent_id = $target->id;
$source->save();
if ($orig_name != $source->name) {
switch ($source->type) {
case "album":
Message::info(
t("Album <b>%old_name</b> renamed to <b>%new_name</b> to avoid a conflict",
array("old_name" => $orig_name, "new_name" => $source->name)));
break;

case "photo":
Message::info(
t("Photo <b>%old_name</b> renamed to <b>%new_name</b> to avoid a conflict",
array("old_name" => $orig_name, "new_name" => $source->name)));
break;

case "movie":
Message::info(
t("Movie <b>%old_name</b> renamed to <b>%new_name</b> to avoid a conflict",
array("old_name" => $orig_name, "new_name" => $source->name)));
break;
}
}
}

static function make_album_cover($item) {
$parent = $item->parent;
Access::required("view", $item);
Expand Down

0 comments on commit 5460d64

Please sign in to comment.