From 2023b30dc3654f897e97a628a611c0be39bd10d8 Mon Sep 17 00:00:00 2001
From: "Hahn Axel (hahn)" <axel.hahn@unibe.ch>
Date: Fri, 10 May 2024 16:31:58 +0200
Subject: [PATCH] add select in test section; add space for css class

---
 public_html/classes/render-adminlte.class.php | 38 ++++++++++++++++++-
 1 file changed, 37 insertions(+), 1 deletion(-)

diff --git a/public_html/classes/render-adminlte.class.php b/public_html/classes/render-adminlte.class.php
index d319b97..bb0f0b9 100755
--- a/public_html/classes/render-adminlte.class.php
+++ b/public_html/classes/render-adminlte.class.php
@@ -455,6 +455,42 @@ class renderadminlte {
                 ]
             ],
             // ------------------------------------------------------------
+            // WIP
+            'select'=>[
+                'label'=>'Form: select',
+                'description'=>'Select box',
+                'method'=>'getFormSelect',
+        
+                'params'=>[
+                    'label'       => [
+                        'group'=>'styling', 
+                        'description'=>'label for the select field', 
+                        'example_value'=>'Enter text'
+                    ],
+                    'bootstrap-select' => ['select'=> [
+                        'description'=>'Enable bootstrap-select plugin',
+                        'group'=>'styling',
+                        'values'=>[
+                            '0'=>'no',
+                            '1'=>'yes',
+                            ]
+                    ]
+                    ],
+                    'class'       => [
+                        'group'=>'styling', 
+                        'description'=>'optional: css classes', 
+                        'example_value'=>'myclass'
+                    ],
+                    'options' => [
+                        'example_value'=> [
+                            [ "value" => "1", "label"=>"one" ],
+                            [ "value" => "2", "label"=>"two" ],
+                            [ "value" => "3", "label"=>"three" ],
+                        ],
+                    ]
+                ],
+            ],
+            // ------------------------------------------------------------
             'textarea'=>[
                 'label'=>'Form: textarea',
                 'description'=>'textarea or html editor',
@@ -1386,7 +1422,7 @@ class renderadminlte {
         $aElement=$aOptions;
         $aElement['class']=''
             . 'form-control '
-            . (isset($aOptions['class']) ? $aOptions['class']: '')
+            . (isset($aOptions['class']) ? $aOptions['class'].' ': '')
             . (isset($aOptions['bootstrap-select']) ? 'selectpicker ': '') //$aOptions
         ;
         if(isset($aOptions['bootstrap-select']) && $aOptions['bootstrap-select']){
-- 
GitLab