ShowMore: Use trait ipl\Web\Common\BaseTarget

This commit is contained in:
Johannes Meyer 2021-08-02 16:02:05 +02:00
parent a359add0a1
commit 8eaab649de
8 changed files with 10 additions and 7 deletions

View file

@ -89,7 +89,7 @@ class CommentsController extends Controller
if ($compact) {
$this->addContent(
(new ShowMore($results, Url::fromRequest()->without(['showCompact', 'limit'])))
->setAttribute('data-base-target', '_next')
->setBaseTarget('_next')
->setAttribute('title', sprintf(
t('Show all %d comments'),
$comments->count()

View file

@ -94,7 +94,7 @@ class DowntimesController extends Controller
if ($compact) {
$this->addContent(
(new ShowMore($results, Url::fromRequest()->without(['showCompact', 'limit'])))
->setAttribute('data-base-target', '_next')
->setBaseTarget('_next')
->setAttribute('title', sprintf(
t('Show all %d downtimes'),
$downtimes->count()

View file

@ -84,7 +84,7 @@ class HostgroupsController extends Controller
if ($compact) {
$this->addContent(
(new ShowMore($results, Url::fromRequest()->without(['showCompact', 'limit'])))
->setAttribute('data-base-target', '_next')
->setBaseTarget('_next')
->setAttribute('title', sprintf(
t('Show all %d hostgroups'),
$hostgroups->count()

View file

@ -100,7 +100,7 @@ class HostsController extends Controller
if ($compact) {
$this->addContent(
(new ShowMore($results, Url::fromRequest()->without(['showCompact', 'limit'])))
->setAttribute('data-base-target', '_next')
->setBaseTarget('_next')
->setAttribute('title', sprintf(
t('Show all %d hosts'),
$hosts->count()

View file

@ -83,7 +83,7 @@ class NotificationsController extends Controller
if ($compact) {
$this->addContent(
(new ShowMore($results, Url::fromRequest()->without(['showCompact', 'limit'])))
->setAttribute('data-base-target', '_next')
->setBaseTarget('_next')
->setAttribute('title', sprintf(
t('Show all %d notifications'),
$notifications->count()

View file

@ -83,7 +83,7 @@ class ServicegroupsController extends Controller
if ($compact) {
$this->addContent(
(new ShowMore($results, Url::fromRequest()->without(['showCompact', 'limit'])))
->setAttribute('data-base-target', '_next')
->setBaseTarget('_next')
->setAttribute('title', sprintf(
t('Show all %d servicegroups'),
$servicegroups->count()

View file

@ -105,7 +105,7 @@ class ServicesController extends Controller
if ($compact) {
$this->addContent(
(new ShowMore($results, Url::fromRequest()->without(['showCompact', 'limit'])))
->setAttribute('data-base-target', '_next')
->setBaseTarget('_next')
->setAttribute('title', sprintf(
t('Show all %d services'),
$services->count()

View file

@ -6,11 +6,14 @@ namespace Icinga\Module\Icingadb\Widget;
use ipl\Html\BaseHtmlElement;
use ipl\Orm\ResultSet;
use ipl\Web\Common\BaseTarget;
use ipl\Web\Url;
use ipl\Web\Widget\ActionLink;
class ShowMore extends BaseHtmlElement
{
use BaseTarget;
protected $defaultAttributes = ['class' => 'show-more'];
protected $tag = 'div';