Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

fileinfo.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: fileinfo.php 6231 2001-07-20 11:30:53Z jakobn $
5 //
6 // Created on: <22-Apr-2001 14:16:46 bf>
7 //
8 // This source file is part of Exponential Basic, publishing software.
9 //
10 // Copyright (C) 1999-2001 eZ Systems. All rights reserved.
11 //
12 // This program is free software; you can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
25 //
26 $sum = array();
27
28 // include_once( "classes/eztemplate.php" );
29 // include_once( "classes/ezlocale.php" );
30 // include_once( "classes/ezhttptool.php" );
31
32 // include_once( "ezsysinfo/classes/ezsysinfo.php" );
33
34 $ini =& eZINI::instance( 'site.ini' );
35 $Language =& $ini->variable( "eZSysinfoMain", "Language" );
36
37 $t = new eZTemplate( "kernel/ezsysinfo/admin/" . $ini->variable( "eZSysinfoMain", "AdminTemplateDir" ),
38 "kernel/ezsysinfo/admin/intl/", $Language, "fileinfo.php" );
39
40
41 $t->set_file( "file_info_tpl", "fileinfo.tpl" );
42
43 $t->set_block( "file_info_tpl", "disk_tpl", "disk" );
44
45 $t->setAllStrings();
46
47 $fs = eZSysinfo::fsinfo();
48
49 for ( $i = 0; $i < sizeof($fs); $i++ )
50 {
51 $sum['size'] = $fs[$i]['size'];
52 $sum['used'] = $fs[$i]['used'];
53 $sum['free'] = $fs[$i]['free'];
54
55 $t->set_var( "mount_point", $fs[$i]['mount'] );
56 $t->set_var( "fs_type", $fs[$i]['fstype'] );
57 $t->set_var( "device", $fs[$i]['disk'] );
58
59 $t->set_var( "capacity_percent", $fs[$i]['percent'] );
60 $t->set_var( "capacity_inverted_percent", 100 - (int) $fs[$i]['percent'] );
61
62 $t->set_var( "free", eZSysinfo::format_bytesize( $fs[$i]['free'] ) );
63 $t->set_var( "used", eZSysinfo::format_bytesize( $fs[$i]['used'] ) );
64 $t->set_var( "total", eZSysinfo::format_bytesize( $fs[$i]['size'] ) );
65
66 $t->parse( "disk", "disk_tpl", true );
67 }
68
69 $sum_percent = round( ($sum['used'] * 100) / $sum['size'] );
70
71 $t->set_var( "sum_capacity_percent", $sum_percent );
72 $t->set_var( "sum_capacity_inverted_percent", 100 - $sum_percent );
73
74 $t->set_var( "sum_free", eZSysinfo::format_bytesize( $sum['free'] ) );
75 $t->set_var( "sum_used", eZSysinfo::format_bytesize( $sum['used'] ) );
76 $t->set_var( "sum_total", eZSysinfo::format_bytesize( $sum['size'] ) );
77
78 $t->pparse( "output", "file_info_tpl" );
79
80 ?>
$i
$i
Definition: admin/adlist.php:91
eZSysinfo\format_bytesize
static format_bytesize( $kbytes, $dec_places=2)
Definition: ezsysinfo.php:83
eZSysinfo\fsinfo
static fsinfo()
Definition: ezsysinfo.php:534
eZTemplate
Definition: eztemplate.php:107
$t
$t
Definition: fileinfo.php:37
$sum_percent
for( $i=0; $i< sizeof($fs); $i++) $sum_percent
Definition: fileinfo.php:69
$Language
$Language
Definition: fileinfo.php:35
$ini
$ini
Definition: fileinfo.php:34
$sum
$sum
Definition: fileinfo.php:26
$fs
$fs
Definition: fileinfo.php:47
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.