9if (PHP_SAPI !==
'cli') {
10 http_response_code(404);
21 $inc =
$base .
'include' . DIRECTORY_SEPARATOR;
23 foreach (glob($inc .
'*.class.php') ?: array() as $path) {
24 if (is_file($path))
$files[] = $path;
35 $src = @file_get_contents(
$file);
36 if (!is_string($src) || $src ===
'')
continue;
37 if (preg_match(
"/get_modul_var\s*\(\s*['\"]dbx_run2['\"]/", $src)) {
40 if (preg_match_all(
"/case\s+['\"]([^'\"]+)['\"]\s*:/", $src, $matches)) {
41 foreach ($matches[1] as $case) {
42 $case = trim((
string)$case);
43 if ($case ===
'' || $case ===
'default')
continue;
47 if (preg_match_all(
'/\$(?:run|action|work)\s*===?\s*[\'"]([^\'"]+)[\'"]/', $src, $ifs)) {
48 foreach ($ifs[1] as $case) {
49 $case = trim((
string)$case);
50 if ($case ===
'')
continue;
54 if (preg_match_all(
"/get_modul_var\s*\(\s*['\"]dbx_run1['\"][^)]*['\"]([a-zA-Z0-9_]+)['\"]/", $src, $defaults)) {
55 foreach ($defaults[1] as $case) {
56 $case = trim((
string)$case);
57 if ($case ===
'' || $case ===
'parameter')
continue;
63 'run1' => array_keys($run1),
64 'uses_run2' => $uses_run2,
69 if (preg_match(
'/^cms_(tree|page|save|new|delete|move|media|upload|external|remove|edit|set|assign|sort|mod_)/', $run1)) {
77 'dbxContent' => array(
78 'cms' => array(
'show',
'tree',
'page'),
79 'content' => array(
'edit'),
82 'user' => array(
'profil',
'avatar',
'avatar_upload',
'edit_profil',
'edit_avatar'),
85 'register' => array(
'confirm',
'resend_confirm'),
88 'dbx' => array(
'show'),
91 if (!isset($map[$modul][$run1]))
return array();
92 return $map[$modul][$run1];
97 $uses_run2 = !empty($scan[
'uses_run2']);
98 $run1_list = $scan[
'run1'];
100 if ($uses_run2 && $modul ===
'dbxHelp') {
101 return array(array(
'dbx',
'show'));
105 foreach ($run1_list as $run1) {
108 $specs[] = array($run1,
'');
110 $specs[] = array($run1, $run2);
115 $specs[] = array(
'show',
'');
120 foreach (
$specs as $spec) {
121 $key = $spec[0] .
'|' . $spec[1];
122 if (isset($uniq[$key]))
continue;
130 $key = strtolower($run2 !==
'' ? $run2 : $run1);
131 if (preg_match(
'/(form|contact|edit|profil|register|login)/', $key))
return 'form';
132 if (preg_match(
'/(list|tree|flat|overview|folder|files|grid)/', $key))
return 'list';
133 if (preg_match(
'/(menu|load|nav)/', $key))
return 'menu';
134 if (preg_match(
'/(cms|content|show|view|page|dashboard|run)/', $key))
return 'content';
135 if (preg_match(
'/(media|image|upload|avatar)/', $key))
return 'media';
136 if (preg_match(
'/(api|web|json|html)/', $key))
return 'api';
142 'form' => array(
'#f8f6f2',
'#8a6d3b',
'#d8cfc0'),
143 'list' => array(
'#f2f6fa',
'#2a5a8a',
'#c8d8ea'),
144 'menu' => array(
'#f2faf4',
'#2a6a3a',
'#c8e8d0'),
145 'content' => array(
'#f4f6fa',
'#3a4a7a',
'#d0d8ea'),
146 'media' => array(
'#faf4f8',
'#7a3a6a',
'#e8d0e0'),
147 'api' => array(
'#f6f4fa',
'#5a3a8a',
'#ddd0ea'),
148 'default' => array(
'#f5f5f5',
'#555555',
'#dddddd'),
150 return $palettes[$type] ?? $palettes[
'default'];
156 $marker =
'[modul=' . $modul .
']' . $params .
'[/modul]';
158 $paramLine = $params !==
'' ? $params :
'(Standard-Aufruf)';
159 $run2Line = $run2 !==
'' ? (
'dbx_run2=' . $run2) :
'';
162 if ($type ===
'form') {
164 <rect x="40" y="50" width="280" height="14" fill="' . $accent .
'" rx="3" opacity="0.35"/>
165 <rect x="40" y="78" width="280" height="28" fill="#fff" stroke="' . $border .
'" rx="4"/>
166 <rect x="40" y="118" width="280" height="28" fill="#fff" stroke="' . $border .
'" rx="4"/>
167 <rect x="40" y="158" width="100" height="26" fill="' . $accent .
'" rx="4"/>';
168 } elseif ($type ===
'list') {
170 <rect x="40" y="52" width="300" height="22" fill="#fff" stroke="' . $border .
'" rx="3"/>
171 <rect x="40" y="82" width="300" height="22" fill="#fff" stroke="' . $border .
'" rx="3"/>
172 <rect x="40" y="112" width="300" height="22" fill="#fff" stroke="' . $border .
'" rx="3"/>
173 <rect x="40" y="142" width="300" height="22" fill="#fff" stroke="' . $border .
'" rx="3"/>';
174 } elseif ($type ===
'menu') {
176 <rect x="40" y="60" width="70" height="24" fill="' . $accent .
'" rx="4" opacity="0.8"/>
177 <rect x="120" y="60" width="70" height="24" fill="' . $accent .
'" rx="4" opacity="0.55"/>
178 <rect x="200" y="60" width="70" height="24" fill="' . $accent .
'" rx="4" opacity="0.35"/>
179 <rect x="40" y="110" width="320" height="60" fill="#fff" stroke="' . $border .
'" rx="6"/>';
180 } elseif ($type ===
'media') {
182 <rect x="60" y="55" width="120" height="90" fill="#fff" stroke="' . $border .
'" rx="6"/>
183 <circle cx="110" cy="90" r="18" fill="' . $accent .
'" opacity="0.4"/>
184 <polygon points="180,130 220,70 260,130" fill="' . $accent .
'" opacity="0.35"/>';
187 <rect x="40" y="55" width="320" height="110" fill="#fff" stroke="' . $border .
'" rx="6"/>
188 <rect x="56" y="72" width="180" height="12" fill="' . $accent .
'" rx="2" opacity="0.5"/>
189 <rect x="56" y="94" width="260" height="10" fill="' . $accent .
'" rx="2" opacity="0.25"/>
190 <rect x="56" y="112" width="220" height="10" fill="' . $accent .
'" rx="2" opacity="0.25"/>';
193 $esc =
function ($s) {
194 return htmlspecialchars((
string)$s, ENT_QUOTES,
'UTF-8');
197 return '<?xml version="1.0" encoding="UTF-8"?>
198<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 200" role="img" aria-label="' . $esc($modul .
' ' . $run1) .
'">
199 <rect width="800" height="200" fill="' . $bg .
'" stroke="' . $border .
'" stroke-width="2" rx="8"/>
201 <text x="420" y="58" font-family="Segoe UI,Arial,sans-serif" font-size="22" font-weight="700" fill="' . $accent .
'">' . $esc($title) .
'</text>
202 <text x="420" y="88" font-family="Consolas,monospace" font-size="14" fill="#333">dbx_run1=' . $esc($run1) .
'</text>
203 ' . ($run2Line !==
'' ?
'<text x="420" y="112" font-family="Consolas,monospace" font-size="14" fill="#333">' . $esc($run2Line) .
'</text>' :
'') .
'
204 <text x="420" y="150" font-family="Consolas,monospace" font-size="11" fill="#666">' . $esc($paramLine) .
'</text>
205 <text x="400" y="182" text-anchor="middle" font-family="Consolas,monospace" font-size="10" fill="#888">' . $esc($marker) .
'</text>
211 $name = $modul .
'_' . $run1;
212 if ($run2 !==
'') $name .=
'_' . $run2;
213 return $name .
'.svg';
218 if ($run1 !==
'') $params[] =
'dbx_run1=' . rawurlencode($run1);
219 if ($run2 !==
'') $params[] =
'dbx_run2=' . rawurlencode($run2);
220 return implode(
'&', $params);
226foreach (glob(
$modulesDir .
'*', GLOB_ONLYDIR) ?: array() as $path) {
227 $modul = basename(str_replace(
'\\',
'/', $path));
228 if (!preg_match(
'/^[A-Za-z][A-Za-z0-9_]*$/', $modul))
continue;
229 if (!is_file($path . DIRECTORY_SEPARATOR . $modul .
'.class.php'))
continue;
233 $outDir = $path . DIRECTORY_SEPARATOR .
'tpl' . DIRECTORY_SEPARATOR .
'mod' . DIRECTORY_SEPARATOR;
235 fwrite(STDERR,
"Cannot create dir: $outDir\n");
239 foreach (
$specs as $spec) {
240 list($run1, $run2) = $spec;
242 if (is_file(
$file)) {
248 file_put_contents(
$file, $svg);
250 echo
"created: $modul / " . basename(
$file) .
"\n";
254echo
"Done. Created: $created, skipped (exists): $skipped\n";
if(!is_object( $db)) if($db->connect_db_server($server) !==1) $created
mod_class_files($modulesDir, $modul)
mod_specs_for_module($modulesDir, $modul, $scan)
mod_svg_content($modul, $run1, $run2, $params)
mod_run2_variants($modul, $run1)
mod_scan_runs($modulesDir, $modul)
if(PHP_SAPI !=='cli') $modulesDir
Erzeugt Platzhalter-SVGs in dbx/modules/{modul}/tpl/mod/ Dateiname: {Modul}_{dbx_run1}...
mod_visual_type($run1, $run2)
mod_filename($modul, $run1, $run2)
mod_build_params($run1, $run2)