2
0
forked from Wavyzz/dolibarr

Add class reposition on button that switch the view mode

This commit is contained in:
Laurent Destailleur
2019-09-30 17:46:53 +02:00
parent b390cff172
commit dc7ad61940
4 changed files with 17 additions and 9 deletions

View File

@@ -8239,7 +8239,7 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url =
*
* @param string $label label of button
* @param string $helpText optional : content for help tooltip
* @param string $iconClass class for icon element
* @param string $iconClass class for icon element (Example: 'fa fa-file')
* @param string $url the url for link
* @param string $id attribute id of button
* @param int $status 0 no user rights, 1 active, -1 Feature Disabled, -2 disable Other reason use helpText as tooltip
@@ -8255,12 +8255,12 @@ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $u
return '';
}
$class = 'btnTitle' ;
$class = 'btnTitle';
// hidden conf keep during button transition TODO: remove this block
if(empty($conf->global->MAIN_USE_NEW_TITLE_BUTTON)){
if (empty($conf->global->MAIN_USE_NEW_TITLE_BUTTON)) {
$class = 'butActionNew';
}
if (! empty($params['morecss'])) $class.=' '.$params['morecss'];
$attr=array(
'class' => $class
@@ -8326,9 +8326,9 @@ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $u
$TCompiledAttr[] = $key.'="'.$value.'"';
}
$compiledAttributes = !empty($TCompiledAttr)?implode(' ', $TCompiledAttr):'';
$compiledAttributes = (empty($TCompiledAttr) ? '' : implode(' ', $TCompiledAttr));
$tag = !empty($attr['href'])?'a':'span';
$tag = (empty($attr['href']) ? 'span' : 'a');
$button ='<'.$tag.' '.$compiledAttributes.' >';