Minor change to freebusy report test.
[davical.git] / htdocs / admin.php
blob7fe272c368127ebca36eca417f527882005bca74
1 <?php
2 require_once('./always.php');
3 require_once('classEditor.php');
4 require_once('classBrowser.php');
5 include("DAViCalSession.php");
6 $session->LoginRequired();
8 require_once('AwlQuery.php');
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');
14 $c->stylesheets[] = 'css/'.$action.'.css';
15 if ( $c->enable_row_linking ) {
16 $c->scripts[] = 'js/browse.js';
19 require_once('interactive-page.php');
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 @ob_flush(); exit(0);
30 include('page-header.php');
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.
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';
43 else {
44 echo $page_element;
48 if (function_exists("post_render_function")) {
49 post_render_function();
52 include('page-footer.php');