function feeds_ui_mapping_settings_form in Feeds 8.2
Same name and namespace in other branches
- 7.2 feeds_ui/feeds_ui.admin.inc \feeds_ui_mapping_settings_form()
Per mapper configuration form that is a part of feeds_ui_mapping_form().
1 call to feeds_ui_mapping_settings_form()
- feeds_ui_mapping_form in feeds_ui/
feeds_ui.admin.inc - Edit mapping.
File
- feeds_ui/
feeds_ui.admin.inc, line 565 - Contains all page callbacks, forms and theming functions for Feeds administrative pages.
Code
function feeds_ui_mapping_settings_form($form, $form_state, $i, $mapping, $target) {
$form_state += array(
'mapping_settings_edit' => NULL,
'mapping_settings' => array(),
);
$base_button = array(
'#submit' => array(
'feeds_ui_mapping_form_multistep_submit',
),
'#ajax' => array(
'callback' => 'feeds_ui_mapping_settings_form_callback',
'wrapper' => 'feeds-ui-mapping-form-wrapper',
'effect' => 'fade',
'progress' => 'none',
),
'#i' => $i,
);
if (isset($form_state['mapping_settings'][$i])) {
$mapping = $form_state['mapping_settings'][$i] + $mapping;
}
if ($form_state['mapping_settings_edit'] === $i) {
// Build the form.
if (isset($target['form_callback'])) {
$settings_form = call_user_func($target['form_callback'], $mapping, $target, $form, $form_state);
}
else {
$settings_form = array();
}
// Merge in the optional unique form.
$settings_form += feeds_ui_mapping_settings_optional_unique_form($mapping, $target, $form, $form_state);
return array(
'#type' => 'container',
'settings' => $settings_form,
'save_settings' => $base_button + array(
'#type' => 'submit',
'#name' => 'mapping_settings_update_' . $i,
'#value' => t('Update'),
'#op' => 'update',
),
'cancel_settings' => $base_button + array(
'#type' => 'submit',
'#name' => 'mapping_settings_cancel_' . $i,
'#value' => t('Cancel'),
'#op' => 'cancel',
),
);
}
else {
// Build the summary.
if (isset($target['summary_callback'])) {
$summary = call_user_func($target['summary_callback'], $mapping, $target, $form, $form_state);
}
else {
$summary = '';
}
// Append the optional unique summary.
if ($optional_unique_summary = feeds_ui_mapping_settings_optional_unique_summary($mapping, $target, $form, $form_state)) {
$summary .= ' ' . $optional_unique_summary;
}
if ($summary) {
return array(
'summary' => array(
'#prefix' => '<div>',
'#markup' => $summary,
'#suffix' => '</div>',
),
'edit_settings' => $base_button + array(
'#type' => 'image_button',
'#name' => 'mapping_settings_edit_' . $i,
'#src' => 'misc/configure.png',
'#attributes' => array(
'alt' => t('Edit'),
),
'#op' => 'edit',
'#src' => 'core/misc/configure-dark.png',
),
);
}
}
}