Build current fields

@return void
187544
protected function buildFields()
    {
        $this->debug->groupCollapsed(__METHOD__);
        $status = &$this->status;
        $persist = $this->persist;
        $pageI = $this->persist->get('i');
        $submitFieldCount = 0;
        $keys = \array_keys($this->currentFields);
        foreach ($keys as $k) {
            $field = $this->currentFields[$k];
            unset($this->currentFields[$k]);
            if (!\is_object($field)) {
                $field = $this->buildField($field, $k);
            }
            $field->pageI = $pageI;
            if ($field->attribs['type'] == 'newPage') {
                $this->debug->info('possible new page', $field->attribs['value']);
                if ($field->isRequired()) {
                    $this->debug->log('adding new page', $field->attribs['value']);
                    $status['additionalPages'][] = $field;
                }
                continue;
            } elseif ($field->attribs['type'] == 'submit') {
                $submitFieldCount++;
            } elseif ($field->attribs['type'] == 'file') {
                $status['multipart'] = true;
            }
            $k = \is_int($k)
                ? $field->attribs['name']
                : $k;
            $this->currentFields[$k] = $field;
        }
        if ($submitFieldCount < 1) {
            $this->debug->info('submit field not set');
            $fieldArray = array(
                'type'  => 'submit',
                'label' => ( !empty($status['additionalPages']) || $persist->pageCount() > $persist->pageCount(true)+1 )
                            ? 'Continue'
                            : 'Submit',
                'attribs' => array('class' => array('btn btn-primary', 'replace')),
                'tagOnly' => true,
            );
            $this->currentFields['submit'] = $this->fieldFactory->build($fieldArray);
            $this->debug->log('array_keys(currentFields)', \array_keys($this->currentFields));
        }
        if ($status['multipart']) {
            $this->debug->log('<a target="_blank" href="http://www.php.net/manual/en/ini.php">post_max_size</a> = '.Str::getBytes(\ini_get('post_max_size')));
            $this->debug->log('<a target="_blank" href="http://www.php.net/manual/en/ini.php">upload_max_filesize</a> = '.Str::getBytes(\ini_get('upload_max_filesize')));
        }
        $this->debug->groupEnd();
    }
789294
private function buildHiddenFields()
    {
        $this->debug->groupCollapsed(__METHOD__);
        $cfg = $this->form->cfg;
        $printOpts = &$cfg['output'];
        $hiddenFields = '';
        if ($printOpts['inputKey']) {   //  && $cfg['persist_method'] != 'none'
            $hiddenFields .= '<input type="hidden" name="_key_" value="'.\htmlspecialchars($this->keyValue).'" />';
        }
        if (\strtolower($cfg['attribs']['method']) == 'get') {
            $this->debug->warn('get method');
            $urlParts = \parse_url(\html_entity_decode($cfg['attribs']['action']));
            // $attribs['action'] = $urlParts['path'];
            if (!empty($urlParts['query'])) {
                \parse_str($urlParts['query'], $params);
                $fieldNames = array();
                foreach ($this->form->currentFields as $field) {
                    $fieldNames[] = $field->attribs['name'];
                }
                foreach ($params as $k => $v) {
                    if (\in_array($k, $fieldNames)) {
                        continue;
                    }
                    $hiddenFields .= '<input type="hidden" name="'.\htmlspecialchars($k).'" value="'.\htmlspecialchars($v).'" />'."\n";
                }
            }
        }
        $this->debug->log('hiddenFields', $hiddenFields);
        $this->debug->groupEnd();
        return $hiddenFields;
    }
1013075
public function build()
    {
        $this->classMetadata->mergeExtension($this->getExtensionName(), [
            $this->key => $this->fieldName,
        ]);
    }
