From a9e3692027dc767b340242ed18fe7184cbfd883d Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 21 May 2009 01:31:29 +0000 Subject: 1) This provides the editting functionality for albums and photos in the organize feature. 2) Remove the tag functionality at this point 3) Added a callback to handle validating conflicting names (only used by organize at this point. 4) Closes #231 --- core/helpers/core_organize.php | 63 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 core/helpers/core_organize.php (limited to 'core/helpers/core_organize.php') diff --git a/core/helpers/core_organize.php b/core/helpers/core_organize.php new file mode 100644 index 00000000..6ccc0197 --- /dev/null +++ b/core/helpers/core_organize.php @@ -0,0 +1,63 @@ + "gEditGeneral", "ref" => "general")); + // In this case we know there is only 1 item, but in general we should loop + // and create multiple hidden items. + $generalPane->hidden("item[]")->value($item->id); + $generalPane->input("title")->label(t("Title"))->value($item->title); + $generalPane->textarea("description")->label(t("Description"))->value($item->description); + $generalPane->input("dirname")->label(t("Path Name"))->value($item->name) + ->callback("item::validate_no_slashes") + ->error_messages("no_slashes", t("The directory name can't contain a \"/\"")) + ->callback("item::validate_no_trailing_period") + ->error_messages("no_trailing_period", t("The directory name can't end in \".\"")) + ->callback("item::validate_no_name_conflict") + ->error_messages("conflict", t("The path name is not unique")); + + return $generalPane; + } + + static function getSortEditForm($item) { + $sortPane = new Forge("core_organize/__FUNCTION__", "", "post", + array("id" => "gEditSort", "ref" => "sort")); + $sortPane->hidden("item[]")->value($item->id); + $sortPane->dropdown("column", array("id" => "gAlbumSortColumn")) + ->label(t("Sort by")) + ->options(array("weight" => t("Default"), + "captured" => t("Capture Date"), + "created" => t("Creation Date"), + "title" => t("Title"), + "updated" => t("Updated Date"), + "view_count" => t("Number of views"), + "rand_key" => t("Random"))) + ->selected($item->sort_column); + $sortPane->dropdown("direction", array("id" => "gAlbumSortDirection")) + ->label(t("Order")) + ->options(array("ASC" => t("Ascending"), + "DESC" => t("Descending"))) + ->selected($item->sort_order); + + return $sortPane; + } +} -- cgit v1.2.3