From 086dc50eeeb05136d5ad91638906e4c7d1d62002 Mon Sep 17 00:00:00 2001 From: "Hahn Axel (hahn)" <axel.hahn@iml.unibe.ch> Date: Thu, 15 Dec 2022 11:19:13 +0100 Subject: [PATCH] add overview and backlink to it --- public_html/pages/component.php | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/public_html/pages/component.php b/public_html/pages/component.php index 86151ea..e3b820a 100644 --- a/public_html/pages/component.php +++ b/public_html/pages/component.php @@ -27,14 +27,9 @@ $aWidgetOptions=[]; // ---------------------------------------------------------------------- if(!$renderAdminLTE->getComponent($sComponent)) { - echo ' - <h2>Ooops</h2> - <p>Maybe there is a typo ... the component <strong>"'.$sComponent.'"</strong> was not found.</p> - - <p>Show all components...</p> - '; - + echo '<h2>Show all components...</h2>'; + $sAllWidgets=''; foreach($renderAdminLTE->getComponents(1) as $sComponent=>$aComponent){ // code to fix ... @@ -46,8 +41,20 @@ if(!$renderAdminLTE->getComponent($sComponent)) { } } // print_r($aWidgetOptions); - echo getOutput("\$renderAdminLTE->".$aComponent['method']."(".var_export($aWidgetOptions, 1).");") . '<br><br>'; + $sAllWidgets.= $renderAdminLTE->addCol( + $renderAdminLTE->getCard(array ( + 'title' => $aComponent['label'], + //'tools' => 'Tools', + 'text' => getOutput("\$renderAdminLTE->".$aComponent['method']."(".var_export($aWidgetOptions, 1).");"), + 'footer' => '<a href="?id='.$sComponent.'" class="btn btn-secondary">Test ['.$aComponent['label'].']</a>', + )), + 3, + false + ); } + echo $renderAdminLTE->addRow( + $sAllWidgets + ); } else { @@ -128,7 +135,7 @@ if(!$renderAdminLTE->getComponent($sComponent)) { // ---------- output echo $renderAdminLTE->addRow( - '<h2>'.$aComp['label'].'</h2>' + '<h2><a href="?" class="btn btn-secondary"> << </a> '.$aComp['label'].'</h2>' ) .$renderAdminLTE->addRow( '<p>'.$aComp['description'].'</p>' -- GitLab