Skip to content

Commit

Permalink
Issue #61: use dropdown buttons for operations (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
herbdool authored Jul 18, 2020
1 parent b18e056 commit 1eeecf7
Showing 1 changed file with 32 additions and 7 deletions.
39 changes: 32 additions & 7 deletions feeds_ui/feeds_ui.admin.inc
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ function feeds_ui_mapping_help() {
*/
function feeds_ui_overview_form($form, &$form_status) {
$form = $form['enabled'] = $form['disabled'] = array();
$current_path = current_path();
$options = array('destination' => $current_path);

$form['#header'] = array(
t('Name'),
Expand Down Expand Up @@ -93,13 +95,36 @@ function feeds_ui_overview_form($form, &$form_status) {
$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')),
);
if (!$importer->disabled) {
$links['edit'] = array(
'title' => $edit,
'href' => 'admin/structure/feeds/' . $importer->id,
'query' => $options,
);
$links['export'] = array(
'title' => t('Export'),
'href' => 'admin/structure/feeds/' . $importer->id . '/export',
'query' => $options,
);
$links['clone'] = array(
'title' => t('Clone'),
'href' => 'admin/structure/feeds/' . $importer->id . '/clone',
'query' => $options,
);
if ($importer->export_type != EXPORT_IN_CODE) {
$links['delete'] = array(
'title' => $delete,
'href' => 'admin/structure/feeds/' . $importer->id . '/delete',
'query' => $options,
);
}
$importer_form['operations'] = array(
'#type' => 'dropbutton',
'#links' => $links,
);
} else {
$importer_form['operations']['#markup'] = t('Disabled');
}

$importer_form[$importer->id] = array(
'#type' => 'checkbox',
Expand Down

0 comments on commit 1eeecf7

Please sign in to comment.