Alternc  latest
Alternc logiel libre pour l'hébergement
menu.php
Go to the documentation of this file.
1 <?php
2 /*
3  ----------------------------------------------------------------------
4  LICENSE
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public License (GPL)
8  as published by the Free Software Foundation; either version 2
9  of the License, or (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  To read the license please visit http://www.gnu.org/copyleft/gpl.html
17  ----------------------------------------------------------------------
18 */
19 
20 /**
21  * Main left menu of AlternC, uses Hooks
22  *
23  * @copyright AlternC-Team 2000-2017 https://alternc.com/
24  */
25 
26 require_once("../class/config.php");
27 
28 // Getting logo
29 $logo = variable_get('logo_menu', '' ,'You can specify a logo for the menu, example /images/my_logo.png .', array('desc'=>'URL','type'=>'string'));
30 
31 echo '<div class="menutoplogo">';
32 if ( ! empty($logo) && ! is_null($logo)) {
33  echo "<img src=\"".$logo."\" border='0' alt='AlternC' width='45px' height='46px' />";
34 }
35 echo "<img src='images/logo3.png' border='0' alt='AlternC' ".(( ! empty($logo) && ! is_null($logo))?"width='140px'":"")." height='40px' />";
36 echo "</div>";
37 ?>
38 <p class="currentuser"><?php echo sprintf(_("Welcome %s"),$mem->user["login"]); ?></p>
39 
40 <?php
41 
42 $obj_menu = $menu->getmenu();
43 
44 foreach ($obj_menu as $k => $m ) {
45  echo "<div class='menu-box {$k}-menu ".(!empty($m['divclass'])?$m['divclass']:'')."'>\n";
46  echo " <a href=\"".$m['link']."\"";
47  if (!empty($m['target'])) echo " target='". $m['target']."' ";
48  echo ">\n";
49  echo " <span class='menu-title'>\n";
50  echo " <span class='";
51  if (!empty($m['class'])) echo $m['class']." ";
52  echo "'>"; // fin span ouvrant
53  echo $m['title'];
54  if (isset($m['quota_total'])) {
55  if (!$quota->cancreate($k)) { echo '<span class="full">' ; } else { echo "<span>"; }
56  echo " (".$m['quota_used']."/".$m['quota_total'].")";
57  echo "</span>\n";
58  } // if there are some quota
59  echo " </span>";
60  echo " </span>\n";
61  echo " </a>\n";
62 
63  if (!empty($m['links'])) {
64  if ( $m['visibility']) $visible=""; else $visible="style=\"display: none\"";
65  echo "<div class='menu-content' id='menu-$k' $visible >";
66  echo " <ul>";
67  foreach( $m['links'] as $l ) {
68  if ( $l['txt'] == 'progressbar' ) {
69  $usage_percent = (int) ($l['used'] / $l['total'] * 100);
70  echo "<li>";
71  echo '<div class="progress-bar">';
72  echo '<div class="barre" style="width:'.$usage_percent.'%; background-color:'.PercentToColor($usage_percent).'" ></div>';
73  //echo '<div class="txt">'.$usage.' %</div>';
74  echo '</div>';
75  echo "</li>";
76  continue;
77  } // progressbar
78  echo "<li><a href=\"".$l['url']."\" ";
79  if (!empty($l['onclick'])) echo " onclick='". $l['onclick']."' ";
80  if (!empty($l['target'])) echo " target='". $l['target']."' ";
81  echo " ><span class='".(empty($l['class'])?'':$l['class'])."'>";
82  if (!empty($l['ico'])) echo "<img src='".$l['ico']."' alt='' />&nbsp;";
83  echo $l['txt'];
84  echo "</span></a></li>";
85  }
86  echo " </ul>";
87  echo "</div>";
88  }
89  echo "</div>";
90 
91 }
92 
93 ?>
94 <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>
95 <br />
96 <?php
97 echo "$L_VERSION";
98 ?>
99 </p>
100 
101 
$mem
Definition: bootstrap.php:71
variable_get($name, $default=null, $createit_comment=null)
Return a persistent variable.
Definition: variables.php:85
PercentToColor($p=0)
Definition: functions.php:1096
$logo
Main left menu of AlternC, uses Hooks.
Definition: menu.php:29
$obj_menu
Definition: menu.php:42