Skip to content
Snippets Groups Projects

Update renderer class

Merged Hahn Axel (hahn) requested to merge update_renderer_class into main
3 files
+ 75
2
Compare changes
  • Side-by-side
  • Inline

Files

@@ -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
;
}
}
Loading