1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14:
15:
16:
17: if (!defined('SAM_BASE')) {
18: define('SAM_BASE', dirname(__FILE__) . '/..');
19: }
20:
21: if (!defined('HORDE_BASE')) {
22: 23:
24: if (file_exists(SAM_BASE . '/config/horde.local.php')) {
25: include SAM_BASE . '/config/horde.local.php';
26: } else {
27: define('HORDE_BASE', SAM_BASE . '/..');
28: }
29: }
30:
31: 32:
33: require_once HORDE_BASE . '/lib/core.php';
34:
35: class Sam_Application extends Horde_Registry_Application
36: {
37: 38:
39: public $version = 'H4 (1.0-git)';
40:
41: 42:
43: protected function _init()
44: {
45: $GLOBALS['injector']->bindFactory('Sam_Driver', 'Sam_Factory_Driver', 'create');
46: }
47:
48: 49:
50: public function ($menu)
51: {
52: if ($GLOBALS['conf']['enable']['rules']) {
53: $menu->add(Horde::url('spam.php'), _("Spam Options"), 'sam.png',
54: null, null, null,
55: basename($_SERVER['PHP_SELF']) == 'index.php' ? 'current' : null);
56: }
57: try {
58: $whitelist_url = $GLOBALS['registry']->link('mail/showWhitelist');
59: $menu->add(Horde::url($whitelist_url), _("Whitelist"), 'whitelist.png');
60: } catch (Horde_Exception $e) {
61: }
62: try {
63: $blacklist_url = $GLOBALS['registry']->link('mail/showBlacklist');
64: $menu->add(Horde::url($blacklist_url), _("Blacklist"), 'blacklist.png');
65: } catch (Horde_Exception $e) {
66: }
67: }
68: }
69: