Overview

Packages

  • Ansel
  • None

Classes

  • Ansel_Application
  • Ansel_Block_Cloud
  • Ansel_Block_Gallery
  • Ansel_Block_MyGalleries
  • Ansel_Block_RandomPhoto
  • Ansel_Block_RecentComments
  • Ansel_Block_RecentFaces
  • Ansel_Block_Recentlyadded
  • Ansel_Block_RecentlyAddedGeodata
  • Ansel_Config
  • Ansel_Form_Watermark
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * This file provides a recent faces display in a block.
 4:  *
 5:  * Copyright 2007-2012 Horde LLC (http://www.horde.org/)
 6:  *
 7:  * See the enclosed file COPYING for license information (GPL). If you
 8:  * did not receive this file, see http://www.horde.org/licenses/gpl.
 9:  *
10:  * @author Duck <Duck@obala.net>
11:  */
12: class Ansel_Block_RecentFaces extends Horde_Core_Block
13: {
14:     /**
15:      */
16:     public function __construct($app, $params = array())
17:     {
18:         parent::__construct($app, $params);
19: 
20:         $this->enabled = !empty($GLOBALS['conf']['faces']['driver']);
21:         $this->_name = _("Recent faces");
22:     }
23: 
24:     /**
25:      */
26:     protected function _params()
27:     {
28:         return array(
29:             'limit' => array(
30:                 'name' => _("Maximum number of faces"),
31:                 'type' => 'int',
32:                 'default' => 10
33:             )
34:         );
35:     }
36: 
37:     /**
38:      */
39:     protected function _content()
40:     {
41:         $faces = $GLOBALS['injector']->getInstance('Ansel_Faces');
42:         $results = $faces->allFaces(0, $this->_params['limit']);
43:         $html = '';
44:         foreach ($results as $face) {
45:             $facename = htmlspecialchars($face['face_name']);
46:             $html .= '<a href="' . Ansel_Faces::getLink($face) . '" title="' . $facename . '">'
47:                     . '<img src="' . $faces->getFaceUrl($face['image_id'], $face['face_id'])
48:                     . '" style="padding-bottom: 5px; padding-left: 5px" alt="' . $facename  . '" /></a>';
49:         }
50: 
51:         return $html;
52:     }
53: 
54: }
55: 
API documentation generated by ApiGen