Created
September 26, 2011 17:49
-
-
Save star-szr/1242851 to your computer and use it in GitHub Desktop.
Band-aid fixes for conflict between Block Title Link and Menu Block modules (D7)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Mini module to remove Block Title Link options from Menu Block blocks | |
function MODULE_form_alter(&$form, &$form_state, $form_id) { | |
if ($form_id == 'block_admin_configure') { | |
$module = $form['module']['#value']; | |
if ($module == 'menu_block') { | |
// remove fieldset | |
unset($form['settings']['block_titlelink']); | |
// remove validate and submit handlers | |
$form['#validate'] = array_diff($form['#validate'], array('block_titlelink_form_validate')); | |
$form['#submit'] = array_diff($form['#submit'], array('block_titlelink_form_submit')); | |
} | |
} | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function THEME_preprocess_block(&$variables) { | |
$block = &$variables['elements']['#block']; | |
if ($block->module == 'menu_block') { | |
unset($block->title_link); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment