You are here

function _hosting_task_log_table in Hosting 5

Same name and namespace in other branches
  1. 6.2 task/hosting_task.module \_hosting_task_log_table()
  2. 7.4 task/hosting_task.module \_hosting_task_log_table()
  3. 7.3 task/hosting_task.module \_hosting_task_log_table()

Display table containing the logged information for this task

1 call to _hosting_task_log_table()
hosting_task_view in task/hosting_task.module
Implementation of hook_view().

File

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

Code

function _hosting_task_log_table($vid) {
  $result = db_query("SELECT * FROM {hosting_task_log} WHERE vid=%d", $vid);
  if (db_num_rows($result)) {
    $header = array(
      'data' => 'Log message',
    );
    while ($entry = db_fetch_object($result)) {
      if (strlen($entry->message) > 300) {
        $summary = "<span class='hosting-task-summary'>" . filter_xss(substr($entry->message, 0, 75), array()) . "... <a href='javascript:void(0)' class='hosting-summary-expand'>(" . t('Expand') . ')</a></span>';
        $message = $summary . "<span class='hosting-task-full'>" . filter_xss($entry->message) . '</span>';
      }
      else {
        $message = $entry->message;
      }
      $row = array(
        array(
          'data' => $message,
          'class' => 'hosting-status',
        ),
      );
      $rows[] = array(
        'data' => $row,
        'class' => _hosting_task_log_class($entry->type),
      );
    }
    return theme("table", $header, (array) $rows, array(
      'id' => 'hosting-task-log',
      'class' => 'hosting-table',
    ));
  }
  return false;
}