CoreFiles by mySites.guru
default.php77 lines, 3,345 bytes, from Joomla_6.1.0-beta1-Beta-Full_Package.zip
Raw History Compare with 6.0.0-beta3
md5
55ce61320e71438a915455b881bc1317
sha1
440c9fab78fc407676048d4c9ee3235b055b79b6
sha256
e79b0550c0c89152a838865e4da0f3009e1c91960c03d33a9def871e1d2379a0
<?php

/**
 * @package     Joomla.Administrator
 * @subpackage  com_workflow
 *
 * @copyright   (C) 2026 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 * @since       6.1.0
 */

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

use Joomla\CMS\Language\Text;

/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->getDocument()->getWebAssetManager();
$wa->useScript('keepalive')
    ->useScript('form.validate')
    ->useScript('joomla.dialog')
    ->useScript('joomla.dialog-autocreate');
$wa->useScript('com_workflow.workflowgraph')
    ->useStyle('com_workflow.workflowgraph');

// Populate the language
$this->loadTemplate('texts');

$shortcuts = [
    ['key' => 'Alt + N',             'description' => Text::_('COM_WORKFLOW_GRAPH_ADD_STAGE')],
    ['key' => 'Alt + M',             'description' => Text::_('COM_WORKFLOW_GRAPH_ADD_TRANSITION')],
    ['key' => 'Enter / SpaceBar',    'description' => Text::_('COM_WORKFLOW_GRAPH_SELECT_ITEM')],
    ['key' => 'Select + E',          'description' => Text::_('COM_WORKFLOW_GRAPH_EDIT_ITEM')],
    ['key' => 'Select + Delete',     'description' => Text::_('COM_WORKFLOW_GRAPH_TRASH_ITEM')],
    ['key' => 'Select + Backspace',  'description' => Text::_('COM_WORKFLOW_GRAPH_TRASH_ITEM')],
    ['key' => 'Select + Shift + Arrows', 'description' => Text::_('COM_WORKFLOW_GRAPH_MOVE_STAGE')],
    ['key' => 'Escape',              'description' => Text::_('COM_WORKFLOW_GRAPH_CLEAR_SELECTION')],
    ['key' => '+ / =',               'description' => Text::_('COM_WORKFLOW_GRAPH_ZOOM_IN')],
    ['key' => '- / _',               'description' => Text::_('COM_WORKFLOW_GRAPH_ZOOM_OUT')],
    ['key' => 'F',                   'description' => Text::_('COM_WORKFLOW_GRAPH_FIT_VIEW')],
    ['key' => 'Tab',                 'description' => Text::_('COM_WORKFLOW_GRAPH_FOCUS_TYPE_CHANGE')],
    ['key' => 'Arrows',              'description' => Text::_('COM_WORKFLOW_GRAPH_NAVIGATE_NODES')],
    ['key' => 'Shift + Arrows',      'description' => Text::_('COM_WORKFLOW_GRAPH_MOVE_VIEW')],
];

$col1 = array_slice($shortcuts, 0, ceil(count($shortcuts) / 2));
$col2 = array_slice($shortcuts, ceil(count($shortcuts) / 2));

$shortcutsHtml   = [];
$shortcutsHtml[] = '<section class="p-3">';
$shortcutsHtml[] = '<div class="row">';
$renderColumn    = function ($column) {
    $html = '<div class="col-md-6">';
    $html .= '<table class="table table-borderless mb-0">';
    $html .= '<legend class="fw-bold mb-2 d-none">' . Text::_('COM_WORKFLOW_GRAPH_SHORTCUTS_TITLE') . '</legend>';
    foreach ($column as $item) {
        $html .= '<tr>';
        $html .= '<th scope="row" class="fw-bold text-nowrap"><kbd>' . htmlspecialchars($item['key']) . '</kbd></th>';
        $html .= '<td>' . Text::_($item['description']) . '</td>';
        $html .= '</tr>';
    }
    $html .= '</table></div>';
    return $html;
};

$shortcutsHtml[] = $renderColumn($col1);
$shortcutsHtml[] = $renderColumn($col2);

$shortcutsHtml[] = '</div>';
$shortcutsHtml[] = '</section>';
?>

<template id="shortcuts-popup-content">
    <?php echo implode($shortcutsHtml); ?>
</template>
<section id="workflow-graph-root" aria-label="<?php echo Text::_('COM_WORKFLOW_GRAPH'); ?>"></section>

No other release has this exact content. See every version of this file.