]>
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 require "${General::swroot}/lang.pl";
36 ###############################################################################
38 # print menu html elements for submenu entries
39 # @param submenu entries
44 foreach my $item (sort keys %$submenus) {
45 $link = getlink
($submenus->{$item});
46 next if (!is_menu_visible
($link) or $link eq '');
48 my $subsubmenus = $submenus->{$item}->{'subMenu'};
51 print '<li class="has-sub ">';
55 print '<a href="'.$link.'">'.$submenus->{$item}->{'caption'}.'</a>';
57 &showsubmenu
($subsubmenus) if ($subsubmenus);
63 ###############################################################################
65 # print menu html elements
67 print '<div id="cssmenu" class="bigbox fixed">';
69 if ($settings{'SPEED'} ne 'off') {
72 <strong>Traffic:</strong>
73 In <span id='rx_kbs'>--.-- bit/s</span>
74 Out <span id='tx_kbs'>--.-- bit/s</span>
80 foreach my $k1 ( sort keys %$menu ) {
81 $link = getlink
($menu->{$k1});
82 next if (!is_menu_visible
($link) or $link eq '');
83 print '<li class="has-sub "><a href="#"><span>'.$menu->{$k1}->{'caption'}.'</span></a>';
84 my $submenus = $menu->{$k1}->{'subMenu'};
85 &showsubmenu
($submenus) if ($submenus);
92 ###############################################################################
94 # print page opening html layout
97 # @param extra html code for html head section
98 # @param suppress menu option, can be numeric 1 or nothing.
99 # menu will be suppressed if param is 1
103 my $extrahead = shift;
104 my $suppressMenu = shift;
105 my @tmp = split(/\./, basename
($0));
106 my $scriptName = @tmp[0];
108 @URI=split ('\?', $ENV{'REQUEST_URI'} );
109 &General
::readhash
("${swroot}/main/settings", \
%settings);
112 my $headline = "IPFire";
113 if (($settings{'WINDOWWITHHOSTNAME'} eq 'on') || ($settings{'WINDOWWITHHOSTNAME'} eq '')) {
114 $headline = "$settings{'HOSTNAME'}.$settings{'DOMAINNAME'}";
122 <title>$headline - $title</title>
124 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
125 <link rel="shortcut icon" href="/favicon.ico" />
126 <script type="text/javascript" src="/include/jquery.js"></script>
127 <script src="/include/rrdimage.js"></script>
129 <script type="text/javascript">
130 function swapVisibility(id) {
131 \$('#' + id).toggle();
137 print "<link href=\"/themes/ipfire/include/css/style.css\" rel=\"stylesheet\" type=\"text/css\" />\n";
140 if ($settings{'SPEED'} ne 'off') {
142 <script type="text/javascript" src="/themes/ipfire/include/js/refreshInetInfo.js"></script>
150 <div id="header" class="fixed">
152 <a href="https://www.ipfire.org" style="text-decoration: none;">
153 <img src="/themes/ipfire/images/tux2.png" style="float:left; margin-left: -3px; margin-top: -3px;"/>
156 if ($settings{'WINDOWWITHHOSTNAME'} ne 'off') {
157 print "</a><h1>$settings{'HOSTNAME'}.$settings{'DOMAINNAME'}</h1>";
159 print "<h1>IPFire</h1></a>";
168 &showmenu
() if ($suppressMenu != 1);
171 <div class="bigbox fixed">
172 <div id="main_inner" class="fixed">
178 ###############################################################################
180 # print page opening html layout without menu
183 # @param extra html code for html head section
184 sub openpagewithoutmenu
{
185 openpage
(shift,shift,shift,1);
189 ###############################################################################
191 # print page closing html layout
194 open(FILE
, "</etc/system-release");
195 my $system_release = <FILE
>;
196 $system_release =~ s/core/Core Update /;
203 <div id="footer" class='bigbox fixed'>
204 <span class="pull-right">
205 <a href="https://www.ipfire.org/" target="_blank"><strong>IPFire.org</strong></a> •
206 <a href="https://www.ipfire.org/donate" target="_blank">$Lang::tr{'support donation'}</a>
209 <strong>$system_release</strong>
217 ###############################################################################
219 # print big box opening html layout
223 ###############################################################################
225 # print big box closing html layout
229 ###############################################################################
231 # print box opening html layout
234 # @param page caption
240 if($align eq 'center') {
241 print "<div class='post' align='center'>\n"
244 print "<div class='post'>\n";
248 print "<h2>$caption</h2>\n";
252 ###############################################################################
254 # print box closing html layout