Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[4] Empty state for com_redirect (#33384)
* Empty state for com_redirect * merge from other pr * change icon * cs * alpha * Update administrator/language/en-GB/com_redirect.ini Co-authored-by: Quy <quy@fluxbb.org> * Update administrator/components/com_redirect/tmpl/links/emptystate.php Co-authored-by: Brian Teeman <brian@teeman.net> Co-authored-by: Quy <quy@fluxbb.org> Co-authored-by: Brian Teeman <brian@teeman.net>
- Loading branch information
1 parent
1293461
commit 770e24b
Showing
4 changed files
with
75 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
administrator/components/com_redirect/tmpl/links/emptystate.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
/** | ||
* @package Joomla.Administrator | ||
* @subpackage com_redirect | ||
* | ||
* @copyright (C) 2021 Open Source Matters, Inc. <https://www.joomla.org> | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
defined('_JEXEC') or die; | ||
|
||
use Joomla\CMS\Factory; | ||
use Joomla\CMS\HTML\HTMLHelper; | ||
use Joomla\CMS\Language\Text; | ||
use Joomla\CMS\Layout\LayoutHelper; | ||
|
||
$displayData = [ | ||
'textPrefix' => 'COM_REDIRECT', | ||
'formURL' => 'index.php?option=com_redirect&view=links', | ||
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help4.x:Redirects:_Links', | ||
'icon' => 'icon-map-signs redirect', | ||
]; | ||
|
||
$user = Factory::getApplication()->getIdentity(); | ||
|
||
if ($user->authorise('core.create', 'com_redirect')) | ||
{ | ||
$displayData['createURL'] = 'index.php?option=com_redirect&task=link.add'; | ||
} | ||
|
||
if ($user->authorise('core.create', 'com_redirect') | ||
&& $user->authorise('core.edit', 'com_redirect') | ||
&& $user->authorise('core.edit.state', 'com_redirect')) | ||
{ | ||
$displayData['formAppend'] = HTMLHelper::_( | ||
'bootstrap.renderModal', | ||
'collapseModal', | ||
[ | ||
'title' => Text::_('COM_REDIRECT_BATCH_OPTIONS'), | ||
'footer' => $this->loadTemplate('batch_footer'), | ||
], | ||
$this->loadTemplate('batch_body') | ||
); | ||
} | ||
|
||
echo LayoutHelper::render('joomla.content.emptystate', $displayData); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters