- Added function isEmptyString to fhc_helper

- Added function isEmptyArray to fhc_helper
- Adapted the code in application/* to use as much as possible this two new functions
- Removed the php function empty almost everywhere
This commit is contained in:
Paolo
2018-06-27 15:06:04 +02:00
parent d04b0450da
commit 25e66bf9dd
23 changed files with 214 additions and 200 deletions
+5 -4
View File
@@ -63,7 +63,8 @@ class UDFLib
*/
public function UDFWidget($args, $htmlArgs = array())
{
if (!empty($args[UDFLib::SCHEMA_ARG_NAME]) && !empty($args[UDFLib::TABLE_ARG_NAME]))
if ((isset($args[UDFLib::SCHEMA_ARG_NAME]) && !isEmptyString($args[UDFLib::SCHEMA_ARG_NAME]))
&& (isset($args[UDFLib::TABLE_ARG_NAME]) && !isEmptyString($args[UDFLib::TABLE_ARG_NAME])))
{
// Loads the widget library
$this->_ci->load->library('WidgetLib');
@@ -72,7 +73,7 @@ class UDFLib
loadResource(APPPATH.'widgets/udf');
// Default external block is true
if (empty($args[UDFLib::FIELD_ARG_NAME]) && !isset($htmlArgs[HTMLWidget::EXTERNAL_BLOCK]))
if (!isset($args[UDFLib::FIELD_ARG_NAME]) && !isset($htmlArgs[HTMLWidget::EXTERNAL_BLOCK]))
{
$htmlArgs[HTMLWidget::EXTERNAL_BLOCK] = true;
}
@@ -85,11 +86,11 @@ class UDFLib
}
else
{
if (empty($args[UDFLib::SCHEMA_ARG_NAME]))
if (!isset($args[UDFLib::SCHEMA_ARG_NAME]) || isEmptyString($args[UDFLib::SCHEMA_ARG_NAME]))
{
show_error(UDFLib::SCHEMA_ARG_NAME.' parameter is missing!');
}
if (empty($args[UDFLib::TABLE_ARG_NAME]))
if (!isset($args[UDFLib::TABLE_ARG_NAME]) || isEmptyString($args[UDFLib::TABLE_ARG_NAME]))
{
show_error(UDFLib::TABLE_ARG_NAME.' parameter is missing!');
}