You are here

function brightcove_parse_id in Brightcove Video Connect 7.3

Same name and namespace in other branches
  1. 6.2 brightcove.module \brightcove_parse_id()
  2. 6 brightcove.module \brightcove_parse_id()
  3. 7.7 brightcove.module \brightcove_parse_id()
  4. 7.2 brightcove.module \brightcove_parse_id()
  5. 7.4 brightcove.module \brightcove_parse_id()
  6. 7.5 brightcove.module \brightcove_parse_id()
  7. 7.6 brightcove.module \brightcove_parse_id()

Parse a field value in form of "title [id:123]" and return 123

Parameters

$id: Video ID in form of "title [id:123]".

Return value

Int value of the ID or NULL if not found.

2 calls to brightcove_parse_id()
brightcove_field_browser_playlist_validate in brightcove_field/brightcove_field.module
Validate callback for the playlist field.
brightcove_field_browser_video_validate in brightcove_field/brightcove_field.module
Validate callback for the video field.

File

./brightcove.module, line 731
Brightcove module is an integration layer between any modules using Brightcove API. It makes all necessary checks for the API and makes settings available to the user.

Code

function brightcove_parse_id($id) {
  preg_match('/\\[id:([^\\[]*)\\]$/', $id, $matches);
  if (count($matches) == 2) {
    return $matches[1];
  }
  return NULL;
}