You are here

function jw_player_update_7003 in JW Player 7.2

Set JW Player hosting based on currently saved keys and URLs.

File

./jw_player.install, line 147
Install, update and uninstall functions for the JW Player module.

Code

function jw_player_update_7003() {

  // If a license key has been entered, we assume this is self-hosting.
  if (variable_get('jw_player_key', FALSE) || variable_get('jw_player_key_7', FALSE)) {
    variable_set('jw_player_hosting', 'self');
    variable_set('jw_player_cloud_player_default', '');
    drupal_set_message(t('JW Player hosting has been set to Self-Hosting, and any saved cloud-hosting URL removed.'));
  }
  else {
    if (variable_get('jw_player_cloud_player_default', FALSE)) {
      variable_set('jw_player_hosting', 'cloud');
      variable_set('jw_player_key', '');
      variable_set('jw_player_key_7', '');
      drupal_set_message(t('JW Player hosting has been set to Cloud-Hosting, and any saved self-hosting license keys removed.'));
    }
    else {
      if (variable_get('jw_player_version', FALSE)) {
        variable_set('jw_player_hosting', 'self');
        drupal_set_message(t('JW Player hosting has been set by default to Self-Hosting.'));
      }
    }
  }
}