[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [13851] fixing datatable and forms
From: |
Saul |
Subject: |
[Fmsystem-commits] [13851] fixing datatable and forms |
Date: |
Fri, 04 Sep 2015 16:52:21 +0000 |
Revision: 13851
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=13851
Author: psaul
Date: 2015-09-04 16:52:20 +0000 (Fri, 04 Sep 2015)
Log Message:
-----------
fixing datatable and forms
Modified Paths:
--------------
branches/dev-syncromind/booking/inc/class.socommon.inc.php
branches/dev-syncromind/phpgwapi/js/jquery/common.js
branches/dev-syncromind/phpgwapi/templates/pure/css/demo_mmenu.css
branches/dev-syncromind/property/inc/class.uibudget.inc.php
Added Paths:
-----------
branches/dev-syncromind/phpsysinfo/plugins/BAT/class.bat.inc.php
branches/dev-syncromind/phpsysinfo/plugins/BAT/js/bat.js
branches/dev-syncromind/phpsysinfo/plugins/BAT/lang/cz.xml
branches/dev-syncromind/phpsysinfo/plugins/BAT/lang/en.xml
branches/dev-syncromind/phpsysinfo/plugins/BAT/lang/fr.xml
branches/dev-syncromind/phpsysinfo/plugins/BAT/lang/pl.xml
branches/dev-syncromind/phpsysinfo/plugins/BAT/lang/ru.xml
branches/dev-syncromind/phpsysinfo/plugins/MDStatus/class.mdstatus.inc.php
branches/dev-syncromind/phpsysinfo/plugins/MDStatus/css/mdstatus.css
branches/dev-syncromind/phpsysinfo/plugins/MDStatus/gfx/error.png
branches/dev-syncromind/phpsysinfo/plugins/MDStatus/gfx/harddrivefail.png
branches/dev-syncromind/phpsysinfo/plugins/MDStatus/gfx/harddriveok.png
branches/dev-syncromind/phpsysinfo/plugins/MDStatus/gfx/harddrivespare.png
branches/dev-syncromind/phpsysinfo/plugins/MDStatus/js/mdstatus.js
branches/dev-syncromind/phpsysinfo/plugins/MDStatus/lang/cz.xml
branches/dev-syncromind/phpsysinfo/plugins/MDStatus/lang/de.xml
branches/dev-syncromind/phpsysinfo/plugins/MDStatus/lang/en.xml
branches/dev-syncromind/phpsysinfo/plugins/MDStatus/lang/fr.xml
branches/dev-syncromind/phpsysinfo/plugins/MDStatus/lang/gr.xml
branches/dev-syncromind/phpsysinfo/plugins/MDStatus/lang/ru.xml
branches/dev-syncromind/phpsysinfo/plugins/PS/class.ps.inc.php
branches/dev-syncromind/phpsysinfo/plugins/PS/js/ps.js
branches/dev-syncromind/phpsysinfo/plugins/PS/lang/cz.xml
branches/dev-syncromind/phpsysinfo/plugins/PS/lang/de.xml
branches/dev-syncromind/phpsysinfo/plugins/PS/lang/en.xml
branches/dev-syncromind/phpsysinfo/plugins/PS/lang/fr.xml
branches/dev-syncromind/phpsysinfo/plugins/PS/lang/gr.xml
branches/dev-syncromind/phpsysinfo/plugins/PS/lang/pl.xml
branches/dev-syncromind/phpsysinfo/plugins/PS/lang/ru.xml
branches/dev-syncromind/phpsysinfo/plugins/PSStatus/class.psstatus.inc.php
branches/dev-syncromind/phpsysinfo/plugins/PSStatus/css/psstatus.css
branches/dev-syncromind/phpsysinfo/plugins/PSStatus/gfx/offline.png
branches/dev-syncromind/phpsysinfo/plugins/PSStatus/gfx/online.png
branches/dev-syncromind/phpsysinfo/plugins/PSStatus/js/psstatus.js
branches/dev-syncromind/phpsysinfo/plugins/PSStatus/lang/cz.xml
branches/dev-syncromind/phpsysinfo/plugins/PSStatus/lang/de.xml
branches/dev-syncromind/phpsysinfo/plugins/PSStatus/lang/en.xml
branches/dev-syncromind/phpsysinfo/plugins/PSStatus/lang/fr.xml
branches/dev-syncromind/phpsysinfo/plugins/PSStatus/lang/gr.xml
branches/dev-syncromind/phpsysinfo/plugins/PSStatus/lang/pl.xml
branches/dev-syncromind/phpsysinfo/plugins/PSStatus/lang/ru.xml
branches/dev-syncromind/phpsysinfo/plugins/Quotas/class.quotas.inc.php
branches/dev-syncromind/phpsysinfo/plugins/Quotas/css/quotas.css
branches/dev-syncromind/phpsysinfo/plugins/Quotas/js/quotas.js
branches/dev-syncromind/phpsysinfo/plugins/Quotas/lang/cz.xml
branches/dev-syncromind/phpsysinfo/plugins/Quotas/lang/de.xml
branches/dev-syncromind/phpsysinfo/plugins/Quotas/lang/en.xml
branches/dev-syncromind/phpsysinfo/plugins/Quotas/lang/fr.xml
branches/dev-syncromind/phpsysinfo/plugins/Quotas/lang/pl.xml
branches/dev-syncromind/phpsysinfo/plugins/Quotas/lang/ru.xml
branches/dev-syncromind/phpsysinfo/plugins/SMART/class.smart.inc.php
branches/dev-syncromind/phpsysinfo/plugins/SMART/css/smart.css
branches/dev-syncromind/phpsysinfo/plugins/SMART/js/smart.js
branches/dev-syncromind/phpsysinfo/plugins/SMART/lang/cz.xml
branches/dev-syncromind/phpsysinfo/plugins/SMART/lang/en.xml
branches/dev-syncromind/phpsysinfo/plugins/SMART/lang/fr.xml
branches/dev-syncromind/phpsysinfo/plugins/SMART/lang/gr.xml
branches/dev-syncromind/phpsysinfo/plugins/SMART/lang/pl.xml
branches/dev-syncromind/phpsysinfo/plugins/SMART/lang/ru.xml
Modified: branches/dev-syncromind/booking/inc/class.socommon.inc.php
===================================================================
--- branches/dev-syncromind/booking/inc/class.socommon.inc.php 2015-09-04
00:21:10 UTC (rev 13850)
+++ branches/dev-syncromind/booking/inc/class.socommon.inc.php 2015-09-04
16:52:20 UTC (rev 13851)
@@ -434,8 +434,6 @@
}
$base_sql = "SELECT $cols FROM $this->table_name $joins
WHERE $condition $order ";
-// echo $base_sql;
-// exit();
if ($results)
{
@@ -444,7 +442,6 @@
$offset = ($start > 0) ? 'OFFSET ' . $start .
' ' : ' ';
$this->db->query($base_sql.$offset, __LINE__,
__FILE__);
}
-
$results = array();
while ($this->db->next_record())
{
@@ -512,13 +509,14 @@
}
}
}
- return array(
- 'total_records' => $total_records,
- 'results' => $results,
- 'start' => $start,
- 'sort' => is_array($sort) ?
$sort[0] : $sort,
- 'dir' => $dir
- );
+
+ return array(
+ 'total_records' => $total_records,
+ 'results' => $results,
+ 'start' => $start,
+ 'sort' => is_array($sort) ?
$sort[0] : $sort,
+ 'dir' => $dir
+ );
}
protected function is_auto_field_def(array &$field_def,
$action) {
Modified: branches/dev-syncromind/phpgwapi/js/jquery/common.js
===================================================================
--- branches/dev-syncromind/phpgwapi/js/jquery/common.js 2015-09-04
00:21:10 UTC (rev 13850)
+++ branches/dev-syncromind/phpgwapi/js/jquery/common.js 2015-09-04
16:52:20 UTC (rev 13851)
@@ -76,8 +76,12 @@
var name = 'Link';
var link = data;
}
-
- return '<a href="' + link + '">' + name + '</a>';
+ if (link){
+ return '<a href="' + link + '">' + name + '</a>';
+ }else{
+ return name;
+ }
+
};
JqueryPortico.formatLinkGenericLlistAttribute = function(key, oData) {
Modified: branches/dev-syncromind/phpgwapi/templates/pure/css/demo_mmenu.css
===================================================================
--- branches/dev-syncromind/phpgwapi/templates/pure/css/demo_mmenu.css
2015-09-04 00:21:10 UTC (rev 13850)
+++ branches/dev-syncromind/phpgwapi/templates/pure/css/demo_mmenu.css
2015-09-04 16:52:20 UTC (rev 13851)
@@ -85,6 +85,7 @@
position: absolute;
top: 40px;
right: 0px;
+ z-index: 1;
}
.header a
@@ -157,6 +158,7 @@
{
transition: none 0.5s ease 0.5s;
transition-property: transform, top, bottom, left, opacity;
+ box-shadow: 0px 0px 1px 0px #777;
}
html.mm-opening #hamburger span
{
Added: branches/dev-syncromind/phpsysinfo/plugins/BAT/class.bat.inc.php
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/BAT/class.bat.inc.php
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/BAT/class.bat.inc.php
2015-09-04 16:52:20 UTC (rev 13851)
@@ -0,0 +1,309 @@
+<?php
+ /**
+ * BAT Plugin, which displays battery state
+ *
+ * @category PHP
+ * @package PSI_Plugin_BAT
+ * @author Erkan V
+ * @copyright 2009 phpSysInfo
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public
License
+ * @version $Id: class.bat.inc.php 661 2012-08-27 11:26:39Z namiltd $
+ * @link http://phpsysinfo.sourceforge.net
+ */
+class BAT extends PSI_Plugin
+{
+ /**
+ * variable, which holds the content of the command
+ * @var array
+ */
+ private $_filecontent = array();
+
+ /**
+ * variable, which holds the result before the xml is generated out of
this array
+ * @var array
+ */
+ private $_result = array();
+
+ /**
+ * holds the COM object that we pull all the WMI data from
+ *
+ * @var Object
+ */
+ private $_wmi = null;
+
+ /**
+ * read the data into an internal array and also call the parent
constructor
+ *
+ * @param String $enc encoding
+ */
+ public function __construct($enc)
+ {
+ parent::__construct(__CLASS__, $enc);
+ switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
+ case 'command':
+ if (PSI_OS == 'Android') {
+
CommonFunctions::rfts('/sys/class/power_supply/battery/uevent', $buffer_info);
+ $buffer_state = '';
+ if
(CommonFunctions::rfts('/sys/class/power_supply/battery/capacity', $buffer1, 1,
4096, false)) {
+ $buffer_state .= 'POWER_SUPPLY_CAPACITY='.$buffer1;
+ }
+ if
(CommonFunctions::rfts('/sys/class/power_supply/battery/batt_temp', $buffer1,
1, 4096, false)) {
+ $buffer_state .= 'POWER_SUPPLY_TEMP='.$buffer1;
+ }
+ if
(CommonFunctions::rfts('/sys/class/power_supply/battery/batt_vol', $buffer1, 1,
4096, false)) {
+ $buffer_state .=
'POWER_SUPPLY_VOLTAGE_NOW='.($buffer1*1000)."\n";
+ }
+ if
(CommonFunctions::rfts('/sys/class/power_supply/battery/voltage_max_design',
$buffer1, 1, 4096, false)) {
+ $buffer_state .=
'POWER_SUPPLY_VOLTAGE_MAX_DESIGN='.($buffer1*1000)."\n";
+ }
+ if
(CommonFunctions::rfts('/sys/class/power_supply/battery/technology', $buffer1,
1, 4096, false)) {
+ $buffer_state .= 'POWER_SUPPLY_TECHNOLOGY='.$buffer1;
+ }
+ if
(CommonFunctions::rfts('/sys/class/power_supply/battery/status', $buffer1, 1,
4096, false)) {
+ $buffer_state .= 'POWER_SUPPLY_STATUS='.$buffer1;
+ }
+ if
(CommonFunctions::rfts('/sys/class/power_supply/battery/health', $buffer1, 1,
4096, false)) {
+ $buffer_state .= 'POWER_SUPPLY_HEALTH='.$buffer1;
+ }
+ } elseif (PSI_OS == 'WINNT') {
+ // don't set this params for local connection, it will not work
+ $strHostname = '';
+ $strUser = '';
+ $strPassword = '';
+ try {
+ // initialize the wmi object
+ $objLocator = new COM('WbemScripting.SWbemLocator');
+ if ($strHostname == "") {
+ $this->_wmi = $objLocator->ConnectServer();
+
+ } else {
+ $this->_wmi = $objLocator->ConnectServer($strHostname,
'rootcimv2', $strHostname.'\\'.$strUser, $strPassword);
+ }
+ } catch (Exception $e) {
+ $this->error->addError("WMI connect error", "PhpSysInfo
can not connect to the WMI interface for security reasons.\nCheck an
authentication mechanism for the directory where phpSysInfo is installed.");
+ }
+ $buffer_info = '';
+ $buffer_state = '';
+ $buffer = CommonFunctions::getWMI($this->_wmi,
'Win32_Battery', array('EstimatedChargeRemaining', 'DesignVoltage',
'BatteryStatus', 'Chemistry'));
+ $capacity = '';
+ if (isset($buffer[0]['EstimatedChargeRemaining'])) {
+ $capacity = $buffer[0]['EstimatedChargeRemaining'];
+ }
+ if (isset($buffer[0]['DesignVoltage'])) {
+ $buffer_state .=
'POWER_SUPPLY_VOLTAGE_NOW='.(1000*$buffer[0]['DesignVoltage'])."\n";
+ }
+ if (isset($buffer[0]['BatteryStatus'])) {
+ switch ($buffer[0]['BatteryStatus']) {
+ case 1: $batstat = 'Discharging'; break;
+ case 2: $batstat = 'AC connected'; break;
+ case 3: $batstat = 'Fully Charged'; break;
+ case 4: $batstat = 'Low'; break;
+ case 5: $batstat = 'Critical'; break;
+ case 6: $batstat = 'Charging'; break;
+ case 7: $batstat = 'Charging and High'; break;
+ case 8: $batstat = 'Charging and Low'; break;
+ case 9: $batstat = 'Charging and Critical'; break;
+ case 10: $batstat = 'Undefined'; break;
+ case 11: $batstat = 'Partially Charged'; break;
+ default: $batstat = '';
+ }
+ if ($batstat != '') $buffer_state .=
'POWER_SUPPLY_STATUS='.$batstat."\n";
+ }
+ $techn = '';
+ if (isset($buffer[0]['Chemistry'])) {
+ switch ($buffer[0]['Chemistry']) {
+ case 1: $techn = 'Other'; break;
+ case 2: $techn = 'Unknown'; break;
+ case 3: $techn = 'PbAc'; break;
+ case 4: $techn = 'NiCd'; break;
+ case 5: $techn = 'NiMH'; break;
+ case 6: $techn = 'Li-ion'; break;
+ case 7: $techn = 'Zinc-air'; break;
+ case 8: $techn = 'Li-poly'; break;
+ }
+ }
+ $buffer = CommonFunctions::getWMI($this->_wmi,
'Win32_PortableBattery', array('DesignVoltage', 'Chemistry', 'DesignCapacity'));
+ if (isset($buffer[0]['DesignVoltage'])) {
+ $buffer_info .=
'POWER_SUPPLY_VOLTAGE_MAX_DESIGN='.(1000*$buffer[0]['DesignVoltage'])."\n";
+ }
+ // sometimes Chemistry from Win32_Battery returns 2 but
Win32_PortableBattery returns e.g. 6
+ if ((($techn == '') || ($techn == 'Unknown')) &&
isset($buffer[0]['Chemistry'])) {
+ switch ($buffer[0]['Chemistry']) {
+ case 1: $techn = 'Other'; break;
+ case 2: $techn = 'Unknown'; break;
+ case 3: $techn = 'PbAc'; break;
+ case 4: $techn = 'NiCd'; break;
+ case 5: $techn = 'NiMH'; break;
+ case 6: $techn = 'Li-ion'; break;
+ case 7: $techn = 'Zinc-air'; break;
+ case 8: $techn = 'Li-poly'; break;
+ }
+ }
+ if ($techn != '') $buffer_info .=
'POWER_SUPPLY_TECHNOLOGY='.$techn."\n";
+ if (isset($buffer[0]['DesignCapacity'])) {
+ $buffer_info .= 'design
capacity:'.$buffer[0]['DesignCapacity']." mWh\n";
+ if ($capacity != '') $buffer_state .= 'remaining
capacity:'.round($capacity*$buffer[0]['DesignCapacity']/100)." mWh\n";
+ } else {
+ if ($capacity != '') $buffer_state .=
'POWER_SUPPLY_CAPACITY='.$capacity."\n";
+ }
+ } else {
+ $rfts_bi =
CommonFunctions::rfts('/proc/acpi/battery/'.PSI_PLUGIN_BAT_DEVICE.'/info',
$buffer_info, 0, 4096, false);
+ $rfts_bs =
CommonFunctions::rfts('/proc/acpi/battery/'.PSI_PLUGIN_BAT_DEVICE.'/state',
$buffer_state, 0, 4096, false);
+ if (!$rfts_bi && !$rfts_bs) {
+
CommonFunctions::rfts('/sys/class/power_supply/'.PSI_PLUGIN_BAT_DEVICE.'/uevent',
$buffer_info);
+ $buffer_state = '';
+ if
(CommonFunctions::rfts('/sys/class/power_supply/'.PSI_PLUGIN_BAT_DEVICE.'/voltage_min_design',
$buffer1, 1, 4096, false)) {
+ $buffer_state .=
'POWER_SUPPLY_VOLTAGE_MIN_DESIGN='.$buffer1."\n";
+ }
+ if
(CommonFunctions::rfts('/sys/class/power_supply/'.PSI_PLUGIN_BAT_DEVICE.'/voltage_now',
$buffer1, 1, 4096, false)) {
+ $buffer_state .=
'POWER_SUPPLY_VOLTAGE_NOW='.$buffer1."\n";
+ }
+ if
(CommonFunctions::rfts('/sys/class/power_supply/'.PSI_PLUGIN_BAT_DEVICE.'/energy_full',
$buffer1, 1, 4096, false)) {
+ $buffer_state .=
'POWER_SUPPLY_ENERGY_FULL='.$buffer1."\n";
+ }
+ if
(CommonFunctions::rfts('/sys/class/power_supply/'.PSI_PLUGIN_BAT_DEVICE.'/energy_now',
$buffer1, 1, 4096, false)) {
+ $buffer_state .=
'POWER_SUPPLY_ENERGY_NOW='.$buffer1."\n";
+ }
+ if
(CommonFunctions::rfts('/sys/class/power_supply/'.PSI_PLUGIN_BAT_DEVICE.'/capacity',
$buffer1, 1, 4096, false)) {
+ $buffer_state .= 'POWER_SUPPLY_CAPACITY='.$buffer1;
+ }
+ if
(CommonFunctions::rfts('/sys/class/power_supply/'.PSI_PLUGIN_BAT_DEVICE.'/technology',
$buffer1, 1, 4096, false)) {
+ $buffer_state .= 'POWER_SUPPLY_TECHNOLOGY='.$buffer1;
+ }
+ if
(CommonFunctions::rfts('/sys/class/power_supply/'.PSI_PLUGIN_BAT_DEVICE.'/status',
$buffer1, 1, 4096, false)) {
+ $buffer_state .= 'POWER_SUPPLY_STATUS='.$buffer1;
+ }
+ }
+ }
+ break;
+ case 'data':
+ CommonFunctions::rfts(APP_ROOT."/data/bat_info.txt", $buffer_info);
+ CommonFunctions::rfts(APP_ROOT."/data/bat_state.txt",
$buffer_state);
+ break;
+ default:
+ $this->global_error->addConfigError("__construct()",
"PSI_PLUGIN_BAT_ACCESS");
+ break;
+ }
+ $this->_filecontent['info'] = preg_split("/\n/", $buffer_info, -1,
PREG_SPLIT_NO_EMPTY);
+ $this->_filecontent['state'] = preg_split("/\n/", $buffer_state, -1,
PREG_SPLIT_NO_EMPTY);
+ }
+
+ /**
+ * doing all tasks to get the required informations that the plugin needs
+ * result is stored in an internal array
+ *
+ * @return void
+ */
+ public function execute()
+ {
+ if ( empty($this->_filecontent)) {
+ return;
+ }
+ foreach ($this->_filecontent['info'] as $roworig) {
+ if (preg_match('/^design capacity\s*:\s*(.*)$/', trim($roworig),
$data)) {
+ $bat['design_capacity'] = $data[1];
+ } elseif (preg_match('/^design voltage\s*:\s*(.*)$/',
trim($roworig), $data)) {
+ $bat['design_voltage'] = $data[1];
+ } elseif (preg_match('/^battery type\s*:\s*(.*)$/',
trim($roworig), $data)) {
+ $bat['battery_type'] = $data[1];
+
+ } elseif
(preg_match('/^POWER_SUPPLY_VOLTAGE_MIN_DESIGN\s*=\s*(.*)$/', trim($roworig),
$data)) {
+ $bat['design_voltage'] = ($data[1]/1000).' mV';
+ } elseif (preg_match('/^POWER_SUPPLY_ENERGY_FULL\s*=\s*(.*)$/',
trim($roworig), $data)) {
+ $bat['design_capacity'] = ($data[1]/1000).' mWh';
+ } elseif (preg_match('/^POWER_SUPPLY_ENERGY_NOW\s*=\s*(.*)$/',
trim($roworig), $data)) {
+ $bat['remaining_capacity'] = ($data[1]/1000).' mWh';
+
+ /* Android */
+ } elseif (preg_match('/^POWER_SUPPLY_CAPACITY\s*=\s*(.*)$/',
trim($roworig), $data) && !isset($bat['remaining_capacity'])) {
+ $bat['remaining_capacity'] = $data[1];
+ $bat['design_capacity'] = '%';
+ } elseif (preg_match('/^POWER_SUPPLY_TEMP\s*=\s*(.*)$/',
trim($roworig), $data)) {
+ $bat['battery_temperature'] = $data[1]/10;
+ } elseif (preg_match('/^POWER_SUPPLY_VOLTAGE_NOW\s*=\s*(.*)$/',
trim($roworig), $data)) {
+ $bat['present_voltage'] = ($data[1]/1000).' mV';
+ } elseif
(preg_match('/^POWER_SUPPLY_VOLTAGE_MAX_DESIGN\s*=\s*(.*)$/', trim($roworig),
$data)) {
+ $bat['design_voltage'] = ($data[1]/1000).' mV';
+ } elseif (preg_match('/^POWER_SUPPLY_TECHNOLOGY\s*=\s*(.*)$/',
trim($roworig), $data)) {
+ $bat['battery_type'] = $data[1];
+ } elseif (preg_match('/^POWER_SUPPLY_STATUS\s*=\s*(.*)$/',
trim($roworig), $data)) {
+ $bat['charging_state'] = $data[1];
+ } elseif (preg_match('/^POWER_SUPPLY_HEALTH\s*=\s*(.*)$/',
trim($roworig), $data)) {
+ $bat['battery_condition'] = $data[1];
+ }
+ }
+ foreach ($this->_filecontent['state'] as $roworig) {
+ if (preg_match('/^remaining capacity\s*:\s*(.*)$/',
trim($roworig), $data)) {
+ $bat['remaining_capacity'] = $data[1];
+ } elseif (preg_match('/^present voltage\s*:\s*(.*)$/',
trim($roworig), $data)) {
+ $bat['present_voltage'] = $data[1];
+ } elseif (preg_match('/^charging state\s*:\s*(.*)$/',
trim($roworig), $data)) {
+ $bat['charging_state'] = $data[1];
+
+ } elseif
(preg_match('/^POWER_SUPPLY_VOLTAGE_MIN_DESIGN\s*=\s*(.*)$/', trim($roworig),
$data)) {
+ $bat['design_voltage'] = ($data[1]/1000).' mV';
+ } elseif (preg_match('/^POWER_SUPPLY_ENERGY_FULL\s*=\s*(.*)$/',
trim($roworig), $data)) {
+ $bat['design_capacity'] = ($data[1]/1000).' mWh';
+ } elseif (preg_match('/^POWER_SUPPLY_ENERGY_NOW\s*=\s*(.*)$/',
trim($roworig), $data)) {
+ $bat['remaining_capacity'] = ($data[1]/1000).' mWh';
+
+ /* Android */
+ } elseif (preg_match('/^POWER_SUPPLY_CAPACITY\s*=\s*(.*)$/',
trim($roworig), $data) && !isset($bat['remaining_capacity'])) {
+ $bat['remaining_capacity'] = $data[1];
+ $bat['design_capacity'] = '%';
+ } elseif (preg_match('/^POWER_SUPPLY_TEMP\s*=\s*(.*)$/',
trim($roworig), $data)) {
+ $bat['battery_temperature'] = $data[1]/10;
+ } elseif (preg_match('/^POWER_SUPPLY_VOLTAGE_NOW\s*=\s*(.*)$/',
trim($roworig), $data)) {
+ $bat['present_voltage'] = ($data[1]/1000).' mV';
+ } elseif
(preg_match('/^POWER_SUPPLY_VOLTAGE_MAX_DESIGN\s*=\s*(.*)$/', trim($roworig),
$data)) {
+ $bat['design_voltage'] = ($data[1]/1000).' mV';
+ } elseif (preg_match('/^POWER_SUPPLY_TECHNOLOGY\s*=\s*(.*)$/',
trim($roworig), $data)) {
+ $bat['battery_type'] = $data[1];
+ } elseif (preg_match('/^POWER_SUPPLY_STATUS\s*=\s*(.*)$/',
trim($roworig), $data)) {
+ $bat['charging_state'] = $data[1];
+ } elseif (preg_match('/^POWER_SUPPLY_HEALTH\s*=\s*(.*)$/',
trim($roworig), $data)) {
+ $bat['battery_condition'] = $data[1];
+ }
+ }
+
+ if (isset($bat)) $this->_result[0] = $bat;
+ }
+
+ /**
+ * generates the XML content for the plugin
+ *
+ * @return SimpleXMLElement entire XML content for the plugin
+ */
+ public function xml()
+ {
+ foreach ($this->_result as $bat_item) {
+ $xmlbat = $this->xml->addChild("Bat");
+ if (isset($bat_item['design_capacity'])) {
+ $xmlbat->addAttribute("DesignCapacity",
$bat_item['design_capacity']);
+ }
+ if (isset($bat_item['design_voltage'])) {
+ $xmlbat->addAttribute("DesignVoltage",
$bat_item['design_voltage']);
+ }
+ if (isset($bat_item['remaining_capacity'])) {
+ $xmlbat->addAttribute("RemainingCapacity",
$bat_item['remaining_capacity']);
+ }
+ if (isset($bat_item['present_voltage'])) {
+ $xmlbat->addAttribute("PresentVoltage",
$bat_item['present_voltage']);
+ }
+ if (isset($bat_item['charging_state'])) {
+ $xmlbat->addAttribute("ChargingState",
$bat_item['charging_state']);
+ }
+ if (isset($bat_item['battery_type'])) {
+ $xmlbat->addAttribute("BatteryType",
$bat_item['battery_type']);
+ }
+ if (isset($bat_item['battery_temperature'])) {
+ $xmlbat->addAttribute("BatteryTemperature",
$bat_item['battery_temperature']);
+ }
+ if (isset($bat_item['battery_condition'])) {
+ $xmlbat->addAttribute("BatteryCondition",
$bat_item['battery_condition']);
+ }
+ }
+
+ return $this->xml->getSimpleXmlElement();
+ }
+}
Added: branches/dev-syncromind/phpsysinfo/plugins/BAT/js/bat.js
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/BAT/js/bat.js
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/BAT/js/bat.js 2015-09-04
16:52:20 UTC (rev 13851)
@@ -0,0 +1,152 @@
+/***************************************************************************
+ * Copyright (C) 2008 by phpSysInfo - A PHP System Information Script *
+ * http://phpsysinfo.sourceforge.net/ *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License 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. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+//
+// $Id: bat.js 661 2012-08-27 11:26:39Z namiltd $
+//
+
+/*global $, jQuery, buildBlock, datetime, plugin_translate, genlang, createBar
*/
+
+"use strict";
+
+var bat_show = false, bat_table;
+/**
+ * insert content into table
+ * @param {jQuery} xml plugin-XML
+ */
+function bat_populate(xml) {
+
+ bat_table.fnClearTable();
+
+ $("Plugins Plugin_BAT Bat", xml).each(function bat_getitem(idp) {
+ var DesignCapacity = "", DesignVoltage = "", BatteryType =
"",RemainingCapacity = "", PresentVoltage = "", ChargingState = "",
BatteryTemperature = "", BatteryCondition = "";
+ DesignCapacity = $(this).attr("DesignCapacity");
+ DesignVoltage = $(this).attr("DesignVoltage");
+ BatteryType = $(this).attr("BatteryType");
+ RemainingCapacity = $(this).attr("RemainingCapacity");
+ PresentVoltage = $(this).attr("PresentVoltage");
+ ChargingState = $(this).attr("ChargingState");
+ BatteryTemperature = $(this).attr("BatteryTemperature");
+ BatteryCondition = $(this).attr("BatteryCondition");
+
+ if (DesignCapacity == undefined) {
+ if (RemainingCapacity != undefined)
bat_table.fnAddData([genlang(4, true, "BAT"), RemainingCapacity, ' ']);
+ } else if (DesignCapacity == "%") {
+ if (RemainingCapacity != undefined)
bat_table.fnAddData([genlang(4, true, "BAT"),
createBar(parseInt(RemainingCapacity, 10)), ' ']);
+ } else {
+ bat_table.fnAddData([genlang(3, true, "BAT"), DesignCapacity,
' ']);
+ if (RemainingCapacity != undefined)
bat_table.fnAddData([genlang(4, true, "BAT"), RemainingCapacity,
createBar(parseInt(parseInt(RemainingCapacity, 10) / parseInt(DesignCapacity,
10) * 100, 10))]);
+ }
+ if (ChargingState != undefined) {
+ bat_table.fnAddData([genlang(9, true, "BAT"), ChargingState,
' ']);
+ }
+ if (DesignVoltage != undefined) {
+ bat_table.fnAddData([genlang(5, true, "BAT"), DesignVoltage,
' ']);
+ }
+ if (PresentVoltage != undefined) {
+ bat_table.fnAddData([genlang(6, true, "BAT"), PresentVoltage,
' ']);
+ }
+ if (BatteryType != undefined) {
+ bat_table.fnAddData([genlang(10, true, "BAT"), BatteryType,
' ']);
+ }
+ if (BatteryTemperature != undefined) {
+ bat_table.fnAddData([genlang(11, true, "BAT"), BatteryTemperature,
' ']);
+ }
+ if (BatteryCondition != undefined) {
+ bat_table.fnAddData([genlang(12, true, "BAT"), BatteryCondition,
' ']);
+ }
+
+ bat_show = true;
+ });
+}
+
+/**
+ * fill the plugin block with table structure
+ */
+function bat_buildTable() {
+ var html = "";
+
+ html += "<table id=\"Plugin_BATTable\" style=\"border-spacing:0;\">\n";
+ html += " <thead>\n";
+ html += " <tr>\n";
+ html += " <th>" + genlang(7, true, "BAT") + "</th>\n";
+ html += " <th>" + genlang(8, true, "BAT") + "</th>\n";
+ html += " <th> </th>\n";
+ html += " </tr>\n";
+ html += " </thead>\n";
+ html += " <tbody>\n";
+ html += " </tbody>\n";
+ html += "</table>\n";
+
+ $("#Plugin_BAT").append(html);
+
+}
+
+/**
+ * load the xml via ajax
+ */
+function bat_request() {
+ $.ajax({
+ url: "xml.php?plugin=BAT",
+ dataType: "xml",
+ error: function bat_error() {
+ $.jGrowl("Error loading XML document for Plugin BAT!");
+ },
+ success: function bat_buildblock(xml) {
+ populateErrors(xml);
+ bat_populate(xml);
+ if (bat_show) {
+ plugin_translate("BAT");
+ $("#Plugin_BAT").show();
+ }
+ }
+ });
+}
+
+$(document).ready(function bat_buildpage() {
+ $("#footer").before(buildBlock("BAT", 1, true));
+ $("#Plugin_BAT").css("width", "451px");
+
+ bat_buildTable();
+
+ bat_table = $("#Plugin_BATTable").dataTable({
+ "bPaginate": false,
+ "bLengthChange": false,
+ "bFilter": false,
+ "bSort": false,
+ "bInfo": false,
+ "bProcessing": true,
+ "bAutoWidth": false,
+ "bStateSave": true,
+ "aoColumns": [{
+ "sType": 'span-string'
+ }, {
+ "sType": 'span-string'
+ }, {
+ "sType": 'span-string'
+ }]
+ });
+
+ bat_request();
+
+ $("#Reload_BATTable").click(function bat_reload(id) {
+ bat_request();
+ $("#Reload_BATTable").attr("title",datetime());
+ });
+});
Added: branches/dev-syncromind/phpsysinfo/plugins/BAT/lang/cz.xml
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/BAT/lang/cz.xml
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/BAT/lang/cz.xml 2015-09-04
16:52:20 UTC (rev 13851)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+ <!-- $Id: cz.xml 661 2012-08-27 11:26:39Z namiltd $ -->
+ <!--
+ phpSysInfo language file Language: Czech Created by: Tomáš Růžička
+ -->
+<tns:translationPlugin language="czech" charset="utf-8"
+ xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin
../../../language/translation-plugin.xsd">
+ <expression id="plugin_bat_001" name="bat_title">
+ <exp>Stav baterie</exp>
+ </expression>
+ <expression id="plugin_bat_002" name="bat_date">
+ <exp>Aktualizováno</exp>
+ </expression>
+ <expression id="plugin_bat_003" name="bat_design_capacity">
+ <exp>Konstrukční kapacita</exp>
+ </expression>
+ <expression id="plugin_bat_004" name="bat_remaining_capacity">
+ <exp>Zbývající kapacita</exp>
+ </expression>
+ <expression id="plugin_bat_005" name="bat_design_voltage">
+ <exp>Konstrukční napětí</exp>
+ </expression>
+ <expression id="plugin_bat_006" name="bat_present_voltage">
+ <exp>Aktuální napětí</exp>
+ </expression>
+ <expression id="plugin_bat_007" name="bat_item">
+ <exp>Položky</exp>
+ </expression>
+ <expression id="plugin_bat_008" name="bat_value">
+ <exp>Hodnoty</exp>
+ </expression>
+ <expression id="plugin_bat_009" name="bat_charging_state">
+ <exp>Stav nabíjení</exp>
+ </expression>
+ <expression id="plugin_bat_010" name="bat_battery_type">
+ <exp>Battery Type</exp>
+ </expression>
+ <expression id="plugin_bat_011" name="bat_battery_temperature">
+ <exp>Battery Temperature</exp>
+ </expression>
+ <expression id="plugin_bat_012" name="bat_battery_condition">
+ <exp>Battery Condition</exp>
+ </expression>
+</tns:translationPlugin>
Added: branches/dev-syncromind/phpsysinfo/plugins/BAT/lang/en.xml
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/BAT/lang/en.xml
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/BAT/lang/en.xml 2015-09-04
16:52:20 UTC (rev 13851)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+ <!-- $Id: en.xml 661 2012-08-27 11:26:39Z namiltd $ -->
+ <!--
+ phpSysInfo language file Language: English Created by: Erkan VALENTIN
+ -->
+<tns:translationPlugin language="english" charset="utf-8"
+ xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin
../../../language/translation-plugin.xsd">
+ <expression id="plugin_bat_001" name="bat_title">
+ <exp>Battery Status</exp>
+ </expression>
+ <expression id="plugin_bat_002" name="bat_date">
+ <exp>Last refresh</exp>
+ </expression>
+ <expression id="plugin_bat_003" name="bat_design_capacity">
+ <exp>Design capacity</exp>
+ </expression>
+ <expression id="plugin_bat_004" name="bat_remaining_capacity">
+ <exp>Remaining capacity</exp>
+ </expression>
+ <expression id="plugin_bat_005" name="bat_design_voltage">
+ <exp>Design voltage</exp>
+ </expression>
+ <expression id="plugin_bat_006" name="bat_present_voltage">
+ <exp>Present voltage</exp>
+ </expression>
+ <expression id="plugin_bat_007" name="bat_item">
+ <exp>Items</exp>
+ </expression>
+ <expression id="plugin_bat_008" name="bat_value">
+ <exp>Values</exp>
+ </expression>
+ <expression id="plugin_bat_009" name="bat_charging_state">
+ <exp>Charging state</exp>
+ </expression>
+ <expression id="plugin_bat_010" name="bat_battery_type">
+ <exp>Battery Type</exp>
+ </expression>
+ <expression id="plugin_bat_011" name="bat_battery_temperature">
+ <exp>Battery Temperature</exp>
+ </expression>
+ <expression id="plugin_bat_012" name="bat_battery_condition">
+ <exp>Battery Condition</exp>
+ </expression>
+</tns:translationPlugin>
Added: branches/dev-syncromind/phpsysinfo/plugins/BAT/lang/fr.xml
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/BAT/lang/fr.xml
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/BAT/lang/fr.xml 2015-09-04
16:52:20 UTC (rev 13851)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+ <!-- $Id: fr.xml 661 2012-08-27 11:26:39Z namiltd $ -->
+ <!--
+ phpSysInfo language file Language: French Created by: Erkan VALENTIN
+ -->
+<tns:translationPlugin language="french" charset="utf-8"
+ xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin
../../../language/translation-plugin.xsd">
+ <expression id="plugin_bat_001" name="bat_title">
+ <exp>Etat des batteries</exp>
+ </expression>
+ <expression id="plugin_bat_002" name="bat_date">
+ <exp>Dernière actualisation</exp>
+ </expression>
+ <expression id="plugin_bat_003" name="bat_design_capacity">
+ <exp>Capacité d'origine</exp>
+ </expression>
+ <expression id="plugin_bat_004" name="bat_remaining_capacity">
+ <exp>Capacité restante</exp>
+ </expression>
+ <expression id="plugin_bat_005" name="bat_design_voltage">
+ <exp>Tension d'origine</exp>
+ </expression>
+ <expression id="plugin_bat_006" name="bat_present_voltage">
+ <exp>Tension actuelle</exp>
+ </expression>
+ <expression id="plugin_bat_007" name="bat_item">
+ <exp>Elements</exp>
+ </expression>
+ <expression id="plugin_bat_008" name="bat_value">
+ <exp>Valeurs</exp>
+ </expression>
+ <expression id="plugin_bat_009" name="bat_charging_state">
+ <exp>Etat</exp>
+ </expression>
+ <expression id="plugin_bat_010" name="bat_battery_type">
+ <exp>Battery Type</exp>
+ </expression>
+ <expression id="plugin_bat_011" name="bat_battery_temperature">
+ <exp>Battery Temperature</exp>
+ </expression>
+ <expression id="plugin_bat_012" name="bat_battery_condition">
+ <exp>Battery Condition</exp>
+ </expression>
+</tns:translationPlugin>
Added: branches/dev-syncromind/phpsysinfo/plugins/BAT/lang/pl.xml
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/BAT/lang/pl.xml
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/BAT/lang/pl.xml 2015-09-04
16:52:20 UTC (rev 13851)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+ <!-- $Id: pl.xml 661 2012-08-27 11:26:39Z namiltd $ -->
+ <!--
+ phpSysInfo language file Language: Polish Created by: Mieczyslaw Nalewaj
+ -->
+<tns:translationPlugin language="polish" charset="utf-8"
+ xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin
../../../language/translation-plugin.xsd">
+ <expression id="plugin_bat_001" name="bat_title">
+ <exp>Status Baterii</exp>
+ </expression>
+ <expression id="plugin_bat_002" name="bat_date">
+ <exp>Ostatnie odświeżenie</exp>
+ </expression>
+ <expression id="plugin_bat_003" name="bat_design_capacity">
+ <exp>Pojemność znamionowa</exp>
+ </expression>
+ <expression id="plugin_bat_004" name="bat_remaining_capacity">
+ <exp>Pojemność aktualna</exp>
+ </expression>
+ <expression id="plugin_bat_005" name="bat_design_voltage">
+ <exp>Napięcie znamionowe</exp>
+ </expression>
+ <expression id="plugin_bat_006" name="bat_present_voltage">
+ <exp>Napięcie aktualne</exp>
+ </expression>
+ <expression id="plugin_bat_007" name="bat_item">
+ <exp>Parametry</exp>
+ </expression>
+ <expression id="plugin_bat_008" name="bat_value">
+ <exp>Wartości</exp>
+ </expression>
+ <expression id="plugin_bat_009" name="bat_charging_state">
+ <exp>Stan ładowania</exp>
+ </expression>
+ <expression id="plugin_bat_010" name="bat_battery_type">
+ <exp>Typ ogniw</exp>
+ </expression>
+ <expression id="plugin_bat_011" name="bat_battery_temperature">
+ <exp>Temperatura ogniw</exp>
+ </expression>
+ <expression id="plugin_bat_012" name="bat_battery_condition">
+ <exp>Kondycja ogniw</exp>
+ </expression>
+</tns:translationPlugin>
Added: branches/dev-syncromind/phpsysinfo/plugins/BAT/lang/ru.xml
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/BAT/lang/ru.xml
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/BAT/lang/ru.xml 2015-09-04
16:52:20 UTC (rev 13851)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+ <!-- $Id: en.xml 661 2012-08-27 11:26:39Z namiltd $ -->
+ <!--
+ phpSysInfo language file Language: Russian Created by: Denis Sevostyanov
(den007)
+ -->
+<tns:translationPlugin language="russian" charset="utf-8"
+ xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin
../../../language/translation-plugin.xsd">
+ <expression id="plugin_bat_001" name="bat_title">
+ <exp>Состояние батареи</exp>
+ </expression>
+ <expression id="plugin_bat_002" name="bat_date">
+ <exp>Последние обновление</exp>
+ </expression>
+ <expression id="plugin_bat_003" name="bat_design_capacity">
+ <exp>Проектная мощность</exp>
+ </expression>
+ <expression id="plugin_bat_004" name="bat_remaining_capacity">
+ <exp>Оставшийся объем</exp>
+ </expression>
+ <expression id="plugin_bat_005" name="bat_design_voltage">
+ <exp>Проектное напряжение</exp>
+ </expression>
+ <expression id="plugin_bat_006" name="bat_present_voltage">
+ <exp>Фактическое напряжение</exp>
+ </expression>
+ <expression id="plugin_bat_007" name="bat_item">
+ <exp>Элементы</exp>
+ </expression>
+ <expression id="plugin_bat_008" name="bat_value">
+ <exp>Значение</exp>
+ </expression>
+ <expression id="plugin_bat_009" name="bat_charging_state">
+ <exp>Состояние зарядки</exp>
+ </expression>
+ <expression id="plugin_bat_010" name="bat_battery_type">
+ <exp>Тип батареи</exp>
+ </expression>
+ <expression id="plugin_bat_011" name="bat_battery_temperature">
+ <exp>Температура батареи</exp>
+ </expression>
+ <expression id="plugin_bat_012" name="bat_battery_condition">
+ <exp>Состояние аккумулятора</exp>
+ </expression>
+</tns:translationPlugin>
Added:
branches/dev-syncromind/phpsysinfo/plugins/MDStatus/class.mdstatus.inc.php
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/MDStatus/class.mdstatus.inc.php
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/MDStatus/class.mdstatus.inc.php
2015-09-04 16:52:20 UTC (rev 13851)
@@ -0,0 +1,224 @@
+<?php
+/**
+ * MDStatus Plugin
+ *
+ * PHP version 5
+ *
+ * @category PHP
+ * @package PSI_Plugin_MDStatus
+ * @author Michael Cramer <address@hidden>
+ * @copyright 2009 phpSysInfo
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public
License
+ * @version SVN: $Id: class.mdstatus.inc.php 661 2012-08-27 11:26:39Z
namiltd $
+ * @link http://phpsysinfo.sourceforge.net
+ */
+ /**
+ * mdstat Plugin, which displays a snapshot of the kernel's RAID/md state
+ * a simple view which shows supported types and RAID-Devices which are
determined by
+ * parsing the "/proc/mdstat" file, another way is to provide
+ * a file with the output of the /proc/mdstat file, so there is no need to run
a execute by the
+ * webserver, the format of the command is written down in the
mdstat.config.php file, where also
+ * the method of getting the information is configured
+ *
+ * @category PHP
+ * @package PSI_Plugin_MDStatus
+ * @author Michael Cramer <address@hidden>
+ * @copyright 2009 phpSysInfo
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public
License
+ * @version Release: 3.0
+ * @link http://phpsysinfo.sourceforge.net
+ */
+class MDStatus extends PSI_Plugin
+{
+ /**
+ * variable, which holds the content of the command
+ * @var array
+ */
+ private $_filecontent = "";
+
+ /**
+ * variable, which holds the result before the xml is generated out of
this array
+ * @var array
+ */
+ private $_result = array();
+
+ /**
+ * read the data into an internal array and also call the parent
constructor
+ *
+ * @param String $enc encoding
+ */
+ public function __construct($enc)
+ {
+ $buffer = "";
+ parent::__construct(__CLASS__, $enc);
+ switch (strtolower(PSI_PLUGIN_MDSTATUS_ACCESS)) {
+ case 'file':
+ CommonFunctions::rfts("/proc/mdstat", $buffer);
+ break;
+ case 'data':
+ CommonFunctions::rfts(APP_ROOT."/data/mdstat.txt", $buffer);
+ break;
+ default:
+ $this->global_error->addConfigError("__construct()",
"PSI_PLUGIN_MDSTATUS_ACCESS");
+ break;
+ }
+ if (trim($buffer) != "") {
+ $this->_filecontent = preg_split("/\n/", $buffer, -1,
PREG_SPLIT_NO_EMPTY);
+ } else {
+ $this->_filecontent = array();
+ }
+ }
+
+ /**
+ * doing all tasks to get the required informations that the plugin needs
+ * result is stored in an internal array<br>the array is build like a tree,
+ * so that it is possible to get only a specific process with the childs
+ *
+ * @return void
+ */
+ public function execute()
+ {
+ if ( empty($this->_filecontent)) {
+ return;
+ }
+ // get the supported types
+ if (preg_match('/[a-zA-Z]* : (\[([a-z0-9])*\]([ \n]))+/',
$this->_filecontent[0], $res)) {
+ $parts = preg_split("/ : /", $res[0]);
+ $parts = preg_split("/ /", $parts[1]);
+ $count = 0;
+ foreach ($parts as $types) {
+ if (trim($types) != "") {
+ $this->_result['supported_types'][$count++] =
substr(trim($types), 1, -1);
+ }
+ }
+ }
+ // get disks
+ if (preg_match("/^read_ahead/", $this->_filecontent[2])) {
+ $count = 2;
+ } else {
+ $count = 1;
+ }
+ $cnt_filecontent = count($this->_filecontent);
+ do {
+ $parts = preg_split("/ : /", $this->_filecontent[$count]);
+ $dev = trim($parts[0]);
+ if (count($parts) == 2) {
+ $details = preg_split('/ /', $parts[1]);
+ if (!strstr($details[0], 'inactive')) {
+ $this->_result['devices'][$dev]['level'] = $details[1];
+ }
+ $this->_result['devices'][$dev]['status'] = $details[0];
+ for ($i = 2, $cnt_details = count($details); $i <
$cnt_details; $i++) {
+ preg_match('/(([a-z0-9])+)(\[([0-9]+)\])(\([SF ]\))?/',
trim($details[$i]), $partition);
+ if (count($partition) == 5 || count($partition) == 6) {
+
$this->_result['devices'][$dev]['partitions'][$partition[1]]['raid_index'] =
substr(trim($partition[3]), 1, -1);
+ if (isset($partition[5])) {
+ $search = array("(", ")");
+ $replace = array("", "");
+
$this->_result['devices'][$dev]['partitions'][$partition[1]]['status'] =
str_replace($search, $replace, trim($partition[5]));
+ } else {
+
$this->_result['devices'][$dev]['partitions'][$partition[1]]['status'] = " ";
+ }
+ }
+ }
+ $count++;
+ $optionline = $this->_filecontent[$count -
1].$this->_filecontent[$count];
+ if (preg_match('/([^\sk]*)k chunk/', $optionline, $chunksize))
{
+ $this->_result['devices'][$dev]['chunk_size'] =
$chunksize[1];
+ } else {
+ $this->_result['devices'][$dev]['chunk_size'] = -1;
+ }
+ if ($pos = strpos($optionline, "super non-persistent")) {
+ $this->_result['devices'][$dev]['pers_superblock'] = 0;
+ } else {
+ $this->_result['devices'][$dev]['pers_superblock'] = 1;
+ }
+ if ($pos = strpos($optionline, "algorithm")) {
+ $this->_result['devices'][$dev]['algorithm'] =
trim(substr($optionline, $pos + 9, 2));
+ } else {
+ $this->_result['devices'][$dev]['algorithm'] = -1;
+ }
+ if (preg_match('/(\[[0-9]?\/[0-9]\])/', $optionline, $res)) {
+ $slashpos = strpos($res[0], '/');
+ $this->_result['devices'][$dev]['registered'] =
substr($res[0], 1, $slashpos - 1);
+ $this->_result['devices'][$dev]['active'] =
substr($res[0], $slashpos + 1, strlen($res[0]) - $slashpos - 2);
+ } else {
+ $this->_result['devices'][$dev]['registered'] = -1;
+ $this->_result['devices'][$dev]['active'] = -1;
+ }
+ if (preg_match(('/([a-z]+)( *)=( *)([0-9\.]+)%/'),
$this->_filecontent[$count + 1], $res) || (preg_match(('/([a-z]+)( *)=(
*)([0-9\.]+)/'), $optionline, $res))) {
+ list($this->_result['devices'][$dev]['action']['name'],
$this->_result['devices'][$dev]['action']['percent']) = preg_split("/=/",
str_replace("%", "", $res[0]));
+ if (preg_match(('/([a-z]*=[0-9\.]+[a-z]+)/'),
$this->_filecontent[$count + 1], $res)) {
+ $time = preg_split("/=/", $res[0]);
+
list($this->_result['devices'][$dev]['action']['finish_time'],
$this->_result['devices'][$dev]['action']['finish_unit']) = sscanf($time[1],
'%f%s');
+ } else {
+
$this->_result['devices'][$dev]['action']['finish_time'] = -1;
+
$this->_result['devices'][$dev]['action']['finish_unit'] = -1;
+ }
+ } else {
+ $this->_result['devices'][$dev]['action']['name'] = -1;
+ $this->_result['devices'][$dev]['action']['percent'] = -1;
+ $this->_result['devices'][$dev]['action']['finish_time'] =
-1;
+ $this->_result['devices'][$dev]['action']['finish_unit'] =
-1;
+ }
+ } else {
+ $count++;
+ }
+ } while ($cnt_filecontent > $count);
+ $lastline = $this->_filecontent[$cnt_filecontent - 2];
+ if (strpos($lastline, "unused devices") !== false) {
+ $parts = preg_split("/:/", $lastline);
+ $search = array("<", ">");
+ $replace = array("", "");
+ $this->_result['unused_devs'] = trim(str_replace($search,
$replace, $parts[1]));
+ } else {
+ $this->_result['unused_devs'] = -1;
+ }
+ }
+
+ /**
+ * generates the XML content for the plugin
+ *
+ * @return SimpleXMLObject entire XML content for the plugin
+ */
+ public function xml()
+ {
+ if ( empty($this->_result)) {
+ return $this->xml->getSimpleXmlElement();
+ }
+ $sup = $this->xml->addChild("Supported_Types");
+ foreach ($this->_result['supported_types'] as $type) {
+ $typ = $sup->addChild("Type");
+ $typ->addAttribute("Name", $type);
+ }
+ foreach ($this->_result['devices'] as $key=>$device) {
+ $dev = $this->xml->addChild("Raid");
+ $dev->addAttribute("Device_Name", $key);
+ $dev->addAttribute("Level", $device["level"]);
+ $dev->addAttribute("Disk_Status", $device["status"]);
+ $dev->addAttribute("Chunk_Size", $device["chunk_size"]);
+ $dev->addAttribute("Persistend_Superblock",
$device["pers_superblock"]);
+ $dev->addAttribute("Algorithm", $device["algorithm"]);
+ $dev->addAttribute("Disks_Registered", $device["registered"]);
+ $dev->addAttribute("Disks_Active", $device["active"]);
+ $action = $dev->addChild("Action");
+ $action->addAttribute("Percent", $device['action']['percent']);
+ $action->addAttribute("Name", $device['action']['name']);
+ $action->addAttribute("Time_To_Finish",
$device['action']['finish_time']);
+ $action->addAttribute("Time_Unit",
$device['action']['finish_unit']);
+ $disks = $dev->addChild("Disks");
+ foreach ($device['partitions'] as $diskkey=>$disk) {
+ $disktemp = $disks->addChild("Disk");
+ $disktemp->addAttribute("Name", $diskkey);
+ $disktemp->addAttribute("Status", $disk['status']);
+ $disktemp->addAttribute("Index", $disk['raid_index']);
+ }
+ }
+ if ($this->_result['unused_devs'] !== - 1) {
+ $unDev = $this->xml->addChild("Unused_Devices");
+ $unDev->addAttribute("Devices", $this->_result['unused_devs']);
+ }
+
+ return $this->xml->getSimpleXmlElement();
+ }
+}
Added: branches/dev-syncromind/phpsysinfo/plugins/MDStatus/css/mdstatus.css
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/MDStatus/css/mdstatus.css
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/MDStatus/css/mdstatus.css
2015-09-04 16:52:20 UTC (rev 13851)
@@ -0,0 +1,14 @@
+/*
+ $Id: mdstatus.css 661 2012-08-27 11:26:39Z namiltd $
+ */
+.plugin_mdstatus_biun {
+ text-align: center;
+ margin-bottom: 5px;
+ margin-right: 20px;
+ float: left;
+ width: 64px;
+}
+
+img.plugin_mdstatus_biun {
+ margin: auto;
+}
Added: branches/dev-syncromind/phpsysinfo/plugins/MDStatus/gfx/error.png
===================================================================
(Binary files differ)
Property changes on:
branches/dev-syncromind/phpsysinfo/plugins/MDStatus/gfx/error.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/dev-syncromind/phpsysinfo/plugins/MDStatus/gfx/harddrivefail.png
===================================================================
(Binary files differ)
Property changes on:
branches/dev-syncromind/phpsysinfo/plugins/MDStatus/gfx/harddrivefail.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/dev-syncromind/phpsysinfo/plugins/MDStatus/gfx/harddriveok.png
===================================================================
(Binary files differ)
Property changes on:
branches/dev-syncromind/phpsysinfo/plugins/MDStatus/gfx/harddriveok.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
branches/dev-syncromind/phpsysinfo/plugins/MDStatus/gfx/harddrivespare.png
===================================================================
(Binary files differ)
Property changes on:
branches/dev-syncromind/phpsysinfo/plugins/MDStatus/gfx/harddrivespare.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/dev-syncromind/phpsysinfo/plugins/MDStatus/js/mdstatus.js
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/MDStatus/js/mdstatus.js
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/MDStatus/js/mdstatus.js
2015-09-04 16:52:20 UTC (rev 13851)
@@ -0,0 +1,224 @@
+/***************************************************************************
+ * Copyright (C) 2008 by phpSysInfo - A PHP System Information Script *
+ * http://phpsysinfo.sourceforge.net/ *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License 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. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+//
+// $Id: mdstatus.js 679 2012-09-04 10:10:11Z namiltd $
+//
+
+/*global $, jQuery, buildBlock, genlang, createBar, plugin_translate, datetime
*/
+
+"use strict";
+
+//appendcss("./plugins/MDStatus/css/MDStatus.css");
+
+var mdstatus_show = false;
+
+/**
+ * get the details of the raid
+ * @param {jQuery} xml part of the plugin-XML
+ * @param {number} id id of the device
+ */
+function mdstatus_buildinfos(xml, id) {
+ var html = "", devstatus = "", devlevel = "", devchunk = 0, devsuper = 0,
devalgo = 0, devactive = 0, devregis = 0, button = "";
+
+ devstatus = $(xml).attr("Disk_Status");
+ devlevel = $(xml).attr("Level");
+ devchunk = parseInt($(xml).attr("Chunk_Size"), 10);
+ devsuper = parseInt($(xml).attr("Persistent_Superblock"), 10);
+ devalgo = parseInt($(xml).attr("Algorithm"), 10);
+ devactive = parseInt($(xml).attr("Disks_Active"), 10);
+ devregis = parseInt($(xml).attr("Disks_Registered"), 10);
+ html += "<tr><td>" + genlang(5, false, "MDStatus") + "</td><td>" +
devstatus + "</td></tr>";
+ html += "<tr><td>" + genlang(6, false, "MDStatus") + "</td><td>" +
devlevel + "</td></tr>";
+ if (devchunk !== -1) {
+ html += "<tr><td>" + genlang(7, false, "MDStatus") + "</td><td>" +
devchunk + "K</td></tr>";
+ }
+ if (devalgo !== -1) {
+ html += "<tr><td>" + genlang(8, false, "MDStatus") + "</td><td>" +
devalgo + "</td></tr>";
+ }
+ if (devsuper !== -1) {
+ html += "<tr><td>" + genlang(9, false, "MDStatus") + "</td><td>" +
genlang(10, false, "MDStatus") + "</td></tr>";
+ }
+ else {
+ html += "<tr><td>" + genlang(9, false, "MDStatus") + "</td><td>" +
genlang(11, false, "MDStatus") + "</td></tr>";
+ }
+ if (devactive !== -1 && devregis !== -1) {
+ html += "<tr><td>" + genlang(12, false, "MDStatus") + "</td><td>" +
devregis + "/" + devactive + "</td></tr>";
+ }
+ button += "<h3 style=\"cursor: pointer\" id=\"sPlugin_MDStatus_Info" + id
+ "\"><img src=\"./gfx/bullet_toggle_plus.png\" alt=\"plus\"
style=\"vertical-align:middle;\" />" + genlang(4, false, "MDStatus") + "</h3>";
+ button += "<h3 style=\"cursor: pointer; display: none;\"
id=\"hPlugin_MDStatus_Info" + id + "\"><img
src=\"./gfx/bullet_toggle_minus.png\" alt=\"minus\"
style=\"vertical-align:middle;\" />" + genlang(4, false, "MDStatus") + "</h3>";
+ button += "<table id=\"Plugin_MDStatus_InfoTable" + id + "\"
style=\"border-spacing:0; display:none;\">" + html + "</table>";
+ return button;
+}
+
+/**
+ * generate a html string with the current action on the disks
+ * @param {jQuery} xml part of the plugin-XML
+ */
+function mdstatus_buildaction(xml) {
+ var html = "", name = "", time = "", tunit = "", percent = 0;
+ $("Action", xml).each(function mdstatus_getaction(id) {
+ name = $(this).attr("Name");
+ if (parseInt(name, 10) !== -1) {
+ time = $(this).attr("Time_To_Finish");
+ tunit = $(this).attr("Time_Unit");
+ percent = parseFloat($(this).attr("Percent"));
+ html += "<div style=\"padding-left:10px;\">";
+ html += genlang(13, false, "MDStatus") + ": " + name +
"<br/>";
+ html += createBar(percent);
+ html += "<br/>";
+ html += genlang(14, false, "MDStatus") + " " + time +
" " + tunit;
+ html += "</div>";
+ }
+ });
+ return html;
+}
+
+/**
+ * choose the right diskdrive icon
+ * @param {jQuery} xml part of the plugin-XML
+ */
+function mdstatus_diskicon(xml) {
+ var html = "";
+ $("Disks Disk", xml).each(function mdstatus_getdisk(id) {
+ var diskstatus = "", diskname = "", img = "", alt = "";
+ html += "<div class=\"plugin_mdstatus_biun\">";
+ diskstatus = $(this).attr("Status");
+ diskname = $(this).attr("Name");
+ switch (diskstatus) {
+ case " ":
+ case "":
+ img = "harddriveok.png";
+ alt = "ok";
+ break;
+ case "F":
+ img = "harddrivefail.png";
+ alt = "fail";
+ break;
+ case "S":
+ img = "harddrivespare.png";
+ alt = "spare";
+ break;
+ default:
+ alert("--" + diskstatus + "--");
+ img = "error.png";
+ alt = "error";
+ break;
+ }
+ html += "<img class=\"plugin_mdstatus_biun\"
src=\"./plugins/mdstatus/gfx/" + img + "\" alt=\"" + alt + "\" />";
+ html += "<small>" + diskname + "</small>";
+ html += "</div>";
+ });
+ return html;
+}
+
+/**
+ * fill the plugin block
+ * @param {jQuery} xml plugin-XML
+ */
+function mdstatus_populate(xml) {
+ var htmltypes = "";
+
+ $("#Plugin_MDStatusTable").empty();
+
+ $("Plugins Plugin_MDStatus Supported_Types Type", xml).each(function
mdstatus_getsupportedtypes(id) {
+ htmltypes += "<li>" + $(this).attr("Name") + "</li>";
+ });
+ if (htmltypes.length > 0) {
+ htmltypes = "<ul>" + htmltypes + "</ul>";
+ $("#Plugin_MDStatusTable").append("<tr><td style=\"width:160px;\">" +
genlang(2, false, "MDStatus") + "</td><td>" + htmltypes + "</td></tr>");
+ mdstatus_show = true;
+ }
+
+ $("Plugins Plugin_MDStatus Raid", xml).each(function
mdstatus_getdevice(id) {
+ var htmldisks = "", htmldisklist = "", topic = "", name = "",
buildedaction = "";
+ name = $(this).attr("Device_Name");
+ htmldisklist += mdstatus_diskicon(this);
+ htmldisks += "<table style=\"width:100%;\">";
+ htmldisks += "<tr><td>" + htmldisklist + "</td></tr>";
+ buildedaction = mdstatus_buildaction($(this));
+ if (buildedaction) {
+ htmldisks += "<tr><td>" + buildedaction + "</td></tr>";
+ }
+ htmldisks += "<tr><td>" + mdstatus_buildinfos($(this), id) +
"<td></tr>";
+ htmldisks += "</table>";
+ if (id) {
+ topic = "";
+ }
+ else {
+ topic = genlang(3, false, "MDStatus");
+ }
+ $("#Plugin_MDStatusTable").append("<tr><td>" + topic + "</td><td><div
class=\"plugin_mdstatus_biun\" style=\"text-align:left;\"><b>" + name +
"</b></div>" + htmldisks + "</td></tr>");
+ $("#sPlugin_MDStatus_Info" + id).click(function mdstatus_showinfo() {
+ $("#Plugin_MDStatus_InfoTable" + id).slideDown("slow");
+ $("#sPlugin_MDStatus_Info" + id).hide();
+ $("#hPlugin_MDStatus_Info" + id).show();
+ });
+ $("#hPlugin_MDStatus_Info" + id).click(function mdstatus_hideinfo() {
+ $("#Plugin_MDStatus_InfoTable" + id).slideUp("slow");
+ $("#hPlugin_MDStatus_Info" + id).hide();
+ $("#sPlugin_MDStatus_Info" + id).show();
+ });
+ mdstatus_show = true;
+ });
+
+ if ($("Plugins Plugin_MDStatus Unused_Devices", xml).length > 0) {
+ $("#Plugin_MDStatusTable").append("<tr><td>" + genlang(15, false,
"MDStatus") + "</td><td>" + $(this).attr("Devices") + "</td></tr>");
+ mdstatus_show = true;
+ }
+}
+
+/**
+ * load the xml via ajax
+ */
+function mdstatus_request() {
+ $.ajax({
+ url: "xml.php?plugin=MDStatus",
+ dataType: "xml",
+ error: function mdstatus_error() {
+ $.jGrowl("Error loading XML document for Plugin MDStatus");
+ },
+ success: function mdstatus_buildblock(xml) {
+ populateErrors(xml);
+ mdstatus_populate(xml);
+ if (mdstatus_show) {
+ plugin_translate("MDStatus");
+ $("#Plugin_MDStatus").show();
+ }
+ }
+ });
+}
+
+$(document).ready(function mdstatus_buildpage() {
+ var html = "";
+
+ $("#footer").before(buildBlock("MDStatus", 1, true));
+ html += " <table id=\"Plugin_MDStatusTable\"
style=\"border-spacing:0;\">\n";
+ html += " </table>\n";
+ $("#Plugin_MDStatus").append(html);
+
+ $("#Plugin_MDStatus").css("width", "915px");
+
+ mdstatus_request();
+
+ $("#Reload_MDStatusTable").click(function mdstatus_reload(id) {
+ mdstatus_request();
+ $("#Reload_MDStatusTable").attr("title",datetime());
+ });
+});
Added: branches/dev-syncromind/phpsysinfo/plugins/MDStatus/lang/cz.xml
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/MDStatus/lang/cz.xml
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/MDStatus/lang/cz.xml
2015-09-04 16:52:20 UTC (rev 13851)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+ <!-- $Id: cz.xml 661 2012-08-27 11:26:39Z namiltd $ -->
+ <!--
+ phpSysInfo language file Language: Czech Created by: Tomáš Růžička
+ -->
+<tns:translationPlugin language="czech" charset="utf-8"
+ xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin
../../../language/translation-plugin.xsd">
+ <expression id="plugin_mdstatus_001" name="mdstatus_title">
+ <exp>Stav RAIDu</exp>
+ </expression>
+ <expression id="plugin_mdstatus_002" name="mdstatus_support">
+ <exp>Poodporované typy RAID </exp>
+ </expression>
+ <expression id="plugin_mdstatus_003" name="mdstatus_devices">
+ <exp>RAID-zařízení</exp>
+ </expression>
+ <expression id="plugin_mdstatus_004" name="mdstatus_infos">
+ <exp>Dodatečné informace </exp>
+ </expression>
+ <expression id="plugin_mdstatus_005" name="mdstatus_status">
+ <exp>Stav</exp>
+ </expression>
+ <expression id="plugin_mdstatus_006" name="mdstatus_level">
+ <exp>Úroveň RAIDu</exp>
+ </expression>
+ <expression id="plugin_mdstatus_007" name="mdstatus_chunk">
+ <exp>Velikost proužku</exp>
+ </expression>
+ <expression id="plugin_mdstatus_008" name="mdstatus_algo">
+ <exp>Algoritmus</exp>
+ </expression>
+ <expression id="plugin_mdstatus_009" name="mdstatus_superb">
+ <exp>Persistentní Superblock </exp>
+ </expression>
+ <expression id="plugin_mdstatus_010" name="mdstatus_avail">
+ <exp>dostupný</exp>
+ </expression>
+ <expression id="plugin_mdstatus_011" name="mdstatus_navail">
+ <exp>nedostupný</exp>
+ </expression>
+ <expression id="plugin_mdstatus_012" name="mdstatus_regact">
+ <exp>Registrovné/aktivní disky</exp>
+ </expression>
+ <expression id="plugin_mdstatus_013" name="mdstatus_curact">
+ <exp>Aktuální činnost</exp>
+ </expression>
+ <expression id="plugin_mdstatus_014" name="mdstatus_finishin">
+ <exp>Čas dokončení</exp>
+ </expression>
+ <expression id="plugin_mdstatus_015" name="mdstatus_unused">
+ <exp>Nevyužité disky</exp>
+ </expression>
+ <expression id="plugin_mdstatus_016" name="mdstatus_refresh">
+ <exp>Aktualizováno</exp>
+ </expression>
+</tns:translationPlugin>
Added: branches/dev-syncromind/phpsysinfo/plugins/MDStatus/lang/de.xml
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/MDStatus/lang/de.xml
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/MDStatus/lang/de.xml
2015-09-04 16:52:20 UTC (rev 13851)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+ <!-- $Id: de.xml 661 2012-08-27 11:26:39Z namiltd $ -->
+ <!--
+ phpSysInfo language file Language: German Created by: Michael Cramer
+ -->
+<tns:translationPlugin language="german" charset="utf-8"
+ xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin
../../../language/translation-plugin.xsd">
+ <expression id="plugin_mdstatus_001" name="mdstatus_title">
+ <exp>RAID Status</exp>
+ </expression>
+ <expression id="plugin_mdstatus_002" name="mdstatus_support">
+ <exp>Unterstützte RAID-Typen</exp>
+ </expression>
+ <expression id="plugin_mdstatus_003" name="mdstatus_devices">
+ <exp>RAID-Geräte</exp>
+ </expression>
+ <expression id="plugin_mdstatus_004" name="mdstatus_infos">
+ <exp>Zusätzliche Informationen</exp>
+ </expression>
+ <expression id="plugin_mdstatus_005" name="mdstatus_status">
+ <exp>Status</exp>
+ </expression>
+ <expression id="plugin_mdstatus_006" name="mdstatus_level">
+ <exp>RAID-Level</exp>
+ </expression>
+ <expression id="plugin_mdstatus_007" name="mdstatus_chunk">
+ <exp>Blockgröße</exp>
+ </expression>
+ <expression id="plugin_mdstatus_008" name="mdstatus_algo">
+ <exp>Algorithmus</exp>
+ </expression>
+ <expression id="plugin_mdstatus_009" name="mdstatus_superb">
+ <exp>Persistenter Superblock</exp>
+ </expression>
+ <expression id="plugin_mdstatus_010" name="mdstatus_avail">
+ <exp>verfügbar</exp>
+ </expression>
+ <expression id="plugin_mdstatus_011" name="mdstatus_navail">
+ <exp>nicht verfügbar</exp>
+ </expression>
+ <expression id="plugin_mdstatus_012" name="mdstatus_regact">
+ <exp>Registrierte/Aktive Platten</exp>
+ </expression>
+ <expression id="plugin_mdstatus_013" name="mdstatus_curact">
+ <exp>Aktuelle Aktion</exp>
+ </expression>
+ <expression id="plugin_mdstatus_014" name="mdstatus_finishin">
+ <exp>Fertig in</exp>
+ </expression>
+ <expression id="plugin_mdstatus_015" name="mdstatus_unused">
+ <exp>Unbenutzte Platten</exp>
+ </expression>
+ <expression id="plugin_mdstatus_016" name="mdstatus_refresh">
+ <exp>Zuletzt aktualisiert</exp>
+ </expression>
+</tns:translationPlugin>
Added: branches/dev-syncromind/phpsysinfo/plugins/MDStatus/lang/en.xml
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/MDStatus/lang/en.xml
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/MDStatus/lang/en.xml
2015-09-04 16:52:20 UTC (rev 13851)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+ <!-- $Id: en.xml 661 2012-08-27 11:26:39Z namiltd $ -->
+ <!--
+ phpSysInfo language file Language: English Created by: Michael Cramer
+ -->
+<tns:translationPlugin language="english" charset="utf-8"
+ xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin
../../../language/translation-plugin.xsd">
+ <expression id="plugin_mdstatus_001" name="mdstatus_title">
+ <exp>RAID Status</exp>
+ </expression>
+ <expression id="plugin_mdstatus_002" name="mdstatus_support">
+ <exp>Supported RAID-Types </exp>
+ </expression>
+ <expression id="plugin_mdstatus_003" name="mdstatus_devices">
+ <exp>RAID-Devices</exp>
+ </expression>
+ <expression id="plugin_mdstatus_004" name="mdstatus_infos">
+ <exp>Additional Information </exp>
+ </expression>
+ <expression id="plugin_mdstatus_005" name="mdstatus_status">
+ <exp>Status</exp>
+ </expression>
+ <expression id="plugin_mdstatus_006" name="mdstatus_level">
+ <exp>RAID-Level</exp>
+ </expression>
+ <expression id="plugin_mdstatus_007" name="mdstatus_chunk">
+ <exp>Chunk Size</exp>
+ </expression>
+ <expression id="plugin_mdstatus_008" name="mdstatus_algo">
+ <exp>Algorithm</exp>
+ </expression>
+ <expression id="plugin_mdstatus_009" name="mdstatus_superb">
+ <exp>Persistent Superblock </exp>
+ </expression>
+ <expression id="plugin_mdstatus_010" name="mdstatus_avail">
+ <exp>available</exp>
+ </expression>
+ <expression id="plugin_mdstatus_011" name="mdstatus_navail">
+ <exp>not available</exp>
+ </expression>
+ <expression id="plugin_mdstatus_012" name="mdstatus_regact">
+ <exp>Registered/Active Disks</exp>
+ </expression>
+ <expression id="plugin_mdstatus_013" name="mdstatus_curact">
+ <exp>Current Action</exp>
+ </expression>
+ <expression id="plugin_mdstatus_014" name="mdstatus_finishin">
+ <exp>Finishing in</exp>
+ </expression>
+ <expression id="plugin_mdstatus_015" name="mdstatus_unused">
+ <exp>Unused Disks</exp>
+ </expression>
+ <expression id="plugin_mdstatus_016" name="mdstatus_refresh">
+ <exp>Last refresh</exp>
+ </expression>
+</tns:translationPlugin>
Added: branches/dev-syncromind/phpsysinfo/plugins/MDStatus/lang/fr.xml
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/MDStatus/lang/fr.xml
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/MDStatus/lang/fr.xml
2015-09-04 16:52:20 UTC (rev 13851)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+ <!-- $Id: fr.xml 661 2012-08-27 11:26:39Z namiltd $ -->
+ <!--
+ phpSysInfo language file Language: French Created by: Erkan VALENTIN
+ -->
+<tns:translationPlugin language="french" charset="utf-8"
+ xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin
../../../language/translation-plugin.xsd">
+ <expression id="plugin_mdstatus_001" name="mdstatus_title">
+ <exp>Statut RAID</exp>
+ </expression>
+ <expression id="plugin_mdstatus_002" name="mdstatus_support">
+ <exp>Type de RAID supporté</exp>
+ </expression>
+ <expression id="plugin_mdstatus_003" name="mdstatus_devices">
+ <exp>Périphériques RAID</exp>
+ </expression>
+ <expression id="plugin_mdstatus_004" name="mdstatus_infos">
+ <exp>Informations additionnelles</exp>
+ </expression>
+ <expression id="plugin_mdstatus_005" name="mdstatus_status">
+ <exp>Statut</exp>
+ </expression>
+ <expression id="plugin_mdstatus_006" name="mdstatus_level">
+ <exp>Type de RAID</exp>
+ </expression>
+ <expression id="plugin_mdstatus_007" name="mdstatus_chunk">
+ <exp>Granularité</exp>
+ </expression>
+ <expression id="plugin_mdstatus_008" name="mdstatus_algo">
+ <exp>Algorithme</exp>
+ </expression>
+ <expression id="plugin_mdstatus_009" name="mdstatus_superb">
+ <exp>Superblocs persistants</exp>
+ </expression>
+ <expression id="plugin_mdstatus_010" name="mdstatus_avail">
+ <exp>disponible</exp>
+ </expression>
+ <expression id="plugin_mdstatus_011" name="mdstatus_navail">
+ <exp>non disponible</exp>
+ </expression>
+ <expression id="plugin_mdstatus_012" name="mdstatus_regact">
+ <exp>Disques Enregistrés/Actives</exp>
+ </expression>
+ <expression id="plugin_mdstatus_013" name="mdstatus_curact">
+ <exp>Action courante</exp>
+ </expression>
+ <expression id="plugin_mdstatus_014" name="mdstatus_finishin">
+ <exp>Temps restant</exp>
+ </expression>
+ <expression id="plugin_mdstatus_015" name="mdstatus_unused">
+ <exp>Disques inutilisés</exp>
+ </expression>
+ <expression id="plugin_mdstatus_016" name="mdstatus_refresh">
+ <exp>Dernière actualisation</exp>
+ </expression>
+</tns:translationPlugin>
Added: branches/dev-syncromind/phpsysinfo/plugins/MDStatus/lang/gr.xml
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/MDStatus/lang/gr.xml
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/MDStatus/lang/gr.xml
2015-09-04 16:52:20 UTC (rev 13851)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+ <!-- $Id: gr.xml 661 2012-08-27 11:26:39Z namiltd $ -->
+ <!--
+ phpSysInfo language file Language: Greek Created by: mojiro
+ -->
+<tns:translationPlugin language="english" charset="utf-8"
+ xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin
../../../language/translation-plugin.xsd">
+ <expression id="plugin_mdstatus_001" name="mdstatus_title">
+ <exp>Κατάσταση RAID</exp>
+ </expression>
+ <expression id="plugin_mdstatus_002" name="mdstatus_support">
+ <exp>Υποστηριζόμενοι τύποι RAID</exp>
+ </expression>
+ <expression id="plugin_mdstatus_003" name="mdstatus_devices">
+ <exp>Αλυσίδες RAID</exp>
+ </expression>
+ <expression id="plugin_mdstatus_004" name="mdstatus_infos">
+ <exp>Πρόσθετες πληροφορίες</exp>
+ </expression>
+ <expression id="plugin_mdstatus_005" name="mdstatus_status">
+ <exp>Κατάσταση</exp>
+ </expression>
+ <expression id="plugin_mdstatus_006" name="mdstatus_level">
+ <exp>Τύπος RAID</exp>
+ </expression>
+ <expression id="plugin_mdstatus_007" name="mdstatus_chunk">
+ <exp>Μέγεθος Chunk</exp>
+ </expression>
+ <expression id="plugin_mdstatus_008" name="mdstatus_algo">
+ <exp>Αλγόριθμος</exp>
+ </expression>
+ <expression id="plugin_mdstatus_009" name="mdstatus_superb">
+ <exp>Μόνιμο Superblock</exp>
+ </expression>
+ <expression id="plugin_mdstatus_010" name="mdstatus_avail">
+ <exp>διαθέσιμο</exp>
+ </expression>
+ <expression id="plugin_mdstatus_011" name="mdstatus_navail">
+ <exp>μη διαθέσιμο</exp>
+ </expression>
+ <expression id="plugin_mdstatus_012" name="mdstatus_regact">
+ <exp>Δηλωμένοι/Ενεργοί Δίσκοι</exp>
+ </expression>
+ <expression id="plugin_mdstatus_013" name="mdstatus_curact">
+ <exp>Τρέχουσα ενέργεια</exp>
+ </expression>
+ <expression id="plugin_mdstatus_014" name="mdstatus_finishin">
+ <exp>Ολοκληρώνεται σε</exp>
+ </expression>
+ <expression id="plugin_mdstatus_015" name="mdstatus_unused">
+ <exp>Αχρησιμοποίητοι Δίσκοι</exp>
+ </expression>
+ <expression id="plugin_mdstatus_016" name="mdstatus_refresh">
+ <exp>Ενημέρωση</exp>
+ </expression>
+</tns:translationPlugin>
Added: branches/dev-syncromind/phpsysinfo/plugins/MDStatus/lang/ru.xml
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/MDStatus/lang/ru.xml
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/MDStatus/lang/ru.xml
2015-09-04 16:52:20 UTC (rev 13851)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+ <!-- $Id: en.xml 661 2012-08-27 11:26:39Z namiltd $ -->
+ <!--
+ phpSysInfo language file Language: Russian Created by: Denis Sevostyanov
(den007)
+ -->
+<tns:translationPlugin language="russian" charset="utf-8"
+ xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin
../../../language/translation-plugin.xsd">
+ <expression id="plugin_mdstatus_001" name="mdstatus_title">
+ <exp>RAID Статус</exp>
+ </expression>
+ <expression id="plugin_mdstatus_002" name="mdstatus_support">
+ <exp>Поддерживаются типы RAID </exp>
+ </expression>
+ <expression id="plugin_mdstatus_003" name="mdstatus_devices">
+ <exp>RAID-Устройства</exp>
+ </expression>
+ <expression id="plugin_mdstatus_004" name="mdstatus_infos">
+ <exp>Дополнительные сведения </exp>
+ </expression>
+ <expression id="plugin_mdstatus_005" name="mdstatus_status">
+ <exp>Статус</exp>
+ </expression>
+ <expression id="plugin_mdstatus_006" name="mdstatus_level">
+ <exp>RAID-Уровень</exp>
+ </expression>
+ <expression id="plugin_mdstatus_007" name="mdstatus_chunk">
+ <exp>Размер блока</exp>
+ </expression>
+ <expression id="plugin_mdstatus_008" name="mdstatus_algo">
+ <exp>Алгоритм</exp>
+ </expression>
+ <expression id="plugin_mdstatus_009" name="mdstatus_superb">
+ <exp>Постоянный суперблок </exp>
+ </expression>
+ <expression id="plugin_mdstatus_010" name="mdstatus_avail">
+ <exp>доступен</exp>
+ </expression>
+ <expression id="plugin_mdstatus_011" name="mdstatus_navail">
+ <exp>не доступен</exp>
+ </expression>
+ <expression id="plugin_mdstatus_012" name="mdstatus_regact">
+ <exp>Зарегистрировано/Активных Дисков</exp>
+ </expression>
+ <expression id="plugin_mdstatus_013" name="mdstatus_curact">
+ <exp>Текущее действие</exp>
+ </expression>
+ <expression id="plugin_mdstatus_014" name="mdstatus_finishin">
+ <exp>Окончание в</exp>
+ </expression>
+ <expression id="plugin_mdstatus_015" name="mdstatus_unused">
+ <exp>Неиспользуемые диски</exp>
+ </expression>
+ <expression id="plugin_mdstatus_016" name="mdstatus_refresh">
+ <exp>Последнее обновление</exp>
+ </expression>
+</tns:translationPlugin>
Added: branches/dev-syncromind/phpsysinfo/plugins/PS/class.ps.inc.php
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/PS/class.ps.inc.php
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/PS/class.ps.inc.php
2015-09-04 16:52:20 UTC (rev 13851)
@@ -0,0 +1,182 @@
+<?php
+/**
+ * PS Plugin
+ *
+ * PHP version 5
+ *
+ * @category PHP
+ * @package PSI_Plugin_PS
+ * @author Michael Cramer <address@hidden>
+ * @copyright 2009 phpSysInfo
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public
License
+ * @version SVN: $Id: class.ps.inc.php 692 2012-09-08 17:12:08Z namiltd $
+ * @link http://phpsysinfo.sourceforge.net
+ */
+ /**
+ * process Plugin, which displays all running processes
+ * a simple tree view which is filled with the running processes which are
determined by
+ * calling the "ps" command line utility, another way is to provide
+ * a file with the output of the ps utility, so there is no need to run a
execute by the
+ * webserver, the format of the command is written down in the ps.config.php
file, where also
+ * the method of getting the information is configured
+ *
+ * @category PHP
+ * @package PSI_Plugin_PS
+ * @author Michael Cramer <address@hidden>
+ * @copyright 2009 phpSysInfo
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public
License
+ * @version Release: 3.0
+ * @link http://phpsysinfo.sourceforge.net
+ */
+class PS extends PSI_Plugin
+{
+ /**
+ * variable, which holds the content of the command
+ * @var array
+ */
+ private $_filecontent = array();
+ /**
+ * variable, which holds the result before the xml is generated out of
this array
+ * @var array
+ */
+ private $_result = array();
+ /**
+ * read the data into an internal array and also call the parent
constructor
+ *
+ * @param String $enc encoding
+ */
+ public function __construct($enc)
+ {
+ parent::__construct(__CLASS__, $enc);
+ switch (strtolower(PSI_PLUGIN_PS_ACCESS)) {
+ case 'command':
+ if (PSI_OS == 'WINNT') {
+ try {
+ $objLocator = new COM("WbemScripting.SWbemLocator");
+ $wmi = $objLocator->ConnectServer();
+ $os_wmi = $wmi->InstancesOf('Win32_OperatingSystem');
+ foreach ($os_wmi as $os) {
+ $memtotal = $os->TotalVisibleMemorySize * 1024;
+ }
+ $process_wmi = $wmi->InstancesOf('Win32_Process');
+ foreach ($process_wmi as $process) {
+ if (strlen(trim($process->CommandLine)) > 0) {
+ $ps = trim($process->CommandLine);
+ } else {
+ $ps = trim($process->Caption);
+ }
+ if (trim($process->ProcessId) != 0) {
+ $memusage = round(trim($process->WorkingSetSize) *
100 / $memtotal, 1);
+ //ParentProcessId
+ //Unique identifier of the process that creates a
process. Process identifier numbers are reused, so they
+ //only identify a process for the lifetime of that
process. It is possible that the process identified by
+ //ParentProcessId is terminated, so
ParentProcessId may not refer to a running process. It is also
+ //possible that ParentProcessId incorrectly refers
to a process that reuses a process identifier. You can
+ //use the CreationDate property to determine
whether the specified parent was created after the process
+ //represented by this Win32_Process instance was
created.
+ //=> subtrees of processes may be missing (WHAT
TODO?!?)
+ $this->_filecontent[] =
trim($process->ProcessId)." ".trim($process->ParentProcessId)." ".$memusage."
".$ps;
+ }
+ }
+ } catch (Exception $e) {
+ }
+ } else {
+ CommonFunctions::executeProgram("ps", "axo
pid,ppid,pmem,args", $buffer, PSI_DEBUG);
+ }
+ break;
+ case 'data':
+ CommonFunctions::rfts(APP_ROOT."/data/ps.txt", $buffer);
+ break;
+ default:
+ $this->global_error->addConfigError("__construct()",
"PSI_PLUGIN_PS_ACCESS");
+ break;
+ }
+ if (PSI_OS != 'WINNT') {
+ if (trim($buffer) != "") {
+ $this->_filecontent = preg_split("/\n/", $buffer, -1,
PREG_SPLIT_NO_EMPTY);
+ unset($this->_filecontent[0]);
+ } else {
+ $this->_filecontent = array();
+ }
+ }
+ }
+ /**
+ * doing all tasks to get the required informations that the plugin needs
+ * result is stored in an internal array<br>the array is build like a tree,
+ * so that it is possible to get only a specific process with the childs
+ *
+ * @return void
+ */
+ public function execute()
+ {
+ if ( empty($this->_filecontent)) {
+ return;
+ }
+ foreach ($this->_filecontent as $roworig) {
+ $row = preg_split("/[\s]+/", trim($roworig), 4);
+ if (count($row) != 4) {
+ break;
+ }
+ foreach ($row as $key=>$val) {
+ $items[$row[0]][$key] = $val;
+ }
+ if ($row[1] !== $row[0]) {
+ $items[$row[1]]['childs'][$row[0]] = &$items[$row[0]];
+ }
+ }
+ $this->_result = $items[0];
+ }
+ /**
+ * generates the XML content for the plugin
+ *
+ * @return SimpleXMLElement entire XML content for the plugin
+ */
+ public function xml()
+ {
+ if ($this->_result) {
+ $positions = array(0=>0);
+ $this->_addchild($this->_result['childs'], $this->xml, $positions);
+ }
+
+ return $this->xml->getSimpleXmlElement();
+ }
+ /**
+ * recursive function to allow appending child processes to a parent
process
+ *
+ * @param Array $child part of the array which should be
appended to the XML
+ * @param SimpleXMLExtended $xml XML-Object to which the array
content is appended
+ * @param Array &$positions array with parent positions in xml
structure
+ *
+ * @return SimpleXMLExtended Object with the appended array content
+ */
+ private function _addchild($child, SimpleXMLExtended $xml, &$positions)
+ {
+ foreach ($child as $key=>$value) {
+ $xmlnode = $xml->addChild("Process");
+ foreach ($value as $key2=>$value2) {
+ if (!is_array($value2)) {
+ switch ($key2) {
+ case 0:
+ array_push($positions, $value2);
+ $xmlnode->addAttribute('PID', $value2);
+ break;
+ case 1:
+ $xmlnode->addAttribute('ParentID',
array_search($value2, $positions));
+ $xmlnode->addAttribute('PPID', $value2);
+ break;
+ case 2:
+ $xmlnode->addAttribute('MemoryUsage', $value2);
+ break;
+ case 3:
+ $xmlnode->addAttribute('Name', $value2);
+ break;
+ }
+ } else {
+ $this->_addChild($value2, $xml, $positions);
+ }
+ }
+ }
+
+ return $xml;
+ }
+}
Added: branches/dev-syncromind/phpsysinfo/plugins/PS/js/ps.js
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/PS/js/ps.js
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/PS/js/ps.js 2015-09-04
16:52:20 UTC (rev 13851)
@@ -0,0 +1,119 @@
+/***************************************************************************
+ * Copyright (C) 2008 by phpSysInfo - A PHP System Information Script *
+ * http://phpsysinfo.sourceforge.net/ *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License 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. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+//
+// $Id: ps.js 661 2012-08-27 11:26:39Z namiltd $
+//
+
+/*global $, jQuery, buildBlock, datetime, plugin_translate, createBar, genlang
*/
+
+"use strict";
+
+var ps_show = false;
+
+/**
+ * build the table where content is inserted
+ * @param {jQuery} xml plugin-XML
+ */
+function ps_buildTable(xml) {
+ var html = "", tree = [], closed = [2];
+
+ $("#Plugin_PS #Plugin_PSTable").remove();
+
+ html += " <table id=\"Plugin_PSTable\" class=\"tablemain\"
style=\"width:100%;\">\n";
+ html += " <thead>\n";
+ html += " <tr>\n";
+ html += " <th>" + genlang(3, false, "PS") + "</th>\n";
+ html += " <th style=\"width:80px;\">" + genlang(4, false, "PS") +
"</th>\n";
+ html += " <th style=\"width:80px;\">" + genlang(5, false, "PS") +
"</th>\n";
+ html += " <th style=\"width:110px;\">" + genlang(6, false, "PS") +
"</th>\n";
+ html += " </tr>\n";
+ html += " </thead>\n";
+ html += " <tbody class=\"tree\">\n";
+
+ $("Plugins Plugin_PS Process", xml).each(function ps_getprocess(id) {
+ var close = 0, pid = 0, ppid = 0, name = "", percent = 0, parentId = 0;
+ name = $(this).attr("Name");
+ parentId = parseInt($(this).attr("ParentID"), 10);
+ pid = parseInt($(this).attr("PID"), 10);
+ ppid = parseInt($(this).attr("PPID"), 10);
+ percent = parseInt($(this).attr("MemoryUsage"), 10);
+
+ html += " <tr><td>" + name + "</td><td>" + pid + "</td><td>" + ppid
+ "</td><td>" + createBar(percent) + "</td></tr>\n";
+ close = tree.push(parentId);
+ if (parentId === 1) {
+ closed.push(close);
+ }
+ ps_show = true;
+ });
+
+ html += " </tbody>\n";
+ html += " </table>\n";
+
+ $("#Plugin_PS").append(html);
+
+ $("#Plugin_PSTable").jqTreeTable(tree, {
+ openImg: "./gfx/treeTable/tv-collapsable.gif",
+ shutImg: "./gfx/treeTable/tv-expandable.gif",
+ leafImg: "./gfx/treeTable/tv-item.gif",
+ lastOpenImg: "./gfx/treeTable/tv-collapsable-last.gif",
+ lastShutImg: "./gfx/treeTable/tv-expandable-last.gif",
+ lastLeafImg: "./gfx/treeTable/tv-item-last.gif",
+ vertLineImg: "./gfx/treeTable/vertline.gif",
+ blankImg: "./gfx/treeTable/blank.gif",
+ collapse: closed,
+ column: 0,
+ striped: true,
+ highlight: false,
+ state: false
+ });
+}
+
+/**
+ * load the xml via ajax
+ */
+function ps_request() {
+ $.ajax({
+ url: "xml.php?plugin=PS",
+ dataType: "xml",
+ error: function ps_error() {
+ $.jGrowl("Error loading XML document for Plugin PS!");
+ },
+ success: function ps_buildblock(xml) {
+ populateErrors(xml);
+ ps_buildTable(xml);
+ if (ps_show) {
+ plugin_translate("PS");
+ $("#Plugin_PS").show();
+ }
+ }
+ });
+}
+
+$(document).ready(function ps_buildpage() {
+ $("#footer").before(buildBlock("PS", 1, true));
+ $("#Plugin_PS").css("width", "915px");
+
+ ps_request();
+
+ $("#Reload_PSTable").click(function ps_reload(id) {
+ ps_request();
+ $("#Reload_PSTable").attr("title",datetime());
+ });
+});
Added: branches/dev-syncromind/phpsysinfo/plugins/PS/lang/cz.xml
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/PS/lang/cz.xml
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/PS/lang/cz.xml 2015-09-04
16:52:20 UTC (rev 13851)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+ <!-- $Id: cz.xml 661 2012-08-27 11:26:39Z namiltd $ -->
+ <!--
+ phpSysInfo language file Language: Czech Created by: Tomáš Růžička
+ -->
+<tns:translationPlugin language="czech" charset="utf-8"
+ xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin
../../../language/translation-plugin.xsd">
+ <expression id="plugin_ps_001" name="ps_title">
+ <exp>Procesy</exp>
+ </expression>
+ <expression id="plugin_ps_002" name="ps_date">
+ <exp>Aktualizováno</exp>
+ </expression>
+ <expression id="plugin_ps_003" name="ps_command">
+ <exp>Příkaz</exp>
+ </expression>
+ <expression id="plugin_ps_004" name="ps_pid">
+ <exp>PID</exp>
+ </expression>
+ <expression id="plugin_ps_005" name="ps_ppid">
+ <exp>Rodičovský PID</exp>
+ </expression>
+ <expression id="plugin_ps_006" name="ps_mem">
+ <exp>Spotřeba paměti</exp>
+ </expression>
+</tns:translationPlugin>
Added: branches/dev-syncromind/phpsysinfo/plugins/PS/lang/de.xml
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/PS/lang/de.xml
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/PS/lang/de.xml 2015-09-04
16:52:20 UTC (rev 13851)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+ <!-- $Id: de.xml 661 2012-08-27 11:26:39Z namiltd $ -->
+ <!--
+ phpSysInfo language file Language: German Created by: Michael Cramer
+ -->
+<tns:translationPlugin language="german" charset="utf-8"
+ xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin
../../../language/translation-plugin.xsd">
+ <expression id="plugin_ps_001" name="ps_title">
+ <exp>Prozess Status</exp>
+ </expression>
+ <expression id="plugin_ps_002" name="ps_date">
+ <exp>Letzte Aktualisierung</exp>
+ </expression>
+ <expression id="plugin_ps_003" name="ps_command">
+ <exp>Befehl</exp>
+ </expression>
+ <expression id="plugin_ps_004" name="ps_pid">
+ <exp>Prozess ID</exp>
+ </expression>
+ <expression id="plugin_ps_005" name="ps_ppid">
+ <exp>Eltern ID</exp>
+ </expression>
+ <expression id="plugin_ps_006" name="ps_mem">
+ <exp>Speichernutzung</exp>
+ </expression>
+</tns:translationPlugin>
Added: branches/dev-syncromind/phpsysinfo/plugins/PS/lang/en.xml
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/PS/lang/en.xml
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/PS/lang/en.xml 2015-09-04
16:52:20 UTC (rev 13851)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+ <!-- $Id: en.xml 661 2012-08-27 11:26:39Z namiltd $ -->
+ <!--
+ phpSysInfo language file Language: English Created by: Michael Cramer
+ -->
+<tns:translationPlugin language="english" charset="utf-8"
+ xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin
../../../language/translation-plugin.xsd">
+ <expression id="plugin_ps_001" name="ps_title">
+ <exp>Process Status</exp>
+ </expression>
+ <expression id="plugin_ps_002" name="ps_date">
+ <exp>Last refresh</exp>
+ </expression>
+ <expression id="plugin_ps_003" name="ps_command">
+ <exp>Command</exp>
+ </expression>
+ <expression id="plugin_ps_004" name="ps_pid">
+ <exp>Process ID</exp>
+ </expression>
+ <expression id="plugin_ps_005" name="ps_ppid">
+ <exp>Parent ID</exp>
+ </expression>
+ <expression id="plugin_ps_006" name="ps_mem">
+ <exp>Memory Usage</exp>
+ </expression>
+</tns:translationPlugin>
Added: branches/dev-syncromind/phpsysinfo/plugins/PS/lang/fr.xml
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/PS/lang/fr.xml
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/PS/lang/fr.xml 2015-09-04
16:52:20 UTC (rev 13851)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+ <!-- $Id: fr.xml 661 2012-08-27 11:26:39Z namiltd $ -->
+ <!--
+ phpSysInfo language file Language: French Created by: Erkan VALENTIN
+ -->
+<tns:translationPlugin language="french" charset="utf-8"
+ xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin
../../../language/translation-plugin.xsd">
+ <expression id="plugin_ps_001" name="ps_title">
+ <exp>Etat des processus</exp>
+ </expression>
+ <expression id="plugin_ps_002" name="ps_date">
+ <exp>Dernière actualisation</exp>
+ </expression>
+ <expression id="plugin_ps_003" name="ps_command">
+ <exp>Commande</exp>
+ </expression>
+ <expression id="plugin_ps_004" name="ps_pid">
+ <exp>ID processus</exp>
+ </expression>
+ <expression id="plugin_ps_005" name="ps_ppid">
+ <exp>ID processus père</exp>
+ </expression>
+ <expression id="plugin_ps_006" name="ps_mem">
+ <exp>Utilisation mémoire</exp>
+ </expression>
+</tns:translationPlugin>
Added: branches/dev-syncromind/phpsysinfo/plugins/PS/lang/gr.xml
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/PS/lang/gr.xml
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/PS/lang/gr.xml 2015-09-04
16:52:20 UTC (rev 13851)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+ <!-- $Id: gr.xml 661 2012-08-27 11:26:39Z namiltd $ -->
+ <!--
+ phpSysInfo language file Language: Greek Created by: mojiro
+ -->
+<tns:translationPlugin language="english" charset="utf-8"
+ xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin
../../../language/translation-plugin.xsd">
+ <expression id="plugin_ps_001" name="ps_title">
+ <exp>Διεργασίες Συστήματος</exp>
+ </expression>
+ <expression id="plugin_ps_002" name="ps_date">
+ <exp>Ενημέρωση</exp>
+ </expression>
+ <expression id="plugin_ps_003" name="ps_command">
+ <exp>Εντολή</exp>
+ </expression>
+ <expression id="plugin_ps_004" name="ps_pid">
+ <exp>ID Διεργασίας</exp>
+ </expression>
+ <expression id="plugin_ps_005" name="ps_ppid">
+ <exp>ID Κύριας Διεργασίας</exp>
+ </expression>
+ <expression id="plugin_ps_006" name="ps_mem">
+ <exp>Χρήση Μνήμης</exp>
+ </expression>
+</tns:translationPlugin>
Added: branches/dev-syncromind/phpsysinfo/plugins/PS/lang/pl.xml
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/PS/lang/pl.xml
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/PS/lang/pl.xml 2015-09-04
16:52:20 UTC (rev 13851)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+ <!-- $Id: pl.xml 661 2012-08-27 11:26:39Z namiltd $ -->
+ <!--
+ phpSysInfo language file Language: Polish Created by: Mieczyslaw Nalewaj
+ -->
+<tns:translationPlugin language="polish" charset="utf-8"
+ xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin
../../../language/translation-plugin.xsd">
+ <expression id="plugin_ps_001" name="ps_title">
+ <exp>Status Procesów</exp>
+ </expression>
+ <expression id="plugin_ps_002" name="ps_date">
+ <exp>Ostatnie odświeżenie</exp>
+ </expression>
+ <expression id="plugin_ps_003" name="ps_command">
+ <exp>Polecenie</exp>
+ </expression>
+ <expression id="plugin_ps_004" name="ps_pid">
+ <exp>PID</exp>
+ </expression>
+ <expression id="plugin_ps_005" name="ps_ppid">
+ <exp>PID rodzica</exp>
+ </expression>
+ <expression id="plugin_ps_006" name="ps_mem">
+ <exp>Wykorzystanie pamięci</exp>
+ </expression>
+</tns:translationPlugin>
Added: branches/dev-syncromind/phpsysinfo/plugins/PS/lang/ru.xml
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/PS/lang/ru.xml
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/PS/lang/ru.xml 2015-09-04
16:52:20 UTC (rev 13851)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+ <!-- $Id: en.xml 661 2012-08-27 11:26:39Z namiltd $ -->
+ <!--
+ phpSysInfo language file Language: Russian Created by: Denis Sevostyanov
(den007)
+ -->
+<tns:translationPlugin language="russian" charset="utf-8"
+ xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin
../../../language/translation-plugin.xsd">
+ <expression id="plugin_ps_001" name="ps_title">
+ <exp>Статус процессов</exp>
+ </expression>
+ <expression id="plugin_ps_002" name="ps_date">
+ <exp>Последнее обновление</exp>
+ </expression>
+ <expression id="plugin_ps_003" name="ps_command">
+ <exp>Команда</exp>
+ </expression>
+ <expression id="plugin_ps_004" name="ps_pid">
+ <exp>ID процесса</exp>
+ </expression>
+ <expression id="plugin_ps_005" name="ps_ppid">
+ <exp>ID родителя</exp>
+ </expression>
+ <expression id="plugin_ps_006" name="ps_mem">
+ <exp>Использовано памяти</exp>
+ </expression>
+</tns:translationPlugin>
Added:
branches/dev-syncromind/phpsysinfo/plugins/PSStatus/class.psstatus.inc.php
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/PSStatus/class.psstatus.inc.php
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/PSStatus/class.psstatus.inc.php
2015-09-04 16:52:20 UTC (rev 13851)
@@ -0,0 +1,160 @@
+<?php
+/**
+ * PSStatus Plugin
+ *
+ * PHP version 5
+ *
+ * @category PHP
+ * @package PSI_Plugin_PSStatus
+ * @author Michael Cramer <address@hidden>
+ * @copyright 2009 phpSysInfo
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public
License
+ * @version SVN: $Id: class.psstatus.inc.php 692 2012-09-08 17:12:08Z
namiltd $
+ * @link http://phpsysinfo.sourceforge.net
+ */
+ /**
+ * process Plugin, which displays the status of configured processes
+ * a simple view which shows a process name and the status
+ * status determined by calling the "pidof" command line utility, another way
is to provide
+ * a file with the output of the pidof utility, so there is no need to run a
executeable by the
+ * webserver, the format of the command is written down in the
psstatus.config.php file, where also
+ * the method of getting the information is configured
+ * processes that should be checked are also defined in psstatus.config.php
+ *
+ * @category PHP
+ * @package PSI_Plugin_PSStatus
+ * @author Michael Cramer <address@hidden>
+ * @copyright 2009 phpSysInfo
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public
License
+ * @version Release: 3.0
+ * @link http://phpsysinfo.sourceforge.net
+ */
+class PSStatus extends PSI_Plugin
+{
+ /**
+ * variable, which holds the content of the command
+ * @var array
+ */
+ private $_filecontent = array();
+
+ /**
+ * variable, which holds the result before the xml is generated out of
this array
+ * @var array
+ */
+ private $_result = array();
+
+ /**
+ * read the data into an internal array and also call the parent
constructor
+ *
+ * @param String $enc target encoding
+ */
+ public function __construct($enc)
+ {
+ parent::__construct(__CLASS__, $enc);
+ switch (strtolower(PSI_PLUGIN_PSSTATUS_ACCESS)) {
+ case 'command':
+ if (PSI_OS == 'WINNT') {
+ try {
+ $objLocator = new COM("WbemScripting.SWbemLocator");
+ $wmi = $objLocator->ConnectServer();
+ $process_wmi = $wmi->InstancesOf('Win32_Process');
+ foreach ($process_wmi as $process) {
+ $this->_filecontent[] = array(trim($process->Caption),
trim($process->ProcessId));
+ }
+ } catch (Exception $e) {
+ }
+ } else {
+ if ( defined('PSI_PLUGIN_PSSTATUS_PROCESSES') &&
is_string(PSI_PLUGIN_PSSTATUS_PROCESSES) ) {
+ if (preg_match(ARRAY_EXP, PSI_PLUGIN_PSSTATUS_PROCESSES)) {
+ $processes = eval(PSI_PLUGIN_PSSTATUS_PROCESSES);
+ } else {
+ $processes = array(PSI_PLUGIN_PSSTATUS_PROCESSES);
+ }
+ foreach ($processes as $process) {
+ CommonFunctions::executeProgram("pidof", "-s
".$process, $buffer, PSI_DEBUG);
+ if (strlen(trim($buffer)) > 0) {
+ $this->_filecontent[] = array($process,
trim($buffer));
+ }
+ }
+ }
+ }
+ break;
+ case 'data':
+ CommonFunctions::rfts(APP_ROOT."/data/psstatus.txt", $buffer);
+ $processes = preg_split("/\n/", $buffer, -1, PREG_SPLIT_NO_EMPTY);
+ foreach ($processes as $process) {
+ $ps = preg_split("/[\s]?\|[\s]?/", $process, -1,
PREG_SPLIT_NO_EMPTY);
+ if (count($ps) == 2) {
+ $this->_filecontent[] = array(trim($ps[0]), trim($ps[1]));
+ }
+ }
+ break;
+ default:
+
$this->global_error->addError("switch(PSI_PLUGIN_PSSTATUS_ACCESS)", "Bad
psstatus configuration in psstatus.config.php");
+ break;
+ }
+ }
+
+ /**
+ * doing all tasks to get the required informations that the plugin needs
+ * result is stored in an internal array<br>the array is build like a tree,
+ * so that it is possible to get only a specific process with the childs
+ *
+ * @return void
+ */
+ public function execute()
+ {
+ if ( empty($this->_filecontent)) {
+ return;
+ }
+ if ( defined('PSI_PLUGIN_PSSTATUS_PROCESSES') &&
is_string(PSI_PLUGIN_PSSTATUS_PROCESSES) ) {
+ if (preg_match(ARRAY_EXP, PSI_PLUGIN_PSSTATUS_PROCESSES)) {
+ $processes = eval(PSI_PLUGIN_PSSTATUS_PROCESSES);
+ } else {
+ $processes = array(PSI_PLUGIN_PSSTATUS_PROCESSES);
+ }
+ foreach ($processes as $process) {
+ if ($this->_recursiveinarray($process, $this->_filecontent)) {
+ $this->_result[] = array($process, true);
+ } else {
+ $this->_result[] = array($process, false);
+ }
+ }
+ }
+ }
+
+ /**
+ * generates the XML content for the plugin
+ *
+ * @return SimpleXMLElement entire XML content for the plugin
+ */
+ public function xml()
+ {
+ foreach ($this->_result as $ps) {
+ $xmlps = $this->xml->addChild("Process");
+ $xmlps->addAttribute("Name", $ps[0]);
+ $xmlps->addAttribute("Status", $ps[1] ? 1 : 0);
+ }
+
+ return $this->xml->getSimpleXmlElement();
+ }
+
+ /**
+ * checks an array recursive if an value is in, extended version of
in_array()
+ *
+ * @param mixed $needle what to find
+ * @param array $haystack where to find
+ *
+ * @return boolean true - found<br>false - not found
+ */
+ private function _recursiveinarray($needle, $haystack)
+ {
+ foreach ($haystack as $stalk) {
+ if ($needle == $stalk || (is_array($stalk) &&
$this->_recursiveinarray($needle, $stalk))) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+}
Added: branches/dev-syncromind/phpsysinfo/plugins/PSStatus/css/psstatus.css
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/PSStatus/css/psstatus.css
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/PSStatus/css/psstatus.css
2015-09-04 16:52:20 UTC (rev 13851)
@@ -0,0 +1,17 @@
+/*
+ $Id: psstatus.css 661 2012-08-27 11:26:39Z namiltd $
+ */
+#plugin_psstatusTable thead tr .header {
+ background-image: url("../../../gfx/bg.gif");
+ background-position: right center;
+ background-repeat: no-repeat;
+ cursor: pointer;
+}
+
+#plugin_psstatusTable thead tr .headerSortUp {
+ background-image: url("../../../gfx/asc.gif");
+}
+
+#plugin_psstatusTable thead tr .headerSortDown {
+ background-image: url("../../../gfx/desc.gif");
+}
Added: branches/dev-syncromind/phpsysinfo/plugins/PSStatus/gfx/offline.png
===================================================================
(Binary files differ)
Property changes on:
branches/dev-syncromind/phpsysinfo/plugins/PSStatus/gfx/offline.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/dev-syncromind/phpsysinfo/plugins/PSStatus/gfx/online.png
===================================================================
(Binary files differ)
Property changes on:
branches/dev-syncromind/phpsysinfo/plugins/PSStatus/gfx/online.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/dev-syncromind/phpsysinfo/plugins/PSStatus/js/psstatus.js
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/PSStatus/js/psstatus.js
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/PSStatus/js/psstatus.js
2015-09-04 16:52:20 UTC (rev 13851)
@@ -0,0 +1,124 @@
+/***************************************************************************
+ * Copyright (C) 2008 by phpSysInfo - A PHP System Information Script *
+ * http://phpsysinfo.sourceforge.net/ *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License 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. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+//
+// $Id: psstatus.js 679 2012-09-04 10:10:11Z namiltd $
+//
+
+/*global $, jQuery, buildBlock, datetime, plugin_translate, genlang */
+
+"use strict";
+
+var psstatus_show = false, psstatus_table;
+
+//appendcss("./plugins/PSStatus/css/PSStatus.css");
+
+/**
+ * insert content into table
+ * @param {jQuery} xml plugin-XML
+ */
+function psstatus_populate(xml) {
+ var name = "", status = 0, state = "";
+
+ psstatus_table.fnClearTable();
+
+ $("Plugins Plugin_PSStatus Process", xml).each(function
psstatus_getprocess(idp) {
+ name = $(this).attr("Name");
+ status = parseInt($(this).attr("Status"), 10);
+ if (status === 1 && !isNaN(status)) {
+ state = "<span style=\"display:none;\">" + status.toString() +
"</span><img src=\"./plugins/psstatus/gfx/online.png\" alt=\"online\" />";
+ }
+ else {
+ state = "<span style=\"display:none;\">" + status.toString() +
"</span><img src=\"./plugins/psstatus/gfx/offline.png\" alt=\"offline\" />";
+ }
+ psstatus_table.fnAddData(["<span style=\"display:none;\">" + name +
"</span>" + name, state]);
+ psstatus_show = true;
+ });
+}
+
+/**
+ * fill the plugin block with table structure
+ */
+function psstatus_buildTable() {
+ var html = "";
+
+ html += "<table id=\"Plugin_PSStatusTable\"
style=\"border-spacing:0;\">\n";
+ html += " <thead>\n";
+ html += " <tr>\n";
+ html += " <th>" + genlang(3, false, "PSStatus") + "</th>\n";
+ html += " <th>" + genlang(4, false, "PSStatus") + "</th>\n";
+ html += " </tr>\n";
+ html += " </thead>\n";
+ html += " <tbody>\n";
+ html += " </tbody>\n";
+ html += "</table>\n";
+
+ $("#Plugin_PSStatus").append(html);
+
+ psstatus_table = $("#Plugin_PSStatusTable").dataTable({
+ "bPaginate": false,
+ "bLengthChange": false,
+ "bFilter": false,
+ "bSort": true,
+ "bInfo": false,
+ "bProcessing": true,
+ "bAutoWidth": false,
+ "bStateSave": true,
+ "aoColumns": [{
+ "sType": 'span-string'
+ }, {
+ "sType": 'span-number'
+ }]
+ });
+}
+
+/**
+ * load the xml via ajax
+ */
+function psstatus_request() {
+ $.ajax({
+ url: "xml.php?plugin=PSStatus",
+ dataType: "xml",
+ error: function psstatus_error() {
+ $.jGrowl("Error loading XML document for Plugin PSStatus!");
+ },
+ success: function psstatus_buildblock(xml) {
+ populateErrors(xml);
+ psstatus_populate(xml);
+ if (psstatus_show) {
+ plugin_translate("PSStatus");
+ $("#Plugin_PSStatus").show();
+ }
+ }
+ });
+}
+
+$(document).ready(function psstatus_buildpage() {
+ $("#footer").before(buildBlock("PSStatus", 1, true));
+ $("#Plugin_PSStatus").css("width", "451px");
+
+ psstatus_buildTable();
+
+ psstatus_request();
+
+ $("#Reload_PSStatusTable").click(function psstatus_reload(id) {
+ psstatus_request();
+ $("#Reload_PSStatusTable").attr("title",datetime());
+ });
+});
Added: branches/dev-syncromind/phpsysinfo/plugins/PSStatus/lang/cz.xml
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/PSStatus/lang/cz.xml
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/PSStatus/lang/cz.xml
2015-09-04 16:52:20 UTC (rev 13851)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Id: cz.xml 661 2012-08-27 11:26:39Z namiltd $ -->
+<!--
+phpSysInfo language file Language: Czech Created by: Tomáš Růžička
+-->
+<tns:translationPlugin language="czech" charset="utf-8"
+ xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin
../../../language/translation-plugin.xsd">
+ <expression id="plugin_psstatus_001" name="ps_title">
+ <exp>Stav procesů</exp>
+ </expression>
+ <expression id="plugin_psstatus_002" name="ps_date">
+ <exp>Aktualizováno</exp>
+ </expression>
+ <expression id="plugin_psstatus_003" name="ps_name">
+ <exp>Název</exp>
+ </expression>
+ <expression id="plugin_psstatus_004" name="ps_status">
+ <exp>Stav</exp>
+ </expression>
+</tns:translationPlugin>
Added: branches/dev-syncromind/phpsysinfo/plugins/PSStatus/lang/de.xml
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/PSStatus/lang/de.xml
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/PSStatus/lang/de.xml
2015-09-04 16:52:20 UTC (rev 13851)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Id: de.xml 661 2012-08-27 11:26:39Z namiltd $ -->
+<!--
+phpSysInfo language file Language: German Created by: Michael Cramer
+-->
+<tns:translationPlugin language="german" charset="utf-8"
+ xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin
../../../language/translation-plugin.xsd">
+ <expression id="plugin_psstatus_001" name="ps_title">
+ <exp>Prozess Status</exp>
+ </expression>
+ <expression id="plugin_psstatus_002" name="ps_date">
+ <exp>Letzte Aktualisierung</exp>
+ </expression>
+ <expression id="plugin_psstatus_003" name="ps_name">
+ <exp>Name</exp>
+ </expression>
+ <expression id="plugin_psstatus_004" name="ps_status">
+ <exp>Status</exp>
+ </expression>
+</tns:translationPlugin>
Added: branches/dev-syncromind/phpsysinfo/plugins/PSStatus/lang/en.xml
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/PSStatus/lang/en.xml
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/PSStatus/lang/en.xml
2015-09-04 16:52:20 UTC (rev 13851)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Id: en.xml 661 2012-08-27 11:26:39Z namiltd $ -->
+<!--
+phpSysInfo language file Language: English Created by: Michael Cramer
+-->
+<tns:translationPlugin language="english" charset="utf-8"
+ xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin
../../../language/translation-plugin.xsd">
+ <expression id="plugin_psstatus_001" name="ps_title">
+ <exp>Process Status</exp>
+ </expression>
+ <expression id="plugin_psstatus_002" name="ps_date">
+ <exp>Last refresh</exp>
+ </expression>
+ <expression id="plugin_psstatus_003" name="ps_name">
+ <exp>Name</exp>
+ </expression>
+ <expression id="plugin_psstatus_004" name="ps_status">
+ <exp>Status</exp>
+ </expression>
+</tns:translationPlugin>
Added: branches/dev-syncromind/phpsysinfo/plugins/PSStatus/lang/fr.xml
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/PSStatus/lang/fr.xml
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/PSStatus/lang/fr.xml
2015-09-04 16:52:20 UTC (rev 13851)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Id: fr.xml 661 2012-08-27 11:26:39Z namiltd $ -->
+<!--
+phpSysInfo language file Language: French Created by: Erkan VALENTIN
+-->
+<tns:translationPlugin language="french" charset="utf-8"
+ xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin
../../../language/translation-plugin.xsd">
+ <expression id="plugin_psstatus_001" name="ps_title">
+ <exp>Etat des processus</exp>
+ </expression>
+ <expression id="plugin_psstatus_002" name="ps_date">
+ <exp>Dernière actualisation</exp>
+ </expression>
+ <expression id="plugin_psstatus_003" name="ps_name">
+ <exp>Nom</exp>
+ </expression>
+ <expression id="plugin_psstatus_004" name="ps_status">
+ <exp>Etat</exp>
+ </expression>
+</tns:translationPlugin>
Added: branches/dev-syncromind/phpsysinfo/plugins/PSStatus/lang/gr.xml
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/PSStatus/lang/gr.xml
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/PSStatus/lang/gr.xml
2015-09-04 16:52:20 UTC (rev 13851)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Id: gr.xml 661 2012-08-27 11:26:39Z namiltd $ -->
+<!--
+phpSysInfo language file Language: Greek Created by: mojiro
+-->
+<tns:translationPlugin language="english" charset="utf-8"
+ xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin
../../../language/translation-plugin.xsd">
+ <expression id="plugin_psstatus_001" name="ps_title">
+ <exp>Κατάσταση Κρίσιμων Διεργασιών</exp>
+ </expression>
+ <expression id="plugin_psstatus_002" name="ps_date">
+ <exp>Ενημέρωση</exp>
+ </expression>
+ <expression id="plugin_psstatus_003" name="ps_name">
+ <exp>Διεργασία</exp>
+ </expression>
+ <expression id="plugin_psstatus_004" name="ps_status">
+ <exp>Κατάσταση</exp>
+ </expression>
+</tns:translationPlugin>
Added: branches/dev-syncromind/phpsysinfo/plugins/PSStatus/lang/pl.xml
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/PSStatus/lang/pl.xml
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/PSStatus/lang/pl.xml
2015-09-04 16:52:20 UTC (rev 13851)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Id: pl.xml 661 2012-08-27 11:26:39Z namiltd $ -->
+<!--
+phpSysInfo language file Language: Polish Created by: Mieczyslaw Nalewaj
+-->
+<tns:translationPlugin language="polish" charset="utf-8"
+ xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin
../../../language/translation-plugin.xsd">
+ <expression id="plugin_psstatus_001" name="ps_title">
+ <exp>Status Procesów</exp>
+ </expression>
+ <expression id="plugin_psstatus_002" name="ps_date">
+ <exp>Ostatnie odświeżenie</exp>
+ </expression>
+ <expression id="plugin_psstatus_003" name="ps_name">
+ <exp>Nazwa</exp>
+ </expression>
+ <expression id="plugin_psstatus_004" name="ps_status">
+ <exp>Status</exp>
+ </expression>
+</tns:translationPlugin>
Added: branches/dev-syncromind/phpsysinfo/plugins/PSStatus/lang/ru.xml
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/PSStatus/lang/ru.xml
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/PSStatus/lang/ru.xml
2015-09-04 16:52:20 UTC (rev 13851)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Id: en.xml 661 2012-08-27 11:26:39Z namiltd $ -->
+<!--
+phpSysInfo language file Language: Russian Created by: Denis Sevostyanov
(den007)
+-->
+<tns:translationPlugin language="russian" charset="utf-8"
+ xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin
../../../language/translation-plugin.xsd">
+ <expression id="plugin_psstatus_001" name="ps_title">
+ <exp>Статус служб</exp>
+ </expression>
+ <expression id="plugin_psstatus_002" name="ps_date">
+ <exp>Последнее обновление</exp>
+ </expression>
+ <expression id="plugin_psstatus_003" name="ps_name">
+ <exp>Имя службы</exp>
+ </expression>
+ <expression id="plugin_psstatus_004" name="ps_status">
+ <exp>Статус</exp>
+ </expression>
+</tns:translationPlugin>
Added: branches/dev-syncromind/phpsysinfo/plugins/Quotas/class.quotas.inc.php
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/Quotas/class.quotas.inc.php
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/Quotas/class.quotas.inc.php
2015-09-04 16:52:20 UTC (rev 13851)
@@ -0,0 +1,132 @@
+<?php
+/**
+ * Quotas Plugin
+ *
+ * PHP version 5
+ *
+ * @category PHP
+ * @package PSI_Plugin_Quotas
+ * @author Michael Cramer <address@hidden>
+ * @copyright 2009 phpSysInfo
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public
License
+ * @version SVN: $Id: class.quotas.inc.php 661 2012-08-27 11:26:39Z namiltd $
+ * @link http://phpsysinfo.sourceforge.net
+ */
+ /**
+ * Quotas Plugin, which displays all quotas on the machine
+ * display all quotas in a sortable table with the current values which are
determined by
+ * calling the "repquota" command line utility, another way is to provide
+ * a file with the output of the repquota utility, so there is no need to run
a execute by the
+ * webserver, the format of the command is written down in the
quota.config.php file, where also
+ * the method of getting the information is configured
+ *
+ * @category PHP
+ * @package PSI_Plugin_Quotas
+ * @author Michael Cramer <address@hidden>
+ * @copyright 2009 phpSysInfo
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public
License
+ * @version Release: 3.0
+ * @link http://phpsysinfo.sourceforge.net
+ */
+class Quotas extends PSI_Plugin
+{
+ /**
+ * variable, which holds the content of the command
+ * @var array
+ */
+ private $_filecontent = array();
+
+ /**
+ * variable, which holds the result before the xml is generated out of
this array
+ * @var array
+ */
+ private $_result = array();
+
+ /**
+ * read the data into an internal array and also call the parent
constructor
+ *
+ * @param String $enc target encoding
+ */
+ public function __construct($enc)
+ {
+ parent::__construct(__CLASS__, $enc);
+ switch (strtolower(PSI_PLUGIN_QUOTAS_ACCESS)) {
+ case 'command':
+ CommonFunctions::executeProgram("repquota", "-au", $buffer,
PSI_DEBUG);
+ break;
+ case 'data':
+ CommonFunctions::rfts(APP_ROOT."/data/quotas.txt", $buffer);
+ break;
+ default:
+ $this->global_error->addConfigError("__construct()",
"PSI_PLUGIN_QUOTAS_ACCESS");
+ break;
+ }
+ if (trim($buffer) != "") {
+ $this->_filecontent = preg_split("/\n/", $buffer, -1,
PREG_SPLIT_NO_EMPTY);
+ unset($this->_filecontent[0]);
+ } else {
+ $this->_filecontent = array();
+ }
+ }
+
+ /**
+ * doing all tasks to get the required informations that the plugin needs
+ * result is stored in an internal array<br>the array is build like a tree,
+ * so that it is possible to get only a specific process with the childs
+ *
+ * @return void
+ */
+ public function execute()
+ {
+ $i = 0;
+ $quotas = array();
+ foreach ($this->_filecontent as $thisline) {
+ $thisline = preg_replace("/([\s]--)/", "", $thisline);
+ $thisline = preg_split("/(\s)/e", $thisline, -1,
PREG_SPLIT_NO_EMPTY);
+ if (count($thisline) == 7) {
+ $quotas[$i]['user'] = str_replace("--", "", $thisline[0]);
+ $quotas[$i]['byte_used'] = $thisline[1] * 1024;
+ $quotas[$i]['byte_soft'] = $thisline[2] * 1024;
+ $quotas[$i]['byte_hard'] = $thisline[3] * 1024;
+ if ($thisline[3] != 0) {
+ $quotas[$i]['byte_percent_used'] =
round((($quotas[$i]['byte_used'] / $quotas[$i]['byte_hard']) * 100), 1);
+ } else {
+ $quotas[$i]['byte_percent_used'] = 0;
+ }
+ $quotas[$i]['file_used'] = $thisline[4];
+ $quotas[$i]['file_soft'] = $thisline[5];
+ $quotas[$i]['file_hard'] = $thisline[6];
+ if ($thisline[6] != 0) {
+ $quotas[$i]['file_percent_used'] =
round((($quotas[$i]['file_used'] / $quotas[$i]['file_hard']) * 100), 1);
+ } else {
+ $quotas[$i]['file_percent_used'] = 0;
+ }
+ $i++;
+ }
+ }
+ $this->_result = $quotas;
+ }
+
+ /**
+ * generates the XML content for the plugin
+ *
+ * @return SimpleXMLElement entire XML content for the plugin
+ */
+ public function xml()
+ {
+ foreach ($this->_result as $quota) {
+ $quotaChild = $this->xml->addChild("Quota");
+ $quotaChild->addAttribute("User", $quota['user']);
+ $quotaChild->addAttribute("ByteUsed", $quota['byte_used']);
+ $quotaChild->addAttribute("ByteSoft", $quota['byte_soft']);
+ $quotaChild->addAttribute("ByteHard", $quota['byte_hard']);
+ $quotaChild->addAttribute("BytePercentUsed",
$quota['byte_percent_used']);
+ $quotaChild->addAttribute("FileUsed", $quota['file_used']);
+ $quotaChild->addAttribute("FileSoft", $quota['file_soft']);
+ $quotaChild->addAttribute("FileHard", $quota['file_hard']);
+ $quotaChild->addAttribute("FilePercentUsed",
$quota['file_percent_used']);
+ }
+
+ return $this->xml->getSimpleXmlElement();
+ }
+}
Added: branches/dev-syncromind/phpsysinfo/plugins/Quotas/css/quotas.css
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/Quotas/css/quotas.css
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/Quotas/css/quotas.css
2015-09-04 16:52:20 UTC (rev 13851)
@@ -0,0 +1,18 @@
+/*
+ $Id: quotas.css 661 2012-08-27 11:26:39Z namiltd $
+ */
+#plugin_quotasTable thead tr .header {
+ background-image: url("../../../gfx/bg.gif");
+ background-position: right center;
+ background-repeat: no-repeat;
+ cursor: pointer;
+ text-align: center;
+}
+
+#plugin_quotasTable thead tr .headerSortUp {
+ background-image: url("../../../gfx/asc.gif");
+}
+
+#plugin_quotasTable thead tr .headerSortDown {
+ background-image: url("../../../gfx/desc.gif");
+}
Added: branches/dev-syncromind/phpsysinfo/plugins/Quotas/js/quotas.js
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/Quotas/js/quotas.js
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/Quotas/js/quotas.js
2015-09-04 16:52:20 UTC (rev 13851)
@@ -0,0 +1,146 @@
+/***************************************************************************
+ * Copyright (C) 2008 by phpSysInfo - A PHP System Information Script *
+ * http://phpsysinfo.sourceforge.net/ *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License 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. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+//
+// $Id: quotas.js 661 2012-08-27 11:26:39Z namiltd $
+//
+
+/*global $, jQuery, buildBlock, datetime, plugin_translate, genlang,
formatBytes, createBar */
+
+"use strict";
+
+var quotas_show = false, quotas_table;
+
+//appendcss("./plugins/Quotas/css/Quotas.css");
+
+/**
+ * insert content into table
+ * @param {jQuery} xml plugin-XML
+ */
+function quotas_populate(xml) {
+ quotas_table.fnClearTable();
+
+ $("Plugins Plugin_Quotas Quota", xml).each(function quotas_getquota(id) {
+ var user = "", bused = 0, bsoft = 0, bhard = 0, bpuse = 0, fpuse = 0,
fused = 0, fsoft = 0, fhard = 0;
+ user = $(this).attr("User");
+ bused = parseInt($(this).attr("ByteUsed"), 10);
+ bsoft = parseInt($(this).attr("ByteSoft"), 10);
+ bhard = parseInt($(this).attr("ByteHard"), 10);
+ bpuse = parseInt($(this).attr("BytePercentUsed"), 10);
+ fused = parseInt($(this).attr("FileUsed"), 10);
+ fsoft = parseInt($(this).attr("FileSoft"), 10);
+ fhard = parseInt($(this).attr("FileHard"), 10);
+ fpuse = parseInt($(this).attr("FilePercentUsed"), 10);
+
+ quotas_table.fnAddData(["<span style=\"display:none;\">" + user +
"</span>" + user, "<span style=\"display:none;\">" + bused + "</span>" +
formatBytes(bused, xml), "<span style=\"display:none;\">" + bsoft + "</span>" +
formatBytes(bsoft, xml), "<span style=\"display:none;\">" + bhard + "</span>" +
formatBytes(bhard, xml), "<span style=\"display:none;\">" + bpuse + "</span>" +
createBar(bpuse), "<span style=\"display:none;\">" + fused + "</span>" + fused,
"<span style=\"display:none;\">" + fsoft + "</span>" + fsoft, "<span
style=\"display:none;\">" + fhard + "</span>" + fhard, "<span
style=\"display:none;\">" + fpuse + "</span>" + createBar(fpuse)]);
+ quotas_show = true;
+ });
+}
+
+/**
+ * fill the plugin block with table structure
+ */
+function quotas_buildTable() {
+ var html = "";
+
+ html += "<table id=\"Plugin_QuotasTable\" style=\"border-spacing:0;\">\n";
+ html += " <thead>\n";
+ html += " <tr>\n";
+ html += " <th>" + genlang(3, false, "Quotas") + "</th>\n";
+ html += " <th class=\"right\">" + genlang(4, false, "Quotas") +
"</th>\n";
+ html += " <th class=\"right\">" + genlang(5, false, "Quotas") +
"</th>\n";
+ html += " <th class=\"right\">" + genlang(6, false, "Quotas") +
"</th>\n";
+ html += " <th>" + genlang(7, false, "Quotas") + "</th>\n";
+ html += " <th class=\"right\">" + genlang(8, false, "Quotas") +
"</th>\n";
+ html += " <th class=\"right\">" + genlang(9, false, "Quotas") +
"</th>\n";
+ html += " <th class=\"right\">" + genlang(10, false, "Quotas") +
"</th>\n";
+ html += " <th>" + genlang(11, false, "Quotas") + "</th>\n";
+ html += " </tr>\n";
+ html += " </thead>\n";
+ html += " <tbody>\n";
+ html += " </tbody>\n";
+ html += "</table>\n";
+
+ $("#Plugin_Quotas").append(html);
+
+ quotas_table = $("#Plugin_QuotasTable").dataTable({
+ "bPaginate": false,
+ "bLengthChange": false,
+ "bFilter": false,
+ "bSort": true,
+ "bInfo": false,
+ "bProcessing": true,
+ "bAutoWidth": false,
+ "bStateSave": true,
+ "aoColumns": [{
+ "sType": 'span-string'
+ }, {
+ "sType": 'span-number'
+ }, {
+ "sType": 'span-number'
+ }, {
+ "sType": 'span-number'
+ }, {
+ "sType": 'span-number'
+ }, {
+ "sType": 'span-number'
+ }, {
+ "sType": 'span-number'
+ }, {
+ "sType": 'span-number'
+ }, {
+ "sType": 'span-number'
+ }]
+ });
+}
+
+/**
+ * load the xml via ajax
+ */
+function quotas_request() {
+ $.ajax({
+ url: "xml.php?plugin=Quotas",
+ dataType: "xml",
+ error: function quotas_error() {
+ $.jGrowl("Error loading XML document for Plugin quotas!");
+ },
+ success: function quotas_buildblock(xml) {
+ populateErrors(xml);
+ quotas_populate(xml);
+ if (quotas_show) {
+ plugin_translate("Quotas");
+ $("#Plugin_Quotas").show();
+ }
+ }
+ });
+}
+
+$(document).ready(function quotas_buildpage() {
+ $("#footer").before(buildBlock("Quotas", 1, true));
+ $("#Plugin_Quotas").css("width", "915px");
+
+ quotas_buildTable();
+
+ quotas_request();
+
+ $("#Reload_QuotasTable").click(function quotas_reload(id) {
+ quotas_request();
+ $("#Reload_QuotasTable").attr("title",datetime());
+ });
+});
Added: branches/dev-syncromind/phpsysinfo/plugins/Quotas/lang/cz.xml
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/Quotas/lang/cz.xml
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/Quotas/lang/cz.xml
2015-09-04 16:52:20 UTC (rev 13851)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+ <!-- $Id: cz.xml 661 2012-08-27 11:26:39Z namiltd $ -->
+ <!--
+ phpSysInfo language file Language: Czech Created by: Tomáš Růžička
+ -->
+<tns:translationPlugin language="czech" charset="utf-8"
+ xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin
../../../language/translation-plugin.xsd">
+ <expression id="plugin_quotas_001" name="ps_title">
+ <exp>Stav kvót</exp>
+ </expression>
+ <expression id="plugin_quotas_002" name="quotas_date">
+ <exp>aktualizováno</exp>
+ </expression>
+ <expression id="plugin_quotas_003" name="quotas_user">
+ <exp>Uživatel</exp>
+ </expression>
+ <expression id="plugin_quotas_004" name="quotas_bused">
+ <exp>Využité místo</exp>
+ </expression>
+ <expression id="plugin_quotas_005" name="quotas_bsoft">
+ <exp>Měkký limit</exp>
+ </expression>
+ <expression id="plugin_quotas_006" name="quotas_bhard">
+ <exp>Tvrdý limit</exp>
+ </expression>
+ <expression id="plugin_quotas_007" name="quotas_bpuse">
+ <exp>Procento využití</exp>
+ </expression>
+ <expression id="plugin_quotas_008" name="quotas_fused">
+ <exp>Počet soouborů</exp>
+ </expression>
+ <expression id="plugin_quotas_009" name="quotas_fsoft">
+ <exp>Měkký souborový limit</exp>
+ </expression>
+ <expression id="plugin_quotas_010" name="quotas_fhard">
+ <exp>Tvrdý souborový limit</exp>
+ </expression>
+ <expression id="plugin_quotas_011" name="quotas_fpuse">
+ <exp>Procento využití souborů</exp>
+ </expression>
+</tns:translationPlugin>
Added: branches/dev-syncromind/phpsysinfo/plugins/Quotas/lang/de.xml
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/Quotas/lang/de.xml
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/Quotas/lang/de.xml
2015-09-04 16:52:20 UTC (rev 13851)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+ <!-- $Id: de.xml 661 2012-08-27 11:26:39Z namiltd $ -->
+ <!--
+ phpSysInfo language file Language: English Created by: Michael Cramer
+ -->
+<tns:translationPlugin language="german" charset="utf-8"
+ xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin
../../../language/translation-plugin.xsd">
+ <expression id="plugin_quotas_001" name="ps_title">
+ <exp>Quota Status</exp>
+ </expression>
+ <expression id="plugin_quotas_002" name="quotas_date">
+ <exp>Letze Aktualisierung</exp>
+ </expression>
+ <expression id="plugin_quotas_003" name="quotas_user">
+ <exp>Benutzer</exp>
+ </expression>
+ <expression id="plugin_quotas_004" name="quotas_bused">
+ <exp>Bytes <br/>(Belegt)</exp>
+ </expression>
+ <expression id="plugin_quotas_005" name="quotas_bsoft">
+ <exp>Bytes <br/>(Soft Limit)</exp>
+ </expression>
+ <expression id="plugin_quotas_006" name="quotas_bhard">
+ <exp>Bytes <br/>(Hard Limit)</exp>
+ </expression>
+ <expression id="plugin_quotas_007" name="quotas_bpuse">
+ <exp>Bytes <br/>(Belegt Prozent)</exp>
+ </expression>
+ <expression id="plugin_quotas_008" name="quotas_fused">
+ <exp>Dateien <br/>(Benutzt)</exp>
+ </expression>
+ <expression id="plugin_quotas_009" name="quotas_fsoft">
+ <exp>Dateien <br/>(Soft Limit)</exp>
+ </expression>
+ <expression id="plugin_quotas_010" name="quotas_fhard">
+ <exp>Dateien <br/>(Hard Limit)</exp>
+ </expression>
+ <expression id="plugin_quotas_011" name="quotas_fpuse">
+ <exp>Dateien <br/>(Benutzt Prozent)</exp>
+ </expression>
+</tns:translationPlugin>
Added: branches/dev-syncromind/phpsysinfo/plugins/Quotas/lang/en.xml
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/Quotas/lang/en.xml
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/Quotas/lang/en.xml
2015-09-04 16:52:20 UTC (rev 13851)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+ <!-- $Id: en.xml 661 2012-08-27 11:26:39Z namiltd $ -->
+ <!--
+ phpSysInfo language file Language: English Created by: Michael Cramer
+ -->
+<tns:translationPlugin language="english" charset="utf-8"
+ xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin
../../../language/translation-plugin.xsd">
+ <expression id="plugin_quotas_001" name="ps_title">
+ <exp>Quota Status</exp>
+ </expression>
+ <expression id="plugin_quotas_002" name="quotas_date">
+ <exp>Last Refresh</exp>
+ </expression>
+ <expression id="plugin_quotas_003" name="quotas_user">
+ <exp>User</exp>
+ </expression>
+ <expression id="plugin_quotas_004" name="quotas_bused">
+ <exp>Bytes Used</exp>
+ </expression>
+ <expression id="plugin_quotas_005" name="quotas_bsoft">
+ <exp>Bytes Soft</exp>
+ </expression>
+ <expression id="plugin_quotas_006" name="quotas_bhard">
+ <exp>Bytes Hard</exp>
+ </expression>
+ <expression id="plugin_quotas_007" name="quotas_bpuse">
+ <exp>Bytes Used Percent</exp>
+ </expression>
+ <expression id="plugin_quotas_008" name="quotas_fused">
+ <exp>Files Used</exp>
+ </expression>
+ <expression id="plugin_quotas_009" name="quotas_fsoft">
+ <exp>Files Soft</exp>
+ </expression>
+ <expression id="plugin_quotas_010" name="quotas_fhard">
+ <exp>Files Hard</exp>
+ </expression>
+ <expression id="plugin_quotas_011" name="quotas_fpuse">
+ <exp>Files Used Percent</exp>
+ </expression>
+</tns:translationPlugin>
Added: branches/dev-syncromind/phpsysinfo/plugins/Quotas/lang/fr.xml
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/Quotas/lang/fr.xml
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/Quotas/lang/fr.xml
2015-09-04 16:52:20 UTC (rev 13851)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+ <!-- $Id: fr.xml 661 2012-08-27 11:26:39Z namiltd $ -->
+ <!--
+ phpSysInfo language file Language: French Created by: Erkan VALENTIN
+ -->
+<tns:translationPlugin language="french" charset="utf-8"
+ xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin
../../../language/translation-plugin.xsd">
+ <expression id="plugin_quotas_001" name="ps_title">
+ <exp>Etat des quotas</exp>
+ </expression>
+ <expression id="plugin_quotas_002" name="quotas_date">
+ <exp>Dernière actualisation</exp>
+ </expression>
+ <expression id="plugin_quotas_003" name="quotas_user">
+ <exp>Utilisateurs</exp>
+ </expression>
+ <expression id="plugin_quotas_004" name="quotas_bused">
+ <exp>Espace utilisés</exp>
+ </expression>
+ <expression id="plugin_quotas_005" name="quotas_bsoft">
+ <exp>Espace limite souple</exp>
+ </expression>
+ <expression id="plugin_quotas_006" name="quotas_bhard">
+ <exp>Espace limite stricte</exp>
+ </expression>
+ <expression id="plugin_quotas_007" name="quotas_bpuse">
+ <exp>Pourcentage espace utilisés</exp>
+ </expression>
+ <expression id="plugin_quotas_008" name="quotas_fused">
+ <exp>Inodes utilisés</exp>
+ </expression>
+ <expression id="plugin_quotas_009" name="quotas_fsoft">
+ <exp>Inodes limite souple</exp>
+ </expression>
+ <expression id="plugin_quotas_010" name="quotas_fhard">
+ <exp>Inodes limite stricte</exp>
+ </expression>
+ <expression id="plugin_quotas_011" name="quotas_fpuse">
+ <exp>Pourcentage inodes utilisés</exp>
+ </expression>
+</tns:translationPlugin>
Added: branches/dev-syncromind/phpsysinfo/plugins/Quotas/lang/pl.xml
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/Quotas/lang/pl.xml
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/Quotas/lang/pl.xml
2015-09-04 16:52:20 UTC (rev 13851)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+ <!-- $Id: pl.xml 661 2012-08-27 11:26:39Z namiltd $ -->
+ <!--
+ phpSysInfo language file Language: Polish Created by: Mieczyslaw Nalewaj
+ -->
+<tns:translationPlugin language="polish" charset="utf-8"
+ xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin
../../../language/translation-plugin.xsd">
+ <expression id="plugin_quotas_001" name="ps_title">
+ <exp>Status Quoty</exp>
+ </expression>
+ <expression id="plugin_quotas_002" name="quotas_date">
+ <exp>Ostatnie odświeżenie</exp>
+ </expression>
+ <expression id="plugin_quotas_003" name="quotas_user">
+ <exp>Użytkownik</exp>
+ </expression>
+ <expression id="plugin_quotas_004" name="quotas_bused">
+ <exp>Bajtów wykorzystanych</exp>
+ </expression>
+ <expression id="plugin_quotas_005" name="quotas_bsoft">
+ <exp>Miękki limit bajtów</exp>
+ </expression>
+ <expression id="plugin_quotas_006" name="quotas_bhard">
+ <exp>Twardy limit bajtów</exp>
+ </expression>
+ <expression id="plugin_quotas_007" name="quotas_bpuse">
+ <exp>Procentowo bajtów</exp>
+ </expression>
+ <expression id="plugin_quotas_008" name="quotas_fused">
+ <exp>Plików wykorzystanych</exp>
+ </expression>
+ <expression id="plugin_quotas_009" name="quotas_fsoft">
+ <exp>Miękki limit plików</exp>
+ </expression>
+ <expression id="plugin_quotas_010" name="quotas_fhard">
+ <exp>Twardy limit plików</exp>
+ </expression>
+ <expression id="plugin_quotas_011" name="quotas_fpuse">
+ <exp>Procentowo plików</exp>
+ </expression>
+</tns:translationPlugin>
Added: branches/dev-syncromind/phpsysinfo/plugins/Quotas/lang/ru.xml
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/Quotas/lang/ru.xml
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/Quotas/lang/ru.xml
2015-09-04 16:52:20 UTC (rev 13851)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+ <!-- $Id: en.xml 661 2012-08-27 11:26:39Z namiltd $ -->
+ <!--
+ phpSysInfo language file Language: Russian Created by: Denis Sevostyanov
(den007)
+ -->
+<tns:translationPlugin language="russian" charset="utf-8"
+ xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin
../../../language/translation-plugin.xsd">
+ <expression id="plugin_quotas_001" name="ps_title">
+ <exp>Состояние Квоты</exp>
+ </expression>
+ <expression id="plugin_quotas_002" name="quotas_date">
+ <exp>Последнее обновление</exp>
+ </expression>
+ <expression id="plugin_quotas_003" name="quotas_user">
+ <exp>Пользователь</exp>
+ </expression>
+ <expression id="plugin_quotas_004" name="quotas_bused">
+ <exp>Используется</exp>
+ </expression>
+ <expression id="plugin_quotas_005" name="quotas_bsoft">
+ <exp>Программы</exp>
+ </expression>
+ <expression id="plugin_quotas_006" name="quotas_bhard">
+ <exp>Жесткий диск</exp>
+ </expression>
+ <expression id="plugin_quotas_007" name="quotas_bpuse">
+ <exp>Процентов</exp>
+ </expression>
+ <expression id="plugin_quotas_008" name="quotas_fused">
+ <exp>Файлы Используется</exp>
+ </expression>
+ <expression id="plugin_quotas_009" name="quotas_fsoft">
+ <exp>Файлов программ</exp>
+ </expression>
+ <expression id="plugin_quotas_010" name="quotas_fhard">
+ <exp>Файлы на жестком диске</exp>
+ </expression>
+ <expression id="plugin_quotas_011" name="quotas_fpuse">
+ <exp>Проценты файлов</exp>
+ </expression>
+</tns:translationPlugin>
Added: branches/dev-syncromind/phpsysinfo/plugins/SMART/class.smart.inc.php
===================================================================
--- branches/dev-syncromind/phpsysinfo/plugins/SMART/class.smart.inc.php
(rev 0)
+++ branches/dev-syncromind/phpsysinfo/plugins/SMART/class.smart.inc.php
2015-09-04 16:52:20 UTC (rev 13851)
@@ -0,0 +1,280 @@
+<?php
+/**
+ * SMART Plugin
+ *
+ * PHP version 5
+ *
+ * @category PHP
+ * @package PSI_Plugin_SMART
+ * @author Antoine Bertin <address@hidden>
+ * @copyright 2009 phpSysInfo
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public
License
+ * @version SVN: $Id: class.smart.inc.php 707 2012-11-28 10:20:49Z namiltd $
+ * @link http://phpsysinfo.sourceforge.net
+ */
+/**
+ * SMART plugin, which displays all SMART informations available
+ *
+ * @category PHP
+ * @package PSI_Plugin_SMART
+ * @author Antoine Bertin <address@hidden>
+ * @copyright 2009 phpSysInfo
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public
License
+ * @version Release: 3.0
+ * @link http://phpsysinfo.sourceforge.net
+ */
+class SMART extends PSI_Plugin
+{
+ /**
+ * variable, which holds the content of the command
+ * @var array
+ */
+ private $_filecontent = array();
+
+ /**
+ * variable, which holds the result before the xml is generated out of
this array
+ * @var array
+ */
+ private $_result = array();
+
+ /**
+ * variable, which holds PSI_PLUGIN_SMART_IDS well formated datas
+ * @var array
+ */
+ private $_ids = array();
+
+ /**
+ * read the data into an internal array and also call the parent
constructor
+ *
+ * @param String $enc target encoding
+ */
+ public function __construct($enc)
+ {
+ parent::__construct(__CLASS__, $enc);
+ switch (strtolower(PSI_PLUGIN_SMART_ACCESS)) {
+ case 'command':
+ if ( defined('PSI_PLUGIN_SMART_DEVICES') &&
is_string(PSI_PLUGIN_SMART_DEVICES) ) {
+ if (preg_match(ARRAY_EXP, PSI_PLUGIN_SMART_DEVICES)) {
+ $disks = eval(PSI_PLUGIN_SMART_DEVICES);
+ } else {
+ $disks = array(PSI_PLUGIN_SMART_DEVICES);
+ }
+ foreach ($disks as $disk) {
+ $buffer = "";
+ if (CommonFunctions::executeProgram('smartctl',
'--all'.((PSI_PLUGIN_SMART_DEVICE) ? ' --device '.PSI_PLUGIN_SMART_DEVICE :
'').' '.$disk, $buffer, PSI_DEBUG)) {
+ $this->_filecontent[$disk] = $buffer;
+ }
+ }
+ }
+ if ( defined('PSI_PLUGIN_SMART_IDS') &&
is_string(PSI_PLUGIN_SMART_IDS) ) {
+ if (preg_match(ARRAY_EXP, PSI_PLUGIN_SMART_IDS)) {
+ $fullIds = eval(PSI_PLUGIN_SMART_IDS);
+ } else {
+ $fullIds = array(PSI_PLUGIN_SMART_IDS);
+ }
+ foreach ($fullIds as $fullId) {
+ $arrFullId = preg_split('/-/', $fullId);
+ $this->_ids[intval($arrFullId[0])] =
strtolower($arrFullId[1]);
+ if (!empty($arrFullId[2]))
+ $this->_ids[intval($arrFullId[2])] =
"#replace-".intval($arrFullId[0]);
+ }
+ }
+ break;
+ case 'data':
+ if ( defined('PSI_PLUGIN_SMART_DEVICES') &&
is_string(PSI_PLUGIN_SMART_DEVICES) ) {
+ if (preg_match(ARRAY_EXP, PSI_PLUGIN_SMART_DEVICES)) {
+ $disks = eval(PSI_PLUGIN_SMART_DEVICES);
+ } else {
+ $disks = array(PSI_PLUGIN_SMART_DEVICES);
+ }
+ $dn=0;
+ foreach ($disks as $disk) {
+ $buffer="";
+ if
(CommonFunctions::rfts(APP_ROOT."/data/smart{$dn}.txt", $buffer) &&
!empty($buffer)) {
+ $this->_filecontent[$disk] = $buffer;
+ }
+ $dn++;
+ }
+ }
+ if ( defined('PSI_PLUGIN_SMART_IDS') &&
is_string(PSI_PLUGIN_SMART_IDS) ) {
+ if (preg_match(ARRAY_EXP, PSI_PLUGIN_SMART_IDS)) {
+ $fullIds = eval(PSI_PLUGIN_SMART_IDS);
+ } else {
+ $fullIds = array(PSI_PLUGIN_SMART_IDS);
+ }
+ foreach ($fullIds as $fullId) {
+ $arrFullId = preg_split('/-/', $fullId);
+ $this->_ids[intval($arrFullId[0])] =
strtolower($arrFullId[1]);
+ if (!empty($arrFullId[2]))
+ $this->_ids[intval($arrFullId[2])] =
"#replace-".intval($arrFullId[0]);
+ }
+ }
+ break;
+ default:
+
$this->global_error->addError("switch(PSI_PLUGIN_SMART_ACCESS)", "Bad SMART
configuration in SMART.config.php");
+ break;
+ }
+ }
+
+ /**
+ * doing all tasks to get the required informations that the plugin needs
+ * result is stored in an internal array
+ *
+ * @return void
+ */
+ public function execute()
+ {
+ if ( empty($this->_filecontent) || empty($this->_ids)) {
+ return;
+ }
+ foreach ($this->_filecontent as $disk=>$result) {
+ // set the start and end offset in the result string at the
beginning and end respectively
+ // just in case we don't find the two strings, so that it still
works as expected.
+ $startIndex = 0;
+ $endIndex = 0;
+ $vendorInfos = "";
+
+ // locate the beginning string offset for the attributes
+ if ( preg_match('/(Vendor Specific SMART Attributes with
Thresholds)/', $result, $matches, PREG_OFFSET_CAPTURE) )
+ $startIndex = $matches[0][1];
+
+ // locate the end string offset for the attributes, this is
usually right before string "SMART Error Log Version" or "SMART Error Log not
supported" (hopefully every output has it!)
+ if ( preg_match('/(SMART Error Log Version)|(SMART Error Log not
supported)/', $result, $matches, PREG_OFFSET_CAPTURE) )
+ $endIndex = $matches[0][1];
+
+ if ($startIndex && $endIndex && ($endIndex>$startIndex))
+ $vendorInfos = preg_split("/\n/", substr ( $result,
$startIndex, $endIndex - $startIndex ));
+
+ if (!empty($vendorInfos)) {
+ $labels = preg_split('/[\s]+/', $vendorInfos[1]);
+ foreach ($labels as $k=>$v) {
+ $labels[$k] = str_replace('#', '', strtolower($v));
+ }
+ $i = 0; // Line number
+ foreach ($vendorInfos as $line) {
+ $line = preg_replace('/^[\s]+/', '', $line);
+ $values = preg_split('/[\s]+/', $line);
+ if (count($values) > count($labels)) {
+ $values = array_slice($values, 0, count($labels),
true);
+ }
+ $j = 0;
+ $found = false;
+ foreach ($values as $value) {
+ if ((in_array($value, array_keys($this->_ids)) &&
$labels[$j] == 'id')) {
+ $arrFullVa = preg_split('/-/', $this->_ids[$value]);
+ if (($arrFullVa[0]=="#replace") &&
!empty($arrFullVa[1]))
+ $value=$arrFullVa[1];
+ }
+ if (((in_array($value, array_keys($this->_ids)) &&
$labels[$j] == 'id') || ($found && (in_array($labels[$j],
array_values($this->_ids)))) || ($found && $labels[$j] == 'attribute_name'))) {
+ $this->_result[$disk][$i][$labels[$j]] = $value;
+ $found = true;
+ }
+ $j++;
+ }
+ $i++;
+ }
+ } else {
+ //SCSI devices
+ if (!empty($this->_ids[1]) && ($this->_ids[1]=="raw_value")) {
+ preg_match('/read\: (.*)\n/', $result, $lines);
+ if (!empty($lines) && !empty($lines[0])) {
+ $values=preg_split('/[\s,]+/',$lines[0]);
+ if (!empty($values) && ($values[7]!=null)) {
+ $this->_result[$disk][0]['id'] = 1;
+ $this->_result[$disk][0]['attribute_name'] =
"Raw_Read_Error_Rate";
+ $this->_result[$disk][0]['raw_value'] = $values[7];
+ }
+ }
+ }
+ if (!empty($this->_ids[5]) && ($this->_ids[5]=="raw_value")) {
+ preg_match('/Elements in grown defect list\: (.*)\n/',
$result, $lines);
+ if (!empty($lines) && !empty($lines[0])) {
+ $values=preg_split('/[\s,]+/',$lines[0]);
+ if (!empty($values) && ($values[5]!=null)) {
+ $this->_result[$disk][1]['id'] = 5;
+ $this->_result[$disk][1]['attribute_name'] =
"Reallocated_Sector_Ct";
+ $this->_result[$disk][1]['raw_value'] = $values[5];
+ }
+ }
+ }
+ if (!empty($this->_ids[9]) && ($this->_ids[9]=="raw_value")) {
+ preg_match('/ number of hours powered up = (.*)\n/',
$result, $lines);
+ if (!empty($lines) && !empty($lines[0])) {
@@ Diff output truncated at 153600 characters. @@
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [13851] fixing datatable and forms,
Saul <=