function entityconnect_add_form_element_edit in Entity connect 7
Same name and namespace in other branches
- 7.2 includes/entityconnect.form.inc \entityconnect_add_form_element_edit()
Here we attach a "Edit" submit button.
1 call to entityconnect_add_form_element_edit()
- _entityconnect_field_attach_form in includes/
entityconnect.form.inc - Implements hook_field_attach_form().
File
- includes/
entityconnect.form.inc, line 241 - Handles all form alters and submit functions for entityconnect.
Code
function entityconnect_add_form_element_edit(&$widget_element, $language, $field_name, $parents, $key, $extra_class, $entity_type) {
$widget_element["edit_entityconnect__{$field_name}_{$key}_{$parents}"] = array(
'#type' => 'submit',
'#limit_validation_errors' => array(
array(
$field_name,
),
),
'#value' => t('Edit content'),
'#name' => "edit_entityconnect__{$field_name}_{$key}_{$parents}",
'#prefix' => "<div class = 'entityconnect-edit {$extra_class}'>",
'#suffix' => '</div>',
'#key' => $key,
'#field' => $field_name,
'#entity_type_target' => $entity_type,
'#add_child' => FALSE,
'#language' => $language,
'#submit' => array(
'entityconnect_include_form',
'entityconnect_add_edit_button_submit',
),
'#weight' => -2,
'#attached' => array(
'js' => array(
drupal_get_path('module', 'entityconnect') . "/theme/js/entityconnect.js",
),
'css' => array(
drupal_get_path('module', 'entityconnect') . "/theme/css/entityconnect.css",
),
),
'#attributes' => array(
'title' => t('Edit'),
// Support Clientside Validation.
'class' => array(
'cancel',
),
),
);
}