You are here

function radioactivity_node_block in Radioactivity 6

Implementation of hook_block().

See also

boost_block()

File

plugins/radioactivity_node.module, line 249
Node radioactivity

Code

function radioactivity_node_block($op = 'list', $delta = 0, $edit = array()) {
  global $user;
  switch ($op) {
    case 'list':
      return array(
        0 => array(
          'info' => t('Radioactivity Node: AJAX update'),
          'cache' => BLOCK_NO_CACHE,
        ),
      );
    case 'view':
      switch ($delta) {
        case 0:
          if (!(strpos($_SERVER['SCRIPT_FILENAME'], 'index.php') === FALSE || variable_get('site_offline', 0) || $_SERVER['REQUEST_METHOD'] != 'GET' && $_SERVER['REQUEST_METHOD'] != 'HEAD' || $_SERVER['SERVER_SOFTWARE'] === 'PHP CLI' || isset($_GET['nocache']) || !empty($user->uid) || variable_get('radioactivity_node_anon_hook_mode', '') != 'ajax')) {
            $block = array();
            $block['subject'] = '';
            $block['content'] = '<div id="node-radioactivity-update"></div>' . radioactivity_node_ajax_code();
            return $block;
          }
          break;
      }
  }
}