1: <?php
2: /**
3: * Base controller.
4: *
5: * PHP version 5
6: *
7: * @category Kolab
8: * @package Kolab_FreeBusy
9: * @author Gunnar Wrobel <wrobel@pardus.de>
10: * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
11: * @link http://pear.horde.org/index.php?package=Kolab_FreeBusy
12: */
13:
14: /**
15: * Base controller.
16: *
17: * Copyright 2011-2012 Horde LLC (http://www.horde.org/)
18: *
19: * See the enclosed file COPYING for license information (LGPL). If you did not
20: * receive this file, see
21: * http://www.horde.org/licenses/lgpl21.
22: *
23: * @category Kolab
24: * @package Kolab_FreeBusy
25: * @author Gunnar Wrobel <wrobel@pardus.de>
26: * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
27: * @link http://pear.horde.org/index.php?package=Kolab_FreeBusy
28: */
29: class Horde_Kolab_FreeBusy_Controller_Base
30: extends Horde_Controller_Base
31: {
32: /**
33: * The routes match dictionary.
34: *
35: * @var Horde_Kolab_FreeBusy_Controller_MatchDict
36: */
37: private $_match_dict;
38:
39: /**
40: * The actual data provider.
41: *
42: * @var Horde_Kolab_FreeBusy_Provider
43: */
44: private $_provider;
45:
46: /**
47: * Constructor.
48: *
49: * @param Horde_Kolab_FreeBusy_Controller_MatchDict $match_dict The match
50: * dictionar * @param Horde_Kolab_FreeBusy_Provider $provider The data
51: * provider.
52: */
53: public function __construct(
54: Horde_Kolab_FreeBusy_Controller_MatchDict $match_dict,
55: Horde_Kolab_FreeBusy_Provider $provider
56: )
57: {
58: $this->_match_dict = $match_dict;
59: $this->_provider = $provider;
60: }
61:
62: /**
63: * Process the incoming request.
64: *
65: * @param Horde_Controller_Request $request
66: * @param Horde_Controller_Response $response
67: */
68: public function processRequest(Horde_Controller_Request $request, Horde_Controller_Response $response)
69: {
70: $params = $this->_match_dict->getMatchDict();
71: $this->_provider->{$params->action}($response, $params);
72: }
73: }