From: Michael J. Rubinsky Date: Fri, 31 Jul 2009 04:18:44 +0000 (-0400) Subject: More Ansel_Faces cleanup, PHP5 changes, try/catch etc... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=99c513d7984eb40527d9d15be4b8f09942c0a397;p=horde.git More Ansel_Faces cleanup, PHP5 changes, try/catch etc... --- diff --git a/ansel/config/prefs.php.dist b/ansel/config/prefs.php.dist index 701e6bea1..73b775b0d 100644 --- a/ansel/config/prefs.php.dist +++ b/ansel/config/prefs.php.dist @@ -4,10 +4,6 @@ * * See horde/config/prefs.php for documentation on the structure of this file. */ - -// Make sure that constants are defined. -require_once dirname(__FILE__) . '/../lib/Ansel.php'; - $prefGroups['display'] = array( 'column' => _("General Options"), 'label' => _("Display Options"), diff --git a/ansel/faces/claim.php b/ansel/faces/claim.php index 97e305b01..2aaf73098 100644 --- a/ansel/faces/claim.php +++ b/ansel/faces/claim.php @@ -2,8 +2,6 @@ /** * Identify a person in a photo * - * $Horde: ansel/faces/claim.php,v 1.9 2009/06/10 00:33:02 mrubinsk Exp $ - * * Copyright 2008-2009 The Horde Project (http://www.horde.org/) * * See the enclosed file COPYING for license information (GPL). If you @@ -11,19 +9,14 @@ * * @author Duck */ -define('ANSEL_BASE', dirname(__FILE__) . '/../'); -require_once ANSEL_BASE . '/lib/base.php'; -require_once ANSEL_BASE . '/lib/Faces.php'; - -require_once 'Horde/Form.php'; +require_once dirname(__FILE__) . '/../lib/base.php'; $faces = Ansel_Faces::factory(); - $face_id = Horde_Util::getFormData('face'); -$face = $faces->getFaceById($face_id); - -if (is_a($face, 'PEAR_Error')) { - $notification->push($face->getMessage()); +try { + $face = $faces->getFaceById($face_id); +} catch (Horde_Exception $e) { + $notification->push($e->getMessage()); header('Location: ' . Horde::applicationUrl('faces/search/all.php')); exit; } diff --git a/ansel/faces/custom.php b/ansel/faces/custom.php index 8d03f6276..65b725b83 100644 --- a/ansel/faces/custom.php +++ b/ansel/faces/custom.php @@ -2,8 +2,6 @@ /** * Explicitly add/edit a face range to an image. * - * $Horde: ansel/faces/custom.php,v 1.14 2009/07/08 18:28:41 slusarz Exp $ - * * Copyright 2008-2009 The Horde Project (http://www.horde.org/) * * See the enclosed file COPYING for license information (GPL). If you @@ -44,26 +42,19 @@ $y2 = $conf['screen']['width']; $name = Horde_Util::getFormData('name'); if ($face_id) { - require_once ANSEL_BASE . '/lib/Faces.php'; $faces = Ansel_Faces::factory(); - - if (is_a($faces, 'PEAR_Error')) { - $notification->push($faces); - header('Location: ' . $back_url); - exit; + try { + $face = $faces->getFaceById($face_id, true); + } catch (Horde_Exception $e) { + $notification->push($e->getMessage()); } - $face = $faces->getFaceById($face_id, true); - if (is_a($face, 'PEAR_Error')) { - $notification->push($face); - } else { - $x1 = $face['face_x1']; - $y1 = $face['face_y1']; - $x2 = $face['face_x2']; - $y2 = $face['face_y2']; - if (!empty($face['face_name'])) { - $name = $face['face_name']; - } + $x1 = $face['face_x1']; + $y1 = $face['face_y1']; + $x2 = $face['face_x2']; + $y2 = $face['face_y2']; + if (!empty($face['face_name'])) { + $name = $face['face_name']; } } diff --git a/ansel/faces/delete.php b/ansel/faces/delete.php index 7f6e8265d..d2e7335d0 100644 --- a/ansel/faces/delete.php +++ b/ansel/faces/delete.php @@ -2,8 +2,6 @@ /** * Delete a face from an image. * - * $Horde: ansel/faces/delete.php,v 1.10 2009/07/30 18:02:13 mrubinsk Exp $ - * * Copyright 2008-2009 The Horde Project (http://www.horde.org/) * * See the enclosed file COPYING for license information (GPL). If you @@ -12,7 +10,6 @@ * @author Duck */ require_once dirname(__FILE__) . '/../lib/base.php'; -require_once ANSEL_BASE . '/lib/Faces.php'; $image_id = (int)Horde_Util::getFormData('image'); $face_id = (int)Horde_Util::getFormData('face'); @@ -28,11 +25,5 @@ if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) { } $faces = Ansel_Faces::factory(); -if (is_a($faces, 'PEAR_Error')) { - die($faces->getMessage()); -} - $result = $faces->delete($image, $face_id); -if (is_a($result, 'PEAR_Error')) { - die($result->getMessage()); -} + diff --git a/ansel/faces/face.php b/ansel/faces/face.php index 8f159a8af..2577e1507 100644 --- a/ansel/faces/face.php +++ b/ansel/faces/face.php @@ -6,8 +6,6 @@ * At least, we need to rename this to something other that image.php to * reflect what it's used for. * - * $Horde: ansel/faces/face.php,v 1.6 2009/06/10 00:33:02 mrubinsk Exp $ - * * Copyright 2008-2009 The Horde Project (http://www.horde.org/) * * See the enclosed file COPYING for license information (GPL). If you @@ -16,16 +14,11 @@ * @author Duck */ require_once dirname(__FILE__) . '/../lib/base.php'; -require_once ANSEL_BASE . '/lib/Faces.php'; - $faces = Ansel_Faces::factory(); -if (is_a($faces, 'PEAR_Error')) { - die($faces->getMessage()); -} - $face_id = Horde_Util::getFormData('face'); -$face = $faces->getFaceById($face_id); -if (is_a($face, 'PEAR_Error')) { +try { + $face = $faces->getFaceById($face_id); +} catch (Horde_Exception $e) { $notification->push($face->getMessage()); header('Location: ' . Horde::applicationUrl('faces/index.php')); exit; @@ -35,7 +28,5 @@ $title = _("Face") . ' :: ' . $face['face_name']; require ANSEL_TEMPLATES . '/common-header.inc'; require ANSEL_TEMPLATES . '/menu.inc'; - require_once ANSEL_TEMPLATES . '/faces/face.inc'; - require $registry->get('templates', 'horde') . '/common-footer.inc'; \ No newline at end of file diff --git a/ansel/faces/gallery.php b/ansel/faces/gallery.php index 90aae33c5..abf85ad07 100644 --- a/ansel/faces/gallery.php +++ b/ansel/faces/gallery.php @@ -4,8 +4,6 @@ * * TODO: Turn this into an Ansel_View:: * - * $Horde: ansel/faces/gallery.php,v 1.16 2009/07/13 21:33:53 mrubinsk Exp $ - * * Copyright 2008-2009 The Horde Project (http://www.horde.org/) * * See the enclosed file COPYING for license information (GPL). If you @@ -41,7 +39,6 @@ $customimage = $registry->getImageDir('horde') . '/layout.png'; $customurl = Horde_Util::addParameter(Horde::applicationUrl('faces/custom.php'), 'page', $page); $face = Ansel_Faces::factory(); $autogenerate = $face->canAutogenerate(); - $vars = Horde_Variables::getDefaultVariables(); $pager = new Horde_UI_Pager( 'page', $vars, diff --git a/ansel/faces/image.php b/ansel/faces/image.php index a7786d9ca..41628de84 100644 --- a/ansel/faces/image.php +++ b/ansel/faces/image.php @@ -2,8 +2,6 @@ /** * Process an single image (to be called via Ajax) * - * $Horde: ansel/faces/image.php,v 1.10 2009/06/10 00:33:02 mrubinsk Exp $ - * * Copyright 2008-2009 The Horde Project (http://www.horde.org/) * * See the enclosed file COPYING for license information (GPL). If you @@ -12,12 +10,8 @@ * @author Duck */ require_once dirname(__FILE__) . '/../lib/base.php'; -require_once ANSEL_BASE . '/lib/Faces.php'; $faces = Ansel_Faces::factory(); -if (is_a($faces, 'PEAR_Error')) { - die($faces->getMessage()); -} $name = ''; $autocreate = true; @@ -29,19 +23,8 @@ $result = $faces->getImageFacesData($image_id); // or if we were asked to explicitly try again. if (($reload || empty($result))) { $image = &$ansel_storage->getImage($image_id); - if (is_a($image, 'PEAR_Error')) { - exit; - } - - $result = $image->createView('screen'); - if (is_a($result, 'PEAR_Error')) { - exit; - } - + $image->createView('screen'); $result = $faces->getFromPicture($image_id, $autocreate); - if (is_a($result, 'PEAR_Error')) { - exit; - } } if (!empty($result)) { diff --git a/ansel/faces/img.php b/ansel/faces/img.php index 72767e25f..cb513e33a 100644 --- a/ansel/faces/img.php +++ b/ansel/faces/img.php @@ -2,8 +2,6 @@ /** * Fetch face image for display * - * $Horde: ansel/faces/img.php,v 1.11 2009/06/10 00:33:02 mrubinsk Exp $ - * * Copyright 2008-2009 The Horde Project (http://www.horde.org/) * * See the enclosed file COPYING for license information (GPL). If you @@ -12,14 +10,9 @@ * @author Duck */ require_once dirname(__FILE__) . '/../lib/base.php'; -require_once ANSEL_BASE . '/lib/Faces.php'; $face_id = Horde_Util::getFormData('face'); $faces = Ansel_Faces::factory(); -if (is_a($faces, 'PEAR_Error')) { - Horde::logMessage($faces, __FILE__, __LINE__, PEAR_LOG_ERR); - exit; -} // Sendfile support. Lighttpd < 1.5 only understands the X-LIGHTTPD-send-file // header @@ -49,8 +42,5 @@ if ($conf['vfs']['src'] == 'sendfile') { // Run it through PHP $img = $faces->getFaceImageObject($face_id); -if (is_a($img, 'PEAR_Error')) { - exit; -} header('Content-type: image/' . $GLOBALS['conf']['image']['type']); echo $img->raw(); diff --git a/ansel/faces/name.php b/ansel/faces/name.php index d45184577..9a5cf5e85 100644 --- a/ansel/faces/name.php +++ b/ansel/faces/name.php @@ -2,8 +2,6 @@ /** * Set the name of a single image via Ajax * - * $Horde: ansel/faces/name.php,v 1.9 2009/07/08 18:28:41 slusarz Exp $ - * * Copyright 2008-2009 The Horde Project (http://www.horde.org/) * * See the enclosed file COPYING for license information (GPL). If you @@ -12,28 +10,16 @@ * @author Duck */ require_once dirname(__FILE__) . '/../lib/base.php'; -require_once ANSEL_BASE . '/lib/Faces.php'; $image_id = (int)Horde_Util::getFormData('image'); $face_id = (int)Horde_Util::getFormData('face'); $name = Horde_Util::getFormData('name'); $image = &$ansel_storage->getImage($image_id); -if (is_a($image, 'PEAR_Error')) { - die($image->getMessage()); -} - $gallery = &$ansel_storage->getGallery($image->gallery); if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) { - die(_("Access denied editing the photo.")); + throw new Horde_Exception('Access denied editing the photo.'); } $faces = Ansel_Faces::factory(); -if (is_a($faces, 'PEAR_Error')) { - die($faces->getMessage()); -} - -$result = $faces->setName($face_id, $name); -if (is_a($result, 'PEAR_Error')) { - die($result->getDebugInfo()); -} \ No newline at end of file +$result = $faces->setName($face_id, $name); \ No newline at end of file diff --git a/ansel/faces/report.php b/ansel/faces/report.php index 36d491484..0b2f70489 100644 --- a/ansel/faces/report.php +++ b/ansel/faces/report.php @@ -2,8 +2,6 @@ /** * Process an single image (to be called by ajax) * - * $Horde: ansel/faces/report.php,v 1.9 2009/06/10 00:33:02 mrubinsk Exp $ - * * Copyright 2008-2009 The Horde Project (http://www.horde.org/) * * See the enclosed file COPYING for license information (GPL). If you @@ -12,17 +10,14 @@ * @author Duck */ require_once dirname(__FILE__) . '/../lib/base.php'; -require_once ANSEL_BASE . '/lib/Faces.php'; - -require_once 'Horde/Form.php'; - -$faces = Ansel_Faces::factory(); $face_id = Horde_Util::getFormData('face'); -$face = $faces->getFaceById($face_id); -if (is_a($face, 'PEAR_Error')) { - $notification->push($face->getMessage()); +$faces = Ansel_Faces::factory(); +try { + $face = $faces->getFaceById($face_id); +} catch (Horde_Exception $e) { + $notification->push($e->getMessage()); header('Location: ' . Horde::applicationUrl('faces/search/all.php')); exit; } @@ -38,11 +33,8 @@ $form->setButtons($title); if ($form->validate()) { if (Horde_Util::getFormData('submitbutton') == _("Cancel")) { - $notification->push(_("Action was cancelled."), 'horde.warning'); - } else { - require ANSEL_BASE . '/lib/Report.php'; $report = Ansel_Report::factory(); $gallery = $ansel_storage->getGallery($face['gallery_id']); @@ -59,14 +51,12 @@ if ($form->validate()) { . _("Face") . ': ' . $face_link; $report->setTitle($title); - $result = $report->report($body, $gallery->get('owner')); - if (is_a($result, 'PEAR_Error')) { - $notification->push(_("Face name was not reported.") . ' ' . - $result->getMessage(), 'horde.error'); - } else { - $notification->push(_("The owner of the photo was notified."), 'horde.success'); + try { + $result = $report->report($body, $gallery->get('owner')); + } catch (Horde_Exception $e) { + $notification->push(sprintf(_("Face name was not reported: %s"), $e->getMessage()), 'horde.error'); } - + $notification->push(_("The owner of the photo was notified."), 'horde.success'); } header('Location: ' . Ansel_Faces::getLink($face)); diff --git a/ansel/faces/savecustom.php b/ansel/faces/savecustom.php index 4ac701170..d5a521466 100644 --- a/ansel/faces/savecustom.php +++ b/ansel/faces/savecustom.php @@ -2,8 +2,6 @@ /** * Process an single image (to be called by ajax) * - * $Horde: ansel/faces/savecustom.php,v 1.10 2009/07/06 15:50:34 mrubinsk Exp $ - * * Copyright 2008-2009 The Horde Project (http://www.horde.org/) * * See the enclosed file COPYING for license information (GPL). If you @@ -12,7 +10,6 @@ * @author Duck */ require_once dirname(__FILE__) . '/../lib/base.php'; -require_once ANSEL_BASE . '/lib/Faces.php'; $image_id = (int)Horde_Util::getFormData('image_id'); $gallery_id = (int)Horde_Util::getFormData('gallery_id'); @@ -31,28 +28,23 @@ if (Horde_Util::getPost('submit') == _("Cancel")) { header('Location: ' . $back_url); exit; } - -$faces = Ansel_Faces::factory(); -if (is_a($faces, 'PEAR_Error')) { - $notification->push($faces); - header('Location: ' . $back_url); - exit; -} - -$result = $faces->saveCustomFace($face_id, +try { + $faces = Ansel_Faces::factory(); + $result = $faces->saveCustomFace( + $face_id, $image_id, (int)Horde_Util::getFormData('x1'), (int)Horde_Util::getFormData('y1'), (int)Horde_Util::getFormData('x2'), (int)Horde_Util::getFormData('y2'), Horde_Util::getFormData('name')); - -if (is_a($result, 'PEAR_Error')) { - $notification->push($result); - $notification->push($result->getDebugInfo()); +} catch (Horde_Exception $e) { + $notification->push($e->getMessage()); header('Location: ' . $back_url); exit; -} elseif ($face_id == 0) { +} + +if ($face_id == 0) { $notification->push(_("Face successfuly created"), 'horde.success'); } else { $notification->push(_("Face successfuly updated"), 'horde.success'); diff --git a/ansel/faces/search/all.php b/ansel/faces/search/all.php index f363ab2df..bf1e6b6af 100644 --- a/ansel/faces/search/all.php +++ b/ansel/faces/search/all.php @@ -12,7 +12,6 @@ * @author Duck */ require_once 'tabs.php'; -require_once 'Horde/UI/Pager.php'; $title = _("All faces"); $page = Horde_Util::getFormData('page', 0); diff --git a/ansel/faces/search/image.php b/ansel/faces/search/image.php index 1a0f54cc6..cc54b7349 100644 --- a/ansel/faces/search/image.php +++ b/ansel/faces/search/image.php @@ -12,8 +12,6 @@ * @author Duck */ require_once 'tabs.php'; -require_once 'Horde/Form.php'; -require_once 'Horde/Image.php'; /* Search from */ $form = new Horde_Form($vars); diff --git a/ansel/faces/search/image_save.php b/ansel/faces/search/image_save.php index 9c608e283..08e8e1d38 100644 --- a/ansel/faces/search/image_save.php +++ b/ansel/faces/search/image_save.php @@ -12,7 +12,6 @@ * @author Duck */ require_once 'tabs.php'; -require_once 'Horde/Image.php'; /* Check if image exists. */ $tmp = Horde::getTempDir(); diff --git a/ansel/faces/search/image_search.php b/ansel/faces/search/image_search.php index 262de19ca..52a2f74be 100644 --- a/ansel/faces/search/image_search.php +++ b/ansel/faces/search/image_search.php @@ -12,7 +12,6 @@ * @author Duck */ require_once 'tabs.php'; -require_once 'Horde/UI/Pager.php'; $page = Horde_Util::getFormData('page', 0); $perpage = $prefs->getValue('facesperpage'); diff --git a/ansel/faces/search/img.php b/ansel/faces/search/img.php index b3baf086d..8d6cb5798 100644 --- a/ansel/faces/search/img.php +++ b/ansel/faces/search/img.php @@ -12,7 +12,6 @@ * @author Duck */ require_once dirname(__FILE__) . '/../../lib/base.php'; -require_once ANSEL_BASE . '/lib/Faces.php'; /* Face search is allowd only to */ if (!Horde_Auth::isauthenticated()) { diff --git a/ansel/faces/search/name.php b/ansel/faces/search/name.php index 54bebd52e..6232782f0 100644 --- a/ansel/faces/search/name.php +++ b/ansel/faces/search/name.php @@ -12,8 +12,6 @@ * @author Duck */ require_once 'tabs.php'; -require_once 'Horde/Form.php'; -require_once 'Horde/UI/Pager.php'; /* Search from */ $form = new Horde_Form($vars); diff --git a/ansel/faces/search/named.php b/ansel/faces/search/named.php index 2085a9176..fee95b60a 100644 --- a/ansel/faces/search/named.php +++ b/ansel/faces/search/named.php @@ -12,7 +12,6 @@ * @author Duck */ require_once 'tabs.php'; -require_once 'Horde/UI/Pager.php'; $title = _("Named faces"); $page = Horde_Util::getFormData('page', 0); diff --git a/ansel/faces/search/owner.php b/ansel/faces/search/owner.php index 86a79c851..cf3e97d68 100644 --- a/ansel/faces/search/owner.php +++ b/ansel/faces/search/owner.php @@ -12,7 +12,6 @@ * @author Duck */ require_once 'tabs.php'; -require_once 'Horde/UI/Pager.php'; $page = Horde_Util::getFormData('page', 0); $perpage = $prefs->getValue('facesperpage'); diff --git a/ansel/faces/search/tabs.php b/ansel/faces/search/tabs.php index 161841714..4cee56f68 100644 --- a/ansel/faces/search/tabs.php +++ b/ansel/faces/search/tabs.php @@ -2,8 +2,6 @@ /** * Process an single photo (to be called by ajax) * - * $Horde: ansel/faces/search/tabs.php,v 1.10 2009/07/22 21:08:09 mrubinsk Exp $ - * * Copyright 2008-2009 The Horde Project (http://www.horde.org/) * * See the enclosed file COPYING for license information (GPL). If you @@ -12,14 +10,8 @@ * @author Duck */ require_once dirname(__FILE__) . '/../../lib/base.php'; -require_once ANSEL_BASE . '/lib/Faces.php'; -require_once 'Horde/UI/Tabs.php'; $faces = Ansel_Faces::factory(); -if (is_a($faces, 'PEAR_Error')) { - die($faces->getMessage()); -} - /* Face search is allowed only to authenticated users */ if (!Horde_Auth::isauthenticated()) { Horde_Auth::authenticationFailureRedirect(); diff --git a/ansel/lib/Ajax/Imple/EditFaces.php b/ansel/lib/Ajax/Imple/EditFaces.php index f54117047..651a4954c 100644 --- a/ansel/lib/Ajax/Imple/EditFaces.php +++ b/ansel/lib/Ajax/Imple/EditFaces.php @@ -43,10 +43,6 @@ class Ansel_Ajax_Imple_EditFaces extends Horde_Ajax_Imple_Base } $faces = Ansel_Faces::factory(); - if (is_a($faces, 'PEAR_Error')) { - die($faces->getMessage()); - } - switch($action) { case 'process': // process - detects all faces in the image. @@ -57,19 +53,8 @@ class Ansel_Ajax_Imple_EditFaces extends Horde_Ajax_Imple_Base // or if we were asked to explicitly try again. if (($reload || empty($result))) { $image = &$GLOBALS['ansel_storage']->getImage($image_id); - if (is_a($image, 'PEAR_Error')) { - exit; - } - - $result = $image->createView('screen'); - if (is_a($result, 'PEAR_Error')) { - exit; - } - + $image->createView('screen'); $result = $faces->getFromPicture($image_id, $autocreate); - if (is_a($result, 'PEAR_Error')) { - exit; - } } if (!empty($result)) { $imgdir = $GLOBALS['registry']->getImageDir('horde'); @@ -90,24 +75,13 @@ class Ansel_Ajax_Imple_EditFaces extends Horde_Ajax_Imple_Base // delete - deletes a single face from an image. $face_id = (int)Horde_Util::getPost('face'); $image = &$GLOBALS['ansel_storage']->getImage($image_id); - if (is_a($image, 'PEAR_Error')) { - die($image->getMessage()); - } - $gallery = &$GLOBALS['ansel_storage']->getGallery($image->gallery); if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) { - die(_("Access denied editing the photo.")); + throw new Horde_Exception('Access denied editing the photo.'); } $faces = Ansel_Faces::factory(); - if (is_a($faces, 'PEAR_Error')) { - die($faces->getMessage()); - } - - $result = $faces->delete($image, $face_id); - if (is_a($result, 'PEAR_Error')) { - die($result->getMessage()); - } + $faces->delete($image, $face_id); break; case 'setname': @@ -119,25 +93,13 @@ class Ansel_Ajax_Imple_EditFaces extends Horde_Ajax_Imple_Base $name = Horde_Util::getPost('facename'); $image = &$GLOBALS['ansel_storage']->getImage($image_id); - if (is_a($image, 'PEAR_Error')) { - die($image->getMessage()); - } - $gallery = &$GLOBALS['ansel_storage']->getGallery($image->gallery); if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) { - die(_("You are not allowed to edit this photo.")); + throw new Horde_Exception('You are not allowed to edit this photo'); } $faces = Ansel_Faces::factory(); - if (is_a($faces, 'PEAR_Error')) { - die($faces->getMessage()); - } - $result = $faces->setName($face_id, $name); - if (is_a($result, 'PEAR_Error')) { - die($result->getDebugInfo()); - } - return array('response' => 1, 'message' => Ansel_Faces::getFaceTile($face_id)); break; diff --git a/ansel/lib/Block/recent_faces.php b/ansel/lib/Block/recent_faces.php index 521fb7b29..42d28859b 100644 --- a/ansel/lib/Block/recent_faces.php +++ b/ansel/lib/Block/recent_faces.php @@ -7,8 +7,6 @@ if (!empty($GLOBALS['conf']['faces']['driver'])) { * This file provides a recent faces through the Horde_Blocks, by extending * the Horde_Blocks class. * - * $Horde: ansel/lib/Block/recent_faces.php,v 1.3 2009/07/13 17:18:39 mrubinsk Exp $ - * * Copyright 2007-2009 The Horde Project (http://www.horde.org/) * * See the enclosed file COPYING for license information (GPL). If you @@ -17,8 +15,8 @@ if (!empty($GLOBALS['conf']['faces']['driver'])) { * @author Duck * @package Horde_Block */ -class Horde_Block_ansel_recent_faces extends Horde_Block { - +class Horde_Block_ansel_recent_faces extends Horde_Block +{ var $_app = 'ansel'; function _params() @@ -37,14 +35,8 @@ class Horde_Block_ansel_recent_faces extends Horde_Block { function _content() { require_once dirname(__FILE__) . '/../base.php'; - require_once ANSEL_BASE . '/lib/Faces.php'; $faces = Ansel_Faces::factory(); - $results = $faces->allFaces(0, $this->_params['limit']); - if (is_a($results, 'PEAR_Error')) { - return $results; - } - $html = ''; foreach ($results as $face_id => $face) { $facename = htmlspecialchars($face['face_name'], ENT_COMPAT, Horde_Nls::getCharset());