-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathfooter.php
More file actions
136 lines (123 loc) · 5.33 KB
/
footer.php
File metadata and controls
136 lines (123 loc) · 5.33 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?php
/**
*
* @copyright http://www.xoops.org/ The XOOPS Project
* @copyright XOOPS_copyrights.txt
* @copyright http://www.impresscms.org/ The ImpressCMS Project
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License (GPL)
* @package core
* @since XOOPS
* @author http://www.xoops.org The XOOPS Project
* @author Sina Asghari (aka stranger) <pesian_stranger@users.sourceforge.net>
* @version $Id: footer.php 20900 2011-02-27 02:18:47Z skenow $
*/
defined('ICMS_ROOT_PATH') || die('ICMS root path not defined');
if (defined("XOOPS_FOOTER_INCLUDED")) exit();
global $xoopsOption, $icmsConfigMetaFooter, $xoopsTpl, $icmsModule, $xoopsUser, $icmsConfig;
if(is_object($xoopsTpl) AND $icmsConfig['startpage'] == 'formulize') {
include_once XOOPS_ROOT_PATH."/modules/formulize/class/applications.php";
$logoURL = XOOPS_URL;
list($startFid,$startSid,$startURL) = formulizeApplicationMenuLinksHandler::getDefaultScreenForUser();
if(!$xoopsUser AND !$startFid AND !$startSid AND !$startURL) {
$icmsConfig['startpage'] = '--';
} elseif($startURL) {
$logoURL = $startURL;
} else {
if(!$startSid AND $startFid) {
$startSid = determineScreenForUserFromFid($startFid);
}
if($startSid) {
$screen_handler = xoops_getmodulehandler('screen', 'formulize');
if($screenObject = $screen_handler->get($startSid)) {
if($screenObject->getVar('rewriteruleAddress')) {
$logoURL = XOOPS_URL.'/'.urlencode(strip_tags($screenObject->getVar('rewriteruleAddress')));
} else {
$logoURL = XOOPS_URL.'/modules/formulize/index.php?sid='.$startSid;
}
}
} elseif($startFid) {
$logoURL = XOOPS_URL.'/modules/formulize/index.php?fid='.$startFid;
}
}
$xoopsTpl->assign('logo_url', $logoURL);
}
// Check for unread private messages (for inbox link indicator)
$unread_pm_count = 0;
if (is_object($xoopsUser) && $xoopsUser->getVar('notify_method') == 1) {
$pm_handler = icms::handler('icms_data_privmessage');
$criteria = new icms_db_criteria_Compo(new icms_db_criteria_Item('to_userid', $xoopsUser->getVar('uid')));
$criteria->add(new icms_db_criteria_Item('read_msg', 0));
$unread_pm_count = $pm_handler->getCount($criteria);
}
if (is_object($xoopsTpl)) {
$xoopsTpl->assign('unread_pm_count', $unread_pm_count);
}
/** Set the constant XOOPS_FOOTER_INCLUDED to 1 - this file has been included */
define("XOOPS_FOOTER_INCLUDED", 1);
$_SESSION['ad_sess_regen'] = FALSE;
if (isset($_SESSION['sess_regen']) && $_SESSION['sess_regen']) {
icms::$session->sessionOpen(TRUE);
$_SESSION['sess_regen'] = FALSE;
} else {
icms::$session->sessionOpen();
}
/** Masquerade part 1/2: Detect confirm box submit to revert user back to normal mode **/
if (isset($_POST['masquerade_end']) && $_POST['masquerade_end'] == 1 and isset($_SESSION['masquerade_xoopsUserId'])) {
$_SESSION['xoopsUserGroups'] = array(1); // ensure user has permission to access user.php
$_SESSION['masquerade_end'] = 1;
header('Location: ' . ICMS_MODULES_URL . '/profile/admin/user.php');
die;
}
// ################# Preload Trigger beforeFooter ##############
icms::$preload->triggerEvent('beforeFooter');
icms::$logger->stopTime('Module display');
if (isset($xoopsOption['theme_use_smarty']) && $xoopsOption['theme_use_smarty'] == 0) {
// the old way
$footer = htmlspecialchars($icmsConfigMetaFooter['footer']) . '<br /><div style="text-align:center">' . _LOCAL_FOOTER . '</div>';
$google_analytics = $icmsConfigMetaFooter['google_analytics'];
if (isset($xoopsOption['template_main'])) {
$xoopsTpl->caching = 0;
$xoopsTpl->display('db:' . $xoopsOption['template_main']);
}
if (!isset($xoopsOption['show_rblock'])) {$xoopsOption['show_rblock'] = 0;}
//themefooter($xoopsOption['show_rblock'], $footer, $google_analytics);
xoops_footer();
} else {
// RMV-NOTIFY
if (is_object($icmsModule) && $icmsModule->getVar('hasnotification') == 1 && is_object(icms::$user)) {
/** Require the notifications area */
require_once 'include/notification_select.php';
}
/** @todo Notifications include/require clarification in footer.php - if this is included here, why does it need to be required above? */
/** Include the notifications area */
include_once ICMS_ROOT_PATH . '/include/notification_select.php';
if (!headers_sent()) {
header('Content-Type:text/html; charset=' . _CHARSET);
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Cache-Control: private, no-cache');
header('Pragma: no-cache');
}
/*
global $icmsConfig;
if (!$icmsConfig['theme_fromfile']) {
session_write_close();
icms::$xoopsDB->close();
}
*/
//@internal: using global $xoTheme dereferences the variable in old versions, this does not
if (!isset($xoTheme)) {$xoTheme =& $GLOBALS['xoTheme'];}
if (isset($xoopsOption['template_main']) && $xoopsOption['template_main'] != $xoTheme->contentTemplate) {
trigger_error("xoopsOption[template_main] should be defined before including header.php", E_USER_WARNING);
if (FALSE === strpos($xoopsOption['template_main'], ':')) {
$xoTheme->contentTemplate = 'db:' . $xoopsOption['template_main'];
} else {
$xoTheme->contentTemplate = $xoopsOption['template_main'];
}
}
if (isset($_SESSION['masquerade_xoopsUserId'])) {
// set a template variable when masquerading
$xoTheme->template->assign("masquerade_username", $xoopsUser->vars['uname']['value']);
}
$xoTheme->render();
}
icms::$logger->stopTime();