request->params['action'] === 'edit' ? true : false; $fields = [ [ 'field' => 'object_type', 'class' => 'span2', 'disabled' => !empty($this->data[$modelSelection]['object_type']), 'default' => empty($this->data[$modelSelection]['object_type']) ? null : $this->data[$modelSelection]['object_type'], 'options' => $dropdownData['valid_targets'], 'type' => 'dropdown', 'stayInLine' => 1 ], [ 'field' => 'object_uuid', 'class' => 'span4', 'disabled' => !empty($this->data[$modelSelection]['object_uuid']), 'default' => empty($this->data[$modelSelection]['object_uuid']) ? null : $this->data[$modelSelection]['object_uuid'] ], [ 'field' => 'distribution', 'class' => 'input', 'options' => $dropdownData['distributionLevels'], 'default' => isset($attribute['Attribute']['distribution']) ? $attribute['Attribute']['distribution'] : $initialDistribution, 'stayInLine' => 1, 'type' => 'dropdown' ], [ 'field' => 'sharing_group_id', 'class' => 'input', 'options' => $dropdownData['sgs'], 'label' => __("Sharing Group"), 'type' => 'dropdown' ], [ 'field' => 'authors', 'class' => 'span3', 'stayInLine' => $modelSelection === 'Note', 'default' => $me['email'], ], ]; if ($modelSelection === 'Note') { $fields = array_merge($fields, [ [ 'field' => 'language', 'class' => 'span3', 'options' => $languageRFC5646, 'type' => 'dropdown', ], [ 'field' => 'note', 'type' => 'textarea', 'class' => 'input span6', ] ] ); } else if ($modelSelection === 'Opinion') { $fields = array_merge($fields, [ [ 'field' => 'opinion', 'class' => '', 'type' => 'opinion', ], [ 'field' => 'comment', 'type' => 'textarea', 'class' => 'input span6', ] ] ); } else if ($modelSelection === 'Relationship') { $fields = array_merge($fields, [ [ 'field' => 'relationship_type', 'class' => 'span4', 'options' => $existingRelations, 'type' => 'text', 'picker' => array( 'text' => __('Pick Relationship'), 'function' => 'pickerRelationshipTypes', ) ], [ 'field' => 'related_object_type', 'class' => 'span2', 'options' => $dropdownData['valid_targets'], 'type' => 'dropdown', 'stayInLine' => 1, 'disabled' => !empty($this->data[$modelSelection]['related_object_type']), ], [ 'field' => 'related_object_uuid', 'class' => 'span4', 'disabled' => !empty($this->data[$modelSelection]['related_object_uuid']), ], sprintf('
', __('Related Object'), __('- No UUID provided -')) ] ); } echo $this->element('genericElements/Form/genericForm', [ 'data' => [ 'description' => false, 'model' => $modelSelection, 'title' => $edit ? __('Edit %s', $modelSelection) : __('Add new %s', $modelSelection), 'fields' => $fields, 'submit' => [ 'action' => $this->request->params['action'], 'ajaxSubmit' => 'submitGenericFormInPlace(analystDataSubmitSuccess, true);' ] ] ]); if (!$ajax) { echo $this->element('/genericElements/SideMenu/side_menu', $menuData); } ?>