protected function renderContent() { $this->renderScripts(); $mappingFormLayoutUtil = ImportToMappingFormLayoutUtil::make(get_class($this->model), new ZurmoActiveForm(), $this->model->importRulesType, $this->mappableAttributeIndicesAndDerivedTypes); $mappingDataMetadataWithRenderedElements = $this->resolveMappingDataMetadataWithRenderedElements($mappingFormLayoutUtil, $this->mappingDataMetadata, $this->model->firstRowIsHeaderRow, $this->model->importRulesType, $this->model->id); return MappingFormLayoutUtil::renderMappingDataMetadataWithRenderedElements($mappingDataMetadataWithRenderedElements); }
/** * Override to produce a form layout that does not follow the * standard form layout for EditView. */ protected function renderFormLayout($form = null) { assert('$form != null && $form instanceof ZurmoActiveForm'); $mappingFormLayoutUtil = ImportToMappingFormLayoutUtil::make(get_class($this->model), $form, $this->model->importRulesType, $this->mappableAttributeIndicesAndDerivedTypes); $mappingDataMetadataWithRenderedElements = $this->resolveMappingDataMetadataWithRenderedElements($mappingFormLayoutUtil, $this->mappingDataMetadata, $this->model->firstRowIsHeaderRow, $this->model->importRulesType, $this->model->id); $headerColumns = $this->getFormLayoutHeaderColumnsContent(); assert('count($headerColumns) > 0'); $content = $form->errorSummary($this->model); $content .= '<h3>' . Zurmo::t('ImportModule', 'Please map the fields you would like to import.') . '</h3>'; $content .= $this->renderRequiredAttributesLabelsDataContent(); $content .= '<table>'; $content .= '<colgroup>'; if (count($headerColumns) == 4) { $content .= '<col style="width:20%" />'; $content .= '<col style="width:20%" />'; $content .= '<col style="width:25%" />'; $content .= '<col style="width:35%" />'; } else { $content .= '<col style="width:20%" />'; $content .= '<col style="width:25%" />'; $content .= '<col style="width:55%" />'; } $content .= '</colgroup>'; $content .= '<tbody>'; $content .= '<tr>'; foreach ($headerColumns as $headerColumnContent) { $content .= '<th>' . $headerColumnContent . '</th>'; } $content .= '</tr>'; $content .= MappingFormLayoutUtil::renderMappingDataMetadataWithRenderedElements($mappingDataMetadataWithRenderedElements); $content .= '<tr>'; $content .= '<td colspan="' . count($headerColumns) . '">'; $content .= $this->renderAddExtraColumnContent(count($this->mappingDataMetadata)); $content .= '</td>'; $content .= '</tr>'; $content .= '</tbody>'; $content .= '</table>'; return $content; }