classes/Collections/Elements.php
protected function mergeExtra(&$el, $key, $data, $prefix = null)
    {
        // Don't add extra if this in the 1st or 2nd depth (which means there is a prefix)
        // and there is no node for the children.  This prevents a FIELD named "label" to be
        // treated as the the label for it's section.
        $skip = $prefix && empty($data['sections']) && empty($data['fields']);

        // Fields
        if (isset($data['label']) && $data['label'] === false) {
            $el[$prefix.'label'] = false;
        } else {
            $el[$prefix.'label'] = empty($data['label']) || $skip ? Utils\Text::titleFromKey($key) : $data['label'];
        }
        $el[$prefix.'help'] = empty($data['help']) || $skip ? null : $data['help'];

        // Used by radio, select, and checkboxes types
        $el[$prefix.'options'] = empty($data['options']) || $skip ? null : $data['options'];

        // Used by belongs to but maybe others in the future
        $el[$prefix.'class'] = empty($data['class']) || $skip ? null : $data['class'];

        // Used by videoEncoder
        $el[$prefix.'preset'] = empty($data['preset']) || $skip ? null : $data['preset'];
    }
protected function mergeExtra(&$el, $key, $data, $prefix = null)
    {
        // Don't add extra if this in the 1st or 2nd depth (which means there is a prefix)
        // and there is no node for the children.  This prevents a FIELD named "label" to be
        // treated as the the label for it's section.
        $skip = $prefix && empty($data['sections']) && empty($data['fields']);

        // Fields
        if (isset($data['label']) && $data['label'] === false) {
            $el[$prefix.'label'] = false;
        } else {
            $el[$prefix.'label'] = empty($data['label']) || $skip ? Utils\Text::titleFromKey($key) : $data['label'];
        }
        $el[$prefix.'help'] = empty($data['help']) || $skip ? null : $data['help'];

        // Used by radio, select, and checkboxes types
        $el[$prefix.'options'] = empty($data['options']) || $skip ? null : $data['options'];

        // Used by belongs to but maybe others in the future
        $el[$prefix.'class'] = empty($data['class']) || $skip ? null : $data['class'];

        // Used by videoEncoder
        $el[$prefix.'preset'] = empty($data['preset']) || $skip ? null : $data['preset'];
    }
protected function mergeExtra ( & $ el , $ key , $ data , $ prefix = null ) { // Don't add extra if this in the 1st or 2nd depth (which means there is a prefix) // and there is no node for the children.  This prevents a FIELD named "label" to be // treated as the the label for it's section. $ skip = $ prefix && empty ( $ data [ 'sections' ] ) && empty ( $ data [ 'fields' ] ) ; // Fields if ( isset ( $ data [ 'label' ] ) && $ data [ 'label' ] === false ) { $ el [ $ prefix . 'label' ] = false ; } else { $ el [ $ prefix . 'label' ] = empty ( $ data [ 'label' ] ) || $ skip ? Utils \ Text :: titleFromKey ( $ key ) : $ data [ 'label' ] ; } $ el [ $ prefix . 'help' ] = empty ( $ data [ 'help' ] ) || $ skip ? null : $ data [ 'help' ] ; // Used by radio, select, and checkboxes types $ el [ $ prefix . 'options' ] = empty ( $ data [ 'options' ] ) || $ skip ? null : $ data [ 'options' ] ; // Used by belongs to but maybe others in the future $ el [ $ prefix . 'class' ] = empty ( $ data [ 'class' ] ) || $ skip ? null : $ data [ 'class' ] ; // Used by videoEncoder $ el [ $ prefix . 'preset' ] = empty ( $ data [ 'preset' ] ) || $ skip ? null : $ data [ 'preset' ] ; }
Add label and help to the element data for one of the levels

@param array  $el     The element data that is being merged into, passed by reference
@param mixed  $data   The data for a level in the Elements YAML config
@param string $prefix A prefix to append to the beginning of the key being set on $el
Add label and help to the element data for one of the levels