Skip to content

Commit

Permalink
PHP Coding Standards with phpcbf
Browse files Browse the repository at this point in the history
  • Loading branch information
amma35 committed Jun 13, 2018
1 parent 4f44a04 commit da9ccd3
Show file tree
Hide file tree
Showing 67 changed files with 1,792 additions and 2,026 deletions.
8 changes: 4 additions & 4 deletions ajax/dropdownitems.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
-------------------------------------------------------------------------
LICENSE
This file is part of ocsinventoryng.
ocsinventoryng is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -45,12 +45,12 @@
echo "<input type='hidden' name='tolink_itemtype[" . $_POST["id"] . "]' value='" . $_POST["itemtype"] . "'>";
echo "<br>";
$field_id = Html::cleanId("dropdown_" . $_POST['myname'] . $rand);
$p = array('itemtype' => $_POST["itemtype"],
$p = ['itemtype' => $_POST["itemtype"],
//'entity_restrict' => $_POST['entity_restrict'],
'table' => $table,
//'multiple' => $_POST["multiple"],
'myname' => $_POST["myname"],
'rand' => $_POST["rand"]);
'rand' => $_POST["rand"]];

if (isset($_POST["used"]) && !empty($_POST["used"])) {
if (isset($_POST["used"][$_POST["itemtype"]])) {
Expand All @@ -62,4 +62,4 @@
$CFG_GLPI['root_doc'] . "/plugins/ocsinventoryng/ajax/getDropdownFindItem.php",
$p);

}
}
18 changes: 10 additions & 8 deletions ajax/getDropdownFindItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
-------------------------------------------------------------------------
LICENSE
This file is part of ocsinventoryng.
ocsinventoryng is free software; you can redistribute it and/or modify
Expand All @@ -33,7 +33,9 @@
Html::header_nocache();

Session::checkLoginUser();
if (!isset($_POST) || empty($_POST)) $_POST = $_GET;
if (!isset($_POST) || empty($_POST)) {
$_POST = $_GET;
}
// Security
if (!$DB->tableExists($_POST['table'])) {
exit();
Expand Down Expand Up @@ -107,12 +109,12 @@
$LIMIT";
$result = $DB->query($query);

$datas = array();
$datas = [];

// Display first if no search
if ($_POST['page'] == 1 && empty($_POST['searchText'])) {
array_push($datas, array('id' => 0,
'text' => Dropdown::EMPTY_VALUE));
array_push($datas, ['id' => 0,
'text' => Dropdown::EMPTY_VALUE]);
}
$count = 0;
if ($DB->numrows($result)) {
Expand All @@ -135,12 +137,12 @@
$output = sprintf(__('%1$s (%2$s)'), $output, $data['id']);
}

array_push($datas, array('id' => $data['id'],
'text' => $output));
array_push($datas, ['id' => $data['id'],
'text' => $output]);
$count++;
}
}

$ret['count'] = $count;
$ret['results'] = $datas;
echo json_encode($ret);
echo json_encode($ret);
4 changes: 2 additions & 2 deletions css/ocsinventoryng.css
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ table.ipdisc_tab, table.ipdisc_tab_header {
}

/*table{
border-spacing: 0;
border-spacing: 0;
}*/

