You are here

function social_content_variable_info in Social Content 7

Same name and namespace in other branches
  1. 7.2 social_content.variable.inc \social_content_variable_info()

Implements hook_variable_info().

File

./social_content.variable.inc, line 22
Social content variable file

Code

function social_content_variable_info($options) {
  $types = social_content_get_types();
  foreach ($types as $type) {

    // TODO: Apparently it is possible to pass tokens into the variable name
    // (see variable.api.php hook_variable_info())
    // But I was unable to get this working.
    // NOTE: Using type => array means that all variables
    // get type => 'textfield'.  If we ever want to use different types
    // we will need to declare each variable separatley.
    $admin_link = l(t('!social_content_type settings form', array(
      '!social_content_type' => $type['title'],
    )), 'admin/config/services/social-content/' . $type['name']);
    $variable['social_content_' . $type['name']] = array(
      'title' => t('Social Content: !social_content_type', array(
        '!social_content_type' => $type['title'],
      )),
      'type' => 'array',
      'group' => 'social_content',
      'localize' => TRUE,
      'description' => t('Please configure these settings through the !social_settings_form.', array(
        '!social_settings_form' => $admin_link,
      )),
    );
  }
  return $variable;
}