dolibarr
24.0.0-beta
Main Page
Related Pages
Topics
Classes
Files
File List
File Members
dolibarr_dev
htdocs
webportal
controllers
abstractcard.controller.class.php
Go to the documentation of this file.
1
<?php
2
/* Copyright (C) 2023-2024 Laurent Destailleur <eldy@users.sourceforge.net>
3
* Copyright (C) 2023-2024 Lionel Vessiller <lvessiller@easya.solutions>
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 3 of the License, or
8
* (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17
*/
18
19
require_once __DIR__ .
'/../class/controller.class.php'
;
20
30
abstract
class
AbstractCardController
extends
Controller
31
{
35
public
$formCard;
36
42
public
function
display
()
43
{
44
$context
=
Context::getInstance
();
45
if
(!
$context
->controllerInstance->checkAccess()) {
46
$this->
display404
();
47
return
;
48
}
49
50
$this->
loadTemplate
(
'header'
, [
51
'body-class'
=> empty($this->formCard->modal) ?
''
:
'--is-modal'
52
]);
53
54
if
(empty($this->formCard->modal)) {
55
$this->
loadTemplate
(
'menu'
);
56
$this->
loadTemplate
(
'hero-header-banner'
);
57
}
58
59
// @phpstan-ignore-next-line
60
if
(isset($this->formCard)) {
61
$hookRes = $this->
hookPrintPageView
();
62
if
(empty($hookRes)) {
63
print
'<main class="container">'
;
64
if
($this->formCard->object->id > 0) {
65
if
($this->formCard->action ==
'edit'
&& $this->formCard->permissiontoadd) {
66
$this->
loadTemplate
(
'card-edit'
);
67
}
else
{
68
$this->
loadTemplate
(
'card-view'
);
69
}
70
}
71
print
'</main>'
;
72
}
73
}
else
{
74
$this->
loadTemplate
(
'404'
);
75
}
76
77
$this->
loadTemplate
(
'footer'
);
78
}
79
}
AbstractCardController
Class for AbstractCardController.
Definition
abstractcard.controller.class.php:31
AbstractCardController\display
display()
Display.
Definition
abstractcard.controller.class.php:42
Context\getInstance
static getInstance()
Singleton method to create one instance of this object.
Definition
context.class.php:228
Controller
Class to manage pages.
Definition
controller.class.php:30
Controller\hookPrintPageView
hookPrintPageView($parameters=array())
Execute hook PrintPageView.
Definition
controller.class.php:185
Controller\display404
display404()
Display error template.
Definition
controller.class.php:149
Controller\loadTemplate
loadTemplate($templateName, $vars=false)
Load a template .tpl file.
Definition
controller.class.php:209
$context
$context
@method int call_trigger(string $triggerName, ?User $user)
Definition
logout.php:42
Generated on Mon Jun 22 2026 21:04:50 for
dolibarr
by Doxygen 1.11.0