You are here

function socialmedia_platform_definition_load in Social media 7

Load the definition for an widget.

The element definition is a set of core properties for an image element, not containing any user-settings. The definition defines various functions to call when configuring or executing an image element. This loader is mostly for internal use within image.module. Use widgetx_element_load() or widgetx_set_load() to get image elements that contain configuration.

Parameters

$element: The name of the element definition to load.

$set: An image set array to which this element will be added.

Return value

An array containing the image element definition with the following keys:

  • "element": The unique name for the element being performed. Usually prefixed with the name of the module providing the element.
  • "module": The module providing the element.
  • "help": A description of the element.
  • "function": The name of the function that will execute the element.
  • "form": (optional) The name of a function to configure the element.
  • "summary": (optional) The name of a theme function that will display a one-line summary of the element. Does not include the "theme_" prefix.
1 call to socialmedia_platform_definition_load()
socialmedia_tokens in ./socialmedia.tokens.inc

File

./socialmedia.module, line 386
Demonstrate basic module socialmedia.

Code

function socialmedia_platform_definition_load($platform, $uid = NULL) {
  $definitions = socialmedia_platform_definitions();

  // If a set is specified, do not allow loading of default set
  // elements.
  // TODO: what was I doing here? I can't remember, commenting out logic

  /*
  if (isset($uid)) {
    $set = socialmedia_user_load($uid, NULL);
  }
  */
  return isset($definitions[$platform]) ? $definitions[$platform] : FALSE;
}