From 3a067a9459cbe30078e04f7e02844568fa8683bb Mon Sep 17 00:00:00 2001 From: Paolo Date: Fri, 9 Feb 2018 18:20:33 +0100 Subject: [PATCH] - Better code in fhc_herper - Changed parameters in views/system/infocenter/infocenterData.php --- application/helpers/fhc_helper.php | 11 ++++++----- .../views/system/infocenter/infocenterData.php | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/application/helpers/fhc_helper.php b/application/helpers/fhc_helper.php index 7fb6d9f91..549247754 100644 --- a/application/helpers/fhc_helper.php +++ b/application/helpers/fhc_helper.php @@ -33,7 +33,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); function generateToken($length = 64) { // For PHP 7 you can use random_bytes() - if(function_exists('random_bytes')) + if (function_exists('random_bytes')) { $token = base64_encode(random_bytes($length)); //base64 is about 33% longer, so we need to truncate the result @@ -41,7 +41,7 @@ function generateToken($length = 64) } // for PHP >=5.3 and <7 - if(function_exists('openssl_random_pseudo_bytes')) + if (function_exists('openssl_random_pseudo_bytes')) { $token = base64_encode(openssl_random_pseudo_bytes($length, $strong)); // is the token strong enough? @@ -57,6 +57,7 @@ function generateToken($length = 64) //select some random characters for ($i = 0; $i < $length; $i++) $token .= $characters[mt_rand(0, $charactersLength)]; + return $token; } @@ -103,7 +104,7 @@ function loadResource($path, $resources = null, $subdir = false) { $tmpResources = array(); } - else if (!is_array($resources)) + elseif (!is_array($resources)) { $tmpResources = array($resources); } @@ -135,10 +136,10 @@ function loadResource($path, $resources = null, $subdir = false) } // Loops through the resources - foreach($tmpResources as $tmpResource) + foreach ($tmpResources as $tmpResource) { // Loops through the paths - foreach($tmpPaths as $tmpPath) + foreach ($tmpPaths as $tmpPath) { $fileName = $tmpPath.$tmpResource.'.php'; // Php extension if (file_exists($fileName)) diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php index 28b2d018e..e9371d8a7 100644 --- a/application/views/system/infocenter/infocenterData.php +++ b/application/views/system/infocenter/infocenterData.php @@ -94,8 +94,8 @@ ) ORDER BY "LastAction" DESC ', - 'hideHeader' => false, - 'hideSave' => false, + 'hideHeader' => true, + 'hideSave' => true, 'checkboxes' => array('PersonId'), 'additionalColumns' => array('Details'), 'formatRaw' => function($fieldName, $fieldValue, $datasetRaw) {