index.php
5.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<?php
/**
* @file index.inc.php
* @category freeSN
* @mailto code [at] netz.coop
* @version 0.4.200901
* @link http://netz.coop
*
* @copyright Copyright by netz.coop e.G. 2015
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/**
* Definitionen und Umwandlung von $_POST[] und $_GET[] Variablen finden
* in der statischen Controller Klasse (Controller.php)
* und in den globalen Variablen von xsl (default_GlobalVariable.xsl) statt,
*
* Formulare ($_POST[] und $_GET[]) sind definiert XSL
* * default.xsl
*
* Tabellennamen sind definiert in der CONSTKindOf Klasse
* XMLTagnamen sind definiert in der CONSTKindOf Klasse und default.xsl
*/
require_once("include/config.php");
//require_once("include/php/TreeRequireClass.$_TREE.inc.php");
require_once("../../include/System/php/RequireClass.inc.php");
header('Content-Type: text/html; charset='.$_LOSP_CHARSET);
/** Klassen die standard mäßig benötigt werden */
$DB = StorableFactory::create($_LOSP_STORABLE_KINDOF, $_LOSP_STORABLE_DATA);
$HostAccount = BasisElement::createNewInstance($DB, 'Account', 0, $param_PartOf=null);
$DOMDocument = new DOMDocument('1.0', $_LOSP_CHARSET);
$DOMDocument->formatOutput = TRUE;
$Content = $DOMDocument->appendChild($DOMDocument->createElement('content'));
$Content->setAttribute('Tree', $_PAGE_NAME);
/** Sprache */
$DOMLanguage = new DOMDocument('1.0', $_LOSP_CHARSET);
if(array_key_exists(CONSTKindOf::LANG,$_GET)){
$langName=Language::getLanguageFilename($_GET[CONSTKindOf::LANG]);
}
else{
$langName=Language::getLanguageFilename();
}
$DOMLanguage->load($_PAGEDIR.'/include/language/'.$langName);
if(!$DOMLanguage->documentElement){
Error::newError("Language","Language file ".$langName." does not exist!","256");
}
else{
Language::addISOLanguages($DOMLanguage);
$Content->appendChild($DOMDocument->importNode($DOMLanguage->documentElement, true));
}
$DOMElement_HTMLTagHead = $DOMDocument->createElement("XMLSite_Head");
require_once($_PAGEDIR.'/include/php/TreeIndex.'.$_PAGE_NAME.'.inc.php');
/** HTML Header */
$DOMElement_HTMLTagHead->appendChild($DOMDocument->createElement("title","mensch.coop e.G."));
$DOMElement_HTMLTagHead->appendChild($DOMDocument->createElement("description","mensch.coop e.G. Seite"));
//$DOMElement_HTMLTagHead->appendChild($DOMDocument->createElement("title",$_TITLE));
//$DOMElement_HTMLTagHead->appendChild($DOMDocument->createElement("description",$_DESCRIPTION));
$DOMElement_HTMLTagHead->appendChild($DOMDocument->createElement("root",$_LOSP_ROOT));
/** Url header */
$_URL=$DOMDocument->createElement("url");
$_URL->setAttribute('parameter', '?'.urldecode(http_build_query($_GET)));
foreach($_GET as $key => $value){
if($key=='p'){
$tmp='?';
}
else{
$tmp='&';
}
$tmp_url[$key]=$_GET[$key];
$tmp_url = $tmp.urldecode(http_build_query($tmp_url));
if(substr($tmp_url,-1) == '='){
$tmp_url = substr($tmp_url,0,-1);
}
$_URL->setAttribute($key, $tmp_url);
unset($tmp_url);
}
$DOMElement_HTMLTagHead->appendChild($_URL);
$XMLStylesheet = $DOMElement_HTMLTagHead->appendChild($DOMDocument->createElement("XMLStylesheet"));
$XMLStylesheet->appendChild($DOMDocument->createElement("href",$var_css));
$XMLStylesheet->appendChild($DOMDocument->createElement("name","default"));
/** XSLTProcessor */
$stylesheet = new DOMDocument;
$stylesheet->load($_PAGEDIR.'/include/xsl/default.xsl');
$processor = new XSLTProcessor;
$processor->registerPHPFunctions();
$processor->importStylesheet($stylesheet);
$DB->disconnect();
/** die eigentliche Ausgabe */
echo $processor->transformToDoc($DOMDocument)->saveXML();
if($_LOSP_DEV)
{
/**
* @if $_LOSP_DEV (kann innerhalb @see config gesetzt werden)
*
* folgende Ausgaben sind nur für die Entwicklungszeit gedacht
*/
$var_ErrorWarnString = date('d. m. Y G:i:s').': ';
if(ErrorEvent::$count_handleError || ErrorEvent::$count_handleNotice) {
if(ErrorEvent::$count_handleError) {
$var_ErrorWarnString .= '<a href="'.$_E_LOGFILE_ERROR.'" style=\"font-size:15;color:red;\">Error('.ErrorEvent::$count_handleError.')</a> ';
} else {
$var_ErrorWarnString .= 'Error(0) ';
}
if(ErrorEvent::$count_handleNotice) {
$var_ErrorWarnString .= '<a href="'.$_E_LOGFILE_WARNINGNOTICE.'" style=\"font-size:15;color:red;\">Warn('.ErrorEvent::$count_handleNotice.')</a>';
} else {
$var_ErrorWarnString .= 'Warn(0)';
}
} else {
$var_ErrorWarnString .= 'Error/Warn/Note(0)';
}
D::showGeneralSoftwareAbstractInfos();
}
if($_LOSP_DEV_XMLOUTPUT) {
file_put_contents ( $_LOSP_PATH_TO_ROOT."Temp/XMLOutput.index.$_PAGE_NAME.xml", $DOMDocument->saveXML());
file_put_contents ( $_LOSP_PATH_TO_ROOT."Temp/D_Output.index.$_PAGE_NAME.xml", D::getString());
}
?>