Skip to content

Commit

Permalink
[K6.3] Change: refactored templates back-end view into J5 (#9627)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruud68 authored Feb 22, 2024
1 parent b85bb80 commit ef17a50
Show file tree
Hide file tree
Showing 6 changed files with 150 additions and 151 deletions.
58 changes: 32 additions & 26 deletions src/admin/src/View/Templates/HtmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Exception;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Kunena\Forum\Libraries\Template\KunenaTemplate;

Expand Down Expand Up @@ -95,10 +96,14 @@ public function displayAdd(): void
*/
protected function setToolBarAdd(): void
{
// Get the toolbar object instance
$toolbar = Toolbar::getInstance();

// Set the title bar text
ToolbarHelper::title(Text::_('COM_KUNENA') . ': ' . Text::_('COM_KUNENA_TEMPLATE_MANAGER'), 'color-palette');
ToolbarHelper::spacer();
ToolbarHelper::back();
ToolbarHelper::spacer();

$toolbar->back();

$helpUrl = 'https://docs.kunena.org/en/manual/backend/templates/edit-template-settings';
ToolbarHelper::help('COM_KUNENA', false, $helpUrl);
}
Expand Down Expand Up @@ -131,19 +136,19 @@ public function display($tpl = null)
*/
protected function addToolbar(): void
{
// Get the toolbar object instance
$toolbar = Toolbar::getInstance();

// Set the title bar text
ToolbarHelper::title(Text::_('COM_KUNENA') . ': ' . Text::_('COM_KUNENA_TEMPLATE_MANAGER'), 'color-palette');
ToolbarHelper::spacer();
ToolbarHelper::addNew('template.addnew', 'COM_KUNENA_TEMPLATES_NEW_TEMPLATE');

$toolbar->addNew('template.addnew', 'COM_KUNENA_TEMPLATES_NEW_TEMPLATE');
ToolbarHelper::custom('template.edit', 'edit', 'edit', 'COM_KUNENA_EDIT');
ToolbarHelper::divider();
ToolbarHelper::custom('template.publish', 'star', 'star', 'COM_KUNENA_A_TEMPLATE_MANAGER_DEFAULT');
ToolbarHelper::divider();
ToolbarHelper::custom('template.uninstall', 'remove', 'remove', 'COM_KUNENA_A_TEMPLATE_MANAGER_UNINSTALL');
ToolbarHelper::spacer();
ToolbarHelper::custom('template.chooseCss', 'edit', 'edit', 'COM_KUNENA_A_TEMPLATE_MANAGER_EDITCSS');
ToolbarHelper::divider();
ToolbarHelper::custom('template.chooseScss', 'edit', 'edit', 'COM_KUNENA_A_TEMPLATE_MANAGER_EDITSCSS');
ToolbarHelper::divider();

$helpUrl = 'https://docs.kunena.org/en/manual/backend/templates/add-template';
ToolbarHelper::help('COM_KUNENA', false, $helpUrl);
}
Expand Down Expand Up @@ -185,16 +190,17 @@ public function displayEdit(): void
*/
protected function setToolBarEdit(): void
{
// Get the toolbar object instance
$toolbar = Toolbar::getInstance();

// Set the title bar text
ToolbarHelper::title(Text::_('COM_KUNENA') . ': ' . Text::_('COM_KUNENA_TEMPLATE_MANAGER'), 'color-palette');
ToolbarHelper::spacer();
ToolbarHelper::apply('apply');
ToolbarHelper::spacer();
ToolbarHelper::save('save');
ToolbarHelper::spacer();

$toolbar->apply('apply');
$toolbar->save('save');
ToolbarHelper::custom('restore', 'checkin.png', 'checkin_f2.png', 'COM_KUNENA_TRASH_RESTORE_TEMPLATE_SETTINGS', false);
ToolbarHelper::spacer();
ToolbarHelper::cancel();
ToolbarHelper::spacer();
$toolbar->cancel();

$helpUrl = 'https://docs.kunena.org/en/manual/backend/templates/edit-template-settings';
ToolbarHelper::help('COM_KUNENA', false, $helpUrl);
}
Expand Down Expand Up @@ -223,14 +229,14 @@ public function displayEditCss(): void
*/
protected function setToolBarEditCss(): void
{
// Get the toolbar object instance
$toolbar = Toolbar::getInstance();

// Set the title bar text
ToolbarHelper::title(Text::_('COM_KUNENA') . ': ' . Text::_('COM_KUNENA_TEMPLATE_MANAGER'), 'color-palette');
ToolbarHelper::spacer();
ToolbarHelper::apply('applyCss');
ToolbarHelper::spacer();
ToolbarHelper::save('saveCss');
ToolbarHelper::spacer();
ToolbarHelper::spacer();
ToolbarHelper::cancel();
ToolbarHelper::spacer();

$toolsbar->apply('applyCss');
$toolsbar->save('saveCss');
$toolsbar->cancel();
}
}
4 changes: 2 additions & 2 deletions src/admin/tmpl/attachments/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
<td class="text-center">
<?php echo HTMLHelper::_('grid.id', $i, intval($attachment->id)) ?>
</td>
<td>
<th>
<div class="d-flex">
<div class="image me-2 align-self-center">
<?php echo $attachment->getLayout()->render('thumbnail'); ?>
Expand All @@ -88,7 +88,7 @@
<small><?php echo $attachment->getFilename(); ?></small>
</div>
</div>
</td>
</th>
<td><?php echo $this->escape($attachment->filetype); ?></td>
<td><?php echo number_format(intval($attachment->size) / 1024, 0, '', ',') . ' ' . Text::_('COM_KUNENA_A_FILESIZE_KB'); ?></td>
<td><?php echo $attachment->width > 0 ? $attachment->width . ' x ' . $attachment->height : '' ?></td>
Expand Down
4 changes: 2 additions & 2 deletions src/admin/tmpl/ranks/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@
<img loading=lazy src="<?php echo $this->escape($this->ktemplate->getRankPath($item->rankImage, true)) ?>" alt="<?php echo $this->escape($item->rankImage); ?>" />
<?php endif; ?>
</td>
<td>
<th>
<?php if ($canEdit) : ?>
<a href="<?php echo Route::_('index.php?option=com_kunena&view=rank&layout=edit&id=' . $item->rankId); ?>" title="<?php echo Text::_('JACTION_EDIT'); ?> <?php echo $this->escape($item->rankTitle); ?>">
<?php echo Text::_($item->rankTitle); ?></a>
<?php else : ?>
<?php echo Text::_($item->rankTitle); ?>
<?php endif; ?>
</td>
</th>

<td class="d-none d-md-table-cell">
<?php echo $item->rankSpecial == 1 ? Text::_('COM_KUNENA_YES') : Text::_('COM_KUNENA_NO'); ?>
Expand Down
4 changes: 2 additions & 2 deletions src/admin/tmpl/smilies/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@
<td class="text-center">
<?php echo HTMLHelper::_('grid.id', $i, intval($row->id)) ?>
</td>
<td class="d-none d-md-table-cell center">
<th class="d-none d-md-table-cell center">
<a href="<?php echo Route::_('index.php?option=com_kunena&view=smiley&layout=edit&id=' . (int) $row->id); ?>">
<img loading=lazy src="<?php echo $this->escape($this->ktemplate->getSmileyPath($row->location, true)); ?>" alt="<?php echo $this->escape($row->location); ?>" />
</a>
</td>
</td>
<td>
<?php echo $this->escape($row->code); ?>
</td>
Expand Down
Loading

0 comments on commit ef17a50

Please sign in to comment.