From: Michael J. Rubinsky Date: Mon, 31 May 2010 19:48:49 +0000 (-0400) Subject: don't show "find similar" link if we don't have the libpuzzle extension loaded. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=08069e160142e8f981858b76bbc11a03bd6bd2fe;p=horde.git don't show "find similar" link if we don't have the libpuzzle extension loaded. --- diff --git a/ansel/lib/Faces.php b/ansel/lib/Faces.php index a55738432..2616716cc 100644 --- a/ansel/lib/Faces.php +++ b/ansel/lib/Faces.php @@ -106,7 +106,7 @@ class Ansel_Faces $face_id = $face['face_id']; $claim_url = Horde::applicationUrl('faces/claim.php'); - $search_url = Horde::applicationUrl('faces/search/image_search.php'); + // The HTML to display the face image. $imghtml = sprintf("\"%s\"", @@ -124,18 +124,19 @@ class Ansel_Faces $html = '
' . ' ' . $imghtml . ''; if (!empty($face['face_name'])) { - $html .= Horde::link(Horde_Util::addParameter(Horde::applicationUrl('faces/face.php'), 'face', $face['face_id'], false)) . $face['face_name'] . '
'; + $html .= Horde::applicationUrl('faces/face.php')->add('face', $face['face_id'])->link() . $face['face_name'] . '
'; } // Display the face name or a link to claim the face. if (empty($face['face_name']) && $GLOBALS['conf']['report_content']['driver']) { - $html .= ' ' - . _("Claim") . ''; + $html .= ' '; } // Link for searching for similar faces. - $html .= ' ' . _("Find similar") . ''; + if (Horde_Util::loadExtension('libpuzzle') !== false) { + $search_url = Horde::applicationUrl('faces/search/image_search.php'); + $html .= $search_url->add('face_id', $face_id)-link() . _("Find similar") . ''; + } $html .= '
'; return $html; diff --git a/ansel/templates/faces/face.inc b/ansel/templates/faces/face.inc index 774cf9379..787067cd9 100755 --- a/ansel/templates/faces/face.inc +++ b/ansel/templates/faces/face.inc @@ -8,10 +8,9 @@ ">
- ' . _("Similar faces") . ''; - } - ?> + add('face_id', $face_id)->link(array('title' => _("Find similar"))) . _("Similar faces") . ''; + } ?> ' . _("Report") . '
'; } -if ($conf['faces']['search']) { - echo '' . _("Similar faces") . ''; +if ($conf['faces']['search'] && Horde_Util::loadExtension('libpuzzle') !== false) { + echo Horde::applicationUrl('faces/search/image_search.php')->add('face_id', $face_id)->link(array('title' => _("Find similar"))) . _("Similar faces") . ''; } ?>