Commit d9760209 authored by Dave Reid's avatar Dave Reid

Fixed coding standards.

parent 4043c1d2
......@@ -90,12 +90,12 @@ function _menu_block_form_block_admin_display_form_alter(&$form, $form_state) {
}
}
if (variable_get('menu_block_suppress_core')) {
foreach (array_keys(menu_get_menus(FALSE)) AS $delta) {
foreach (array_keys(menu_get_menus(FALSE)) as $delta) {
if (empty($form['blocks']['menu_' . $delta]['region']['#default_value'])) {
unset($form['blocks']['menu_' . $delta]);
}
}
foreach (array_keys(menu_list_system_menus()) AS $delta) {
foreach (array_keys(menu_list_system_menus()) as $delta) {
if (empty($form['blocks']['system_' . $delta]['region']['#default_value'])) {
unset($form['blocks']['system_' . $delta]);
}
......@@ -300,15 +300,15 @@ function menu_block_configure_form($form, &$form_state) {
'#title' => t('Starting level'),
'#default_value' => $config['level'],
'#options' => array(
'1' => t('1st level (primary)'),
'2' => t('2nd level (secondary)'),
'3' => t('3rd level (tertiary)'),
'4' => t('4th level'),
'5' => t('5th level'),
'6' => t('6th level'),
'7' => t('7th level'),
'8' => t('8th level'),
'9' => t('9th level'),
'1' => t('1st level (primary)'),
'2' => t('2nd level (secondary)'),
'3' => t('3rd level (tertiary)'),
'4' => t('4th level'),
'5' => t('5th level'),
'6' => t('6th level'),
'7' => t('7th level'),
'8' => t('8th level'),
'9' => t('9th level'),
),
'#description' => t('Blocks that start with the 1st level will always be visible. Blocks that start with the 2nd level or deeper will only be visible when the trail to the active menu item passes though the block’s starting level.'),
);
......@@ -348,16 +348,16 @@ function menu_block_configure_form($form, &$form_state) {
'#title' => t('Maximum depth'),
'#default_value' => $config['depth'],
'#options' => array(
'1' => '1',
'2' => '2',
'3' => '3',
'4' => '4',
'5' => '5',
'6' => '6',
'7' => '7',
'8' => '8',
'9' => '9',
'0' => t('Unlimited'),
'1' => '1',
'2' => '2',
'3' => '3',
'4' => '4',
'5' => '5',
'6' => '6',
'7' => '7',
'8' => '8',
'9' => '9',
'0' => t('Unlimited'),
),
'#description' => t('From the starting level, specify the maximum depth of the menu tree.'),
);
......@@ -523,7 +523,7 @@ function menu_block_admin_settings_form($form, &$form_state) {
*/
function menu_block_admin_settings_form_submit($form, &$form_state) {
$menu_order = array();
foreach ($form_state['values']['menu_order'] AS $menu_name => $row) {
foreach ($form_state['values']['menu_order'] as $menu_name => $row) {
if ($row['available']) {
// Add available menu and its weight to list.
$menu_order[$menu_name] = (int) $row['weight'];
......@@ -531,7 +531,7 @@ function menu_block_admin_settings_form_submit($form, &$form_state) {
}
// Sort the keys by the weight stored in the value.
asort($menu_order);
foreach ($menu_order AS $menu_name => $weight) {
foreach ($menu_order as $menu_name => $weight) {
// Now that the array is sorted, the weight is redundant data.
$menu_order[$menu_name] = '';
}
......
......@@ -18,7 +18,7 @@ function _menu_tree_prune_active_tree(&$tree, $level) {
do {
$found_active_trail = FALSE;
// Examine each element at this level for the active trail.
foreach ($tree AS $key => &$value) {
foreach ($tree as $key => &$value) {
if ($tree[$key]['link']['in_active_trail']) {
$found_active_trail = TRUE;
// If the active trail item has children, examine them.
......@@ -26,7 +26,7 @@ function _menu_tree_prune_active_tree(&$tree, $level) {
// If we are pruning to the active menu item's level, check if this
// is the active menu item by checking its children.
if ($level == 'active') {
foreach ($tree[$key]['below'] AS $child_key => &$value) {
foreach ($tree[$key]['below'] as $child_key => &$value) {
if ($tree[$key]['below'][$child_key]['link']['in_active_trail']) {
// Get the title for the pruned tree.
menu_block_set_title($tree[$key]['link']);
......
......@@ -9,7 +9,7 @@
*/
function menu_block_uninstall() {
// Delete menu block variables.
foreach (variable_get('menu_block_ids', array()) AS $delta) {
foreach (variable_get('menu_block_ids', array()) as $delta) {
variable_del("menu_block_{$delta}_title_link");
variable_del("menu_block_{$delta}_admin_title");
variable_del("menu_block_{$delta}_parent");
......@@ -48,7 +48,7 @@ function menu_block_update_5100() {
$enabled_blocks = array();
// Find the old enabled blocks.
foreach (variable_get('menu_block_enabled_blocks', array()) AS $old_delta => $enabled) {
foreach (variable_get('menu_block_enabled_blocks', array()) as $old_delta => $enabled) {
list($mid, $level) = explode('-', $old_delta);
if ($enabled) {
$enabled_blocks[++$delta] = TRUE;
......@@ -71,7 +71,7 @@ function menu_block_update_5100() {
*/
function menu_block_update_5200() {
$block_ids = array();
foreach (variable_get('menu_block_enabled_blocks', array()) AS $delta => $enabled) {
foreach (variable_get('menu_block_enabled_blocks', array()) as $delta => $enabled) {
if ($enabled) {
$block_ids[] = $delta; // Build new $menu_block_ids.
// Convert $menu_block_DELTA_mid to $menu_block_DELTA_menu_name.
......@@ -112,7 +112,7 @@ function menu_block_update_5200() {
*/
function menu_block_update_6200() {
$menus = menu_get_menus();
foreach (variable_get('menu_block_ids', array()) AS $delta) {
foreach (variable_get('menu_block_ids', array()) as $delta) {
// Drupal 6 uses the menu title to create the new menu_name.
$menu_name = preg_replace('/[^a-zA-Z0-9]/', '-', strtolower(variable_get("menu_block_{$delta}_title", '')));
// If we can't find the new menu_name, default to the navigation menu.
......@@ -130,7 +130,7 @@ function menu_block_update_6200() {
*/
function menu_block_update_6201() {
$menus = menu_get_menus();
foreach (variable_get('menu_block_ids', array()) AS $delta) {
foreach (variable_get('menu_block_ids', array()) as $delta) {
variable_set("menu_block_{$delta}_parent", variable_get("menu_block_{$delta}_menu_name", 'navigation') . ':0');
variable_del("menu_block_{$delta}_menu_name");
}
......@@ -141,7 +141,7 @@ function menu_block_update_6201() {
* Converts to Drupal 7 menu names.
*/
function menu_block_update_7200() {
foreach (variable_get('menu_block_ids', array()) AS $delta) {
foreach (variable_get('menu_block_ids', array()) as $delta) {
$menu_name = '';
list($old_menu_name, $parent_mlid) = explode(':', variable_get("menu_block_{$delta}_parent", ' : '));
switch ($old_menu_name) {
......
......@@ -19,7 +19,7 @@ function _menu_tree_sort_active_path(&$tree) {
// Traverse the tree along the active trail.
do {
$next_level = $sort = $first_key = FALSE;
foreach ($current_level AS $key => &$value) {
foreach ($current_level as $key => &$value) {
// Save the first key for later use.
if (!$first_key) {
$first_key = $key;
......
......@@ -56,7 +56,7 @@ function menu_block_export_form_submit(&$form, &$form_state) {
$output = '';
$module = check_plain($form_state['values']['name']);
foreach (variable_get('menu_block_ids', array()) AS $delta) {
foreach (variable_get('menu_block_ids', array()) as $delta) {
$config = menu_block_get_config($delta);
// Use the constant instead of the constant's value.
if ($config['menu_name'] == MENU_TREE__CURRENT_PAGE_MENU) {
......
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