1 installer.browser.inc installer_browser_add_remove_queue_link($project_name, $title = NULL, $id_prefix = 'add-to-queue-link')

Builds the add/remove project to install queue link.

File

core/modules/installer/installer.browser.inc, line 487
Various functions that are required by the Installer browse pages.

Code

function installer_browser_add_remove_queue_link($project_name, $title = NULL, $id_prefix = 'add-to-queue-link') {
  $queued_projects = installer_browser_get_queued_projects();
  if (!$title) {
    $title = isset($queued_projects[$project_name]) ? t('Remove from Installation queue') : t('Add to Installation queue');
  }
  $op = isset($queued_projects[$project_name]) ? 'remove' : 'add';

  if (backdrop_is_dialog()) {
    $form = backdrop_get_form('installer_browser_add_remove_queue_dialog_link', $project_name, $op, $title);
    return backdrop_render($form);
  }
  else {
    $build['ajax_link'] = array(
      '#type' => 'link',
      '#title' => $title,
      '#href' => 'admin/installer/queue/nojs/' . $op . '/' . $project_name,
      '#options' => array(
        'query' => backdrop_get_destination(),
      ),
      '#id' => $id_prefix . '-' . $project_name,
      '#ajax' => array(
        'effect' => 'fade',
        'speed' => 1000,
        'progress' => array(
          'type' => 'throbber',
        ),
      ),
    );

  }

  return backdrop_render($build);
}