file:
ToolbarButton.php
seems the $iconOver created in
public static function custom($task = '', $icon = '', $iconOver = '', $alt = '', $listSelect = true, $formId = null)
{
$bar = Toolbar::getInstance('toolbar');
// Strip extension.
$icon = preg_replace('#\.[^.]*$#', '', $icon);
// Add a standard button.
$bar->appendButton('Standard', $icon, $alt, $task, $listSelect, $formId);
}
How do we address this. I'm not sure where/how it is/should be used.
Labels |
Added:
?
|
$iconOver The image to display when moused over.
correct, however, it doesn't & can't since the icon is never passed to the button.
Thats my point
Indeed. Same in 3.x.
Useless param. It is a remaining of... Joomla 1.5...
1.5
/**
* Writes a custom option and task button for the button bar
* @param string The task to perform (picked up by the switch($task) blocks
* @param string The image to display
* @param string The image to display when moused over
* @param string The alt text for the icon image
* @param boolean True if required to check that a standard list item is checked
*/
function custom( $task='', $icon=NULL, $iconOver='', $alt='', $listSelect=true ) {
$icon = ( $iconOver ? $iconOver : $icon );
$image = JHTML::_('image.site', $icon, '/images/', NULL, NULL, $alt );
if ($listSelect) {
$message = JText::sprintf( 'Please make a selection from the list to', JText::_( $alt ) );
$message = addslashes($message);
$onclick = "javascript:if (document.adminForm.boxchecked.value == 0){ alert('". $message . "');}else{submitbutton('$task')}";
} else {
$onclick = "javascript:submitbutton('$task')";
}
?>
<td>
<a class="toolbar" onclick="<?php echo $onclick ;?>">
<?php echo $image; ?></a>
</td>
<?php
}
then we should deprecate that option and remove all the existing $iconOvers from the toolbarhelper:: calls?
OR add it into all possible occurrence of toolbar and modify the js to use it?
I tested modifying
ToolbarHelper::custom('template.cropImage', 'fas fa-crop', 'fas fa-crop', 'COM_TEMPLATES_BUTTON_CROP', false);
by taking off one of the , 'fas fa-crop'
and the result is that the icon loses its opacity and can't be clicked i.e. disabled.
It works again if I use
ToolbarHelper::custom('template.cropImage', 'fas fa-crop', 'whatever', 'COM_TEMPLATES_BUTTON_CROP', false);
weird...
where would the js be that creates the button?
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-10-23 06:00:55 |
Closed_By | ⇒ | N6REJ |
$iconOver The image to display when moused over.