private function _getUnitSelectInput(array $aField, array $aBaseAttributes, $isKey, $bMultiLabels) { $_aUnitAttributes = $this->_getUnitAttributes($aField, $aBaseAttributes, $bMultiLabels ? $isKey : ''); $_oUnitInput = new AdminPageFramework_Input_select($_aUnitAttributes + array('select' => $_aUnitAttributes)); $_aLabels = $bMultiLabels ? $this->getElement($aField, array('units', $isKey), $aField['units']) : $aField['units']; return "<label " . $this->getAttributes(array('for' => $_aUnitAttributes['id'], 'class' => $_aUnitAttributes['disabled'] ? 'disabled' : null)) . ">" . $this->getElement($aField, $bMultiLabels ? array('before_label', $isKey, 'unit') : array('before_label', 'unit')) . $_oUnitInput->get($_aLabels) . $this->getElement($aField, $bMultiLabels ? array('after_input', $isKey, 'unit') : array('after_input', 'unit')) . "<div class='repeatable-field-buttons'></div>" . "</label>"; }
protected function getField($aField) { $_oSelectInput = new AdminPageFramework_Input_select($aField['attributes']); if ($aField['is_multiple']) { $_oSelectInput->setAttribute(array('select', 'multiple'), 'multiple'); } return $aField['before_label'] . "<div class='admin-page-framework-input-label-container admin-page-framework-select-label' style='min-width: " . $this->sanitizeLength($aField['label_min_width']) . ";'>" . "<label for='{$aField['input_id']}'>" . $aField['before_input'] . $_oSelectInput->get($aField['label']) . $aField['after_input'] . "<div class='repeatable-field-buttons'></div>" . "</label>" . "</div>" . $aField['after_label']; }
protected function getField($aField) { $_oSelectInput = new AdminPageFramework_Input_select($aField); $out = $aField['before_label'] . "<div class='admin-page-framework-input-label-container admin-page-framework-select-label' style='min-width: " . $this->sanitizeLength($aField['label_min_width']) . ";'>" . "<label for='{$aField['input_id']}'>" . $aField['before_input'] . $_oSelectInput->get() . $aField['after_input'] . "<div class='repeatable-field-buttons'></div>" . "</label>" . "</div>"; $out .= '<br/><a href="JavaScript:void(0);" id="hwss_apf_btn_up">Up</a> | <a href="JavaScript:void(0);" id="hwss_apf_btn_down">Down</a> '; $out .= $aField['after_label']; return $out; }
protected function getField($aField) { $aField['units'] = isset($aField['units']) ? $aField['units'] : $this->aDefaultUnits; $aBaseAttributes = $aField['attributes']; unset($aBaseAttributes['unit'], $aBaseAttributes['size']); $aSizeAttributes = array('type' => 'number', 'id' => $aField['input_id'] . '_' . 'size', 'name' => $aField['_input_name'] . '[size]', 'value' => isset($aField['value']['size']) ? $aField['value']['size'] : '') + $this->getFieldElementByKey($aField['attributes'], 'size', $this->aDefaultKeys['attributes']['size']) + $aBaseAttributes; $aSizeLabelAttributes = array('for' => $aSizeAttributes['id'], 'class' => $aSizeAttributes['disabled'] ? 'disabled' : null); $_bIsMultiple = $aField['is_multiple'] ? true : ($aField['attributes']['unit']['multiple'] ? true : false); $_aUnitAttributes = array('type' => 'select', 'id' => $aField['input_id'] . '_' . 'unit', 'multiple' => $_bIsMultiple ? 'multiple' : null, 'name' => $_bIsMultiple ? "{$aField['_input_name']}[unit][]" : "{$aField['_input_name']}[unit]", 'value' => isset($aField['value']['unit']) ? $aField['value']['unit'] : '') + $this->getFieldElementByKey($aField['attributes'], 'unit', $this->aDefaultKeys['attributes']['unit']) + $aBaseAttributes; $_aUnitField = array('label' => $aField['units']) + $aField; $_aUnitField['attributes']['select'] = $_aUnitAttributes; $_oUnitInput = new AdminPageFramework_Input_select($_aUnitField); return $aField['before_label'] . "<div class='admin-page-framework-input-label-container admin-page-framework-select-label' style='min-width: " . $this->sanitizeLength($aField['label_min_width']) . ";'>" . "<label " . $this->generateAttributes($aSizeLabelAttributes) . ">" . $this->getFieldElementByKey($aField['before_label'], 'size') . ($aField['label'] && !$aField['repeatable'] ? "<span class='admin-page-framework-input-label-string' style='min-width:" . $this->sanitizeLength($aField['label_min_width']) . ";'>" . $aField['label'] . "</span>" : "") . "<input " . $this->generateAttributes($aSizeAttributes) . " />" . $this->getFieldElementByKey($aField['after_input'], 'size') . "</label>" . "<label " . $this->generateAttributes(array('for' => $_aUnitAttributes['id'], 'class' => $_aUnitAttributes['disabled'] ? 'disabled' : null)) . ">" . $this->getFieldElementByKey($aField['before_label'], 'unit') . $_oUnitInput->get() . $this->getFieldElementByKey($aField['after_input'], 'unit') . "<div class='repeatable-field-buttons'></div>" . "</label>" . "</div>" . $aField['after_label']; }