-
Notifications
You must be signed in to change notification settings - Fork 346
/
Bottom.php
178 lines (140 loc) · 4.35 KB
/
Bottom.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
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<?php
/**
* Bottom
*
* Displays bottom menu
* Handles Print & Inline Help functionalities
*
* @package RosarioSIS
*/
require_once 'Warehouse.php';
if ( isAJAX() )
{
ETagCache( 'start' );
}
// Output Bottom menu.
if ( empty( $_REQUEST['bottomfunc'] ) ) : ?>
<div id="footerwrap">
<a href="#body" class="a11y-hidden BottomButton">
<?php echo _( 'Skip to main content' ); // Accessibility link to skip menus. ?>
</a>
<a id="BottomButtonMenu" href="#" onclick="expandMenu(); return false;" title="<?php echo AttrEscape( _( 'Menu' ) ); ?>" class="BottomButton">
<svg viewBox="0 0 24 24">
<line x1="3" y1="12" x2="21" y2="12"></line>
<line x1="3" y1="6" x2="21" y2="6"></line>
<line x1="3" y1="18" x2="21" y2="18"></line>
</svg>
<span><?php echo _( 'Menu' ); ?></span>
</a>
<?php // FJ icons.
$btn_path = 'assets/themes/' . Preferences( 'THEME' ) . '/btn/';
if ( User( 'PROFILE' ) === 'admin'
|| User( 'PROFILE' ) === 'teacher' ) :
$back_url = issetVal( $_SESSION['List_PHP_SELF'], '' );
switch ( issetVal( $_SESSION['Back_PHP_SELF'], '' ) )
{
case 'student':
$back_text = _( 'Student List' );
break;
case 'staff':
$back_text = _( 'User List' );
break;
case 'course':
$back_text = _( 'Course List' );
break;
default:
$back_text = sprintf( _( '%s List' ), $_SESSION['Back_PHP_SELF'] );
}
/**
* Remove need to make an AJAX call to Bottom.php
* Which represented up to 10% of total AJAX requests
*
* @since 12.0 JS Show BottomButtonBack & update its URL & text
* @see BottomButtonBackUpdate() function
*/
?>
<a href="<?php echo URLEscape( $back_url ); ?>" title="<?php echo AttrEscape( $back_text ); ?>"
id="BottomButtonBack" class="BottomButton<?php echo $back_url ? '' : ' hide'; ?>">
<img src="<?php echo $btn_path; ?>back.png" alt="">
<span><?php echo $back_text; ?></span>
</a>
<?php endif;
/**
* Do bottom_buttons action hook
*
* @see also 'ProgramFunctions/Bottom.fnc.php|bottom_buttons' action hook
*/
do_action( 'Bottom.php|bottom_buttons' ); ?>
<a href="" target="_blank" title="<?php echo AttrEscape( _( 'Print' ) ); ?>" class="BottomButton"
onclick="this.href = 'Bottom.php?bottomfunc=print&' + window.location.search.substring(1);">
<img src="<?php echo $btn_path; ?>print.png" alt="">
<span><?php echo _( 'Print' ); ?></span>
</a>
<a href="#" onclick="toggleHelp();return false;" title="<?php echo AttrEscape( _( 'Help' ) ); ?>" class="BottomButton">
<img src="<?php echo $btn_path; ?>help.png" alt="">
<span><?php echo _( 'Help' ); ?></span>
</a>
<a href="<?php echo URLEscape( 'index.php?modfunc=logout&token=' . $_SESSION['token'] ); ?>" target="_top" title="<?php echo AttrEscape( _( 'Logout' ) ); ?>" class="BottomButton">
<img src="<?php echo $btn_path; ?>logout.png" alt="">
<span><?php echo _( 'Logout' ); ?></span>
</a>
<span class="loading BottomButton"></span>
</div>
<div id="footerhelp"><div class="footerhelp-content"></div></div>
<?php
// Print PDF.
elseif ( $_REQUEST['bottomfunc'] === 'print' ) :
if ( ! isset( $_REQUEST['modfunc'] ) )
{
$_REQUEST['modfunc'] = false;
}
// Force search_modfunc to list.
if ( Preferences( 'SEARCH' ) !== 'Y' )
{
$_REQUEST['search_modfunc'] = 'list';
}
elseif ( ! isset( $_REQUEST['search_modfunc'] ) )
{
$_REQUEST['search_modfunc'] = '';
}
if ( ! empty( $_REQUEST['expanded_view'] ) )
{
$_SESSION['orientation'] = 'landscape';
}
// FJ call PDFStart to generate Print PDF.
$print_data = PDFStart();
$modname = $_REQUEST['modname'];
if ( ! $wkhtmltopdfPath )
{
$_ROSARIO['allow_edit'] = false;
}
if ( AllowUse() )
{
if ( mb_substr( $modname, -4, 4 ) !== '.php'
|| mb_strpos( $modname, '..' ) !== false
/*|| ! is_file( 'modules/' . $modname )*/ )
{
require_once 'ProgramFunctions/HackingLog.fnc.php';
HackingLog();
}
else
require_once 'modules/' . $modname;
}
// Not allowed, hacking attempt?
elseif ( User( 'USERNAME' ) )
{
require_once 'ProgramFunctions/HackingLog.fnc.php';
HackingLog();
}
// FJ call PDFStop to generate Print PDF.
PDFStop( $print_data );
// Inline Help.
elseif ( $_REQUEST['bottomfunc'] === 'help' ) :
require_once 'ProgramFunctions/Help.fnc.php';
$help_text = GetHelpText( $_REQUEST['modname'] );
echo $help_text;
endif;
if ( isAJAX() )
{
ETagCache( 'stop' );
}