You are here

function linkedin_status_linkedin_user_settings_page in LinkedIn Integration 7

Same name and namespace in other branches
  1. 6 linkedin_status/linkedin_status.module \linkedin_status_linkedin_user_settings_page()

@todo Please document this function.

See also

http://drupal.org/node/1354

File

linkedin_status/linkedin_status.pages.inc, line 99

Code

function linkedin_status_linkedin_user_settings_page($account) {
  $elems = array();
  if (user_access('update LinkedIn status')) {

    //check if linkedin status update is enabled for at least one content type
    $types = node_type_get_types();
    $type = new stdClass();

    //$type->type = 'event_signup';

    //$types[] = $type;
    $type->type = 'comment';
    $types[] = $type;
    foreach ($types as $type) {
      if (variable_get('linkedin_status_enabled_' . $type->type, '0' == '1')) {

        //if true add related option
        $elems['linkedin_status_enabled_by_default'] = array(
          '#type' => 'checkbox',
          '#default_value' => isset($account->data['linkedin_status_enabled_by_default']) ? $account->data['linkedin_status_enabled_by_default'] : '0',
          '#title' => t('By default, on actions such as posting content, update your LinkedIn status'),
          '#description' => t('(You can always bypass this setting individually)'),
        );
        return $elems;
      }
    }
  }
  return;
}