3 // ----------------------------------------------------------------------
4 // POST-NUKE Content Management System
5 // Copyright (C) 2001 by the Post-Nuke Development Team.
6 // http://www.postnuke.com/
7 // ----------------------------------------------------------------------
9 // PHP-NUKE Web Portal System - http://phpnuke.org/
10 // Thatware - http://thatware.org/
11 // ----------------------------------------------------------------------
14 // This program is free software; you can redistribute it and/or
15 // modify it under the terms of the GNU General Public License (GPL)
16 // as published by the Free Software Foundation; either version 2
17 // of the License, or (at your option) any later version.
19 // This program is distributed in the hope that it will be useful,
20 // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 // GNU General Public License for more details.
24 // To read the license please visit http://www.gnu.org/copyleft/gpl.html
25 // ----------------------------------------------------------------------
26 // Original Author of this file: Francisco Burzi
27 // Purpose of this file: Directs to the start page as defined in config.php
28 // ----------------------------------------------------------------------
34 include_once("../../globals.php");
35 include_once("$srcdir/calendar.inc");
36 include_once("$srcdir/patient.inc");
37 include "includes/pnre.inc.php";
38 include 'includes/pnAPI.php';
40 // From Michael Brinson 2006-09-19:
41 if ($_POST['pc_username']) $_SESSION['pc_username'] = $_POST['pc_username'];
43 //if (empty($_GET['no_nav'])) {
44 // $_SESSION['last_calendar_page'] = $_SERVER['PHP_SELF'] . "?" . $_SERVER['QUERY_STRING'];
57 $type,) = pnVarCleanFromInput('module',
64 // Defaults for variables
66 pnVarCleanFromInput('catid');
69 // check requested module and set to start module if not present
71 $name = pnConfigGetVar('startpage');
72 // fixed for the new style of loading modules and set start page for them [class007]
78 // get module information
79 $modinfo = pnModGetInfo(pnModGetIDFromName($module));
81 if ($modinfo['type'] == 2)
83 // New-new style of loading modules
91 // it should be $module not $name [class007]
92 if (pnModAvailable($module)) {
93 if (pnModLoad($module, $type)) {
95 $return = pnModFunc($module, $type, $func);
106 // Sort out return of function. Can be
108 // false - display error msg
109 // text - return information
110 if ((empty($return)) ||
($return == false)) {
111 // Failed to load the module
112 $output = new pnHTML();
113 $output->StartPage();
114 $output->Text('Failed to load module ' . $module .' ( At function: "'.$func.'" )');
116 $output->PrintPage();
118 } elseif (strlen($return) > 1) {
120 $output = new pnHTML();
121 //$output->StartPage();
122 $output->SetInputMode(_PNH_VERBATIMINPUT
);
123 $output->Text($return);
124 $output->SetInputMode(_PNH_PARSEINPUT
);
125 //$output->EndPage();
126 $output->PrintPage();
134 // Old-old style of loading modules
142 include 'includes/legacy.php';
146 define("LOADED_AS_MODULE","1");
147 // added for the module/system seperation [class007]
148 if (file_exists('modules/' . pnVarPrepForOS($name) . '/' . pnVarPrepForOS($file) . '.php')) {
149 include 'modules/' . pnVarPrepForOS($name) . '/' . pnVarPrepForOS($file) . '.php';
151 // Failed to load the module
152 $output = new pnHTML();
153 //$output->StartPage();
154 $output->Text('Failed to load module ' . $module);
156 $output->PrintPage();
161 // Failed to load the module
162 $output = new pnHTML();
163 //$output->StartPage();
164 $output->Text('Sorry, you cannot access this file directly...');
166 $output->PrintPage();