Skip to content

Commit 13cfd2b

Browse files
authored
[4.0] com_banners blank state (#33269)
1 parent 87610e3 commit 13cfd2b

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

administrator/components/com_banners/src/View/Banners/HtmlView.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ public function display($tpl = null): void
101101
$this->filterForm = $model->getFilterForm();
102102
$this->activeFilters = $model->getActiveFilters();
103103

104+
if (!count($this->items) && $this->get('IsBlankSlate'))
105+
{
106+
$this->setLayout('blankstate');
107+
}
108+
104109
// Check for errors.
105110
if (count($errors = $this->get('Errors')))
106111
{
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
/**
3+
* @package Joomla.Administrator
4+
* @subpackage com_banners
5+
*
6+
* @copyright (C) 2021 Open Source Matters, Inc. <https://www.joomla.org>
7+
* @license GNU General Public License version 2 or later; see LICENSE.txt
8+
*/
9+
10+
defined('_JEXEC') or die;
11+
12+
use Joomla\CMS\Language\Text;
13+
use Joomla\CMS\Router\Route;
14+
15+
?>
16+
<form action="<?php echo Route::_('index.php?option=com_banners&view=banners'); ?>" method="post" name="adminForm" id="adminForm">
17+
18+
<div class="px-4 py-5 my-5 text-center">
19+
<span class="fa-8x icon-bookmark banners mb-4" aria-hidden="true"></span>
20+
<h1 class="display-5 fw-bold"><?php echo Text::_('COM_BANNERS_BLANKSTATE_TITLE'); ?></h1>
21+
<div class="col-lg-6 mx-auto">
22+
<p class="lead mb-4">
23+
<?php echo Text::_('COM_BANNERS_BLANKSTATE_CONTACT'); ?>
24+
</p>
25+
<div class="d-grid gap-2 d-sm-flex justify-content-sm-center">
26+
<a href="<?php echo Route::_('index.php?option=com_banners&view=banner&layout=edit'); ?>" class="btn btn-primary btn-lg px-4 me-sm-3"><?php echo Text::_('COM_BANNERS_BLANKSTATE_BUTTON_ADD'); ?></a>
27+
<a href="https://docs.joomla.org/Special:MyLanguage/Help40:Banners" class="btn btn-outline-secondary btn-lg px-4"><?php echo Text::_('COM_BANNERS_BLANKSTATE_BUTTON_LEARNMORE'); ?></a>
28+
</div>
29+
</div>
30+
</div>
31+
32+
<input type="hidden" name="task" value="">
33+
<input type="hidden" name="boxchecked" value="0">
34+
</form>

administrator/language/en-GB/com_banners.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ COM_BANNERS_BATCH_OPTIONS="Batch process the selected banners"
3434
COM_BANNERS_BATCH_TIP="If a category is selected for move/copy, any actions selected will be applied to the copied or moved banners. Otherwise, all actions are applied to the selected banners."
3535
COM_BANNERS_BEGIN_HINT="Begin date (yyyy-mm-dd)"
3636
COM_BANNERS_BEGIN_LABEL="Begin Date"
37+
COM_BANNERS_BLANKSTATE_BUTTON_ADD="Add your first banner"
38+
COM_BANNERS_BLANKSTATE_BUTTON_LEARNMORE="Learn more"
39+
COM_BANNERS_BLANKSTATE_CONTACT="Banners are blocks of content containing advertising information and a record of the number of times the banner has been displayed is kept. You can use this component to create and manage your banners."
40+
COM_BANNERS_BLANKSTATE_TITLE="No Banners have been created yet."
3741
COM_BANNERS_CANCEL="Cancel"
3842
COM_BANNERS_CLICK="Click"
3943
COM_BANNERS_CLIENT_EDIT="Edit Client"

0 commit comments

Comments
 (0)