Alternc  3.2
Alternc logiel libre pour l'h├ębergement
 All Data Structures Namespaces Files Functions Variables Pages
menu.php
Go to the documentation of this file.
1 <?php
2 /*
3  $Id: menu.php,v 1.9 2005/01/18 22:16:10 anarcat Exp $
4  ----------------------------------------------------------------------
5  AlternC - Web Hosting System
6  Copyright (C) 2002 by the AlternC Development Team.
7  http://alternc.org/
8  ----------------------------------------------------------------------
9  Based on:
10  Valentin Lacambre's web hosting softwares: http://altern.org/
11  ----------------------------------------------------------------------
12  LICENSE
13 
14  This program is free software; you can redistribute it and/or
15  modify it under the terms of the GNU General Public License (GPL)
16  as published by the Free Software Foundation; either version 2
17  of the License, or (at your option) any later version.
18 
19  This program is distributed in the hope that it will be useful,
20  but WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  GNU General Public License for more details.
23 
24  To read the license please visit http://www.gnu.org/copyleft/gpl.html
25  ----------------------------------------------------------------------
26  Original Author of file:
27  Purpose of file:
28  ----------------------------------------------------------------------
29 */
30 require_once("../class/config.php");
31 
32 // Getting logo
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 if ( empty($logo) || ! $logo ) {
35  $logo = 'images/logo3.png';
36 }
37 
38 ?>
39 <img src="<?php echo $logo; ?>" class="menutoplogo" border="0" alt="AlternC" width='190px' height='46px' />
40 <p class="currentuser"><?php echo sprintf(_("Welcome %s"),$mem->user["login"]); ?></p>
41 
42 <?php
43 
44 $obj_menu = $menu->getmenu();
45 
46 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>";
48  echo "<div class='menu-box {$k}-menu ".(!empty($m['divclass'])?$m['divclass']:'')."'>\n";
49  echo " <a href=\"".$m['link']."\"";
50  if (!empty($m['target'])) echo " target='". $m['target']."' ";
51  echo ">\n";
52  echo " <span class='menu-title'>\n";
53  //echo " <img src='".$m['ico']."' alt=\"".$m['title']."\" width='16px' height='16px' />&nbsp;";
54  echo " <span class='";
55  if (!empty($m['class'])) echo $m['class']." ";
56  echo "'>"; // fin span ouvrant
57  echo $m['title'];
58  if (isset($m['quota_total'])) {
59  if (!$quota->cancreate($k)) { echo '<span class="full">' ; } else { echo "<span>"; }
60  echo " (".$m['quota_used']."/".$m['quota_total'].")";
61  echo "</span>\n";
62  } // if there are some quota
63  if ( empty($m['links'])) {
64  $i = "images/menu_right.png";
65  // img machin
66  } else {
67  if ( $m['visibility'] ) {
68  $i="/images/menu_moins.png";
69  } else {
70  $i="/images/menu_plus.png";
71  }
72  }
73  echo " <img src='$i' alt='' style='float:right;' width='16px' height='16px' id='menu-$k-img'/>\n";
74  echo " </span>";
75  echo " </span>\n";
76  echo " </a>\n";
77 
78  if (!empty($m['links'])) {
79  echo "<div class='menu-content' id='menu-$k'>";
80  echo " <ul>";
81  foreach( $m['links'] as $l ) {
82  if ( $l['txt'] == 'progressbar' ) {
83  $usage_percent = (int) ($l['used'] / $l['total'] * 100);
84  echo "<li>";
85  echo '<div class="progress-bar">';
86  echo '<div class="barre" style="width:'.$usage_percent.'%; background-color:'.PercentToColor($usage_percent).'" ></div>';
87  //echo '<div class="txt">'.$usage.' %</div>';
88  echo '</div>';
89  echo "</li>";
90  continue;
91  } // progressbar
92  echo "<li><a href=\"".$l['url']."\" ";
93  if (!empty($l['onclick'])) echo " onclick='". $l['onclick']."' ";
94  if (!empty($l['target'])) echo " target='". $l['target']."' ";
95  echo " ><span class='".(empty($l['class'])?'':$l['class'])."'>";
96  if (!empty($l['ico'])) echo "<img src='".$l['ico']."' alt='' />&nbsp;";
97  echo $l['txt'];
98  echo "</span></a></li>";
99  }
100  echo " </ul>";
101  echo "</div>";
102  }
103  echo "</div>";
104  if (! $m['visibility']) echo "<script type='text/javascript'>menu_toggle('menu-$k');</script>\n";
105 
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 <?php
112 echo "$L_VERSION";
113 ?>
114 </p>
115 
116