You are here

function oa_update_admin_form in Open Atrium Core 7.2

Update distro help page..

1 string reference to 'oa_update_admin_form'
oa_update_menu in modules/oa_update/oa_update.module
Implements hook_menu().

File

modules/oa_update/oa_update.module, line 45
Code for the oa_update module

Code

function oa_update_admin_form() {
  $form = array();
  $form['header'] = array(
    '#theme' => 'html_tag',
    '#tag' => 'h3',
    '#value' => t('Do not manually update modules within distributions!'),
  );
  $form['help'] = array(
    '#markup' => '<p>' . t('Drupal Distributions contain a carefully selected set of module
      versions along with specific patches.  You should never update individual modules
      within a distribution unless you are an experienced developer.') . '</p><p>' . t('If you REALLY know what you are doing, you can find the links to the normal Drupal
        update pages in the collapsed section below.') . '</p>',
  );

  // display the update status for just our profile
  $profile_name = drupal_get_profile();
  if (!empty($profile_name)) {
    $available = update_get_available(TRUE);
    if (empty($available[$profile_name])) {

      // if we haven't fetched the update info for the profile yet
      // then do it now
      module_load_include('inc', 'update', 'update.fetch');
      $project = oa_update_get_profile($profile_name);
      _update_process_fetch_task($project);
      $available = update_get_available(TRUE);
    }
    if (!empty($available[$profile_name])) {
      module_load_include('inc', 'update', 'update.compare');
      module_load_include('inc', 'update', 'update.report');
      $data = update_calculate_project_data($available);
      $profile[$profile_name] = $data[$profile_name];
      $markup = theme('update_report', array(
        'data' => $profile,
      ));
      $markup = str_replace('<h3>' . t('Modules') . '</h3>', '<h3>' . t('Distribution') . '</h3>', $markup);
      $form['profile'] = array(
        '#markup' => $markup,
      );
    }
  }
  $form['update'] = array(
    '#type' => 'fieldset',
    '#title' => 'Update Links',
    '#collapsible' => TRUE,
    '#collapsed' => !variable_get('oa_update_enable', FALSE),
  );
  $form['update']['oa_update_enable'] = array(
    '#type' => 'checkbox',
    '#title' => 'Enable module update status',
    '#description' => t('Enable this option (and Save) to access the normal update links'),
    '#default_value' => variable_get('oa_update_enable', FALSE),
  );
  if (variable_get('oa_update_enable', FALSE)) {
    $links[] = array(
      'title' => 'Available updates',
      'href' => 'admin/reports/oa_updates',
    );
    $links[] = array(
      'title' => 'Check for available updates',
      'href' => 'admin/reports/oa_updates/update',
    );
    $form['update']['links'] = array(
      '#theme' => 'links',
      '#links' => $links,
    );
  }
  $form['#submit'][] = 'oa_update_admin_form_submit';
  return system_settings_form($form);
}