FluidTYPO3\Flux\Form::getIcon PHP Method

getIcon() public method

Deprecation:
public getIcon ( ) : string
return string
    public function getIcon()
    {
        GeneralUtility::logDeprecatedFunction();
        $icon = $this->getOption(self::OPTION_ICON);
        if (0 === strpos($icon, 'EXT:')) {
            $icon = GeneralUtility::getFileAbsFileName($icon);
        }
        return $icon;
    }

Usage Example

 /**
  * @param string $table
  * @param Form $form
  */
 protected function processFormForTable($table, Form $form)
 {
     $extensionName = $form->getExtensionName();
     $extensionKey = ExtensionNamingUtility::getExtensionKey($extensionName);
     $tableConfiguration = self::$tableTemplate;
     $fields = array();
     $labelFields = $form->getOption('labels');
     $enableColumns = array();
     foreach ($form->getFields() as $field) {
         $name = $field->getName();
         // note: extracts the TCEforms sub-array from the configuration, as required in TCA.
         $fields[$name] = array_pop($field->build());
     }
     if (TRUE === $form->getOption('hide')) {
         $enableColumns['disabled'] = 'hidden';
     }
     if (TRUE === $form->getOption('start')) {
         $enableColumns['start'] = 'starttime';
     }
     if (TRUE === $form->getOption('end')) {
         $enableColumns['end'] = 'endtime';
     }
     if (TRUE === $form->getOption('frontendUserGroup')) {
         $enableColumns['fe_group'] = 'fe_group';
     }
     $tableConfiguration['iconfile'] = ExtensionManagementUtility::extRelPath($extensionKey) . $form->getIcon();
     $tableConfiguration['enablecolumns'] = $enableColumns;
     $showRecordsFieldList = $this->buildShowItemList($form);
     $GLOBALS['TCA'][$table] = array('title' => $form->getLabel(), 'ctrl' => $tableConfiguration, 'interface' => array('showRecordFieldList' => implode(',', array_keys($fields))), 'columns' => $fields, 'types' => array(0 => array('showitem' => $showRecordsFieldList)));
     if (TRUE === $form->getOption('delete')) {
         $GLOBALS['TCA'][$table]['ctrl']['delete'] = 'deleted';
     }
     if (NULL === $labelFields) {
         reset($fields);
         $GLOBALS['TCA'][$table]['ctrl']['label'] = key($fields);
     } else {
         $GLOBALS['TCA'][$table]['ctrl']['label'] = array_shift($labelFields);
         $GLOBALS['TCA'][$table]['ctrl']['label_alt'] = implode(',', $labelFields);
     }
 }
All Usage Examples Of FluidTYPO3\Flux\Form::getIcon