You are here

function _scald_relationships in Scald: Media Management made easy 6

Get the available Scald Relationships

This function returns a structured array which specifies all the currently provided Scald Relationships. The actions are in an array with one or more elements in the format: array( 'relationship-slug' => array( 'provider' => 'provider-name', 'title' => 'Plain-text title', 'title_reverse' => 'Plain-text reverse title', ), ... );

Return value

The Scald Relationships array

1 call to _scald_relationships()
scald_config_rebuild in ./scald.module
Rebuild the Scald Configuration Object & other key configuration variables.

File

./scald.module, line 798

Code

function _scald_relationships() {
  $scald_relationships = array();
  $relationship_results = db_query('
    SELECT
      relationship,
      provider,
      title,
      title_reverse
    FROM
      {scald_relationships}
  ');
  while ($relationship_raw = db_fetch_array($relationship_results)) {
    $scald_relationships[$relationship_raw['relationship']] = array(
      'provider' => $relationship_raw['provider'],
      'title' => $relationship_raw['title'],
      'title_reverse' => $relationship_raw['title_reverse'],
    );
  }
  return $scald_relationships;
}