From: skodak Date: Wed, 13 Dec 2006 20:32:13 +0000 (+0000) Subject: data preset coding style fixes X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=63efcb8c722d95fc1bb24f42c3eef52cae4f7352;p=moodle.git data preset coding style fixes --- diff --git a/mod/data/preset.php b/mod/data/preset.php index 90e1aaa3ae..866f83ea17 100644 --- a/mod/data/preset.php +++ b/mod/data/preset.php @@ -591,7 +591,7 @@ class PresetImporter { echo ''; echo ''; - if ($currentfields != array() && $newfields != array()) { + if (!empty($currentfields) && !empty($newfields)) { echo "

$strfieldmappings "; helpbutton('fieldmappings', '', 'data'); echo '

'; @@ -622,7 +622,7 @@ class PresetImporter { echo '
'; echo "

$strwarning

"; } - else if ($newfields == array()) { + else if (empty($newfields)) { error("New preset has no defined fields!"); } echo ''; @@ -636,7 +636,7 @@ class PresetImporter { $preservedfields = array(); /* Maps fields and makes new ones */ - if ($newfields != array()) { + if (!empty($newfields)) { /* We require an injective mapping, and need to know what to protect */ foreach ($newfields as $nid => $newfield) { $cid = optional_param("field_$nid", -1, PARAM_INT); @@ -677,7 +677,7 @@ class PresetImporter { } /* Get rid of all old unused data */ - if ($preservedfields != array()) { + if (!empty($preservedfields)) { foreach ($currentfields as $cid => $currentfield) { if (!array_key_exists($cid, $preservedfields)) { /* Data not used anymore so wipe! */