Index: branches/RC/core/kernel/db/db_tag_processor.php =================================================================== diff -u -N -r11662 -r11685 --- branches/RC/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 11662) +++ branches/RC/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 11685) @@ -2425,6 +2425,52 @@ { } + + /** + * Checks, that field is visible on edit form + * + * @param Array $params + * @return bool + */ + function FieldVisible($params) + { + $check_field = $params['field']; + $fields = $this->Application->getUnitOption($this->Prefix, 'Fields'); + $show_mode = array_key_exists('show_mode', $fields[$check_field]) ? $fields[$check_field]['show_mode'] : true; + + if ($show_mode === smDEBUG) { + return defined('DEBUG_MODE') && DEBUG_MODE; + } + + return $show_mode; + } + + /** + * Checks, that there area visible fields in given section on edit form + * + * @param Array $params + * @return bool + */ + function FieldsVisible($params) + { + if (!$params['fields']) { + return true; + } + + $fields = $this->Application->getUnitOption($this->Prefix, 'Fields'); + $check_fields = explode(',', $params['fields']); + + foreach ($check_fields as $check_field) { + // when at least one field in subsection is visible, then subsection is visible too + $show_mode = array_key_exists('show_mode', $fields[$check_field]) ? $fields[$check_field]['show_mode'] : true; + if (($show_mode === true) || (($show_mode === smDEBUG) && (defined('DEBUG_MODE') && DEBUG_MODE))) { + // field is visible + return true; + } + } + + return false; + } } ?> \ No newline at end of file