Commit 6dd28caf authored by Gábor Hojtsy's avatar Gábor Hojtsy

#191246 by domasj: sort module help pages by display name, not file name

parent 6efb4183
...@@ -52,20 +52,22 @@ function help_links_as_list() { ...@@ -52,20 +52,22 @@ function help_links_as_list() {
$modules = array(); $modules = array();
foreach (module_implements('help', TRUE) as $module) { foreach (module_implements('help', TRUE) as $module) {
if (module_invoke($module, 'help', "admin/help#$module", $empty_arg)) { if (module_invoke($module, 'help', "admin/help#$module", $empty_arg)) {
$modules[] = $module; $modules[$module] = $module_info[$module]->info['name'];
} }
} }
sort($modules); asort($modules);
// Output pretty four-column list // Output pretty four-column list
$count = count($modules); $count = count($modules);
$break = ceil($count / 4); $break = ceil($count / 4);
$output = '<div class="clear-block"><div class="help-items"><ul>'; $output = '<div class="clear-block"><div class="help-items"><ul>';
foreach ($modules as $i => $module) { $i = 0;
$output .= '<li>'. l($module_info[$module]->info['name'], 'admin/help/'. $module) .'</li>'; foreach ($modules as $module => $name) {
$output .= '<li>'. l($name, 'admin/help/'. $module) .'</li>';
if (($i + 1) % $break == 0 && ($i + 1) != $count) { if (($i + 1) % $break == 0 && ($i + 1) != $count) {
$output .= '</ul></div><div class="help-items'. ($i + 1 == $break * 3 ? ' help-items-last' : '') .'"><ul>'; $output .= '</ul></div><div class="help-items'. ($i + 1 == $break * 3 ? ' help-items-last' : '') .'"><ul>';
} }
$i++;
} }
$output .= '</ul></div></div>'; $output .= '</ul></div></div>';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment