Skip to content

Commit

Permalink
Issue #158: operation buttons even if disabled (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
herbdool authored Nov 28, 2024
1 parent 651b6db commit 3effef9
Showing 1 changed file with 27 additions and 31 deletions.
58 changes: 27 additions & 31 deletions feeds_ui/feeds_ui.admin.inc
Original file line number Diff line number Diff line change
Expand Up @@ -86,39 +86,35 @@ function feeds_ui_overview_form($form, array &$form_state) {
'#default_value' => !$importer->disabled,
);

if (!$importer->disabled) {
$links['edit'] = array(
'title' => t('Edit'),
'href' => 'admin/structure/feeds/' . $importer->id,
'query' => $options,
);
if (module_exists('config') && user_access('synchronize configuration')) {
$links['export'] = array(
'title' => t('Export'),
'href' => 'admin/config/development/configuration/single/export',
'query' => array(
'group' => 'Feeds importers',
'name' => 'feeds.feeds_importer.' . $importer->id,
),
);
}
$links['clone'] = array(
'title' => t('Clone'),
'href' => 'admin/structure/feeds/' . $importer->id . '/clone',
'query' => $options,
);
$links['delete'] = array(
'title' => t('Delete'),
'href' => 'admin/structure/feeds/' . $importer->id . '/delete',
'query' => $options,
);
$importer_form['operations'] = array(
'#type' => 'dropbutton',
'#links' => $links,
$links['edit'] = array(
'title' => t('Edit'),
'href' => 'admin/structure/feeds/' . $importer->id,
'query' => $options,
);
if (module_exists('config') && user_access('synchronize configuration')) {
$links['export'] = array(
'title' => t('Export'),
'href' => 'admin/config/development/configuration/single/export',
'query' => array(
'group' => 'Feeds importers',
'name' => 'feeds.feeds_importer.' . $importer->id,
),
);
} else {
$importer_form['operations']['#markup'] = t('Disabled');
}
$links['clone'] = array(
'title' => t('Clone'),
'href' => 'admin/structure/feeds/' . $importer->id . '/clone',
'query' => $options,
);
$links['delete'] = array(
'title' => t('Delete'),
'href' => 'admin/structure/feeds/' . $importer->id . '/delete',
'query' => $options,
);
$importer_form['operations'] = array(
'#type' => 'dropbutton',
'#links' => $links,
);

if ($importer->disabled) {
$form['disabled'][$importer->id] = $importer_form;
Expand Down

0 comments on commit 3effef9

Please sign in to comment.