33387
public function build()
    {
        if ($this->builded) {
            return;
        }

        $collection = $this->processFilter(false);

        $data = $collection->toArray();

        $this->prependRowSelectorColumn();
        $this->appendActionsColumn();

        Column::setOriginalGridModels($collection);

        $this->columns->map(function (Column $column) use (&$data) {
            $data = $column->fill($data);

            $this->columnNames[] = $column->getName();
        });

        $this->buildRows($data);

        $this->builded = true;
    }
903878
protected function _mainFields()
    {
        $fields = $this->getConfig('mainTableFields');

        if ($fields) {
            return $fields;
        }

        $table = $this->_table;
        $fields = $table->getSchema()->columns();

        $this->setConfig('mainTableFields', $fields);

        return $fields;
    }
261059
protected function setup_fields() {
		foreach ( $this->prop( 'fields' ) as $args ) {
			$field = $this->builder
				->get_field( $args, $this )
				->set_option( 'context', $this->args( 'context' ) )
				->initialize();

			if ( ! $field->check_capabilities() ) {
				continue;
			}

			if ( 'hidden' === $args['type'] ) {
				$this->builder->add_hidden_field( $args, $this );
				continue;
			}

			$this->fields[ $field->get_id() ] = $field;
		}
	}
407367
public function setCurrentParams()
    {
        $this->_current['plugin'] = $this->Controller->request->params['plugin'];
        $this->_current['controller'] = $this->Controller->request->params['controller'];
        $this->_current['action'] = $this->Controller->request->params['action'];

        return $this->_current;
    }
1037656
public void setupFields()
    {
        FieldInfo field = null;
        field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_UPDATE_DATE, 25, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, START_ANNIV_DATE, 25, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, END_ANNIV_DATE, 25, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, UPDATE_DAYS, 10, null, new Integer(1));
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, ANNIV_BACK_DAYS, 10, null, new Integer(0));
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, ANNIVERSARY_DAYS, 10, null, new Integer(60));
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, ANNIVERSARY_CATEGORY_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, APPOINTMENT_CATEGORY_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
    }
294989
public function build()
    {
        parent::build();

        $options = $this->suppliedOptions;

        $model        = $this->config->getDataModel();
        $relationship = $model->{$options['field_name']}();
        $relatedModel = $relationship->getRelated();

        $options['table']       = $relationship->getTable();
        $options['column']      = $relationship->getQualifiedForeignPivotKeyName();
        $options['column2']     = $relationship->getQualifiedRelatedPivotKeyName();
        $options['foreign_key'] = $relatedModel->getKeyName();

        $this->suppliedOptions = $options;
    }
937470
function addField( $attributes ) {
		if( isset( $attributes['NAME'] ) ) {
			$name = $attributes['NAME'];
		} else {
			$name = count($this->data[$this->row]);
		}

		// Set the field index so we know where we are
		$this->current_field = $this->FieldID( $name );
	}
197588
private function buildFields()
    {
        $fields = array_map(function($field) {
            return ($field instanceof Builder) ? $field->build() : $field;
        }, $this->getFields());

        return $this->transformFields($fields);
    }
502035
public function getActualFields()
    {
        if ($this->actual_fields === false) {
            $this->actual_fields = $this->getGroupField();
        }

        return $this->actual_fields;
    }
