You are here

function linkit_get_profile_attributes in Linkit 7.2

Get all enabled attributes for the profiles used on the dashboard.

1 call to linkit_get_profile_attributes()
linkit_dashboard_form in ./linkit.module
Implements hook_form().

File

./linkit.module, line 736
Main file for linkit module.

Code

function linkit_get_profile_attributes() {
  $profile = linkit_get_dashboard_profile();
  $enabled_attributes = array();
  if (isset($profile->data['attributes'])) {

    // Loop thru all attributes and build an array with all that is enabled.
    foreach (linkit_get_attributes($profile) as $name => $attribute) {
      if (isset($profile->data['attributes'][$name]['enabled']) && $profile->data['attributes'][$name]['enabled']) {

        // Add Linkit specific class, this is used by the editor JS scripts.
        $attribute['#attributes']['class'][] = 'linkit-attribute';
        $enabled_attributes[$name] = $attribute;
      }
    }
  }
  return $enabled_attributes;
}