function feeds_ui_overview_form in Feeds 8.2
Same name and namespace in other branches
- 6 feeds_ui/feeds_ui.admin.inc \feeds_ui_overview_form()
- 7.2 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 54 - Contains all page callbacks, forms and theming functions for Feeds administrative pages.
Code
function feeds_ui_overview_form($form, &$form_status) {
$form = $form['enabled'] = $form['disabled'] = array();
$form['#header'] = array(
t('Name'),
t('Description'),
t('Attached to'),
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']);
$content_types = node_type_get_names();
if (empty($importer->config['content_type'])) {
$importer_form['attached']['#markup'] = '[none]';
}
else {
if (!$importer->disabled) {
$importer_form['attached']['#markup'] = l($content_types[$importer->config['content_type']], 'node/add/' . str_replace('_', '-', $importer->config['content_type']));
}
else {
$importer_form['attached']['#markup'] = check_plain($content_types[$importer->config['content_type']]);
}
}
$edit = t('Edit');
$delete = t('Delete');
$importer_form['operations'] = array(
'#markup' => l($edit, 'admin/structure/feeds/' . $importer->id) . ' | ' . 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;
}