changed app name to tc
[eq/.git] / index.php
1 <?php
2         /**************************************************************************\
3         * phpGroupWare - Notes                                                     *
4         * http://www.phpgroupware.org                                              *
5         * Written by Bettina Gille [ceb@phpgroupware.org]                          *
6         * -----------------------------------------------                          *
7         *  This program is free software; you can redistribute it and/or modify it *
8         *  under the terms of the GNU General Public License as published by the   *
9         *  Free Software Foundation; either version 2 of the License, or (at your  *
10         *  option) any later version.                                              *
11         \**************************************************************************/
12         /* $Id: index.php,v 1.48.4.1 2003/11/04 15:06:35 ceb Exp $ */
13
14         $GLOBALS['phpgw_info']['flags'] = array
15         (
16                 'currentapp' => 'tc',
17                 'noheader'   => True,
18                 'nonavbar'   => True 
19         );
20         include('../header.inc.php');
21
22         if (@isset($_GET['menuaction']))
23         {
24                 list($app,$class,$method) = explode('.',$_GET['menuaction']);
25                 if (! $app || ! $class || ! $method)
26                 {
27                         $invalid_data = True;
28                 }
29         }
30         else
31         {
32                 $app = 'tc';
33                 $class = 'tc';
34                 $invalid_data = True;
35         }
36
37         $GLOBALS['obj'] = CreateObject(sprintf('%s.%s',$app,$class));
38         $GLOBALS[$class] = $GLOBALS['obj'];
39         if ((is_array($GLOBALS[$class]->public_functions) && $GLOBALS[$class]->public_functions[$method]) && ! $invalid_data)
40         {
41                 execmethod($_GET['menuaction']);
42                 unset($app);
43                 unset($obj);
44                 unset($class);
45                 unset($method);
46                 unset($invalid_data);
47                 unset($api_requested);
48         }
49         else
50         {
51                 if (! $app || ! $class || ! $method)
52                 {
53                         $GLOBALS['phpgw']->log->message(array(
54                                 'text' => 'W-BadmenuactionVariable, menuaction missing or corrupt: %1',
55                                 'p1'   => $menuaction,
56                                 'line' => __LINE__,
57                                 'file' => __FILE__
58                         ));
59                 }
60
61                 if (! is_array($obj->public_functions) || ! $obj->public_functions[$method] && $method)
62                 {
63                         $GLOBALS['phpgw']->log->message(array(
64                                 'text' => 'W-BadmenuactionVariable, attempted to access private method: %1',
65                                 'p1'   => $method,
66                                 'line' => __LINE__,
67                                 'file' => __FILE__
68                         ));
69                 }
70                 //$GLOBALS['phpgw']->log->commit();
71                 
72                 //$GLOBALS['phpgw']->redirect_link('/tc/index.php?menuaction=tc.tc.ht_view');
73         } 
74
75 //$obj = CreateObject('tc.tc');
76 //$obj->ht_view();
77 //$GLOBALS['phpgw']->common->phpgw_footer();
78
79 ?>