You are here

function brightcove_parse_id in Brightcove Video Connect 6.2

Same name and namespace in other branches
  1. 6 brightcove.module \brightcove_parse_id()
  2. 7.7 brightcove.module \brightcove_parse_id()
  3. 7.2 brightcove.module \brightcove_parse_id()
  4. 7.3 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_cck_browser_validate in brightcove_cck/brightcove_cck.module
Validate callback for the field.
brightcove_mm_complete_video in ./brightcove.media_mover.inc
Complete operation for Media Mover - will attach a video to CCK field.

File

./brightcove.module, line 423
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;
}