From d316a1c45f67d371c24f82790109165123625863 Mon Sep 17 00:00:00 2001 From: rWatcher Date: Sun, 10 Jan 2010 14:43:14 -0500 Subject: [PATCH 01/15] Fixed weird access::verify_csrf() issue with TagFaces. --- modules/tagfaces/controllers/tagfaces.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/modules/tagfaces/controllers/tagfaces.php b/modules/tagfaces/controllers/tagfaces.php index 26f1284e..8ad0bfeb 100644 --- a/modules/tagfaces/controllers/tagfaces.php +++ b/modules/tagfaces/controllers/tagfaces.php @@ -20,7 +20,6 @@ class tagfaces_Controller extends Controller { public function drawfaces($id) { // Generate the page that allows the user to draw boxes over a photo. - // Make sure user has access to view and edit the photo. $item = ORM::factory("item", $id); access::required("view", $item); @@ -89,7 +88,7 @@ class tagfaces_Controller extends Controller { $str_y1 = Input::instance()->post("y1"); $str_x2 = Input::instance()->post("x2"); $str_y2 = Input::instance()->post("y2"); - + // If the user didn't select a face, display an error and abort. if (($str_x1 == "") || ($str_x2 == "") || ($str_y1 == "") || ($str_y2 == "")) { message::error(t("Please select a face.")); @@ -180,19 +179,22 @@ class tagfaces_Controller extends Controller { $tags_group->dropdown('tagsList') ->label(t("Select a tag:")) + ->id('tagsList') ->options($array_tags); $tags_group->input("face_title") + ->id('face_title') ->label(t("Title")); $tags_description = $form->group("TagsDescription") ->label(t("Description (optional):")); - $tags_description->input("face_description"); + $tags_description->input("face_description") + ->id('face_description'); // Generate input boxes to hold the coordinates of the face. $coordinates_group = $form->group("FaceCoordinates") ->label(t("Coordinates:")); - $coordinates_group->input("x1") + $coordinates_group->input('x1') ->id('x1') ->label(t("X1")); $coordinates_group->input("y1") @@ -206,7 +208,7 @@ class tagfaces_Controller extends Controller { ->label(t("Y2")); // Add the id# of the photo and a save button to the form. - $form->hidden("item_id")->value($id); + $coordinates_group->hidden("item_id")->value($id); $form->submit("SaveFace")->value(t("Save face")); // Return the newly generated form. @@ -216,7 +218,6 @@ class tagfaces_Controller extends Controller { private function _get_delfaces_form($id) { // Generate a form to allow the user to remove face data // from a photo. - // Make a new Form. $form = new Forge("tagfaces/delface", "", "post", array("id" => "g-tag-del-faces-form")); @@ -238,13 +239,14 @@ class tagfaces_Controller extends Controller { // Add a checklist to the form. $tags_group = $form->group("ExistingFaces") ->label(t("Tags with faces:")); + // Add the id# of the photo and a delete button to the form. + $tags_group->hidden("item_id")->value($id); + $tags_group->checklist("facesList") ->options($array_faces) ->label(t("Select the tag(s) that correspond(s) to the face(s) you wish to delete:")); } - // Add the id# of the photo and a delete button to the form. - $form->hidden("item_id")->value($id); $form->submit("DeleteFace")->value(t("Delete face(s)")); // Return the newly generated form. From 20328ef8a5d0bbea699e7f545f19be91d090e253 Mon Sep 17 00:00:00 2001 From: rWatcher Date: Mon, 11 Jan 2010 02:26:03 -0500 Subject: [PATCH 02/15] Fix highlight box alignment bug with current git. --- modules/tagfaces/views/drawfaces_highlight_block.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tagfaces/views/drawfaces_highlight_block.html.php b/modules/tagfaces/views/drawfaces_highlight_block.html.php index 26321461..efd9c7c4 100644 --- a/modules/tagfaces/views/drawfaces_highlight_block.html.php +++ b/modules/tagfaces/views/drawfaces_highlight_block.html.php @@ -42,7 +42,7 @@ divface.style.display = 'block'; divface.style.left = (photoimg.offsetLeft + x1) + 'px'; - divface.style.top = (photodiv.offsetTop + y1) + 'px'; + divface.style.top = (photodiv.offsetTop + 24 + y1) + 'px'; divface.style.width=(x2-x1) + 'px'; divface.style.height=(y2-y1) + 'px'; if (str_url == '') { From 744a6b6cc76f89d43efa15bb6d653ca302865ab2 Mon Sep 17 00:00:00 2001 From: rWatcher Date: Mon, 11 Jan 2010 16:03:05 -0500 Subject: [PATCH 03/15] Added option for deleting notes from a photo. --- modules/tagfaces/controllers/tagfaces.php | 57 ++++++++++++++++++++--- modules/tagfaces/views/drawfaces.html.php | 3 +- 2 files changed, 51 insertions(+), 9 deletions(-) diff --git a/modules/tagfaces/controllers/tagfaces.php b/modules/tagfaces/controllers/tagfaces.php index 8ad0bfeb..be41773f 100644 --- a/modules/tagfaces/controllers/tagfaces.php +++ b/modules/tagfaces/controllers/tagfaces.php @@ -47,12 +47,15 @@ class tagfaces_Controller extends Controller { access::verify_csrf(); // Convert submitted data to local variables. + // Figure out which tagged faces and notes to delete. $tag_data = Input::instance()->post("facesList"); + $note_data = Input::instance()->post("notesList"); + // Figure out the item id, in order to reload the correct face tagging page. $item_data = Input::instance()->post("item_id"); // If the user didn't select a tag, display and error and abort. - if (count($tag_data) == 0) { - message::error(t("Please select a tag.")); + if ((count($tag_data) == 0) && (count($note_data) == 0)) { + message::error(t("Please select a tag or note to delete.")); url::redirect("tagfaces/drawfaces/$item_data"); return; } @@ -64,12 +67,28 @@ class tagfaces_Controller extends Controller { ->delete_all(); } - // Display a success message. + // Delete the notes(s) from the database. + foreach ($note_data as $one_note) { + ORM::factory("items_note") + ->where("id", "=", $one_note) + ->delete_all(); + } + + // Display a success message for deleted faces. if (count($tag_data) == 1) { message::success(t("One face deleted.")); - } else { + } elseif (count($tag_data) > 1) { message::success(count($tag_data) . t(" faces deleted.")); } + + // Display a success message for deleted notes. + if (count($note_data) == 1) { + message::success(t("One note deleted.")); + } elseif (count($note_data) > 1) { + message::success(count($note_data) . t(" notes deleted.")); + } + + // Re-load the face tagging page. url::redirect("tagfaces/drawfaces/$item_data"); } @@ -178,13 +197,13 @@ class tagfaces_Controller extends Controller { ->label(t("Select a tag or enter in a title:")); $tags_group->dropdown('tagsList') - ->label(t("Select a tag:")) + ->label(t("Tag:")) ->id('tagsList') ->options($array_tags); $tags_group->input("face_title") ->id('face_title') - ->label(t("Title")); + ->label(t("Note Title:")); $tags_description = $form->group("TagsDescription") ->label(t("Description (optional):")); @@ -247,7 +266,31 @@ class tagfaces_Controller extends Controller { ->label(t("Select the tag(s) that correspond(s) to the face(s) you wish to delete:")); } - $form->submit("DeleteFace")->value(t("Delete face(s)")); + // Create an array of all the notes associated with this photo. + $existing_notes = ORM::factory("items_note") + ->where("item_id", "=", $id) + ->find_all(); + + // turn the $existing_notes array into an array that can be used + // for a checklist. + $array_notes = ""; + foreach ($existing_notes as $oneNote) { + $array_notes[$oneNote->id] = array($oneNote->title, false); + } + + if ($array_notes) { + // Add a checklist to the form. + $notes_group = $form->group("ExistingNotes") + ->label(t("Notes:")); + // Add the id# of the photo and a delete button to the form. + $notes_group->hidden("item_id")->value($id); + + $notes_group->checklist("notesList") + ->options($array_notes) + ->label(t("Select the notes you wish to delete:")); + } + + $form->submit("DeleteFace")->value(t("Delete face(s) / note(s)")); // Return the newly generated form. return $form; diff --git a/modules/tagfaces/views/drawfaces.html.php b/modules/tagfaces/views/drawfaces.html.php index 161f717a..f710f198 100644 --- a/modules/tagfaces/views/drawfaces.html.php +++ b/modules/tagfaces/views/drawfaces.html.php @@ -115,8 +115,7 @@ li {
-

-

+

From 2fa96fe8a9fd8bee0b0b5b0780157cfae53b27c0 Mon Sep 17 00:00:00 2001 From: rWatcher Date: Tue, 12 Jan 2010 02:59:25 -0500 Subject: [PATCH 04/15] Fixed "minor" bug that caused the entire contents of the items_faces table to get deleted. --- modules/tagfaces/controllers/tagfaces.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/modules/tagfaces/controllers/tagfaces.php b/modules/tagfaces/controllers/tagfaces.php index be41773f..116c4d99 100644 --- a/modules/tagfaces/controllers/tagfaces.php +++ b/modules/tagfaces/controllers/tagfaces.php @@ -62,18 +62,22 @@ class tagfaces_Controller extends Controller { // Delete the face(s) from the database. foreach ($tag_data as $one_tag) { - ORM::factory("items_face") - ->where("id", "=", $one_tag) - ->delete_all(); + //ORM::factory("items_face") + // ->where("id", "=", $one_tag) + // ->delete(); + db::build()->delete("items_faces")->where("id", "=", $one_tag)->execute(); } + // Delete the notes(s) from the database. foreach ($note_data as $one_note) { - ORM::factory("items_note") - ->where("id", "=", $one_note) - ->delete_all(); + //ORM::factory("items_note") + // ->where("id", "=", $one_note) + // ->delete(); + db::build()->delete("items_notes")->where("id", "=", $one_note)->execute(); } + // Display a success message for deleted faces. if (count($tag_data) == 1) { message::success(t("One face deleted.")); From c53352108b11d98b66737802a0f3333a56d0b521 Mon Sep 17 00:00:00 2001 From: rWatcher Date: Tue, 12 Jan 2010 03:05:49 -0500 Subject: [PATCH 05/15] Hide the delete button when there's nothing to delete. --- modules/tagfaces/controllers/tagfaces.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/tagfaces/controllers/tagfaces.php b/modules/tagfaces/controllers/tagfaces.php index 116c4d99..801a20bb 100644 --- a/modules/tagfaces/controllers/tagfaces.php +++ b/modules/tagfaces/controllers/tagfaces.php @@ -294,7 +294,12 @@ class tagfaces_Controller extends Controller { ->label(t("Select the notes you wish to delete:")); } - $form->submit("DeleteFace")->value(t("Delete face(s) / note(s)")); + // Hide the delete button when there's nothing to delete. + if (($array_notes) || ($array_faces)) { + $form->submit("DeleteFace")->value(t("Delete face(s) / note(s)")); + } else { + $form->group("NoFacesNotes")->label(t("There is nothing to delete for this photo.")); + } // Return the newly generated form. return $form; From f4401fa9ddcc0078928608f4b212a7e1f2a41785 Mon Sep 17 00:00:00 2001 From: rWatcher Date: Tue, 12 Jan 2010 03:17:36 -0500 Subject: [PATCH 06/15] Fixed another "minor" bug that caused the entire contents of the items_faces table to get deleted whenever a face-tagged photo is deleted. --- modules/tagfaces/helpers/tagfaces_event.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/tagfaces/helpers/tagfaces_event.php b/modules/tagfaces/helpers/tagfaces_event.php index 77613304..9b9defb4 100644 --- a/modules/tagfaces/helpers/tagfaces_event.php +++ b/modules/tagfaces/helpers/tagfaces_event.php @@ -58,18 +58,24 @@ class tagfaces_event_Core { ->where("item_id", "=", $item->id) ->find_all(); if (count($existingFaces) > 0) { + /* ORM::factory("items_face") ->where("item_id", "=", $item->id) ->delete_all(); + */ + db::build()->delete("items_faces")->where("item_id", "=", $item->id)->execute(); } $existingNotes = ORM::factory("items_note") ->where("item_id", "=", $item->id) ->find_all(); if (count($existingNotes) > 0) { + /* ORM::factory("items_note") ->where("item_id", "=", $item->id) ->delete_all(); + */ + db::build()->delete("items_notes")->where("item_id", "=", $item->id)->execute(); } } } From c9f95a56136befe5b7f7c161f7bfe875ba2911d3 Mon Sep 17 00:00:00 2001 From: rWatcher Date: Tue, 12 Jan 2010 15:02:20 -0500 Subject: [PATCH 07/15] Code cleanup in TagFaces. --- modules/tagfaces/controllers/tagfaces.php | 20 ++++++-------------- modules/tagfaces/helpers/tagfaces_event.php | 10 ---------- modules/tagfaces/views/drawfaces.html.php | 6 ------ 3 files changed, 6 insertions(+), 30 deletions(-) diff --git a/modules/tagfaces/controllers/tagfaces.php b/modules/tagfaces/controllers/tagfaces.php index 801a20bb..c9f3059d 100644 --- a/modules/tagfaces/controllers/tagfaces.php +++ b/modules/tagfaces/controllers/tagfaces.php @@ -47,13 +47,13 @@ class tagfaces_Controller extends Controller { access::verify_csrf(); // Convert submitted data to local variables. - // Figure out which tagged faces and notes to delete. + // Figure out which tagged faces and notes to delete. $tag_data = Input::instance()->post("facesList"); $note_data = Input::instance()->post("notesList"); - // Figure out the item id, in order to reload the correct face tagging page. + // Figure out the item id, in order to reload the correct face tagging page. $item_data = Input::instance()->post("item_id"); - // If the user didn't select a tag, display and error and abort. + // If the user didn't select a tag or note, display and error and abort. if ((count($tag_data) == 0) && (count($note_data) == 0)) { message::error(t("Please select a tag or note to delete.")); url::redirect("tagfaces/drawfaces/$item_data"); @@ -62,22 +62,14 @@ class tagfaces_Controller extends Controller { // Delete the face(s) from the database. foreach ($tag_data as $one_tag) { - //ORM::factory("items_face") - // ->where("id", "=", $one_tag) - // ->delete(); db::build()->delete("items_faces")->where("id", "=", $one_tag)->execute(); } - // Delete the notes(s) from the database. foreach ($note_data as $one_note) { - //ORM::factory("items_note") - // ->where("id", "=", $one_note) - // ->delete(); db::build()->delete("items_notes")->where("id", "=", $one_note)->execute(); } - // Display a success message for deleted faces. if (count($tag_data) == 1) { message::success(t("One face deleted.")); @@ -91,8 +83,8 @@ class tagfaces_Controller extends Controller { } elseif (count($note_data) > 1) { message::success(count($note_data) . t(" notes deleted.")); } - - // Re-load the face tagging page. + + // Re-load the face tagging page. url::redirect("tagfaces/drawfaces/$item_data"); } @@ -111,7 +103,7 @@ class tagfaces_Controller extends Controller { $str_y1 = Input::instance()->post("y1"); $str_x2 = Input::instance()->post("x2"); $str_y2 = Input::instance()->post("y2"); - + // If the user didn't select a face, display an error and abort. if (($str_x1 == "") || ($str_x2 == "") || ($str_y1 == "") || ($str_y2 == "")) { message::error(t("Please select a face.")); diff --git a/modules/tagfaces/helpers/tagfaces_event.php b/modules/tagfaces/helpers/tagfaces_event.php index 9b9defb4..d0478f23 100644 --- a/modules/tagfaces/helpers/tagfaces_event.php +++ b/modules/tagfaces/helpers/tagfaces_event.php @@ -58,11 +58,6 @@ class tagfaces_event_Core { ->where("item_id", "=", $item->id) ->find_all(); if (count($existingFaces) > 0) { - /* - ORM::factory("items_face") - ->where("item_id", "=", $item->id) - ->delete_all(); - */ db::build()->delete("items_faces")->where("item_id", "=", $item->id)->execute(); } @@ -70,11 +65,6 @@ class tagfaces_event_Core { ->where("item_id", "=", $item->id) ->find_all(); if (count($existingNotes) > 0) { - /* - ORM::factory("items_note") - ->where("item_id", "=", $item->id) - ->delete_all(); - */ db::build()->delete("items_notes")->where("item_id", "=", $item->id)->execute(); } } diff --git a/modules/tagfaces/views/drawfaces.html.php b/modules/tagfaces/views/drawfaces.html.php index f710f198..981854c8 100644 --- a/modules/tagfaces/views/drawfaces.html.php +++ b/modules/tagfaces/views/drawfaces.html.php @@ -120,12 +120,6 @@ li { - - - - - -
From 73f04804f8e44ad5f8d610eb59ce22a777c53d7d Mon Sep 17 00:00:00 2001 From: rWatcher Date: Tue, 19 Jan 2010 01:24:44 -0500 Subject: [PATCH 08/15] Fixed issue with tag links not working. --- modules/tagsmap/views/tagsmap_googlemap.html.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/tagsmap/views/tagsmap_googlemap.html.php b/modules/tagsmap/views/tagsmap_googlemap.html.php index fdc7a1aa..8e08eabd 100644 --- a/modules/tagsmap/views/tagsmap_googlemap.html.php +++ b/modules/tagsmap/views/tagsmap_googlemap.html.php @@ -1,4 +1,5 @@ + @@ -43,12 +44,13 @@ // Create markers for each tag with GPS coordinates. + tag_id); ?> var myGeographicCoordinates = new GLatLng(latitude ?>, longitude ?>); map.addOverlay(createMarker(myGeographicCoordinates, - "description ?>", - "tag_id")?>", - "tag_id)->name ?>" + "description; ?>", + "url(); ?>", + "name); ?>" )); From 1e08891ebf90d491796026f8347519fe485e07d2 Mon Sep 17 00:00:00 2001 From: rWatcher Date: Tue, 19 Jan 2010 01:25:11 -0500 Subject: [PATCH 09/15] Fixed issue where the delete button deletes the whole table instead of just one record. --- modules/tagsmap/controllers/admin_tagsmap.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/modules/tagsmap/controllers/admin_tagsmap.php b/modules/tagsmap/controllers/admin_tagsmap.php index d461de37..c0af4bea 100644 --- a/modules/tagsmap/controllers/admin_tagsmap.php +++ b/modules/tagsmap/controllers/admin_tagsmap.php @@ -68,10 +68,8 @@ class Admin_TagsMap_Controller extends Admin_Controller { // If the tag no longer exists then delete the record. if (count($oneTag) == 0) { - // Delete the record. - ORM::factory("tags_gps") - ->where("tag_id", "=", $oneGPS->tag_id) - ->delete_all(); + // Delete the record. + db::build()->delete("tags_gpses")->where("tag_id", "=", $oneGPS->tag_id)->execute(); $int_deleted_records++; } } @@ -100,9 +98,7 @@ class Admin_TagsMap_Controller extends Admin_Controller { // Delete the GSP data associated with a tag. // Delete the record. - ORM::factory("tags_gps") - ->where("tag_id", "=", $tag_id) - ->delete_all(); + db::build()->delete("tags_gpses")->where("tag_id", "=", $tag_id)->execute(); // Redirect back to the main screen and display a "success" message. message::success(t("Your Settings Have Been Saved.")); From 01326cee20d771ca4550ead77ce0ffd4b9316c71 Mon Sep 17 00:00:00 2001 From: rWatcher Date: Tue, 19 Jan 2010 02:15:34 -0500 Subject: [PATCH 10/15] Display a warning message if the Tags module is not active. --- .../helpers/metadescription_event.php | 34 +++++++++++++++++++ .../helpers/metadescription_installer.php | 34 +++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 modules/metadescription/helpers/metadescription_event.php create mode 100644 modules/metadescription/helpers/metadescription_installer.php diff --git a/modules/metadescription/helpers/metadescription_event.php b/modules/metadescription/helpers/metadescription_event.php new file mode 100644 index 00000000..48e31854 --- /dev/null +++ b/modules/metadescription/helpers/metadescription_event.php @@ -0,0 +1,34 @@ +deactivate)) { + site_status::warning( + t("The MetaDescription module requires the Tags module. " . + "Activate the Tags module now", + array("url" => url::site("admin/modules"))), + "metadescription_needs_tag"); + } else { + site_status::clear("metadescription_needs_tag"); + } + } +} diff --git a/modules/metadescription/helpers/metadescription_installer.php b/modules/metadescription/helpers/metadescription_installer.php new file mode 100644 index 00000000..07cdd8ec --- /dev/null +++ b/modules/metadescription/helpers/metadescription_installer.php @@ -0,0 +1,34 @@ + Date: Wed, 20 Jan 2010 16:57:22 -0500 Subject: [PATCH 11/15] Initial commit of export_facebook module. --- .../controllers/export_facebook.php | 70 +++++++++++++++++++ modules/export_facebook/module.info | 3 + 2 files changed, 73 insertions(+) create mode 100644 modules/export_facebook/controllers/export_facebook.php create mode 100644 modules/export_facebook/module.info diff --git a/modules/export_facebook/controllers/export_facebook.php b/modules/export_facebook/controllers/export_facebook.php new file mode 100644 index 00000000..988eed19 --- /dev/null +++ b/modules/export_facebook/controllers/export_facebook.php @@ -0,0 +1,70 @@ +where("type", "=", "album") + ->where("id", "!=", "1") + ->viewable() + ->find_all(); + + // Loop through each album and output the necessary information. + foreach ($albums as $album) { + $album_contents = ORM::factory("item") + ->where("parent_id", "=", $album->id) + ->where("type", "=", "photo") + ->viewable() + ->find_all(); + + print ($album->level-2) . "\t" . $album->id . "\t" . $album->name . "\t" . count($album_contents) . "\n"; + } + + } else if ($_GET['a'] == "photos") { + // Generate an array of photo's in the specified album. + $photos = ORM::factory("item") + ->where("type", "=", "photo") + ->where("parent_id", "=", $_GET['id']) + ->viewable() + ->find_all(); + + // Loop through each photo, generate a list of tags (if available) and then output the necessary information. + foreach ($photos as $photo) { + $photo_keywords = ""; + if (module::is_active("tag")) { + $photo_tags = ORM::factory("tag") + ->join("items_tags", "tags.id", "items_tags.tag_id") + ->where("items_tags.item_id", "=", $photo->id) + ->find_all(); + foreach ($photo_tags as $tag) { + $photo_keywords = $photo_keywords . $tag->name . ", "; + } + // Cut off the ", " from the end of the string. + if ($photo_keywords != "") { + $photo_keywords = substr($photo_keywords, 0, -2); + } + } + print $photo->id . "\t" . $photo->name . "\t" . stristr($photo->resize_url(false),"/var/") . "\t" . stristr($photo->thumb_url(false), "/var/") . "\t\t" . $photo->description . "\t" . $photo_keywords . "\n"; + } + } + } +} \ No newline at end of file diff --git a/modules/export_facebook/module.info b/modules/export_facebook/module.info new file mode 100644 index 00000000..1f65154a --- /dev/null +++ b/modules/export_facebook/module.info @@ -0,0 +1,3 @@ +name = "export_facebook" +description = "Export Photos from Gallery 3 to Facebook." +version = 1 From f2910faf4c51d48a888911ae9901ae17cb61b26e Mon Sep 17 00:00:00 2001 From: rWatcher Date: Wed, 20 Jan 2010 18:06:40 -0500 Subject: [PATCH 12/15] Display warning message if Tags is not active to alert the user that BatchTag won't work properly without it. --- modules/batchtag/helpers/batchtag_event.php | 34 +++++++++++++++++++ .../batchtag/helpers/batchtag_installer.php | 34 +++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 modules/batchtag/helpers/batchtag_event.php create mode 100644 modules/batchtag/helpers/batchtag_installer.php diff --git a/modules/batchtag/helpers/batchtag_event.php b/modules/batchtag/helpers/batchtag_event.php new file mode 100644 index 00000000..511eff73 --- /dev/null +++ b/modules/batchtag/helpers/batchtag_event.php @@ -0,0 +1,34 @@ +deactivate)) { + site_status::warning( + t("The BatchTag module requires the Tags module. " . + "Activate the Tags module now", + array("url" => url::site("admin/modules"))), + "batchtag_needs_tag"); + } else { + site_status::clear("batchtag_needs_tag"); + } + } +} diff --git a/modules/batchtag/helpers/batchtag_installer.php b/modules/batchtag/helpers/batchtag_installer.php new file mode 100644 index 00000000..6bb17a70 --- /dev/null +++ b/modules/batchtag/helpers/batchtag_installer.php @@ -0,0 +1,34 @@ + Date: Wed, 20 Jan 2010 19:12:47 -0500 Subject: [PATCH 13/15] Fixed issue with batch tagging the contents of sub-albums. --- modules/batchtag/controllers/batchtag.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/batchtag/controllers/batchtag.php b/modules/batchtag/controllers/batchtag.php index db4b081f..9b24b657 100644 --- a/modules/batchtag/controllers/batchtag.php +++ b/modules/batchtag/controllers/batchtag.php @@ -39,15 +39,13 @@ class BatchTag_Controller extends Controller { } else { // Generate an array of all non-album items in the current album // and any sub albums. - $children = ORM::factory("item", $input->post("item_id")) - ->where("type", "!=", "album") - ->descendants(); + $item = ORM::factory("item", $input->post("item_id")); + $children = $item->descendants(); } - // Loop through each item in the album and make sure the user has // access to view and edit it. foreach ($children as $child) { - if (access::can("view", $child) && access::can("edit", $child)) { + if (access::can("view", $child) && access::can("edit", $child) && !$child->is_album()) { // Assuming the user can view/edit the current item, loop // through each tag that was submitted and apply it to From 0a2d33e2ff1421c4f9e6e843a820733fc26edbbd Mon Sep 17 00:00:00 2001 From: rWatcher Date: Wed, 20 Jan 2010 20:49:23 -0500 Subject: [PATCH 14/15] Fixed tag links in rWInfo. --- modules/rwinfo/helpers/rwinfo_theme.php | 2 +- modules/rwinfo/views/rwinfo_block.html.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/rwinfo/helpers/rwinfo_theme.php b/modules/rwinfo/helpers/rwinfo_theme.php index 83c890dd..e91148c7 100644 --- a/modules/rwinfo/helpers/rwinfo_theme.php +++ b/modules/rwinfo/helpers/rwinfo_theme.php @@ -37,7 +37,7 @@ class rwinfo_theme_Core { $results .= t("Tags:") . " "; $anchors = array(); foreach ($tags as $tag) { - $anchors[] = "id}") . ">" . html::clean($tag->name) . ""; + $anchors[] = "" . html::clean($tag->name) . ""; } $results .= join(", ", $anchors) . ""; } diff --git a/modules/rwinfo/views/rwinfo_block.html.php b/modules/rwinfo/views/rwinfo_block.html.php index 20f6efa8..97bb3054 100644 --- a/modules/rwinfo/views/rwinfo_block.html.php +++ b/modules/rwinfo/views/rwinfo_block.html.php @@ -43,7 +43,7 @@ - name}") ?>">name) ?> + name) ?> From 7ab0b1bb5672536b3ab8f0260b02fd68ef4eff6b Mon Sep 17 00:00:00 2001 From: rWatcher Date: Mon, 25 Jan 2010 01:04:59 -0500 Subject: [PATCH 15/15] Use the photo title, not the file name. --- modules/export_facebook/controllers/export_facebook.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/export_facebook/controllers/export_facebook.php b/modules/export_facebook/controllers/export_facebook.php index 988eed19..8c2ce64b 100644 --- a/modules/export_facebook/controllers/export_facebook.php +++ b/modules/export_facebook/controllers/export_facebook.php @@ -63,7 +63,7 @@ class export_facebook_Controller extends Controller { $photo_keywords = substr($photo_keywords, 0, -2); } } - print $photo->id . "\t" . $photo->name . "\t" . stristr($photo->resize_url(false),"/var/") . "\t" . stristr($photo->thumb_url(false), "/var/") . "\t\t" . $photo->description . "\t" . $photo_keywords . "\n"; + print $photo->id . "\t" . $photo->title . "\t" . stristr($photo->resize_url(false),"/var/") . "\t" . stristr($photo->thumb_url(false), "/var/") . "\t\t" . $photo->description . "\t" . $photo_keywords . "\n"; } } }