Пример #1
0
 /**
  * Returns a single input form field.
  * This is just a switch between the specific methods.
  *
  * @param string $fieldName Name of the field
  * @param array $fieldConfig Configuration for this field
  * @param string $fieldValue Current value of this field
  *
  * @return string Result of the specific field methods (usually a html string)
  */
 protected function getInputField($fieldName, array $fieldConfig, $fieldValue = '')
 {
     $content = '';
     switch (strtolower($fieldConfig['type'])) {
         case 'select':
             $content .= $this->getSelectInputField($fieldName, $fieldConfig, $fieldValue);
             break;
         case 'static_info_tables':
             $selected = $fieldValue != '' ? $fieldValue : $fieldConfig['default'];
             $content .= $this->staticInfo->buildStaticInfoSelector($fieldConfig['field'], $this->prefixId . '[' . $fieldName . ']', $fieldConfig['cssClass'], $selected, '', '', '', '', $fieldConfig['select'], $this->getFrontendController()->tmpl->setup['config.']['language']);
             break;
         case 'check':
             $content .= $this->getCheckboxInputField($fieldName, $fieldConfig, $fieldValue);
             break;
         case 'single':
         default:
             $content .= $this->getSingleInputField($fieldName, $fieldConfig, $fieldValue);
     }
     /**
      * Hook for processing the content
      */
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/pi2/class.tx_commerce_pi2.php']['getInputField'])) {
         foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/pi2/class.tx_commerce_pi2.php']['getInputField'] as $classRef) {
             $hookObj = \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($classRef);
             if (method_exists($hookObj, 'postGetInputField')) {
                 $content = $hookObj->postGetInputField($content, $fieldName, $fieldConfig, $fieldValue, $this);
             }
         }
     }
     return $content;
 }
Пример #2
0
 /**
  * Returns a single input form field.
  * This is just a switch between the specific methods.
  *
  * @param string $fieldName Name of the field
  * @param array  $fieldConfig Configuration for this field
  * @param string $fieldValue Current value of this field
  *
  * @return string Result of the specific field methods (usually a html string)
  */
 protected function getInputField($fieldName, array $fieldConfig, $fieldValue = '')
 {
     $content = '';
     switch (strtolower($fieldConfig['type'])) {
         case 'select':
             $content .= $this->getSelectInputField($fieldName, $fieldConfig, $fieldValue);
             break;
         case 'static_info_tables':
             $selected = $fieldValue != '' ? $fieldValue : $fieldConfig['default'];
             $content .= $this->staticInfo->buildStaticInfoSelector($fieldConfig['field'], $this->prefixId . '[' . $fieldName . ']', $fieldConfig['cssClass'], $selected, '', '', '', '', $fieldConfig['select'], $this->getFrontendController()->tmpl->setup['config.']['language']);
             break;
         case 'check':
             $content .= $this->getCheckboxInputField($fieldName, $fieldConfig, $fieldValue);
             break;
         case 'single':
         default:
             $content .= $this->getSingleInputField($fieldName, $fieldConfig, $fieldValue);
     }
     /*
      * Hook for processing the content
      */
     $hooks = HookFactory::getHooks('Controller/AddressesController', 'getInputField');
     foreach ($hooks as $hook) {
         if (method_exists($hook, 'postGetInputField')) {
             $content = $hook->postGetInputField($content, $fieldName, $fieldConfig, $fieldValue, $this);
         }
     }
     return $content;
 }
Пример #3
0
 /**
  * Return a single input form field.
  *
  * @param string $fieldName Name of the field
  * @param array $fieldConfig Configuration of this field
  * @param string $fieldValue Current value of this field
  * @param string $step Name of the step
  *
  * @return string Single input field
  */
 protected function getInputField($fieldName, array $fieldConfig, $fieldValue, $step)
 {
     $this->debug($step, '$step', __FILE__ . ' ' . __LINE__);
     $this->debug($fieldConfig, '$fieldConfig', __FILE__ . ' ' . __LINE__);
     $this->debug($fieldValue, '$fieldValue', __FILE__ . ' ' . __LINE__);
     switch (strtolower($fieldConfig['type'])) {
         case 'select':
             $result = $this->getSelectInputField($fieldName, $fieldConfig, $fieldValue, $step);
             break;
         case 'static_info_tables':
             $selected = $fieldValue != '' ? $fieldValue : $fieldConfig['default'];
             $result = $this->staticInfo->buildStaticInfoSelector($fieldConfig['field'], $this->prefixId . '[' . $step . '][' . $fieldName . ']', $fieldConfig['cssClass'], $selected, '', '', $step . '-' . $fieldName, '', $fieldConfig['select'], $this->getFrontendController()->tmpl->setup['config.']['language']);
             break;
         case 'static_info_country':
             $nameArray = $this->staticInfo->initCountries($fieldConfig['country_association'], $this->getFrontendController()->tmpl->setup['config.']['language'], 1, $fieldConfig['select']);
             asort($nameArray, SORT_LOCALE_STRING);
             $countries = array();
             foreach ($nameArray as $itemKey => $itemName) {
                 $countries[] = array('name' => $itemName, 'value' => $itemKey);
             }
             $selected = $fieldValue != '' ? $fieldValue : $fieldConfig['default'];
             $result = '<select id="' . $step . '-' . $fieldName . '" name="' . $this->prefixId . '[' . $step . '][' . $fieldName . ']" class="' . $fieldConfig['cssClass'] . '">' . LF;
             $options = array();
             $result .= \SJBR\StaticInfoTables\Utility\HtmlElementUtility::optionsConstructor($countries, array($selected), $options);
             $result .= implode(LF, $options) . '</select>' . LF;
             break;
         case 'check':
             $result = $this->getCheckboxInputField($fieldName, $fieldConfig, $fieldValue, $step);
             break;
         case 'hidden':
             // fall through
         // fall through
         case 'single':
             // fall through
         // fall through
         default:
             $result = $this->getSingleInputField($fieldName, $fieldConfig, $step);
     }
     return $result;
 }