Preparing SuiteDesk to display always the dashboard with a pair number of items

This commit is contained in:
Manuel Cillero 2017-09-20 00:26:05 +02:00
parent 0b3650e660
commit 308998cde9
4 changed files with 17 additions and 5 deletions

View file

@ -989,6 +989,10 @@ function storm_dashboard($type = 'page') {
$link_blocks = storm_dashboard_get_links(TRUE, $type);
if (!empty($link_blocks)) {
/* ALWAYS DISPLAY A PAIR NUMBER OF ITEMS
if (count($link_blocks) % 20) {
array_pop($link_blocks);
} */
// DIVIDE LINKS INTO TWO BLOCKS
$count = ceil(count($link_blocks) / 2);
$link_blocks = array_chunk($link_blocks, $count);
@ -1132,20 +1136,25 @@ function storm_storm_dashboard_links($type) {
'title' => t('Attributes'),
'icon' => 'stormattributes-item',
'path' => 'attributes',
'params' => array(),
'access_arguments' => 'Storm: access administration pages',
'map' => array(),
'weight' => 180,
);
$links[] = array(
'theme' => 'storm_dashboard_link',
'title' => t('Configuration'),
'icon' => 'stormconfiguration-item',
'path' => 'admin/settings/suitedesk',
'params' => array(),
'access_arguments' => 'Storm: access administration pages',
'map' => array(),
'weight' => 190,
);
/* $links[] = array(
'theme' => 'storm_dashboard_link',
'title' => t('Search in SuiteDesk'),
'icon' => 'stormsearch-item',
'path' => 'search',
'access_arguments' => 'access content',
'weight' => 200,
); LAST ITEM TO REMOVE IF THERE IS AN ODD NUMBER OF ITEMS */
}
return $links;
}