1: <?php
2: /**
3: * Whups_View for displaying a list of tickets.
4: *
5: * Copyright 2001-2002 Robert E. Coyle <robertecoyle@hotmail.com>
6: * Copyright 2001-2012 Horde LLC (http://www.horde.org/)
7: *
8: * @author Robert E. Coyle <robertcoyle@hotmail.com>
9: * @author Michael J. Rubinsky <mrubinsk@horde.org>
10: * @package Whups
11: */
12: class Whups_View_Results extends Whups_View_Base
13: {
14: protected $_id;
15:
16: public function __construct($params)
17: {
18: parent::__construct($params);
19: $this->_id = uniqid(mt_rand());
20: }
21:
22: public function html()
23: {
24: Horde::addScriptFile('tables.js', 'horde', true);
25:
26: global $prefs, $registry, $session;
27:
28: $sortby = $prefs->getValue('sortby');
29: $sortdir = $prefs->getValue('sortdir');
30: $sortdirclass = $sortdir ? 'sortup' : 'sortdown';
31:
32: $ids = array();
33: foreach ($this->_params['results'] as $info) {
34: $ids[] = $info['id'];
35: }
36: $session->set('whups', 'tickets', $ids);
37:
38: include WHUPS_TEMPLATES . '/view/results.inc';
39: }
40:
41: }
42: