<?php
function form_helper_menu() {
$items['admin/settings/form_helper'] = array(
'title' => 'Form helper',
'description' => 'A collection of modules that assists with form management, validation, and alteration.',
'access arguments' => array('administer site configuration'),
'page callback' => 'module_helper_admin',
'page arguments' => array('Form helper', 'admin/settings/form_helper'),
'file' => 'module_helper.admin.inc',
'type' => MENU_NORMAL_ITEM,
);
$items['admin/settings/form_helper/index'] = array(
'title' => 'Main',
'access arguments' => array('administer site configuration'),
'page callback' => 'module_helper_admin',
'page arguments' => array('Form helper', 'admin/settings/form_helper'),
'file' => 'module_helper.admin.inc',
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -50,
);
return $items;
}
function form_helper_set_weight(&$form, $start_weight = -50) {
foreach (array_keys($form['menu']) as $key ) {
if (strpos($key, '#') !== 0 && !isset($form[$key]['#weight']) ) {
$form[$key]['#weight'] = $start_weight++;
}
}
}