You are here

function _hosting_task_button in Hosting 6.2

Same name and namespace in other branches
  1. 7.4 task/hosting_task.module \_hosting_task_button()
  2. 7.3 task/hosting_task.module \_hosting_task_button()
2 calls to _hosting_task_button()
hosting_task_queue_block in task/hosting_task.module
Hosting task list queue block
hosting_task_table in task/hosting_task.module
A concise table listing of the tasks affecting this node

File

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

Code

function _hosting_task_button($title, $link, $description, $class = '', $status = TRUE, $dialog = FALSE, $add_token = TRUE) {
  global $user;
  if ($status) {
    $classes[] = 'hosting-button-enabled';
    if (!empty($class)) {
      $classes[] = $class;
    }
    if ($dialog) {
      $classes[] = 'hosting-button-dialog';
    }
    $options['attributes'] = array(
      'title' => $description,
      'class' => implode(" ", $classes),
    );
    if ($add_token) {
      $options['query'] = array(
        'token' => drupal_get_token($user->uid),
      );
    }
    return l($title, $link, $options);
  }
  else {
    return "<span class='hosting-button-disabled'>" . $title . "</span>";
  }
}