Commit fbcc48e8 authored by José Luis  Gutiérrez's avatar José Luis Gutiérrez Committed by Alessandro Rubini

www: endpoint mode data structure fix

Endpoint mode was not correctly displayed in endpointmode.php and
endpointcalibration.php when dotconfig CONFIG_PORTXX_PARAMS did not
include the protocol column.
Now, the forms are correctly displayed with and without the protocol
column in dotconfig.
NOTE: we assume that the protocol column is there or not for all ports or for none of them. (not mixture)
parent a2fda0da
......@@ -34,7 +34,10 @@
$infoname = "Endpoint Configuration";
//$size = "6";
$header = array ("WR port","Protocol","Tx","Rx","Mode","Fiber");
if (strpos($_SESSION["KCONFIG"]["CONFIG_PORT00_PARAMS"],'proto=') !== false)
$header = array ("WR port","Protocol","Tx","Rx","Mode","Fiber");
else
$header = array ("WR port","Tx","Rx","Mode","Fiber");
$matrix = array ("key=CONFIG_PORT00_PARAMS,".$_SESSION["KCONFIG"]["CONFIG_PORT00_PARAMS"],
"key=CONFIG_PORT01_PARAMS,".$_SESSION["KCONFIG"]["CONFIG_PORT01_PARAMS"],
"key=CONFIG_PORT02_PARAMS,".$_SESSION["KCONFIG"]["CONFIG_PORT02_PARAMS"],
......
......@@ -1159,9 +1159,13 @@ function parse_endpoint_modes(){
$role = $_SESSION["KCONFIG"]["CONFIG_PORT".$endpoint."_PARAMS"];
$role = explode(",",$role);
$role = str_replace("role=","",$role[4]);
array_push($modes,$role);
foreach ($role as $column){
if (strpos($column,'role=') !== false) {
$role = str_replace("role=","",$column);
array_push($modes,$role);
}
}
}
return $modes;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment