You are here

function _hosting_task_button in Hosting 7.3

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

Utility function to create HTML for a task button.

1 call to _hosting_task_button()
hosting_task_table in task/hosting_task.module
A concise table listing of the tasks affecting this node.

File

task/hosting_task.module, line 1668
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' => $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>";
  }
}