You are here

function hosting_client_block in Hosting 6.2

Same name and namespace in other branches
  1. 5 client/hosting_client.module \hosting_client_block()

Implementation of hook_block().

File

client/hosting_client.module, line 906

Code

function hosting_client_block($op = 'list', $delta = 0, $edit = array()) {
  $blocks = array();
  switch ($op) {
    case 'list':
      $blocks['hosting_clients'] = array(
        'info' => t('Hosting clients'),
        'enabled' => 1,
        'region' => 'left',
        'weight' => 10,
      );
      break;
    case 'view':
      switch ($delta) {
        case 'hosting_clients':
          $blocks['title'] = t('Clients');
          $blocks['content'] = user_access('view client') ? hosting_client_list() : '';
          if (user_access('create client')) {
            $blocks['content'] .= l(t('Add new client'), 'node/add/client', array(
              'attributes' => array(
                'class' => 'add-new-client',
              ),
            ));
          }
          break;
      }
  }
  return $blocks;
}