menu.php 4.3 KB
Newer Older
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
<?php
/*
 $Id: menu.php,v 1.9 2005/01/18 22:16:10 anarcat Exp $
 ----------------------------------------------------------------------
 AlternC - Web Hosting System
 Copyright (C) 2002 by the AlternC Development Team.
 http://alternc.org/
 ----------------------------------------------------------------------
 Based on:
 Valentin Lacambre's web hosting softwares: http://altern.org/
 ----------------------------------------------------------------------
 LICENSE

 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License (GPL)
 as published by the Free Software Foundation; either version 2
 of the License, or (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 To read the license please visit http://www.gnu.org/copyleft/gpl.html
 ----------------------------------------------------------------------
 Original Author of file:
 Purpose of file:
 ----------------------------------------------------------------------
*/
require_once("../class/config.php");

32
// Getting logo
Alan Garcia's avatar
Alan Garcia committed
33
$logo = variable_get('logo_menu', '' ,'You can specify a logo for the menu, example /images/my_logo.png .', array(array('desc'=>'URL','type'=>'string')));
34
35
36
if ( empty($logo) ||  ! $logo ) { 
  $logo = 'images/logo3.png'; 
}
37

38
?>
39
<img src="<?php echo $logo; ?>" class="menutoplogo" border="0" alt="AlternC" width='190px' height='46px' />
Alan Garcia's avatar
Alan Garcia committed
40
<p class="currentuser"><?php echo sprintf(_("Welcome %s"),$mem->user["login"]); ?></p>
41

42
<?php
43

44
45
46
$obj_menu = $menu->getmenu();

foreach ($obj_menu as $k => $m ) {
47
  echo "<style>.$k-menu .menu-title { background-image: url('".$m['ico']."'); background-repeat: no-repeat; background-position: 8px 3px; padding-left: 30px;} </style>";
Alan Garcia's avatar
Alan Garcia committed
48
  echo "<div class='menu-box {$k}-menu ".(!empty($m['divclass'])?$m['divclass']:'')."'>\n";
49
50
51
  echo "  <a href=\"".$m['link']."\"";
  if (!empty($m['target'])) echo " target='". $m['target']."' ";
  echo ">\n";
Alan Garcia's avatar
Alan Garcia committed
52
  echo "    <span class='menu-title'>\n";
Alan Garcia's avatar
Alan Garcia committed
53
  //echo "      <img src='".$m['ico']."' alt=\"".$m['title']."\" width='16px' height='16px' />&nbsp;";
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
  echo "        <span class='";
  if (!empty($m['class'])) echo $m['class']." ";
  echo "'>"; // fin span ouvrant
  echo $m['title'];
  if (isset($m['quota_total'])) {
    if (!$quota->cancreate($k)) { echo '<span class="full">' ; } else { echo "<span>"; }
    echo " (".$m['quota_used']."/".$m['quota_total'].")";
    echo "</span>\n";
  } // if there are some quota
  if ( empty($m['links'])) {
    $i = "images/menu_right.png";
    // img machin
  } else {
    if ( $m['visibility'] ) {
      $i="/images/menu_moins.png";
    } else {
      $i="/images/menu_plus.png";
    }
  }
73
  echo "      <img src='$i' alt='' style='float:right;' width='16px' height='16px' id='menu-$k-img'/>\n";
74
  echo "      </span>";
Alan Garcia's avatar
Alan Garcia committed
75
  echo "    </span>\n";
76
77
78
79
80
81
82
83
84
85
  echo "  </a>\n";

  if (!empty($m['links'])) {
    echo "<div class='menu-content' id='menu-$k'>";
    echo "  <ul>";
    foreach( $m['links'] as $l ) {
      if ( $l['txt'] == 'progressbar' ) {
        $usage_percent = (int) ($l['used'] / $l['total'] * 100);
        echo "<li>";
        echo '<div class="progress-bar">';
86
87
        echo '<div class="barre" style="width:'.$usage_percent.'%; background-color:'.PercentToColor($usage_percent).'" ></div>';
        //echo '<div class="txt">'.$usage.' %</div>';
88
        echo '</div>';
89
        echo "</li>";
90
91
92
        continue;
      } // progressbar
      echo "<li><a href=\"".$l['url']."\" ";
93
      if (!empty($l['onclick'])) echo " onclick='". $l['onclick']."' ";
94
95
96
97
98
99
100
101
102
103
104
105
      if (!empty($l['target'])) echo " target='". $l['target']."' ";
      echo " ><span class='".(empty($l['class'])?'':$l['class'])."'>";
      if (!empty($l['ico'])) echo "<img src='".$l['ico']."' alt='' />&nbsp;";
      echo $l['txt'];
      echo "</span></a></li>";
    }
    echo "  </ul>";
    echo "</div>";
  }
  echo "</div>";
  if (! $m['visibility']) echo "<script type='text/javascript'>menu_toggle('menu-$k');</script>\n";

106
}
107

108
?>
109
<p class="center"><a href="about.php"><img src="images/logo2.png" class="menulogo" border="0" alt="AlternC" title="<?php __("About"); ?>" width='150px' height='102px' /></a>
110
<br />
111
112
113
<?php 
echo "$L_VERSION";
?>
114
</p>
115
116