You are here

public function RulesLinkUIController::entityFormSubmitBuildEntity in Rules Link 7

Same name and namespace in other branches
  1. 7.2 rules_link.admin.inc \RulesLinkUIController::entityFormSubmitBuildEntity()

Overrides EntityDefaultUIController::entityFormSubmitBuildEntity().

Overrides EntityDefaultUIController::entityFormSubmitBuildEntity

File

./rules_link.admin.inc, line 59
Generate a admin UI.

Class

RulesLinkUIController
UI controller.

Code

public function entityFormSubmitBuildEntity($form, &$form_state) {
  $rules_link = $form_state[$this->entityType];
  $values = $form_state['values'];
  $rules_link->name = $values['name'];
  $rules_link->label = $values['label'];
  $rules_link->entity_type = $values['entity_type'];
  $rules_link->path = $values['path'];
  $rules_link->settings['text'] = $values['text'];
  $rules_link->settings['link_type'] = $values['link_type'];
  $rules_link->settings['bundles'] = $values['bundles'];
  $rules_link->settings['entity_link'] = isset($values['entity_link']) ? $values['entity_link'] : '';
  $rules_link->settings['view_mode'] = isset($values['view_mode']) ? $values['view_mode'] : '';
  if ($rules_link->settings['link_type'] == 'confirm') {
    $rules_link->settings['confirm_question'] = $values['question'];
    $rules_link->settings['confirm_description'] = $values['description'];
  }
  return $rules_link;
}