diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-09-23 12:02:35 -0700 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-09-23 12:02:35 -0700 |
commit | b79129e3651a92250b61a501b8c6a1d53bf4928c (patch) | |
tree | 54adc8a3842e738a427494b1f1a4b6b4e7dbaff3 /modules/gallery/helpers/gallery.php | |
parent | d3b55622827adbb9d9ab36a9947b45e0d49aec78 (diff) |
Clone the photo::get_edit_form to the movies helper and use it to generate the movie edit form. Fixes ticket #726.
Diffstat (limited to 'modules/gallery/helpers/gallery.php')
-rw-r--r-- | modules/gallery/helpers/gallery.php | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/modules/gallery/helpers/gallery.php b/modules/gallery/helpers/gallery.php index 80ae65bd..91dd2073 100644 --- a/modules/gallery/helpers/gallery.php +++ b/modules/gallery/helpers/gallery.php @@ -114,19 +114,32 @@ class gallery_Core { } } + switch ($item->type) { + case "album": + $option_text = t("Album options"); + $edit_text = t("Edit album"); + break; + case "movie": + $option_text = t("Movie options"); + $edit_text = t("Edit movie"); + break; + default: + $option_text = t("Photo options"); + $edit_text = t("Edit photo"); + } + $menu->append($options_menu = Menu::factory("submenu") ->id("options_menu") - ->label(t("Photo options"))); + ->label($option_text)); if ($item && ($can_edit || $can_add)) { if ($can_edit) { $options_menu->append(Menu::factory("dialog") ->id("edit_item") - ->label($item->is_album() ? t("Edit album") : t("Edit photo")) + ->label($edit_text) ->url(url::site("form/edit/{$item->type}s/$item->id"))); } if ($item->is_album()) { - $options_menu->label(t("Album options")); if ($can_edit) { $options_menu->append(Menu::factory("dialog") ->id("edit_permissions") |