Adds an input element to the complete form

@param stdClass $item
@param mod_feedback_complete_form $form
427154
public function complete_form_element($item, $form) {
        $form->add_form_element($item,
            ['static',
                $item->typ.'_'.$item->id,
                '',
                html_writer::empty_tag('hr', ['class' => 'feedback_pagebreak', 'id' => 'feedback_item_' . $item->id])
            ]);
    }
1355322
protected function append(array $item)
    {
        if (!$this->isEnabled()) {
            $this->enable();
        }

        $this->getContainer()->append($item);
    }
1210983
public function add(Item $item){
    if(count($this->list) == 100){
      throw new OverflowException('This list is filled');
    }
    $this->list[] = $item;
  }
1273279
protected function addFormElements(\Zend_Form $form)
    {
        $this->saveLabel = $this->_('Save Two Factor Setup');

        $this->authenticator->addSetupFormElements($form, $this->user, $this->formData);

        if ($this->user->canSaveTwoFactorKey()) {
            $options = [
                'label' => $this->_('Enabled'),
                ];

            $keyElement = $form->createElement('Checkbox', 'twoFactorEnabled', $options);
            $form->addElement($keyElement);
        }
    }
654394
public function updateEditForm($form)
    {
        if ($doadd = Config::inst()->get('ModelAdmin', 'addbetterimporters')) {
            $modelclass = $this->owner->modelClass;
            $grid = $form->Fields()->fieldByName($modelclass);
            $config =  $grid->getConfig();

            //don't proceed if there is already an importer
            if ($config->getComponentByType("GridFieldImporter")) {
                return;
            }
            //don't proceed if can't create
            if (!singleton($modelclass)->canCreate(Member::currentUser())) {
                return;
            }
            //allow config to avoid adding when there are existing importers
            $importerClasses = $this->owner->stat('model_importers');
            if (
                $doadd === "scaffolded" &&
                !is_null($importerClasses) &&
                isset($importerClasses[$modelclass])
            ) {
                return;
            }
            
            //add the component
            $config->addComponent(new GridFieldImporter('before'));
        }
    }
1016651
public function add($item)
    {
        if (is_array($item)) {
            return array_map([$this, 'add'], $item);
        }

        if (! $item | strlen(trim($item)) === 0) {
            return false;
        }

        $this->collection[] = trim(strip_tags($item));
    }
279668
public function add_ref($item, $id) {
        $this->validate_item($item);
        $this->refs[$item][$id] = true;
    }
988088
public function add_item( $item ) {
		if ( is_array( $item ) ) {
			foreach ( $item as $single_item ) {
				$this->add_item( $single_item );
			}
		} else {
			$priority                   = $item->get_priority();
			$this->items[ $priority ][] = $item;
		}
	}
188701
public function addItem(Item $item)
    {
        $itemUUID = $item->composeUUID();

        $this->elementsToUpdate[$itemUUID] = $item;
        unset($this->elementsToDelete[$itemUUID]);
    }
38545
public function writeItem($item)
    {
        $this->verifyHandle();

        if ($this->autoDetectHeader && !$this->header && is_array($item)) {
            $this->header = array_keys($item);
            $this->writeItem($this->header);
        }

        $this->csv->insertOne($item);
    }
1113113
public function add(Item $item)
    {
        foreach ($this->filters as $filter) {
            $this->applyFilter($filter, $item);
        }

        $this->items[] = $item;

        return $this;
    }
1142233
public function add_mform_elements(&$mform) {
        if (empty($this->type)) {
            return;
        }

        $mform->addElement('hidden', 'gpr_type', $this->type);
        $mform->setType('gpr_type', PARAM_SAFEDIR);

        if (!empty($this->plugin)) {
            $mform->addElement('hidden', 'gpr_plugin', $this->plugin);
            $mform->setType('gpr_plugin', PARAM_PLUGIN);
        }

        if (!empty($this->courseid)) {
            $mform->addElement('hidden', 'gpr_courseid', $this->courseid);
            $mform->setType('gpr_courseid', PARAM_INT);
        }

        if (!empty($this->userid)) {
            $mform->addElement('hidden', 'gpr_userid', $this->userid);
            $mform->setType('gpr_userid', PARAM_INT);
        }

        if (!empty($this->groupid)) {
            $mform->addElement('hidden', 'gpr_groupid', $this->groupid);
            $mform->setType('gpr_groupid', PARAM_INT);
        }

        if (!empty($this->page)) {
            $mform->addElement('hidden', 'gpr_page', $this->page);
            $mform->setType('gpr_page', PARAM_INT);
        }
    }
