]>
git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - html/html/themes/ipfire-new/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 ###############################################################################
35 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.'"><span>'.$submenus->{$item}->{'caption'}.'</span></a>';
57 &showsubmenu
($subsubmenus) if ($subsubmenus);
63 ###############################################################################
65 # print menu html elements
67 print '<div id="cssmenu"><ul>';
68 foreach my $k1 ( sort keys %$menu ) {
69 $link = getlink
($menu->{$k1});
70 next if (!is_menu_visible
($link) or $link eq '');
71 print '<li class="has-sub "><a><span>'.$menu->{$k1}->{'caption'}.'</span></a>';
72 my $submenus = $menu->{$k1}->{'subMenu'};
73 &showsubmenu
($submenus) if ($submenus);
78 if ($settings{'SPEED'} ne 'off') {
81 <strong>Traffic:</strong>
82 In <span id='rx_kbs'>--.-- Bit/s</span>
83 Out <span id='tx_kbs'>--.-- Bit/s</span>
91 ###############################################################################
93 # print page opening html layout
96 # @param extra html code for html head section
97 # @param suppress menu option, can be numeric 1 or nothing.
98 # menu will be suppressed if param is 1
102 my $extrahead = shift;
103 my $suppressMenu = shift;
104 my @tmp = split(/\./, basename
($0));
105 my $scriptName = @tmp[0];
108 @URI=split ('\?', $ENV{'REQUEST_URI'} );
109 &General
::readhash
("${swroot}/main/settings", \
%settings);
112 $title = "IPFire - $title";
113 if ($settings{'WINDOWWITHHOSTNAME'} eq 'on') {
114 $title = "$settings{'HOSTNAME'}.$settings{'DOMAINNAME'} - $title";
118 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
121 <title>$title</title>
123 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
124 <link rel="shortcut icon" href="/favicon.ico" />
125 <link href="/themes/ipfire-new/include/css/style.css" rel="stylesheet" type="text/css" />
126 <script type="text/javascript" src="/include/jquery-1.9.1.min.js"></script>
129 if ($settings{'SPEED'} ne 'off') {
131 <script type="text/javascript" src="/themes/ipfire-new/include/js/refreshInetInfo.js"></script>
136 if ($settings{'FX'} ne 'off') {
138 <meta http-equiv="Page-Enter" content="blendTrans(Duration=0.5,Transition=12)" />
139 <meta http-equiv="Page-Exit" content="blendTrans(Duration=0.5,Transition=12)" />
151 <!-- IPFIRE HEADER -->
152 <div id="header_inner" class="fixed">
156 if ($settings{'WINDOWWITHHOSTNAME'} eq 'on') {
157 print "<h1><span>$settings{'HOSTNAME'}.$settings{'DOMAINNAME'}</span></h1><br />";
159 print "<h1><span>IPFire</span></h1><br />";
169 &showmenu
() if ($suppressMenu != 1);
173 <div id="main_inner" class="fixed">
174 <div id="columnA_2columns">
179 ###############################################################################
181 # print page opening html layout without menu
184 # @param extra html code for html head section
185 sub openpagewithoutmenu
{
186 openpage
(shift,shift,shift,1);
191 ###############################################################################
193 # print page closing html layout
196 my $status = &connectionstatus
();
197 my $uptime = `/usr/bin/uptime|cut -d \" \" -f 4-`;
198 $uptime =~ s/year(s|)/$Lang::tr{'year'}/;
199 $uptime =~ s/month(s|)/$Lang::tr{'month'}/;
200 $uptime =~ s/days/$Lang::tr{'days'}/;
201 $uptime =~ s/day /$Lang::tr{'day'}/;
202 $uptime =~ s/user(s|)/$Lang::tr{'user'}/;
203 $uptime =~ s/load average/$Lang::tr{'uptime load average'}/;
205 <!-- closepage begin -->
211 print "<div id='columnC_2columns'>";
213 <table cellspacing="5" class="statusdisplay" border="0">
214 <tr><td align='center'>$status Uptime: $uptime</td></tr>
224 <!-- closepage end -->
229 ###############################################################################
231 # print big box opening html layout
236 ###############################################################################
238 # print big box closing html layout
243 ###############################################################################
245 # print box opening html layout
248 # @param page caption
257 <div class="post" align="$align">
260 if ($caption) { print "<h3>$caption</h3>\n"; } else { print " "; }
263 ###############################################################################
265 # print box closing html layout