68454
public void setupFields()
    {
        FieldInfo field = null;
        field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field.setHidden(true);
        field = new FieldInfo(this, FIELD_NAME, 40, null, null);
        field = new FieldInfo(this, FIELD_CLASS, 40, null, null);
        field = new FieldInfo(this, BASE_FIELD_NAME, 40, null, null);
        field = new FieldInfo(this, DEPENDENT_FIELD_NAME, 40, null, null);
        field = new FieldInfo(this, MINIMUM_LENGTH, 4, null, null);
        field.setDataClass(Short.class);
        field = new FieldInfo(this, MAXIMUM_LENGTH, 5, null, null);
        field.setDataClass(Short.class);
        field = new FieldInfo(this, DEFAULT_VALUE, 50, null, null);
        field = new FieldInfo(this, INITIAL_VALUE, 50, null, null);
        field = new FieldInfo(this, FIELD_DESCRIPTION, 100, null, null);
        field = new FieldInfo(this, FIELD_DESC_VERTICAL, 14, null, null);
        field = new FieldInfo(this, FIELD_TYPE, 1, null, null);
        field = new FieldInfo(this, FIELD_DIMENSION, 3, null, null);
        field.setDataClass(Short.class);
        field = new FieldInfo(this, FIELD_FILE_NAME, 40, null, null);
        field = new FieldInfo(this, FIELD_SEQ_NO, 4, null, null);
        field.setDataClass(Short.class);
        field = new FieldInfo(this, FIELD_NOT_NULL, 1, null, null);
        field.setDataClass(Boolean.class);
        //field = new FieldInfo(this, DATA_CLASS, 20, null, null);
        field = new FieldInfo(this, HIDDEN, 10, null, null);
        field.setDataClass(Boolean.class);
        field = new FieldInfo(this, INCLUDE_SCOPE, 10, null, new Integer(0x004));
        field.setDataClass(Integer.class);
    }
301445
public void setupFields()
    {
        FieldInfo field = null;
        field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field.setHidden(true);
        field = new FieldInfo(this, NAME, 30, null, null);
        field = new FieldInfo(this, DESCRIPTION, 40, null, null);
        field = new FieldInfo(this, SHORT_DESC, 128, null, null);
        field = new FieldInfo(this, TITLE, 40, null, null);
        field = new FieldInfo(this, ICON, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field = new FieldInfo(this, FILE_LOCATION, 255, null, null);
    }
648519
public function build()
    {

        $query_params = [];

        $query_params["query"] = $this->q;

        if($this->boost > 1) {
            $query_params["boost"] = $this->boost;
        }

        if(count($this->fields)){
            $query_params["fields"] = $this->fields;
        }

        $this->query->must[] = [
            "query_string" => $query_params
        ];
    }
1126606
public function renderFields()
    {
        // Save fields in DB
        $this->saveFields();

        // Get contents
        $pageCurrent = $this->currentPage;
        $sectionCurrent = $this->currentSection;
        $formFields = $this->fields;
        $contentOptions = $this->options;

        // Get links
        $u_link = 'page='.$pageCurrent;
        $u_section = !empty($sectionCurrent) ? '&section='.$sectionCurrent : '';

        // Work on vars
        $vars = [
            'title'         => $contentOptions['title'],
            'description'   => $contentOptions['description'],
            'submit'        => $contentOptions['submit'],

            // Texts and URLs
            't_submit'      => Translate::t('adminpage.submit'),
            'u_link'        => $u_link,
            'u_action'      => admin_url('admin.php?'.$u_link.$u_section),
        ];

        // Display sections
        if (!empty($contentOptions['sections']) && is_array($contentOptions['sections'])) {
            foreach ($contentOptions['sections'] as $slug => $opts) {
                // Update option
                $opts['slug'] = $slug;
                $opts['u_link'] = admin_url('admin.php?'.$u_link.'&section='.$slug);

                // Update vars
                $vars['sections'][] = $opts;

                if ($slug !== $sectionCurrent) {
                    continue;
                }

                // Update vars
                $vars['submit'] = $opts['submit'];
            }
        }

        // Work on current vars
        $vars['c_page'] = $pageCurrent;
        $vars['c_section'] = $sectionCurrent;

        // Display fields
        if (!empty($formFields)) {
            foreach ($formFields as $field) {
                if (!$field) {
                    continue;
                }

                $vars['fields'][] = $field->render([], [
                    'template' => 'adminpage',
                ], false);
            }
        }

        // Render view
        Render::view('adminpage.html.twig', $vars, 'adminpage');
    }
669467
public function build()
    {
        $this->classMetadata->appendExtension(UploadableDriver::EXTENSION_NAME, [
            $this->type => $this->fieldName,
        ]);
    }