-
Notifications
You must be signed in to change notification settings - Fork 22
/
basic.php
62 lines (52 loc) · 1.47 KB
/
basic.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
/**
* IMP basic view.
*
* Base URL Parameters:
* - page: (string) The current page view.
*
* Copyright 2013-2017 Horde LLC (http://www.horde.org/)
*
* See the enclosed file LICENSE for license information (GPL). If you
* did not receive this file, see http://www.horde.org/licenses/gpl.
*
* @author Michael Slusarz <slusarz@horde.org>
* @category Horde
* @copyright 2013-2017 Horde LLC
* @license http://www.horde.org/licenses/gpl GPL
* @package IMP
*/
require_once __DIR__ . '/lib/Application.php';
$vars = Horde_Variables::getDefaultVariables();
Horde_Registry::appInit('imp', array(
'session_control' => ($vars->page == 'compose' ? 'netscape' : null),
'timezone' => in_array($vars->page, array('compose', 'mailbox', 'message'))
));
$class = 'IMP_Basic_' . Horde_String::ucfirst($vars->page);
switch ($class) {
case 'IMP_Basic_Compose':
IMP_Dynamic_Compose::url()->add($_GET)->redirect();
default:
if (!class_exists($class)) {
throw new IMP_Exception('Page not found: ' . $vars->page);
}
break;
}
try {
$ob = new $class($vars);
} catch (Exception $e) {
if ($registry->getView() == $registry::VIEW_BASIC) {
$notification->push($e);
$ob = new IMP_Basic_Error($vars);
} else {
throw $e;
}
}
$status = $ob->status();
$page_output->header(array_merge(array(
'title' => $ob->title,
'view' => $registry::VIEW_BASIC
), $ob->header_params));
echo $status;
$ob->render();
$page_output->footer();