-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathintro.php
executable file
·51 lines (34 loc) · 1 KB
/
intro.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
// no direct access
defined( '_JEXEC' ) or die;
jimport('joomla.event.plugin');
class plgSystemIntro extends JPlugin {
// constructor
function plgSystemIntro(&$subject, $params) {
parent::__construct($subject, $params);
}
// OnAfterDispatch event to render the introsite.
function OnAfterDispatch()
{
$session = JFactory::getSession();
//check for frontend
if (!JFactory::getApplication()->isSite()) return ;
// check for intro into the session
$intro = $session->get('intro');
if(empty($intro))
{
// get the parameter with the html
echo $this->params->get('intro');
// set intro to session
$session->set('intro', 1);
// stop rendering the site and show the html-output
exit;
}
// keep the session alive
if($this->params->get('session'))
{
echo JHTML::_('behavior.keepalive');
}
}
}
?>