Code cleanup in TagFaces.
This commit is contained in:
parent
f4401fa9dd
commit
c9f95a5613
@ -53,7 +53,7 @@ class tagfaces_Controller extends Controller {
|
||||
// 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."));
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -120,12 +120,6 @@ li {
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<br/>
|
||||
|
||||
<div id="g-exit-faces">
|
||||
|
Reference in New Issue
Block a user