]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - html/html/themes/ipfire/include/functions.pl
ipfire theme: Fix default setting for hostname in title.
[people/teissler/ipfire-2.x.git] / html / html / themes / ipfire / include / functions.pl
index 86bc70939600e1ac20497e2ba3dc9f183c0494e7..0c47cd456bbee33e732d848e2601304e22f133a8 100644 (file)
@@ -31,8 +31,8 @@
 # IPFire default theme.                                                       #
 ###############################################################################
 
-use File::Basename;
 require "${General::swroot}/lang.pl";
+
 ###############################################################################
 #
 # print menu html elements for submenu entries
@@ -80,7 +80,7 @@ EOF
        foreach my $k1 ( sort keys %$menu ) {
                $link = getlink($menu->{$k1});
                next if (!is_menu_visible($link) or $link eq '');
-               print '<li class="has-sub "><a><span>'.$menu->{$k1}->{'caption'}.'</span></a>';
+               print '<li class="has-sub "><a href="#"><span>'.$menu->{$k1}->{'caption'}.'</span></a>';
                my $submenus = $menu->{$k1}->{'subMenu'};
                &showsubmenu($submenus) if ($submenus);
                print "</li>";
@@ -110,33 +110,39 @@ sub openpage {
        &genmenu();
 
        my $headline = "IPFire";
-       if ($settings{'WINDOWWITHHOSTNAME'} eq 'on') {
+       if (($settings{'WINDOWWITHHOSTNAME'} eq 'on') || ($settings{'WINDOWWITHHOSTNAME'} eq '')) {
                $headline =  "$settings{'HOSTNAME'}.$settings{'DOMAINNAME'}";
        }
 
-print <<END
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+       my @stylesheets = ("style.css");
+       if ($THEME_NAME eq "ipfire-rounded") {
+               push(@stylesheets, "style-rounded.css");
+       }
+
+print <<END;
+<!DOCTYPE html>
 <html>
        <head>
        <title>$headline - $title</title>
        $extrahead
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <link rel="shortcut icon" href="/favicon.ico" />
-       <link href="/themes/ipfire-new/include/css/style.css" rel="stylesheet" type="text/css"  />
-       <script type="text/javascript" src="/include/jquery-1.9.1.min.js"></script>
-END
-;
-if ($settings{'SPEED'} ne 'off') {
-print <<END
-       <script type="text/javascript" src="/themes/ipfire-new/include/js/refreshInetInfo.js"></script>
+       <script type="text/javascript" src="/include/jquery.js"></script>
+
+       <script type="text/javascript">
+               function swapVisibility(id) {
+                       \$('#' + id).toggle();
+               }
+       </script>
 END
-;
-}
 
-if ($settings{'FX'} ne 'off') {
+       foreach my $stylesheet (@stylesheets) {
+               print "<link href=\"/themes/ipfire/include/css/$stylesheet\" rel=\"stylesheet\" type=\"text/css\" />\n";
+       }
+
+if ($settings{'SPEED'} ne 'off') {
 print <<END
-       <meta http-equiv="Page-Enter" content="blendTrans(Duration=0.5,Transition=12)" />
-       <meta http-equiv="Page-Exit" content="blendTrans(Duration=0.5,Transition=12)" />
+       <script type="text/javascript" src="/themes/ipfire/include/js/refreshInetInfo.js"></script>
 END
 ;
 }
@@ -148,7 +154,7 @@ print <<END
                        <div id="logo">
 END
 ;
-       if ($settings{'WINDOWWITHHOSTNAME'} eq 'on') {
+       if ($settings{'WINDOWWITHHOSTNAME'} ne 'off') {
                print "<h1>$settings{'HOSTNAME'}.$settings{'DOMAINNAME'}</h1>";
        } else {
                print "<h1>IPFire</h1>";
@@ -232,7 +238,12 @@ sub openbox {
        $align = $_[1];
        $caption = $_[2];
 
-       print "<div class='post' align='$align'>\n";
+       if($align eq 'center') {
+               print "<div class='post' align='center'>\n"
+       }
+       else {
+               print "<div class='post'>\n";
+       }
 
        if ($caption) {
                print "<h2>$caption</h2>\n";