00001 <?php
00002 require_once
TM_PATH . 'juelich/data/
JuelichData.php';
00003 require_once
TM_PATH . 'juelich/data/JuelichAdminData.php';
00004 require_once
TM_PATH . 'juelich/data/
JuelichDbReader.php';
00005
#require_once TM_PATH . 'juelich/data/JuelichDbWriter.php';
00006
require_once
TM_PATH . 'juelich/web/
JuelichPageFactory.php';
00007
00019 function &
getDataInstance() {
00020
static $data = NULL;
00021
if (empty($data)) {
00022 $data =
new JuelichData;
00023 }
00024
return $data;
00025 }
00026
00032 function &
getAdminDataInstance() {
00033
static $adminData = null;
00034
if (empty($adminData)) {
00035 $adminData =
new JuelichAdminData;
00036 }
00037
return $adminData;
00038 }
00039
00045 function &
getDbReaderInstance() {
00046
static $reader = NULL;
00047
if (empty($reader)) {
00048 $reader =
new JuelichDbReader;
00049 }
00050
return $reader;
00051 }
00052
00058 function &
getDbWriterInstance() {
00059
static $writer = NULL;
00060
if (empty($writer)) {
00061 $writer =
new JuelichDbWriter;
00062 }
00063
return $writer;
00064 }
00065
00066
00072 function &
getPageFactoryInstance() {
00073
static $pf = NULL;
00074
if (empty($pf)) {
00075 $data =&
getDataInstance();
00076 $mode = $data->getAppData('mode');
00077 $pf =
new JuelichPageFactory($mode);
00078 }
00079
return $pf;
00080 }
00081
00089 function
getModule($string, &$mod) {
00090
if ($string == 'fernglas' || $string ==
'f') {
00091 include_once
TM_PATH . 'juelich/module/ModFernglas.php';
00092 $mod =
new ModFernglas;
00093 }
00094 elseif ($string == 'teleskop' || $string ==
't') {
00095 include_once
TM_PATH . 'juelich/module/ModTeleskop.php';
00096 $mod =
new ModTeleskop;
00097 }
00098 elseif ($string == 'spektiv' || $string == 'sp') {
00099 include_once
TM_PATH . 'juelich/module/ModSpektiv.php';
00100 $mod =
new ModSpektiv;
00101 }
00102 elseif ($string == 'stativ' || $string == 'sv') {
00103 include_once
TM_PATH . 'juelich/module/ModStativ.php';
00104 $mod =
new ModStativ;
00105 }
00106 elseif ($string == 'globus' || $string ==
'g') {
00107 include_once
TM_PATH . 'juelich/module/ModGlobus.php';
00108 $mod =
new ModGlobus;
00109 }
00110 elseif ($string == 'mikroskop' || $string == 'mk') {
00111 include_once
TM_PATH . 'juelich/module/ModMikroskop.php';
00112 $mod =
new ModMikroskop;
00113 }
00114 elseif ($string == 'miktisch' || $string == 'mt') {
00115 include_once
TM_PATH . 'juelich/module/ModMikTisch.php';
00116 $mod =
new ModMikTisch;
00117 }
00118 elseif ($string == 'stereomikroskop' || $string ==
's') {
00119 include_once
TM_PATH . 'juelich/module/ModStereoMikroskop.php';
00120 $mod =
new ModStereoMikroskop;
00121 }
00122 elseif ($string == 'lupe' || $string ==
'l') {
00123 include_once
TM_PATH . 'juelich/module/ModLupe.php';
00124 $mod =
new ModLupe;
00125 }
00126 elseif ($string == 'sonderposten' || $string == 'sopo') {
00127 include_once
TM_PATH . 'juelich/module/ModSonderposten.php';
00128 $mod =
new ModSonderposten;
00129 }
00130 elseif ($string == 'spektiv_okular' || $string == 'so') {
00131 include_once
TM_PATH . 'juelich/module/ModSpektivOkular.php';
00132 $mod =
new ModSpektivOkular;
00133 }
00134 elseif ($string == 'produkt') {
00135 include_once
TM_PATH . 'juelich/module/ModProdukt.php';
00136 $mod =
new ModProdukt;
00137 }
00138 elseif ($string ==
'h') {
00139 include_once
TM_PATH . 'juelich/module/ModHersteller.php';
00140 $mod =
new ModHersteller;
00141 }
00142 elseif ($string ==
'm') {
00143 include_once
TM_PATH . 'juelich/module/ModModell.php';
00144 $mod =
new ModModell;
00145 }
00146 elseif ($string == 'kvv') {
00147 include_once
TM_PATH . 'juelich/module/ModKvv.php';
00148 $mod =
new ModKvv;
00149 }
00150 elseif ($string == 'ebb') {
00151 include_once
TM_PATH . 'juelich/module/ModEbb.php';
00152 $mod =
new ModEbb;
00153 }
00154 elseif ($string == '
template') {
00155 include_once
TM_PATH . 'juelich/module/ModTemplate.php';
00156 $mod =
new ModTemplate;
00157 }
00158 elseif ($string == 'pfad') {
00159 include_once
TM_PATH . 'juelich/module/ModPfad.php';
00160 $mod =
new ModPfad;
00161 }
00162 elseif ($string == 'zubehoer') {
00163 include_once
TM_PATH . 'juelich/module/ModZubehoer.php';
00164 $mod =
new ModZubehoer;
00165 }
00166 elseif ($string == 'telzub') {
00167 include_once
TM_PATH . 'juelich/module/ModTelZub.php';
00168 $mod =
new ModTelZub;
00169 }
00170 elseif ($string == 'telzubkat') {
00171 include_once
TM_PATH . 'juelich/module/ModTelZubKat.php';
00172 $mod =
new ModTelZubKat;
00173 }
00174 elseif ($string == 'menu') {
00175 include_once
TM_PATH . 'juelich/module/ModMenu.php';
00176 $mod =
new ModMenu;
00177 }
00178 elseif ($string == 'business') {
00179 include_once
TM_PATH . 'juelich/module/ModBusiness.php';
00180 $mod =
new ModBusiness;
00181 }
00182 elseif ($string == 'preise') {
00183 include_once
TM_PATH . 'juelich/module/ModPreise.php';
00184 $mod =
new ModPreise;
00185 }
00186 elseif ($string == 'ohne') {
00187
return;
00188 }
00189
else {
00190 include_once
TM_PATH . 'juelich/web/
JuelichError.php';
00191 $error =
new JuelichError;
00192 $error->printError(4, 'GetModule: Das Modul mit dem Bezeichner '
00193 . $string . ' gibt es nicht.');
00194
exit();
00195 }
00196
return;
00197 }
00198
00208 function
moduleMagic($
id) {
00209
static $modules = array();
00210 $ids = explode(
'-', $
id);
00211 $modString =
getDbReaderInstance()->getModuleString($ids[0]);
00212 $mod =
"";
00213
if (empty($modules[$modString])) {
00214 getmodule($modString, $modules[$modString]);
00215 }
00216 $mod = $modules[$modString];
00217 $cont =&
getDataInstance()->getAppDataContainer();
00218 $cont['module'] = $mod;
00219
if (count($ids) == 2) {
00220 $cont['dependDetail'] =
true;
00221 $cont['dependId'] = $ids[1];
00222 }
00223
else {
00224 $cont['dependDetail'] =
false;
00225 }
00226
getDataInstance()->setModuleDbData();
00227
return;
00228 }
00229
00230
00231 ?>