Skip to content
Snippets Groups Projects
Commit 02132c89 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

add method getIconClass

parent a5eddcb8
Branches
No related tags found
1 merge request!62V2.0
<?php
/**
* html gui elements
* for bootstrap
* see http://dev.ci.iml.unibe.ch:8002/deployment/all/htmltest/
* for bootstrap 3
* CI SERVER GUI
*
* $oHtml=new htmlguielements();
*
......@@ -136,6 +136,7 @@ class htmlguielements{
'icons'=>array(
'menu'=>'fas fa-chevron-right',
'valuestore'=>'fa-solid fa-tags',
'overview'=>'fas fa-list',
'project'=>'fas fa-book',
'project-home'=>'fas fa-home',
......@@ -156,8 +157,8 @@ class htmlguielements{
'filter'=>'fas fa-filter',
'foreman'=>'fas fa-hard-hat',
'gotop'=>'fas fa-arrow-up',
'help'=>'fas fa-question-circle',
'login'=>'fas fa-lock',
'help'=>'fa-solid fa-life-ring',
'login'=>'fa-solid fa-right-to-bracket',
'new'=>'far fa-star',
'phase'=>'fas fa-chevron-right',
'poweroff'=>'fas fa-power-off',
......@@ -167,6 +168,7 @@ class htmlguielements{
'time'=>'far fa-clock',
'waiting'=>'fas fa-clock',
'user'=>'fas fa-user',
'user-profile'=>'fa-regular fa-id-card',
'workflow'=>'fas fa-angle-double-right',
'repository'=>'fas fa-database',
......@@ -274,6 +276,25 @@ class htmlguielements{
}
return '<i'.$this->addAttribute('class', ($sPrefix ? $sPrefix . ' ' : '').$sLabel).'></i> ';
}
/**
* get html code for icon; glypphicons and font-awesome is supported
*
* @param string $sLabel label of icon
* @return string
*/
public function getIconClass($sLabel){
if(!$sLabel){
return '';
}
if(isset($this->aCfg['icons'][$sLabel])){
return $this->aCfg['icons'][$sLabel];
}
$sPrefix=(
strpos($sLabel, 'glyphicon-')===0 ? 'glyphicon'
: ( strpos($sLabel, 'fa-')===0 ? 'fa' : '')
);
return ($sPrefix ? $sPrefix . ' ' : '').$sLabel;
}
/**
* get a default icon from config
......@@ -403,7 +424,7 @@ class htmlguielements{
* @param array $aTabData tab data; key is the tab label; value the content of its tab
* @return string
*/
public function getNav($aTabData){
public function getNav__UNUSED($aTabData){
$sTabs='';
$sContent='';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment