diff --git a/public_html/classes/render-adminlte.class.php b/public_html/classes/render-adminlte.class.php index 73254ba30feb9e236ddd518d31e85e1fb688e1e4..b62ed6166a95333baf2e37dbebcd88ba72bba580 100755 --- a/public_html/classes/render-adminlte.class.php +++ b/public_html/classes/render-adminlte.class.php @@ -582,6 +582,10 @@ class renderadminlte { if($aLink['label']=='-'){ return '<div class="dropdown-divider"></div>'; } + // special menu entry: hamburger menu item (label is "=") + if($aLink['label']=='='){ + return '<li class="nav-item"><a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"></i></a></li>'; + } $aChildren=isset($aLink['children']) && is_array($aLink['children']) && count($aLink['children']) ? $aLink['children'] : false; @@ -665,7 +669,7 @@ class renderadminlte { * @return string */ public function getTopNavigation($aNavItems, $aUlOptions=['class'=>'navbar-nav']){ - array_unshift($aNavItems, ['class'=>'nav-link', 'data-widget'=>'pushmenu', 'href'=>'#', 'role'=>'button', 'label'=>'<i class="fa-solid fa-bars"></i>']); + // array_unshift($aNavItems, ['class'=>'nav-link', 'data-widget'=>'pushmenu', 'href'=>'#', 'role'=>'button', 'label'=>'<i class="fa-solid fa-bars"></i>']); return $this->addWrapper('ul', $aUlOptions, $this->getNavItems($aNavItems)); } @@ -1224,6 +1228,11 @@ class renderadminlte { return $this->_tag('div', ['class'=>$sClass], $sContent.$sIcon.$sFooter); } + // ---------------------------------------------------------------------- + // + // PUBLIC FUNCTIONS :: CONTENT - FORM + // + // ---------------------------------------------------------------------- public function getHorizontalFormElement($sInput, $sLabel=false, $sId=false){ @@ -1345,4 +1354,66 @@ class renderadminlte { } + // ---------------------------------------------------------------------- + // + // PUBLIC FUNCTIONS :: CONTENT - TABBED CONTENT + // + // ---------------------------------------------------------------------- + + /** + * return a box with tabbed content + * @param array $aOptions hash with keys for all options + * - tabs {array} key=tab label; value=content + * @retunr string|array + */ + public function getTabbedContent($aOptions, $asArray=false){ + static $iTabCounter; + if( ! isset($aOptions['tabs']) || ! is_array($aOptions['tabs']) ){ + return false; + } + static $iTabCounter; + if (!isset($iTabCounter)){ + $iTabCounter=1; + } else { + $iTabCounter++; + } + + $id='tab-content-'.$iTabCounter; + $iCounter=0; + + $sTabs=''; + $sContent=''; + foreach($aOptions['tabs'] as $sLabel => $sTabContent){ + $iCounter++; + $sTabId=$id.'-tabitem-'.$iCounter.'-tab'; + $sContentId=$id.'-tabitem-'.$iCounter.'-content'; + + $sTabs.=$this->_tag('li', ['class'=>'nav-item'], + $this->_tag('a', [ + 'class'=>'nav-link'.($iCounter==1 ? ' active' : '' ), + 'id'=>$sTabId, + 'data-toggle'=>'tab', + 'href'=>'#'.$sContentId, + 'role'=>'tab', + 'aria-controls'=>'custom-tabs-one-profile', + 'aria-selected'=>($iCounter==1 ? true : false ), + ], + $sLabel) + ); + $sContent.=$this->_tag('div', [ + 'class'=>'tab-pane fade'.($iCounter==1 ? ' active show' : ''), + 'id'=>$sContentId, + 'role'=>'tabpanel', + 'aria-labelledby'=>$sTabId, + ], $sTabContent); + } + $sTabs=$this->_tag('ul', ['class'=>'nav nav-tabs', 'role'=>'tablist'], $sTabs); + $sContent=$this->_tag('div', ['class'=>'tab-content'], $sContent); + + return $asArray + ? ['tabs'=>$sTabs, 'content'=>$sContent] + : $sTabs . $sContent + ; + } + } diff --git a/public_html/config/navi_top.php b/public_html/config/navi_top.php index 55a294eafe14db13b074db271768e02b28ed2a53..6431da16391013e7aca5d373380124dc47a39f5a 100644 --- a/public_html/config/navi_top.php +++ b/public_html/config/navi_top.php @@ -1,8 +1,9 @@ <?php -// icons: https://fontawesome.com/v5/search?o=r&m=free +// icons: https://fontawesome.com/v6/search?o=r&m=free return [ + ['label'=>'='], ['href'=>'/index.php', 'label'=>'MyHome' , 'icon'=>'fa-solid fa-home', 'class'=>'bg-gray'], ['href'=>'#', 'label'=>'Contact' ], ['href'=>'#', 'label'=>'Help', diff --git a/public_html/config/navi_top.php.dist b/public_html/config/navi_top.php.dist index 55a294eafe14db13b074db271768e02b28ed2a53..718664275f0c5b88d868f2ab6e1dfc0eac8e5e43 100644 --- a/public_html/config/navi_top.php.dist +++ b/public_html/config/navi_top.php.dist @@ -3,6 +3,7 @@ // icons: https://fontawesome.com/v5/search?o=r&m=free return [ + ['label'=>'='], ['href'=>'/index.php', 'label'=>'MyHome' , 'icon'=>'fa-solid fa-home', 'class'=>'bg-gray'], ['href'=>'#', 'label'=>'Contact' ], ['href'=>'#', 'label'=>'Help',