You are here

function _twitter_account_list_row in Twitter 7.4

Same name and namespace in other branches
  1. 6.5 twitter.pages.inc \_twitter_account_list_row()
  2. 6.2 twitter.pages.inc \_twitter_account_list_row()
  3. 6.3 twitter.pages.inc \_twitter_account_list_row()
  4. 6.4 twitter.pages.inc \_twitter_account_list_row()
  5. 7.6 twitter.pages.inc \_twitter_account_list_row()
  6. 7.3 twitter.pages.inc \_twitter_account_list_row()
  7. 7.5 twitter.pages.inc \_twitter_account_list_row()

Returns the form fields to manage a Twitter account.

1 call to _twitter_account_list_row()
twitter_account_list_form in ./twitter.pages.inc
@todo Please document this function.

File

./twitter.pages.inc, line 121
Page callbacks for Twitter module.

Code

function _twitter_account_list_row($account) {
  $form['#account'] = $account;
  $form['id'] = array(
    '#type' => 'value',
    '#value' => $account->id,
  );
  $form['uid'] = array(
    '#type' => 'value',
    '#value' => $account->uid,
  );
  $form['screen_name'] = array(
    '#type' => 'value',
    '#value' => $account->screen_name,
  );
  $form['image'] = array(
    '#markup' => theme('image', array(
      'path' => $account->profile_image_url,
    )),
  );
  $form['visible_name'] = array(
    '#markup' => l($account->screen_name, 'http://www.twitter.com/' . $account->screen_name),
  );
  $form['description'] = array(
    '#markup' => filter_xss($account->description),
  );
  $form['protected'] = array(
    '#markup' => empty($account->protected) ? t('No') : t('Yes'),
  );

  // Here we use user_access('import own tweets') to check permission
  // instead of user_access('import own tweets', $account->uid)
  // because we allow roles with sufficient permission to overwrite
  // the user's import settings.
  if (variable_get('twitter_import', TRUE) && user_access('import own tweets')) {
    $form['import'] = array(
      '#type' => 'checkbox',
      '#default_value' => $account->import ? $account->import : '',
    );
    $form['mentions'] = array(
      '#type' => 'checkbox',
      '#default_value' => $account->mentions ? $account->mentions : '',
    );
  }
  $form['delete'] = array(
    '#type' => 'checkbox',
  );
  return $form;
}