action-menu and info-box testing for overviews
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -45,15 +45,29 @@ if ($page == 'overview') {
|
||||
try {
|
||||
$domain_list_data = include_once dirname(__FILE__) . '/lib/tablelisting/customer/tablelisting.domains.php';
|
||||
$list = (new \Froxlor\UI\Collection(\Froxlor\Api\Commands\SubDomains::class, $userinfo))
|
||||
// ->addParam(['sql_search' => ['d.parentdomainid' => $parentdomain_id]])
|
||||
//->addParam(['sql_search' => ['d.parentdomainid' => $parentdomain_id]])
|
||||
->withPagination($domain_list_data['domain_list']['columns'])
|
||||
->getList();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
}
|
||||
|
||||
$add_link = false;
|
||||
$json_result = SubDomains::getLocal($userinfo, ['sql_search' => ['d.parentdomainid' => 0]])->listing();
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
$parentdomains_count = $result['count'];
|
||||
|
||||
if (($userinfo['subdomains_used'] < $userinfo['subdomains'] || $userinfo['subdomains'] == '-1') && $parentdomains_count != 0) {
|
||||
$add_link = [
|
||||
'href' => $linker->getLink(['section' => 'domains', 'page' => 'domains', 'action' => 'add']),
|
||||
'label' => $lng['domains']['subdomain_add']
|
||||
];
|
||||
}
|
||||
|
||||
UI::twigBuffer('user/table.html.twig', [
|
||||
'listing' => \Froxlor\UI\Listing::format($list, $domain_list_data['domain_list']),
|
||||
'add_link' => $add_link,
|
||||
'entity_info' => $lng['domains']['description']
|
||||
]);
|
||||
UI::twigOutputBuffer();
|
||||
} elseif ($action == 'delete' && $id != 0) {
|
||||
|
||||
@@ -1,9 +1,24 @@
|
||||
{% extends "Froxlor/userarea.html.twig" %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% import "Froxlor/table/table.html.twig" as table %}
|
||||
|
||||
{{ table.table(listing) }}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-10 order-2 order-md-1">
|
||||
{% import "Froxlor/table/table.html.twig" as table %}
|
||||
{{ table.table(listing) }}
|
||||
</div>
|
||||
{% if add_link is iterable or (entity_info is defined and entity_info is not empty) %}
|
||||
<div class="col-12 col-md-2 order-1 order-md-2">
|
||||
{% if add_link is iterable %}
|
||||
<a class="btn btn-success d-block" href="{{ add_link.href|raw }}">
|
||||
<i class="fa-solid fa-plus-circle"></i>
|
||||
{{ add_link.label }}</a>
|
||||
{% endif %}
|
||||
{% if entity_info is defined and entity_info is not empty %}
|
||||
<div class="alert alert-info mt-2" role="alert">
|
||||
{{ entity_info|raw }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user