Overview

Packages

  • Folks
  • None

Classes

  • Folks
  • Folks_Activity_Form
  • Folks_Api
  • Folks_Application
  • Folks_Block_Activities
  • Folks_Block_Friends
  • Folks_Block_Know
  • Folks_Block_New
  • Folks_Block_Random
  • Folks_Block_Recent
  • Folks_Driver
  • Folks_Driver_sql
  • Folks_Friends
  • Folks_Friends_application
  • Folks_Friends_facebook
  • Folks_Friends_prefs
  • Folks_Friends_shared
  • Folks_Friends_sql
  • Folks_Login_Form
  • Folks_Notification
  • Folks_Notification_facebook
  • Folks_Notification_letter
  • Folks_Notification_mail
  • Folks_Notification_tickets
  • Folks_Search_Form
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * @author  Duck <duck@obala.net>
 4:  * @package Folks
 5:  */
 6: class Folks_Block_New extends Horde_Core_Block
 7: {
 8:     /**
 9:      */
10:     public function __construct($app, $params = array())
11:     {
12:         parent::__construct($app, $params);
13: 
14:         $this->_name = _("New users");
15:     }
16: 
17:     /**
18:      */
19:     protected function _params()
20:     {
21:         return array(
22:             'limit' => array(
23:                 'name' => _("Limit"),
24:                 'type' => 'int',
25:                 'default' => 10
26:             )
27:         );
28:     }
29: 
30:     /**
31:      */
32:     protected function _content()
33:     {
34:         require_once dirname(__FILE__) . '/../base.php';
35: 
36:         $new = $GLOBALS['folks_driver']->getNewUsers($this->_params['limit']);
37:         if ($new instanceof PEAR_Error) {
38:             return $new;
39:         }
40: 
41:         $list = array();
42:         foreach ($new as $u) {
43:             $list[] = $u['user_uid'];
44:         }
45: 
46:         // Prepare actions
47:         $actions = array(
48:             array('url' => Horde::url('user.php'),
49:                 'id' => 'user',
50:                 'name' => _("View profile")));
51:         if ($GLOBALS['registry']->hasInterface('letter')) {
52:             $actions[] = array('url' => $GLOBALS['registry']->callByPackage('letter', 'compose', ''),
53:                                 'id' => 'user_to',
54:                                 'name' => _("Send message"));
55:         }
56: 
57:         Horde::addScriptFile('stripe.js', 'horde');
58: 
59:         ob_start();
60:         require FOLKS_TEMPLATES . '/block/users.php';
61:         return ob_get_clean();
62:     }
63: }
64: 
API documentation generated by ApiGen