### Eclipse Workspace Patch 1.0 #P click_heatmap Index: click_heatmap.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/click_heatmap/click_heatmap.module,v retrieving revision 1.5.4.5 diff -u -r1.5.4.5 click_heatmap.module --- click_heatmap.module 9 Mar 2008 20:04:04 -0000 1.5.4.5 +++ click_heatmap.module 9 Mar 2008 20:27:43 -0000 @@ -81,40 +81,31 @@ } /** - * Implementation of hook_footer(). + * Implementation of hook_block(). */ -function click_heatmap_footer() { - if (click_heatmap_display()) { - drupal_add_js( - "clickHeatSite = '". variable_get('site_name', 'Drupal Click Heatmap') ."'; - clickHeatGroup = '". click_heatmap_get_url() ."'; - clickHeatServer = '". click_heatmap_remove_language_prefix(url(drupal_get_path('module', 'click_heatmap') ."/clickheat/click.php", array('absolute' => TRUE))) ."'; - initClickHeat();", - 'inline', 'footer'); - return ''."\n"; +function click_heatmap_block($op = 'list', $delta = 0, $edit = array()) { + switch ($op) { + case 'list': + $blocks = array(); + $blocks[0]['info'] = t('Click Heatmap'); + return $blocks; + case 'configure': + return array(); + case 'save': + return; + case 'view': default: + $block = array(); + $block['content'] = ''."\n"; + drupal_add_js( + "clickHeatSite = '". variable_get('site_name', 'Drupal Click Heatmap') ."'; + clickHeatGroup = '". click_heatmap_get_url() ."'; + clickHeatServer = '". click_heatmap_remove_language_prefix(url(drupal_get_path('module', 'click_heatmap') ."/clickheat/click.php", array('absolute' => TRUE))) ."'; + initClickHeat();", + 'inline', 'footer'); } } /** - * Check to see if the click heatmap javascript should be added to the page. - */ -function click_heatmap_display() { - if (variable_get('click_heatmap_library_installed', FALSE) !== FALSE) { - switch (variable_get('click_heatmap_scope', 'home')) { - case 'all': - return TRUE; - case 'user': - return (strpos(substr(click_heatmap_get_url(), 0, 5), 'admin') === FALSE); - case 'admin': - return (strpos(substr(click_heatmap_get_url(), 0, 5), 'admin') !== FALSE); - case 'home': - return (click_heatmap_get_url() == 'home'); - } - } - return FALSE; -} - -/** * Get the url to be used with ClickHeat system. */ function click_heatmap_get_url() {