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