1 | <?php |
---|
2 | require_once('./always.php'); |
---|
3 | require_once('classEditor.php'); |
---|
4 | require_once('classBrowser.php'); |
---|
5 | include("DAViCalSession.php"); |
---|
6 | $session->LoginRequired(); |
---|
7 | |
---|
8 | require_once('AwlQuery.php'); |
---|
9 | |
---|
10 | param_to_global('action', '{(edit|browse)}', 'action'); |
---|
11 | param_to_global('component', '{[a-z0-9-_]+}', 't'); |
---|
12 | param_to_global('id', '{[a-z0-9-_]+}', 'id'); |
---|
13 | |
---|
14 | $c->stylesheets[] = 'css/'.$action.'.css'; |
---|
15 | if ( $c->enable_row_linking ) { |
---|
16 | $c->scripts[] = 'js/browse.js'; |
---|
17 | } |
---|
18 | |
---|
19 | require_once('interactive-page.php'); |
---|
20 | |
---|
21 | $page_elements = array(); |
---|
22 | $code_file = sprintf( 'ui/%s-%s.php', $component, $action ); |
---|
23 | if ( ! @include_once( $code_file ) ) { |
---|
24 | $c->messages[] = sprintf('No page found to %s %s%s%s', $action, ($action == 'browse' ? '' : 'a '), $component, ($action == 'browse' ? 's' : '')); |
---|
25 | include('page-header.php'); |
---|
26 | include('page-footer.php'); |
---|
27 | exit(0); |
---|
28 | } |
---|
29 | |
---|
30 | include('page-header.php'); |
---|
31 | |
---|
32 | /** |
---|
33 | * Page elements could be an array of viewers, browsers or something else |
---|
34 | * that supports the Render() method... or a non-object which we assume is |
---|
35 | * just a string of text that we echo. |
---|
36 | */ |
---|
37 | $heading_level = null; |
---|
38 | foreach( $page_elements AS $k => $page_element ) { |
---|
39 | if ( is_object($page_element) ) { |
---|
40 | echo $page_element->Render($heading_level); |
---|
41 | $heading_level = 'h2'; |
---|
42 | } |
---|
43 | else { |
---|
44 | echo $page_element; |
---|
45 | } |
---|
46 | } |
---|
47 | |
---|
48 | if (function_exists("post_render_function")) { |
---|
49 | post_render_function(); |
---|
50 | } |
---|
51 | |
---|
52 | include('page-footer.php'); |
---|