/** * Get all checkboxes * @return string */ private function getCheckboxes() { $Checkboxes = ''; foreach ($this->checkboxes as $key => $label) { $value = isset($this->value[$key]) && $this->value[$key] == 'on' ? 1 : 0; $Checkbox = new FormularCheckbox($this->getNameForKey($key), $label, $value); $Checkbox->setLayout(FormularFieldset::$LAYOUT_FIELD_SMALL_INLINE); $Checkbox->addLayout(FormularFieldset::$LAYOUT_FIELD_W25); $Checkbox->setLabelToRight(); $Checkboxes .= $Checkbox->getCode(); } return $Checkboxes; }
/** * Create a field * @param \Runalyze\Configuration\Handle $Handle * @param string $label * @return \FormularField */ private function createFieldFor(Handle $Handle, $label) { $Parameter = $Handle->object(); $Class = 'FormularInput'; if ($Parameter instanceof SelectRow) { $Field = new \FormularSelectDb($Handle->key(), $label, $Handle->value()); $Field->loadOptionsFrom($Parameter->table(), $Parameter->column()); return $Field; } elseif ($Parameter instanceof Select) { $Field = new \FormularSelectBox($Handle->key(), $label, $Handle->value()); $Field->setOptions($Parameter->options()); return $Field; } elseif ($Parameter instanceof Boolean) { $Field = new \FormularCheckbox($Handle->key(), $label, $Handle->value()); $Field->addHiddenSentValue(); return $Field; } return new $Class($Handle->key(), $label, $Handle->object()->valueAsString()); }
/** * Add field: send to multi editor */ private function addFieldSendToMultiEditor() { $Label = Ajax::tooltip(__('Send to multi editor'), sprintf(__('Our multi editor is limited to a maximum of %d activities.'), SearchResults::MAX_LIMIT_FOR_MULTI_EDITOR), 'atRight'); $Field = new FormularCheckbox('send-to-multi-editor', $Label); $Field->setLayout(FormularFieldset::$LAYOUT_FIELD_W33); $this->Fieldset->addField($Field); }
/** * Add fields for jack daniels */ protected function addFieldsForJackDaniels() { $FieldVdot = new FormularInput('vdot', __('New VDOT')); $FieldVdot->setLayout(FormularFieldset::$LAYOUT_FIELD_W50_AS_W100); $FieldVdot->addCSSclass('hide-on-model-change'); $FieldVdot->addCSSclass('only-jack-daniels'); $FieldEndurance = new FormularCheckbox('endurance', __('Use Basic Endurance')); $FieldEndurance->setLayout(FormularFieldset::$LAYOUT_FIELD_W50); $FieldEndurance->addCSSclass('hide-on-model-change'); $FieldEndurance->addCSSclass('only-jack-daniels'); $FieldEnduranceValue = new FormularInput('endurance-value', __('Basic Endurance')); $FieldEnduranceValue->setLayout(FormularFieldset::$LAYOUT_FIELD_W50); $FieldEnduranceValue->addCSSclass('hide-on-model-change'); $FieldEnduranceValue->addCSSclass('only-jack-daniels'); $FieldEnduranceValue->setUnit(FormularUnit::$PERCENT); $this->FieldsetInput->addField($FieldVdot); $this->FieldsetInput->addField($FieldEnduranceValue); $this->FieldsetInput->addField($FieldEndurance); }
/** * Get config code * @return string */ private function getConfigCode() { $Input = new FormularCheckbox('multi-edit', __('Show multi editor afterwards'), true); $Input->setLayout(FormularFieldset::$LAYOUT_FIELD_W100); return $Input->getCode(); }
/** * Get single checkbox for one clothes * @param array $dataArray * @return string */ private static function Checkbox($dataArray) { $name = 'clothes[' . $dataArray['id'] . ']'; $label = $dataArray['short']; $Checkbox = new FormularCheckbox($name, $label); $Checkbox->setLayout(FormularFieldset::$LAYOUT_FIELD_SMALL_INLINE); $Checkbox->addLayout('margin-5'); return $Checkbox->getCode(); }