You are here

function content_profile_template_preprocess in Content Profile 6

Adds $content_profile variable if we can find a $uid.

1 string reference to 'content_profile_template_preprocess'
content_profile_theme_registry_alter in ./content_profile.module
Implementation of hook_theme_registry_alter(). Adds our own preprocess functions to some templates. Further templates can be set in $conf['content_profile_extra_templates'] in settings.php.

File

./content_profile.module, line 646

Code

function content_profile_template_preprocess(&$variables, $hook) {

  // Search the uid
  foreach (array(
    'account_id',
    'uid',
    'account',
    'node',
    'comment',
    'user',
  ) as $name) {
    if (isset($variables[$name])) {
      $uid = is_object($variables[$name]) ? $variables[$name]->uid : $variables[$name];
      $variables['content_profile'] = new content_profile_theme_variables($uid);
      break;
    }
  }
}