td.ipdisc_tab, td.ipdisc_tab_row, table.ipdisc_tab_header {
Expand Down Expand Up @@ -165,4 +165,4 @@ td.ipdisc_tab, td.ipdisc_tab_row, table.ipdisc_tab_header {
.ocsinventoryng_toner_level_other {
border: 0px;
background-color: #0464BB;
}
}
6 changes: 3 additions & 3 deletions front/config.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
-------------------------------------------------------------------------
LICENSE
This file is part of ocsinventoryng.
ocsinventoryng is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -48,12 +48,12 @@
if ($plugin->isActivated("ocsinventoryng")) {
Html::header(__("Automatic synchronization's configuration", 'ocsinventoryng'), '', "tools", "pluginocsinventoryngmenu", "config");

$config->display(array('id' => 1));
$config->display(['id' => 1]);
} else {
Html::header(__('Setup'), '', "tools", "pluginocsinventoryngmenu", "config");
echo "<div class='center'><br><br>";
echo "<img src=\"" . $CFG_GLPI["root_doc"] . "/pics/warning.png\" alt='" . __s('Warning') . "'><br><br>";
echo "<b>" . __('Please activate the plugin', 'ocsinventoryng') . "</b></div>";
}

Html::footer();
Html::footer();
4 changes: 2 additions & 2 deletions front/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
-------------------------------------------------------------------------
LICENSE
This file is part of ocsinventoryng.
ocsinventoryng is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -46,4 +46,4 @@
echo "<b>" . __('Please activate the plugin', 'ocsinventoryng') . "</b></div>";
}

Html::footer();
Html::footer();
4 changes: 2 additions & 2 deletions front/deleted_equiv.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
-------------------------------------------------------------------------
LICENSE
This file is part of ocsinventoryng.
ocsinventoryng is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -94,4 +94,4 @@

echo "</div>";

Html::footer();
Html::footer();
4 changes: 2 additions & 2 deletions front/detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
-------------------------------------------------------------------------
LICENSE
This file is part of ocsinventoryng.
ocsinventoryng is free software; you can redistribute it and/or modify
Expand All @@ -35,4 +35,4 @@

Search::show('PluginOcsinventoryngDetail');

Html::footer();
Html::footer();
12 changes: 6 additions & 6 deletions front/ipdiscover.import.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
}

$subnet = PluginOcsinventoryngIpdiscoverOcslink::getSubnetIDbyIP($ipAdress);
$hardware = array();
$hardware = [];
$knownMacAdresses = $ip->getKnownMacAdresseFromGlpi();
if (isset($status)) {
$hardware = $ip->getHardware($ipAdress, $ocsServerId, $status, $knownMacAdresses);
Expand Down Expand Up @@ -89,7 +89,7 @@
$itemsNames = $_POST["itemsname"];
$itemsDescription = $_POST["itemsdescription"];
$itemsIp = $_POST["itemsip"];
$entities = array();
$entities = [];

if (isset($_POST["entities"])) {
$entities = $_POST["entities"];
Expand Down Expand Up @@ -167,7 +167,7 @@
$itemsDescription = $_POST["itemsdescription"];
$ocsItemstypes = $_POST["ocsitemstype"];
$itemsIp = $_POST["itemsip"];
$entities = array();
$entities = [];

if (isset($_POST["entities"])) {
$entities = $_POST["entities"];
Expand Down Expand Up @@ -240,8 +240,8 @@
$itemtypes = $_POST["tolink_itemtype"];
$items_id = $_POST["tolink_items"];
$macAdresses = $_POST["mactoimport"];
$itemsDescription = (isset($_POST["itemsdescription"]) ? $_POST["itemsdescription"] : array());
$ocsItemstypes = (isset($_POST["ocsitemstype"]) ? $_POST["ocsitemstype"] : array());
$itemsDescription = (isset($_POST["itemsdescription"]) ? $_POST["itemsdescription"] : []);
$ocsItemstypes = (isset($_POST["ocsitemstype"]) ? $_POST["ocsitemstype"] : []);

$ip->linkIpDiscover($_SESSION["plugin_ocsinventoryng_ocsservers_id"], $itemtypes, $items_id, $macAdresses, $ocsItemstypes, $itemsDescription, $_POST["subnet"], 0);
}
Expand Down Expand Up @@ -287,4 +287,4 @@

}

Html::footer();
Html::footer();
6 changes: 3 additions & 3 deletions front/ipdiscover.modifynetwork.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@
if (isset($_POST["ip"])) {

$ipAdress = $_POST["ip"];
$values = array();
$values = [];
if (isset($_POST["subnetName"]) && isset($_POST["subnetChoice"]) && isset($_POST["SubnetMask"])) {
$values = array("subnetName" => $_POST["subnetName"], "subnetChoice" => $_POST["subnetChoice"], "subnetMask" => $_POST["SubnetMask"]);
$values = ["subnetName" => $_POST["subnetName"], "subnetChoice" => $_POST["subnetChoice"], "subnetMask" => $_POST["SubnetMask"]];
}
$ip->modifyNetworkForm($ipAdress, $values);
}

Html::footer();
Html::footer();
4 changes: 2 additions & 2 deletions front/ipdiscover.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
|| isset($_SESSION["subnets"])
) {
$sN = "";
$networksDetail = array();
$networksDetail = [];
$ocsServerId = $_SESSION["plugin_ocsinventoryng_ocsservers_id"];
$tab = $_SESSION["subnets"];
$subnets = $ip->getSubnets($ocsServerId);
Expand Down Expand Up @@ -84,4 +84,4 @@
}
}

