Skip to content
Snippets Groups Projects
Commit 3928185f authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

Merge branch '5640-detailpages-project-phase' into 'master'

remove array_key_exists()

See merge request !29
parents 9c7d26b1 bb3e393d
No related branches found
No related tags found
1 merge request!29remove array_key_exists()
Pipeline #823 passed
...@@ -20,7 +20,7 @@ require_once("./classes/config-replacement.class.php"); ...@@ -20,7 +20,7 @@ require_once("./classes/config-replacement.class.php");
$oPrj = new project($aParams["prj"]); $oPrj = new project($aParams["prj"]);
$sOut = ''; $sOut = '';
if (array_key_exists("par3", $aParams)) { if (isset($aParams["par3"])) {
$sPhase = $aParams["par3"]; $sPhase = $aParams["par3"];
} }
...@@ -76,7 +76,7 @@ if ($sPhase) { ...@@ -76,7 +76,7 @@ if ($sPhase) {
foreach ($aReplacements as $sFile => $aFields) { foreach ($aReplacements as $sFile => $aFields) {
$tTplFile = basename($sFile); $tTplFile = basename($sFile);
$bFileInForeman = $aReplacementsForeman && array_key_exists($tTplFile, $aReplacementsForeman); $bFileInForeman = $aReplacementsForeman && isset($aReplacementsForeman[$tTplFile]);
$sDivIdFile='div4file-'.md5($sFile); $sDivIdFile='div4file-'.md5($sFile);
$sOutReplace.='<h4>' . $sOutReplace.='<h4>' .
...@@ -90,7 +90,7 @@ if ($sPhase) { ...@@ -90,7 +90,7 @@ if ($sPhase) {
; ;
// --- check: does this file in foreman exist? // --- check: does this file in foreman exist?
if (!array_key_exists($tTplFile, $aReplacementsForeman)){ if (!isset($aReplacementsForeman[$tTplFile])){
if ($aReplacementsForeman){ if ($aReplacementsForeman){
$sOutReplace.=$oHtml->getBox('error', t('foreman-error-template-unknown')); $sOutReplace.=$oHtml->getBox('error', t('foreman-error-template-unknown'));
$aWarnings[]=$tTplFile.': '.t('foreman-error-template-unknown'); $aWarnings[]=$tTplFile.': '.t('foreman-error-template-unknown');
...@@ -101,7 +101,7 @@ if ($sPhase) { ...@@ -101,7 +101,7 @@ if ($sPhase) {
// --- check: target file was set? // --- check: target file was set?
$aTable=array('header'=>array(), 'body'=>array()); $aTable=array('header'=>array(), 'body'=>array());
if ($bFileInForeman){ if ($bFileInForeman){
if ($aReplacementsForeman && array_key_exists('target', $aReplacementsForeman[$tTplFile])){ if ($aReplacementsForeman && isset($aReplacementsForeman[$tTplFile]['target'])){
$sTd='<strong>'.$oHtml->getIcon('file-target') . $aReplacementsForeman[$tTplFile]['target'].'</strong>'; $sTd='<strong>'.$oHtml->getIcon('file-target') . $aReplacementsForeman[$tTplFile]['target'].'</strong>';
} else { } else {
if ($bFileInForeman){ if ($bFileInForeman){
...@@ -121,7 +121,7 @@ if ($sPhase) { ...@@ -121,7 +121,7 @@ if ($sPhase) {
// and check if they exist in foreman // and check if they exist in foreman
if (count($aFields)) { if (count($aFields)) {
foreach ($aFields as $sField){ foreach ($aFields as $sField){
if ($aReplacementsForeman && array_key_exists($sField, $aReplacementsForeman[$tTplFile]['replace'])){ if ($aReplacementsForeman && isset($aReplacementsForeman[$tTplFile]['replace'][$sField])){
$sTd=$aReplacementsForeman[$tTplFile]['replace'][$sField]; $sTd=$aReplacementsForeman[$tTplFile]['replace'][$sField];
} else { } else {
if ($bFileInForeman){ if ($bFileInForeman){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment