28 private function is_template_editor_context() {
29 if ((
int)
dbx()->get_system_var(
'dbx_editor', 0,
'int') > 0) {
33 if ((
string)
dbx()->get_system_var(
'dbx_page',
'') ===
'_tpledit') {
37 $modul = (string)
dbx()->get_system_var(
'dbx_modul',
'');
38 $run1 = (string)
dbx()->get_system_var(
'dbx_run1',
'');
40 return $modul ===
'dbxAdmin' && in_array($run1, array(
'_edittpl',
'_edittpl_file'),
true);
52 if ($this->is_template_editor_context()) {
58 $f1=
''; $f2=
''; $modul=
''; $parameter=
'';
62 for ($a=1; $a< 512; $a++) {
76 $patterns =
"/\[modul=([^\[]*)\]([^\[]*)\[\/modul\]/i";
81 $funki = ($matches[1]);
85 if ($f1 >
"" && $f2 >
"") {
89 $replacements =
"ersetzt";
91 $replacements = $this->get_modul_content($modul,$parameter);
92 $inc_patterns =
"[modul=".$f1.
"]".$f2.
"[/modul]";
95 $pos1 = strpos (
$content, $inc_patterns );
96 $lang1 = strlen ($inc_patterns);
98 $vor = substr (
$content, 0 , $pos1);
99 $nach = substr (
$content, ($pos1+$lang1) , $lang2);
100 $content = $vor.$replacements.$nach;
125 if ($this->is_template_editor_context()) {
144 $patterns =
"/\[modul=([^\[]*)\]([^\[]*)\[\/modul\]/i";
145 for ($a = 1; $a < 512; $a++) {
151 foreach ($matches[0] as $idx => $match) {
152 $modul = (string)($matches[1][$idx][0] ??
'');
153 if (!isset(
$allowed[strtolower($modul)])) {
157 $parameter = (string)($matches[2][$idx][0] ??
'');
158 $replacement = $this->
run($this->get_modul_content($modul, $parameter));
159 $pos = (int)$match[1];
160 $len = strlen((
string)$match[0]);
187 private function get_modul_content($modul,$parameter=
'') {
188 dbx()->timer(
'run-'.$modul,
'P='.$parameter);
190 $modul_content=
''; $xparameter=
''; $action=
'undef'; $modul_id=0;
191 $protected_modulvars = array();
193 $access=
dbx()->can_modul($modul);
196 $oModul =
dbx()->get_modul_obj($modul);
197 $modul_id =
dbx()->get_system_var(
'dbx_activ_modul_id');
198 $parameter= trim($parameter);
199 $uid =
dbx()->user(
'id');
200 $part_select = explode (
"&", $parameter);
201 if (is_array($part_select)) {
202 foreach ($part_select as $id =>
$value) {
203 $pos = strpos(
$value,
"=");
205 $paramn = substr(
$value,0,$pos);
206 $paramv = substr(
$value,$pos2);
207 if ($paramv==
'?') $paramv=
dbx()->get_request_var($paramn,
'',
'parameter+|');
208 if ($paramn==
'dbx_run1') $action=$paramv;
210 dbx()->set_modul_var($paramn,$paramv);
213 $protected_modulvars[$paramn] = 1;
221 if (count($protected_modulvars)) {
222 dbx()->set_modul_var(
'dbx_protected_modulvars',$protected_modulvars);
226 dbx()->set_system_var(
'dbx_modul' ,$modul);
227 dbx()->set_system_var(
'dbx_run1' ,$action);
228 dbx()->set_system_var(
'dbx_activ_modul' ,$modul);
229 dbx()->set_system_var(
'dbx_activ_action',$action);
232 $modul_content=
dbx()->run_owner($oModul,
'run', $action);
237 $modul_content=
"<p class='red'>#undef# Modul=($modul) Action=($action)</p>";
243 $oTPL=
dbx()->get_system_obj(
'dbxTPL');
244 $modul_content=$oTPL->get_tpl(
'dbx|alert-warning',
"msg=Sie haben keinen Zugriff auf ($modul)." );
247 $master=
dbx()->get_system_var(
'dbx_master_modul',$modul);
248 $perma =
dbx()->get_system_var(
'dbx_permalink',
'');
250 $modul_content=
'[modul=dbxLogin]dbx_run1=login[/modul]';
255 dbx()->set_remember_var(
'dbx_redir_after_login',$perma,
'dbx');
257 dbx()->set_remember_var(
'dbx_redir_after_login',
"?dbx_modul=$modul&$parameter",
'dbx');
261 $redir=
dbx()->get_remember_var(
'dbx_redir_after_login',
'',
'dbx');
263 dbx()->timer(
'run-'.$modul);
264 return $modul_content;