Commit 02ff5263 authored by Dave Reid's avatar Dave Reid

Moved hook_theme() and hook_ctools_plugin_directory() to menu_block.module.

parent cecfcb1b
......@@ -4,40 +4,6 @@
* Provides infrequently used functions and hooks for menu_block.
*/
/**
* Implements hook_theme().
*/
function _menu_block_theme(&$existing, $type, $theme, $path) {
// Add theme hook suggestion patterns for the core theme functions used in
// this module. We can't add them during hook_theme_registry_alter() because
// we will already have missed the opportunity for the theme engine's
// theme_hook() to process the pattern. And we can't run the pattern ourselves
// because we aren't given the type, theme and path in that hook.
$existing['menu_tree']['pattern'] = 'menu_tree__';
$existing['menu_link']['pattern'] = 'menu_link__';
return array(
'menu_block_wrapper' => array(
'template' => 'menu-block-wrapper',
'variables' => array('content' => array(), 'config' => array(), 'delta' => NULL),
'pattern' => 'menu_block_wrapper__',
),
'menu_block_menu_order' => array(
'render element' => 'element',
'file' => 'menu_block.admin.inc',
),
);
}
/**
* Implements hook_ctools_plugin_directory().
*/
function _menu_block_ctools_plugin_directory($module, $plugin) {
if ($plugin == 'content_types') {
return 'plugins/' . $plugin;
}
}
/**
* Menu callback: display the menu block addition form.
*
......
......@@ -10,10 +10,6 @@
define('MENU_TREE__CURRENT_PAGE_MENU', '_active');
// Off-load the following infrequently called hooks to another file.
function menu_block_theme(&$existing, $type, $theme, $path) {
module_load_include('inc', 'menu_block', 'menu_block.admin');
return _menu_block_theme($existing, $type, $theme, $path);
}
function menu_block_block_info() {
module_load_include('inc', 'menu_block', 'menu_block.admin');
return _menu_block_block_info();
......@@ -30,20 +26,6 @@ function menu_block_form_block_admin_display_form_alter(&$form, $form_state) {
module_load_include('inc', 'menu_block', 'menu_block.admin');
return _menu_block_form_block_admin_display_form_alter($form, $form_state);
}
function menu_block_ctools_plugin_directory($module, $plugin) {
module_load_include('inc', 'menu_block', 'menu_block.admin');
return _menu_block_ctools_plugin_directory($module, $plugin);
}
/**
* Implements hook_ctools_block_info().
*
* @see ctools_block_content_type_content_types().
*/
function menu_block_ctools_block_info($module, $delta, &$info) {
$info['icon'] = 'icon_contrib_menu.png';
$info['category'] = t('Menus');
}
/**
* Implements hook_menu().
......@@ -114,6 +96,50 @@ function menu_block_menu_alter(&$items) {
$items['admin/content/book/%node']['tab_root'] = 'admin/content/book';
}
/**
* Implements hook_ctools_plugin_directory().
*/
function menu_block_ctools_plugin_directory($module, $plugin) {
if ($plugin == 'content_types') {
return 'plugins/' . $plugin;
}
}
/**
* Implements hook_ctools_block_info().
*
* @see ctools_block_content_type_content_types().
*/
function menu_block_ctools_block_info($module, $delta, &$info) {
$info['icon'] = 'icon_contrib_menu.png';
$info['category'] = t('Menus');
}
/**
* Implements hook_theme().
*/
function menu_block_theme(&$existing, $type, $theme, $path) {
// Add theme hook suggestion patterns for the core theme functions used in
// this module. We can't add them during hook_theme_registry_alter() because
// we will already have missed the opportunity for the theme engine's
// theme_hook() to process the pattern. And we can't run the pattern ourselves
// because we aren't given the type, theme and path in that hook.
$existing['menu_tree']['pattern'] = 'menu_tree__';
$existing['menu_link']['pattern'] = 'menu_link__';
return array(
'menu_block_wrapper' => array(
'template' => 'menu-block-wrapper',
'variables' => array('content' => array(), 'config' => array(), 'delta' => NULL),
'pattern' => 'menu_block_wrapper__',
),
'menu_block_menu_order' => array(
'render element' => 'element',
'file' => 'menu_block.admin.inc',
),
);
}
/**
* Implements hook_help().
*/
......
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