CoreFiles by mySites.guru
transition-button.php73 lines, 2,583 bytes, from Joomla_4.0.0-alpha8-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha7
md5
0cc0af207e2db06bffe2f116de8a0c07
sha1
4edac5a6f1f0a4d893fa2c3a9b943df521e2cb00
sha256
1ee7115e2c77c8ac6e5ababd74f2a80c6501582d16d7dbdd47e1547b7b0927ac
<?php
/**
 * @package     Joomla.Site
 * @subpackage  Layout
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;

HTMLHelper::_('bootstrap.popover');

/**
 * @var $icon    string
 * @var $title   string
 * @var $value   string
 * @var $task    string
 * @var $options array
 */
extract($displayData, EXTR_OVERWRITE);

$only_icon = empty($options['transitions']);
$disabled = !empty($options['disabled']);
$tip = !empty($options['tip']);
$id = (int) $options['id'];
$tipTitle = $options['tip_title'];
$checkboxName = $options['checkbox_name'];
?>
<?php if ($only_icon) : ?>
	<span class="tbody-icon mr-1">
		<span class="<?php echo $this->escape($icon ?? ''); ?> <?php echo $tip ? 'hasPopover' : ''; ?>"
			title="<?php echo HTMLHelper::_('tooltipText', Text::_($tipTitle ? : $title), '', 0); ?>"
			data-content="<?php echo HTMLHelper::_('tooltipText', Text::_($title), '', 0); ?>"
			data-placement="top"
		></span>
	</span>
	<div class="mr-auto"><?php echo $this->escape($options['stage']); ?></div>
<?php else : ?>
	<a class="tbody-icon mr-1 data-state-<?php echo $this->escape($value ?? ''); ?> <?php echo $this->escape(!empty($disabled) ? 'disabled' : null); ?> <?php echo $tip ? 'hasPopover' : ''; ?>"
		<?php if (empty($disabled)) : ?>
			href="javascript://"
		<?php endif; ?>

		title="<?php echo HTMLHelper::_('tooltipText', Text::_($tipTitle ? : $title), '', 0); ?>"
		data-content="<?php echo HTMLHelper::_('tooltipText', Text::_($title), '', 0); ?>"
		data-placement="top"
		onclick="Joomla.toggleAllNextElements(this, 'd-none')"
	>
		<span class="<?php echo $this->escape($icon ?? ''); ?>" aria-hidden="true"></span>
	</a>
	<div class="mr-auto"><?php echo $this->escape($options['stage']); ?></div>
	<div class="d-none">
		<?php
			$default = [
				JHtml::_('select.option', '', $this->escape($options['stage'])),
				JHtml::_('select.option', '-1', '--------', ['disable' => true])
			];

			$transitions = array_merge($default, $options['transitions']);

			$attribs = [
				'id'        => 'transition-select_' . (int) $id,
				'list.attr' => [
					'class'    => 'custom-select custom-select-sm form-control form-control-sm',
					'onchange' => "Joomla.listItemTask('" . $checkboxName . $this->escape($row ?? '') . "', 'articles.runTransition')"]
				];

			echo HTMLHelper::_('select.genericlist', $transitions, 'transition_' . (int) $id, $attribs);
		?>
	</div>
<?php endif; ?>

The same content is in 2 releases, Joomla 4.0.0-alpha7 to 4.0.0-alpha8. See them all, or every version of this file.