Skip to content

Commit d119a86

Browse files
authored
Fix display of data-function (#38959)
1 parent 396b4fd commit d119a86

File tree

5 files changed

+7
-52
lines changed

5 files changed

+7
-52
lines changed

administrator/components/com_modules/tmpl/select/default.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,12 @@ class="form-control" id="comModulesSelectSearch"
6060
<div class="main-card card-columns p-4" id="comModulesSelectResultsContainer">
6161
<?php foreach ($this->items as &$item) : ?>
6262
<?php // Prepare variables for the link. ?>
63-
<?php $link = 'index.php?option=com_modules&task=module.add&client_id=' . $this->state->get('client_id', 0) . $this->modalLink . '&eid=' . $item->extension_id; ?>
64-
<?php $name = $this->escape($item->name); ?>
65-
<?php $desc = HTMLHelper::_('string.truncate', $this->escape(strip_tags($item->desc)), 200); ?>
66-
<a href="<?php echo Route::_($link); ?>" class="new-module mb-3 comModulesSelectCard" data-function="' . $this->escape($function) : ''; ?>" aria-label="<?php echo Text::sprintf('COM_MODULES_SELECT_MODULE', $name); ?>">
63+
<?php $link = 'index.php?option=com_modules&task=module.add&client_id=' . $this->state->get('client_id', 0) . $this->modalLink . '&eid=' . $item->extension_id; ?>
64+
<?php $name = $this->escape($item->name); ?>
65+
<?php $desc = HTMLHelper::_('string.truncate', $this->escape(strip_tags($item->desc)), 200); ?>
66+
<a href="<?php echo Route::_($link); ?>" class="new-module mb-3 comModulesSelectCard"
67+
<?php echo !empty($function) ? 'data-function="' . $this->escape($function) . '"' : ''; ?>
68+
aria-label="<?php echo Text::sprintf('COM_MODULES_SELECT_MODULE', $name); ?>">
6769
<div class="new-module-details">
6870
<h3 class="new-module-title"><?php echo $name; ?></h3>
6971
<p class="card-body new-module-caption p-0">

administrator/components/com_scheduler/src/View/Select/HtmlView.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,6 @@ class HtmlView extends BaseHtmlView
5454
*/
5555
protected $items;
5656

57-
/**
58-
* A suffix for links for modal use [?]
59-
*
60-
* @var string
61-
* @since 4.1.0
62-
*/
63-
protected $modalLink;
64-
6557
/**
6658
* HtmlView constructor.
6759
*
@@ -97,7 +89,6 @@ public function display($tpl = null): void
9789
{
9890
$this->state = $this->get('State');
9991
$this->items = $this->get('Items');
100-
$this->modalLink = '';
10192

10293
// Check for errors.
10394
if (\count($errors = $this->get('Errors'))) {

administrator/components/com_scheduler/src/View/Tasks/HtmlView.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,7 @@ public function display($tpl = null): void
109109
throw new GenericDataException(implode("\n", $errors), 500);
110110
}
111111

112-
// We don't need toolbar in the modal window.
113-
if ($this->getLayout() !== 'modal') {
114-
$this->addToolbar();
115-
}
112+
$this->addToolbar();
116113

117114
parent::display($tpl);
118115
}

administrator/components/com_scheduler/tmpl/select/default.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
7272
<?php $desc = HTMLHelper::_('string.truncate', $this->escape(strip_tags($item->desc)), 200); ?>
7373
<!-- The task card begins -->
7474
<a href="<?php echo Route::_($link); ?>" class="new-task mb-3 comSchedulerSelectCard"
75-
data-function="' . $this->escape($function) : ''; ?>"
7675
aria-label="<?php echo Text::sprintf('COM_SCHEDULER_SELECT_TASK_TYPE', $name); ?>">
7776
<div class="new-task-details">
7877
<h3 class="new-task-title"><?php echo $name; ?></h3>

administrator/components/com_scheduler/tmpl/select/modal.php

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)