my proposition :
in dom/html/link/button/toolbar.php, the parseVars($vars) function is modified like this : protected function parseVars($vars)
{
$alignStyle = null;
switch($this->align)
{
case 'left':
case 'right':
$alignStyle = "float: " . $this->align . ";";
break;
case 'center':
$alignStyle = "display: inline-block;";
break;
}
$this->jsCommand();
$btn_type="btn";
$glyph="";
switch ($this->name){
case 'save' :
$gliph = "<i class='icon-ok'></i>";
$btn_type="btn btn-success";
break;
case 'save-new' :
$gliph = "<i class='icon-plus'></i>";
$btn_type="btn btn-success";
break;
case 'cancel' :
$gliph = "<i class='icon-remove'></i>";
$btn_type="btn btn-danger";
break;
}
return parent::parseVars(array_merge(array(
'LI_STYLE' => "list-style:none; " . $alignStyle,
'LI_ID' => 'toolbar-' . $this->task,
'BUTTON_STYLE' => 'cursor:pointer',
'COMMAND' => ($this->link_js?htmlspecialchars($this->link_js):""),
'ICON_CLASS' => $gliph,
'BTN_TYPE' => $btn_type,
'TEXT' => $this->JText($this->text),
'CLASS' => $this->buildDomClass(),
), $vars));
}
the 'ICON_CLASS' is modified and now takes the value of the new $glyph var under jsCommand();
the 'BTN_TYPE' is added to add a class to the button that corresponds to bootstrap classes
More cases are to be set in the switch
Then in in dom/html/link/button/toolbar/standard.php, the build() function is modified like this : function build()
{
$this->addClass('button');
$html = '<li class="<%BTN_TYPE%>" id="<%LI_ID%>" onclick="<%COMMAND%>"></i>'
. $gliph.LN
. '<%ICON_CLASS%> <%TEXT%>'.LN
. '</li>' .LN;
return $html;
}
Those were my 2 cents of the day