You are here

function soundmanager2_block_view in SoundManager2 7.2

Implments hook_block_view().

File

./soundmanager2.module, line 161
Responsible for managing the required SWF and JS files for soundmanager2 to work

Code

function soundmanager2_block_view($delta = '') {
  $block = array();
  switch ($delta) {
    case 'sm2_debug':

      // Only show the debug block if debug mode is enabled
      if (variable_get('sm2_debug_mode', FALSE)) {
        $block_content = '<div id="soundmanager-debug"><p>Debug block for SoundManager 2</p></div>';
        $block = array(
          'subject' => t('SoundManager 2 Debug'),
          'content' => $block_content,
        );
        drupal_add_css('#soundmanager-debug { position:absolute;position:fixed;*position:absolute;bottom:10px;right:10px;width:50em;height:18em;overflow:auto;background:#fff;margin:1em;padding:1em;border:1px solid #999;font-family:"lucida console",verdana,tahoma,"sans serif";font-size:x-small;line-height:1.5em;opacity:0.9;filter:alpha(opacity=90);}', array(
          'type' => 'inline',
        ));
      }
      break;
  }
  return $block;
}