You are here

function drd_server_admin_block in Drupal Remote Dashboard Server 7

Same name and namespace in other branches
  1. 7.2 drd_server.admin.inc \drd_server_admin_block()

DRD Server Admin block.

1 call to drd_server_admin_block()
drd_server_block_view in ./drd_server.module
Implements hook_block_view().

File

./drd_server.admin.inc, line 6

Code

function drd_server_admin_block() {
  $block = array(
    'subject' => t('Extra Admin'),
    'content' => '',
  );
  $menu = array();
  if (user_access('administer site configuration')) {
    $menu[] = array(
      'data' => l(t('Run Cron'), 'admin/reports/status/run-cron'),
      'class' => array(
        'leaf',
      ),
    );
    $menu[] = array(
      'data' => l(t('Run Update'), 'update.php'),
      'class' => array(
        'leaf',
      ),
    );
  }
  if (user_access('flush cache')) {
    $menu[] = array(
      'data' => l(t('Flush Cache'), 'admin/drd_server/flush/cache'),
      'class' => array(
        'leaf',
      ),
    );
  }
  if (user_access('translate interface')) {
    $menu[] = array(
      'data' => l(t('Update Translation'), 'admin/drd_server/update/translation'),
      'class' => array(
        'leaf',
      ),
    );
  }
  drupal_alter('drd_server_admin_block', $menu);
  $block['content'] = theme('item_list', array(
    'items' => $menu,
    'attributes' => array(
      'class' => array(
        'menu',
      ),
    ),
  ));
  return $block;
}