You are here

function opigno_lms_install_tasks in Opigno LMS 7

Same name and namespace in other branches
  1. 8.2 opigno_lms.profile \opigno_lms_install_tasks()
  2. 3.x opigno_lms.profile \opigno_lms_install_tasks()

Implements hook_install_tasks().

File

./opigno_lms.profile, line 109
Enables modules and site configuration for a standard site installation. Provides a default API for Apps and modules to use. This will simplify the user experience.

Code

function opigno_lms_install_tasks(&$install_state) {

  // Add our custom CSS file for the installation process.
  drupal_add_css(drupal_get_path('profile', 'opigno_lms') . '/css/opigno_lms.css');
  $tasks = array();
  $tasks['opigno_lms_install_task_post_install'] = array();
  $tasks['opigno_lms_verify_requirements'] = array(
    'display_name' => st('Check Opigno requirements'),
    'type' => 'form',
  );
  if (!empty($install_state['parameters']['opigno_requirements_finished'])) {
    $tasks['opigno_lms_verify_requirements']['run'] = INSTALL_TASK_SKIP;
  }

  // Determine whether translation import tasks will need to be performed.
  $needs_translations = count($install_state['locales']) > 1 && !empty($install_state['parameters']['locale']) && $install_state['parameters']['locale'] != 'en';
  $tasks['opigno_lms_install_import_translation'] = array(
    'display_name' => st('Set up translations'),
    'display' => $needs_translations,
    'run' => $needs_translations ? INSTALL_TASK_RUN_IF_NOT_COMPLETED : INSTALL_TASK_SKIP,
    'type' => 'batch',
  );
  return $tasks;
}