function feeds_ui_overview_form in Feeds 7.2
Same name and namespace in other branches
- 8.2 feeds_ui/feeds_ui.admin.inc \feeds_ui_overview_form()
- 6 feeds_ui/feeds_ui.admin.inc \feeds_ui_overview_form()
- 7 feeds_ui/feeds_ui.admin.inc \feeds_ui_overview_form()
Build overview of available configurations.
1 string reference to 'feeds_ui_overview_form'
- feeds_ui_menu in feeds_ui/
feeds_ui.module - Implements hook_menu().
File
- feeds_ui/
feeds_ui.admin.inc, line 51 - Contains all page callbacks, forms and theming functions for Feeds administrative pages.
Code
function feeds_ui_overview_form($form, array &$form_state) {
$form = $form['enabled'] = $form['disabled'] = array();
$form['#header'] = array(
t('Name'),
t('Description'),
t('Attached to'),
t('Status'),
t('Operations'),
t('Enabled'),
);
foreach (feeds_importer_load_all(TRUE) as $importer) {
$importer_form = array();
$importer_form['name']['#markup'] = check_plain($importer->config['name']);
$importer_form['description']['#markup'] = check_plain($importer->config['description']);
if (empty($importer->config['content_type'])) {
$importer_form['attached']['#markup'] = '[none]';
}
else {
if (!$importer->disabled) {
$importer_form['attached']['#markup'] = l(node_type_get_name($importer->config['content_type']), 'node/add/' . str_replace('_', '-', $importer->config['content_type']));
}
else {
$importer_form['attached']['#markup'] = check_plain(node_type_get_name($importer->config['content_type']));
}
}
if ($importer->export_type == EXPORT_IN_CODE) {
$status = t('Default');
$edit = t('Override');
$delete = '';
}
elseif ($importer->export_type == EXPORT_IN_DATABASE) {
$status = t('Normal');
$edit = t('Edit');
$delete = t('Delete');
}
elseif ($importer->export_type == (EXPORT_IN_CODE | EXPORT_IN_DATABASE)) {
$status = t('Overridden');
$edit = t('Edit');
$delete = t('Revert');
}
$importer_form['status'] = array(
'#markup' => $status,
);
$importer_form['operations'] = array(
'#markup' => l($edit, 'admin/structure/feeds/' . $importer->id) . ' | ' . l(t('Export'), 'admin/structure/feeds/' . $importer->id . '/export') . ' | ' . l(t('Clone'), 'admin/structure/feeds/' . $importer->id . '/clone') . (empty($delete) ? '' : ' | ' . l($delete, 'admin/structure/feeds/' . $importer->id . '/delete')),
);
$importer_form[$importer->id] = array(
'#type' => 'checkbox',
'#default_value' => !$importer->disabled,
);
if ($importer->disabled) {
$form['disabled'][$importer->id] = $importer_form;
}
else {
$form['enabled'][$importer->id] = $importer_form;
}
}
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Save'),
);
return $form;
}