You are here

function _brightcove_media_session_value_set in Brightcove Video Connect 7.7

Same name and namespace in other branches
  1. 7.6 brightcove_media/brightcove_media.module \_brightcove_media_session_value_set()

Helper function to set a value to the current session.

TODO: This function should be removed and replaced with another storage method that does not rely on the session. This is only a shim at this point to support existing code.

Parameters

string $name: The name of the value to store in the session.

mixed $value: The value to store in the session.

2 calls to _brightcove_media_session_value_set()
ajax_brightcove_media_upload_callback in brightcove_media/brightcove_media.module
Ajax callback for upload form
brightcove_media_file_uri_to_object in brightcove_media/brightcove_media.module
Helper function MediaInternetBrightcoveHandler class getFileObject method.

File

brightcove_media/brightcove_media.module, line 823
This module provide the hook implementations for the integration with Media module.

Code

function _brightcove_media_session_value_set($name, $value) {
  $name = _brightcove_media_session_value_name_personalize($name);

  // If value is NULL, assume the implementer would like to unset the value.
  if ($value === NULL) {
    unset($_SESSION['brightcove_media'][$name]);
  }
  else {
    $_SESSION['brightcove_media'][$name] = $value;
  }
}