966755
private function printItem($item)
    {
        $htmlOptions = ['class' => 'dd-item'];
        $htmlOptions['data-id'] = !empty($item['id']) ? $item['id'] : '';

        echo Html::beginTag('li', $htmlOptions);

        echo Html::tag('div', '', ['class' => 'dd-handle']);
        echo Html::tag('div', $item['name'], ['class' => 'dd-content']);

        echo Html::beginTag('div', ['class' => 'dd-edit-panel']);
        echo Html::input('text', null, $item['name'],
            ['class' => 'dd-input-name', 'placeholder' => $this->getPlaceholderForName()]);

        echo Html::beginTag('div', ['class' => 'btn-group']);
        echo Html::button(Yii::t('voskobovich/nestedsets', 'Save'), [
            'data-action' => 'save',
            'class' => 'btn btn-success btn-sm',
        ]);
        echo Html::a(Yii::t('voskobovich/nestedsets', 'Advanced editing'), $item['update-url'], [
            'data-action' => 'advanced-editing',
            'class' => 'btn btn-default btn-sm',
            'target' => '_blank'
        ]);
        echo Html::button(Yii::t('voskobovich/nestedsets', 'Delete'), [
            'data-action' => 'delete',
            'class' => 'btn btn-danger btn-sm'
        ]);
        echo Html::endTag('div');

        echo Html::endTag('div');

        if (isset($item['children']) && count($item['children'])) {
            $this->printLevel($item['children']);
        }

        echo Html::endTag('li');
    }
506678
protected function addChildrenField($form)
    {
        $form->add(
            'children',
            CollectionType::class,
            [
                'entry_type'   => self::class,
                'required'     => false,
                'allow_add'    => true,
                'allow_delete' => true,
                'prototype'    => true,
                'by_reference' => false,
            ]
        );
    }
621435
protected function addSingleSelecterElementToForm(Form $form, Property $property) {
		if ($this->toOneElement == $this::REF_ONE_ELEMENT_SELECT) {
			$element = new Select($property->getName());
		} else {
			$element = new Radio($property->getName());
		}
		
		$options = [0 => '-none-'] + $this->getValueOptionsFromEntity($property->getTargetEntity());
		$element->setValueOptions($options);
		
		$element->setLabel($property->getName());
		$form->add($element);
	}
245030
public static function processAcmComposite(&$element, FormStateInterface $form_state, &$complete_form) {
    if ($element['#form_mode'] === FALSE) {
      // Form-mode is off, so show the display value instead.
      $display_value = !empty($element['#display_value']) ? $element['#display_value'] : $element['#default_value'];
      $element['display_value'] = [
        '#prefix' => '<div class="form-item-display-value">',
        '#plain_text' => $display_value,
        '#suffix' => '</div>',
      ];
    }
    else {
      // Form-mode is on, so build a field for it.
      $element['form_value'] = [
        '#type' => $element['#field_type'],
      ];
      if (isset($element['#default_value'])) {
        $element['form_value']['#default_value'] = $element['#default_value'];
      }
      if (isset($element['#required'])) {
        $element['form_value']['#required'] = $element['#required'];
      }
      if (isset($element['#placeholder'])) {
        $element['form_value']['#placeholder'] = $element['#placeholder'];
      }
      if (isset($element['#options'])) {
        $element['form_value']['#options'] = $element['#options'];
      }
      if (isset($element['#empty_option'])) {
        $element['form_value']['#empty_option'] = $element['#empty_option'];
      }

      // Set #parents to the original element so that we get a flat value
      // in $form_state->getValues().
      $element['form_value']['#parents'] = $element['#parents'];
    }

    if (!empty($element['#buttons'])) {
      // Set #parents to the original element so that we get a flat value
      // in $form_state->getValues().
      $element['actions'] = [
        '#type' => 'actions',
        '#parents' => $element['#parents'],
      ];
      foreach ($element['#buttons'] as $name => &$button) {
        $button['#parents'] = $element['#parents'];
        $element['actions'][$name] = $button;
      }
    }

    return $element;
  }
124621
protected function add_item_label($item, $element) {
        if (strlen($item->label) && ($this->mode == self::MODE_EDIT || $this->mode == self::MODE_VIEW_TEMPLATE)) {
            $name = $element->getLabel();
            $name = '('.format_string($item->label).') '.$name;
            $element->setLabel($name);
        }
    }