1: <?php
2: 3: 4: 5:
6: class Folks_Block_Recent extends Horde_Core_Block
7: {
8: 9:
10: public function __construct($app, $params = array())
11: {
12: parent::__construct($app, $params);
13:
14: $this->_name = _("Recent visitors");
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: $list = $GLOBALS['folks_driver']->getRecentVisitors($this->_params['limit']);
37: if ($list instanceof PEAR_Error) {
38: return $list;
39: }
40:
41:
42: $actions = array(
43: array('url' => Horde::url('user.php'),
44: 'id' => 'user',
45: 'name' => _("View profile")));
46: if ($GLOBALS['registry']->hasInterface('letter')) {
47: $actions[] = array('url' => $GLOBALS['registry']->callByPackage('letter', 'compose', ''),
48: 'id' => 'user_to',
49: 'name' => _("Send message"));
50: }
51:
52: Horde::addScriptFile('stripe.js', 'horde');
53:
54: ob_start();
55: require FOLKS_TEMPLATES . '/block/users.php';
56: return ob_get_clean();
57: }
58: }
59: