dolibarr
21.0.0-alpha
Main Page
Related Pages
Topics
Classes
Files
File List
File Members
dolibarr_dev
htdocs
webportal
controllers
default.controller.class.php
Go to the documentation of this file.
1
<?php
2
/*
3
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
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
28
class
DefaultController
extends
Controller
29
{
35
public
function
checkAccess
()
36
{
37
$this->accessRight =
true
;
38
39
return
parent::checkAccess();
40
}
41
48
public
function
action
()
49
{
50
global $langs;
51
$context
=
Context::getInstance
();
52
if
(!
$context
->controllerInstance->checkAccess()) {
53
return
-1;
54
}
55
56
$hookRes = $this->
hookDoAction
();
57
if
(empty($hookRes)) {
58
$context
->title = $langs->trans(
'WebPortalHomeTitle'
);
59
$context
->desc = $langs->trans(
'WebPortalHomeDesc'
);
60
//$context->doNotDisplayHeaderBar=1;// hide default header
61
}
62
63
return
1;
64
}
65
71
public
function
display
()
72
{
73
$context
=
Context::getInstance
();
74
if
(!
$context
->controllerInstance->checkAccess()) {
75
$this->
display404
();
76
return
;
77
}
78
79
$this->
loadTemplate
(
'header'
);
80
$this->
loadTemplate
(
'menu'
);
81
$this->
loadTemplate
(
'hero-header-banner'
);
82
83
$hookRes = $this->
hookPrintPageView
();
84
85
if
(empty($hookRes)) {
86
$this->
loadTemplate
(
'home'
);
87
}
88
89
$this->
loadTemplate
(
'footer'
);
90
}
91
}
Context\getInstance
static getInstance()
Singleton method to create one instance of this object.
Definition
context.class.php:219
Controller
Class to manage pages.
Definition
controller.class.php:29
Controller\hookPrintPageView
hookPrintPageView($parameters=array())
Execute hook PrintPageView.
Definition
controller.class.php:170
Controller\display404
display404()
Display error template.
Definition
controller.class.php:134
Controller\hookDoAction
hookDoAction($parameters=array())
Execute hook doActions.
Definition
controller.class.php:147
Controller\loadTemplate
loadTemplate($templateName, $vars=false)
Load a template .tpl file.
Definition
controller.class.php:194
DefaultController
Class for DefaultController.
Definition
default.controller.class.php:29
DefaultController\display
display()
Display.
Definition
default.controller.class.php:71
DefaultController\checkAccess
checkAccess()
Check current access to controller.
Definition
default.controller.class.php:35
DefaultController\action
action()
Action method is called before html output can be used to manage security and change context.
Definition
default.controller.class.php:48
$context
$context
@method int call_trigger(string $triggerName, User $user)
Definition
logout.php:42
Generated on Fri Nov 1 2024 01:00:34 for
dolibarr
by Doxygen 1.11.0