From c53352108b11d98b66737802a0f3333a56d0b521 Mon Sep 17 00:00:00 2001 From: rWatcher Date: Tue, 12 Jan 2010 03:05:49 -0500 Subject: [PATCH] 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;