Html::footer();
Html::footer();
4 changes: 2 additions & 2 deletions front/logs.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
-------------------------------------------------------------------------
LICENSE
This file is part of ocsinventoryng.
ocsinventoryng is free software; you can redistribute it and/or modify
Expand All @@ -36,4 +36,4 @@
$thread = new PluginOcsinventoryngThread();
$thread->showErrorLog();

Html::footer();
Html::footer();
2 changes: 1 addition & 1 deletion front/networkport.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
-------------------------------------------------------------------------
LICENSE
This file is part of ocsinventoryng.
ocsinventoryng is free software; you can redistribute it and/or modify
Expand Down
4 changes: 2 additions & 2 deletions front/networkporttype.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
-------------------------------------------------------------------------
LICENSE
This file is part of ocsinventoryng.
ocsinventoryng is free software; you can redistribute it and/or modify
Expand All @@ -30,4 +30,4 @@
include('../../../inc/includes.php');

$dropdown = new PluginOcsinventoryngNetworkPortType();
include(GLPI_ROOT . "/front/dropdown.common.form.php");
include(GLPI_ROOT . "/front/dropdown.common.form.php");
2 changes: 1 addition & 1 deletion front/networkporttype.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
-------------------------------------------------------------------------
LICENSE
This file is part of ocsinventoryng.
ocsinventoryng is free software; you can redistribute it and/or modify
Expand Down
4 changes: 2 additions & 2 deletions front/notimportedcomputer.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
-------------------------------------------------------------------------
LICENSE
This file is part of ocsinventoryng.
ocsinventoryng is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -52,4 +52,4 @@
}
}

include(GLPI_ROOT . "/front/dropdown.common.form.php");
include(GLPI_ROOT . "/front/dropdown.common.form.php");
4 changes: 2 additions & 2 deletions front/notimportedcomputer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
-------------------------------------------------------------------------
LICENSE
This file is part of ocsinventoryng.
ocsinventoryng is free software; you can redistribute it and/or modify
Expand All @@ -35,4 +35,4 @@

Search::show('PluginOcsinventoryngNotimportedcomputer');

Html::footer();
Html::footer();
4 changes: 2 additions & 2 deletions front/ocslink.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
-------------------------------------------------------------------------
LICENSE
This file is part of ocsinventoryng.
ocsinventoryng is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -58,4 +58,4 @@
}
} else {
Html::displayErrorAndDie("lost");
}
}
4 changes: 2 additions & 2 deletions front/ocsng.clean.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
-------------------------------------------------------------------------
LICENSE
This file is part of ocsinventoryng.
ocsinventoryng is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -57,4 +57,4 @@
}
}

Html::footer();
Html::footer();
4 changes: 2 additions & 2 deletions front/ocsng.import.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
-------------------------------------------------------------------------
LICENSE
This file is part of ocsinventoryng.
ocsinventoryng is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -133,4 +133,4 @@
Html::redirect($_SERVER['PHP_SELF']);
}

Html::footer();
Html::footer();
Loading

0 comments on commit da9ccd3

Please sign in to comment.