From f83a3aab50048921f02c1226067a72eb5edaf792 Mon Sep 17 00:00:00 2001 From: "Hahn Axel (hahn)" <axel.hahn@iml.unibe.ch> Date: Fri, 9 Dec 2022 17:11:50 +0100 Subject: [PATCH] WIP: start generic page for component info --- public_html/pages/component.php | 59 +++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 public_html/pages/component.php diff --git a/public_html/pages/component.php b/public_html/pages/component.php new file mode 100644 index 0000000..b41af1b --- /dev/null +++ b/public_html/pages/component.php @@ -0,0 +1,59 @@ +<?php + +$sComponent=(isset($_GET['id']) ? preg_replace('/[^a-z]/', '', $_GET['id']) : ''); +echo "DEBUG: sComponent = $sComponent<br>"; + + +$aComponents=[ + 'infobox'=>[ + 'label'=>'Infobox', + 'description'=>'', + 'method'=>'getInfobox', + 'examples'=>[ + [ + 'description'=>'Success infobox with progress', + 'params'=>[ + 'type'=>'success', + 'bgcolor'=>'', + 'icon'=>'far fa-thumbs-up', + 'text'=>'Likes', + 'number'=>"41,410", + 'progressvalue'=>70, + 'progresstext'=>'70% Increase in 30 Days' + ] + ], + ] + ], +]; + +if(!isset($aComponents[$sComponent])){ + echo ' + <h2>Ooops</h2> + <p>Maybe there is a typo ... the component <strong>"'.$sComponent.'"</strong> was not found.</p> + '; +} else { + + + $aComp=$aComponents[$sComponent]; + echo $renderAdminLTE->addRow( + '<h2>'.$aComp['label'].'</h2>' + ) + .$renderAdminLTE->addRow( + '<h3>Syntax</h3> + <pre>echo $renderAdminLTE-><strong>'.$aComp['method'].'</strong>($aOptions)</pre> + ' + ); + + foreach($aComp['examples'] as $aExample){ + echo $renderAdminLTE->addRow( + '<h4>'.$aExample['description'].'</h4>' + ) + .$renderAdminLTE->addRow( + showExample('$renderAdminLTE->'.$aComp['method'].'('.var_export($aExample['params'], 1).')') + ); + } + +; +} + +; \ No newline at end of file -- GitLab