]>
git.ipfire.org Git - ipfire-2.x.git/blob - html/html/themes/ipfire/include/functions.pl
2 ###############################################################################
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2007 Michael Tremer & Christian Schmidt #
7 # This program is free software: you can redistribute it and/or modify #
8 # it under the terms of the GNU General Public License as published by #
9 # the Free Software Foundation, either version 3 of the License, or #
10 # (at your option) any later version. #
12 # This program is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
17 # You should have received a copy of the GNU General Public License #
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
20 ###############################################################################
22 # Theme file for IPfire (based on ipfire theme) #
23 # Author kay-michael köhler kmk <michael@koehler.tk> #
25 # Version 1.0 March, 6th 2013 #
26 ###############################################################################
28 # Modyfied theme by a.marx@ipfire.org January 2014 #
30 # Cleanup code, deleted unused code and rewrote the rest to get a new working #
31 # IPFire default theme. #
32 ###############################################################################
34 ###############################################################################
36 # print menu html elements for submenu entries
37 # @param submenu entries
42 foreach my $item (sort keys %$submenus) {
43 $link = getlink
($submenus->{$item});
44 next if (!is_menu_visible
($link) or $link eq '');
46 my $subsubmenus = $submenus->{$item}->{'subMenu'};
49 print '<li class="has-sub ">';
53 print '<a href="'.$link.'">'.$submenus->{$item}->{'caption'}.'</a>';
55 &showsubmenu
($subsubmenus) if ($subsubmenus);
61 ###############################################################################
63 # print menu html elements
65 print '<div id="cssmenu" class="bigbox fixed">';
67 if ($settings{'SPEED'} ne 'off') {
70 <strong>Traffic:</strong>
71 In <span id='rx_kbs'>--.-- bit/s</span>
72 Out <span id='tx_kbs'>--.-- bit/s</span>
78 foreach my $k1 ( sort keys %$menu ) {
79 $link = getlink
($menu->{$k1});
80 next if (!is_menu_visible
($link) or $link eq '');
81 print '<li class="has-sub "><a href="#"><span>'.$menu->{$k1}->{'caption'}.'</span></a>';
82 my $submenus = $menu->{$k1}->{'subMenu'};
83 &showsubmenu
($submenus) if ($submenus);
90 ###############################################################################
92 # print page opening html layout
95 # @param extra html code for html head section
96 # @param suppress menu option, can be numeric 1 or nothing.
97 # menu will be suppressed if param is 1
101 my $extrahead = shift;
102 my $suppressMenu = shift // 0;
103 my @tmp = split(/\./, basename
($0));
104 my $scriptName = @tmp[0];
106 my $headline = "IPFire";
107 if (($settings{'WINDOWWITHHOSTNAME'} eq 'on') || ($settings{'WINDOWWITHHOSTNAME'} eq '')) {
108 $headline = "$settings{'HOSTNAME'}.$settings{'DOMAINNAME'}";
115 <title>$headline - $title</title>
116 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
117 <link rel="shortcut icon" href="/favicon.ico" />
118 <script type="text/javascript" src="/include/jquery.js"></script>
119 <script src="/include/rrdimage.js"></script>
122 <script type="text/javascript">
123 function swapVisibility(id) {
124 \$('#' + id).toggle();
130 print "<link href=\"/themes/ipfire/include/css/style.css\" rel=\"stylesheet\" type=\"text/css\" />\n";
133 if ($settings{'SPEED'} ne 'off') {
135 <script type="text/javascript" src="/themes/ipfire/include/js/refreshInetInfo.js"></script>
143 <div id="header" class="fixed">
145 <a href="https://www.ipfire.org" style="text-decoration: none;">
146 <img src="/themes/ipfire/images/tux2.png" style="float:left; margin-left: -3px; margin-top: -3px;"/>
149 if ($settings{'WINDOWWITHHOSTNAME'} ne 'off') {
150 print "</a><h1>$settings{'HOSTNAME'}.$settings{'DOMAINNAME'}</h1>";
152 print "<h1>IPFire</h1></a>";
161 unless($suppressMenu) {
167 <div class="bigbox fixed">
168 <div id="main_inner" class="fixed">
169 <div id="main_header">
174 # Print user manual link
175 my $manual_url = &Header
::get_manualpage_url
($scriptName);
178 <span><a href="$manual_url" title="$Lang::tr{'online help en'}" target="_blank"><img src="/images/help-browser.png" alt="$Lang::tr{'online help en'}"></a></span>
189 ###############################################################################
191 # print page opening html layout without menu
194 # @param extra html code for html head section
195 sub openpagewithoutmenu
{
196 openpage
(shift,shift,shift,1);
200 ###############################################################################
202 # print page closing html layout
205 open(FILE
, "</etc/system-release");
206 my $system_release = <FILE
>;
207 $system_release =~ s/core/Core Update /;
214 <div id="footer" class='bigbox fixed'>
215 <span class="pull-right">
216 <a href="https://www.ipfire.org/" target="_blank"><strong>IPFire.org</strong></a> •
217 <a href="https://www.ipfire.org/donate" target="_blank">$Lang::tr{'support donation'}</a>
220 <strong>$system_release</strong>
228 ###############################################################################
230 # print big box opening html layout
234 ###############################################################################
236 # print big box closing html layout
240 ###############################################################################
242 # print box opening html layout
245 # @param page caption
251 if($align eq 'center') {
252 print "<div class='post' align='center'>\n"
255 print "<div class='post'>\n";
259 print "<h2>$caption</h2>\n";
263 ###############################################################################
265 # print box closing html layout