You are here

function hosting_task_queue_block in Hosting 6.2

Hosting task list queue block

1 call to hosting_task_queue_block()
hosting_task_summary in task/hosting_task.module
Implementation of hosting_hook_summary()

File

task/hosting_task.module, line 1036
Web server node type is defined here.

Code

function hosting_task_queue_block() {
  drupal_add_js(drupal_get_path('module', 'hosting_task') . '/hosting_task.js');
  $settings['hostingTaskRefresh'] = array(
    'queueBlock' => 1,
  );
  drupal_add_js($settings, 'setting');
  $nodes = hosting_get_tasks('t.task-status', HOSTING_TASK_QUEUED, 5);
  $headers = array(
    t('Task'),
    t('Actions'),
  );
  $rows[] = array();
  foreach ($nodes as $node) {
    $row = array();
    $row['type'] = array(
      'data' => drupal_ucfirst(str_replace(array(
        '_',
        '-',
      ), ' ', $node->task_type)) . ' ' . _hosting_node_link($node->rid),
      'class' => 'hosting-status',
    );
    $log_button = _hosting_task_button(t('View'), 'node/' . $node->nid, t("Display the task log"), 'hosting-button-log', isset($node->nid) && user_access('access task logs'), true, false);
    $row['actions'] = array(
      'data' => $log_button,
      'class' => 'hosting-actions',
    );
    $class = hosting_task_status_class($node->task_status);
    $rows[] = array(
      'data' => $row,
      'class' => $class,
    );
  }
  return "<div id='hosting-task-queue-block'>" . theme('table', $headers, $rows, array(
    'class' => 'hosting-table',
  )) . "</div>";
}