You are here

function gmap_debug_block in GMap Addons 7

Same name and namespace in other branches
  1. 5 gmap_debug/gmap_debug.module \gmap_debug_block()
  2. 6 gmap_debug/gmap_debug.module \gmap_debug_block()

Implementation of hook_block().

File

gmap_debug/gmap_debug.module, line 11
Debugging helpers for gmap.

Code

function gmap_debug_block($op = 'list', $delta = 0, $edit = array()) {
  switch ($op) {
    case 'list':
      return array(
        'gmap_debug' => array(
          'info' => t('GMap Debug'),
        ),
      );
    case 'view':
      if ($delta = 'gmap_debug') {
        drupal_add_js(drupal_get_path('module', 'gmap_debug') . '/gmap_debug.js', 'module', 'header', FALSE, TRUE, FALSE);
        $output = '';
        $output .= theme('menu_item', l(t('Force size check'), '', array(
          'attributes' => array(
            'id' => 'gmap-debug-forcesizecheck',
          ),
        )), FALSE);
        $output .= theme('menu_item', l(t('Run behavior attach'), '', array(
          'attributes' => array(
            'id' => 'gmap-debug-startup',
          ),
        )), FALSE);
        $output .= theme('menu_item', l(t('Shutdown map'), '', array(
          'attributes' => array(
            'id' => 'gmap-debug-shutdown',
          ),
        )), FALSE);
        $output .= theme('menu_item', l(t('Reboot map'), '', array(
          'attributes' => array(
            'id' => 'gmap-debug-reboot',
          ),
        )), FALSE);
        return array(
          'subject' => t('GMap Debug'),
          'content' => theme('menu_tree', $output),
        );
      }
  }
}