Skip to content
Snippets Groups Projects
Commit e30802ee authored by Jeroen Bobbeldijk's avatar Jeroen Bobbeldijk Committed by Jeroen Bobbeldijk
Browse files

Issue #2504885 by jeroen.b: Operations exist for paragraph editing even if...

Issue #2504885 by jeroen.b: Operations exist for paragraph editing even if field ui module is disabled
parent 22d9cbc8
No related branches found
No related tags found
No related merge requests found
......@@ -15,27 +15,46 @@
function paragraphs_admin_bundle_overview() {
$page = array();
$bundles = paragraphs_bundle_load();
$field_ui = module_exists('field_ui');
$header = array(t('Bundle name'), array('data' => t('Operations'), 'colspan' => '4'));
$header = array(
t('Bundle name'),
array('data' => t('Operations'), 'colspan' => $field_ui ? '4' : '2')
);
$rows = array();
foreach ($bundles as $bundle) {
$rows[$bundle->bundle] = array(
array(
'data' => check_plain($bundle->name) . ' (' . $bundle->bundle . ')',
),
array(
'data' => l(t('manage fields'), 'admin/structure/paragraphs/' . strtr($bundle->bundle, array('_' => '-')) . '/fields')
),
array(
'data' => l(t('manage display'), 'admin/structure/paragraphs/' . strtr($bundle->bundle, array('_' => '-')) . '/display')
),
array(
'data' => l(t('edit bundle'), 'admin/structure/paragraphs/' . strtr($bundle->bundle, array('_' => '-')) . '/edit')
),
$type_url_str = strtr($bundle->bundle, array('_' => '-'));
$row = array(
array(
'data' => l(t('delete bundle'), 'admin/structure/paragraphs/' . strtr($bundle->bundle, array('_' => '-')) . '/delete')
),
'data' => $bundle->name . ' (' . $bundle->bundle . ')',
)
);
if ($field_ui) {
// Manage fields.
$row[] = array(
'data' => l(t('manage fields'), 'admin/structure/paragraphs/' . $type_url_str . '/fields')
);
// Display fields.
$row[] = array(
'data' => l(t('manage display'), 'admin/structure/paragraphs/' . $type_url_str . '/display')
);
}
// Manage bundle.
$row[] = array(
'data' => l(t('edit bundle'), 'admin/structure/paragraphs/' . $type_url_str . '/edit')
);
// Delete bundle.
$row[] = array(
'data' => l(t('delete bundle'), 'admin/structure/paragraphs/' . $type_url_str . '/delete')
);
$rows[$bundle->bundle] = $row;
}
// Sort rows by bundle.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment