You are here

function _twitter_account_list_row in Twitter 6.5

Same name and namespace in other branches
  1. 6.2 twitter.pages.inc \_twitter_account_list_row()
  2. 6.3 twitter.pages.inc \_twitter_account_list_row()
  3. 6.4 twitter.pages.inc \_twitter_account_list_row()
  4. 7.6 twitter.pages.inc \_twitter_account_list_row()
  5. 7.3 twitter.pages.inc \_twitter_account_list_row()
  6. 7.4 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
Formats each Twitter account as a row within a form.

File

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

Code

function _twitter_account_list_row($account) {
  $form['#account'] = $account;
  $form['id'] = array(
    '#type' => 'value',
    '#value' => $account->id,
  );
  $form['screen_name'] = array(
    '#type' => 'value',
    '#value' => $account->screen_name,
  );
  $form['image'] = array(
    '#value' => theme('image', $account->profile_image_url, '', '', array(
      'width' => 48,
      'height' => '48',
    ), FALSE),
  );
  $form['visible_name'] = array(
    '#value' => _twitter_user_profile($account->screen_name),
  );
  $form['description'] = array(
    '#value' => filter_xss($account->description),
  );
  if (user_access('administer twitter accounts')) {
    $user = user_load($account->uid);
    $form['user'] = array(
      '#value' => l($user->name, 'user/' . $account->uid),
    );
  }
  $form['auth'] = array(
    '#value' => $account
      ->is_auth() ? t('Yes') : t('No'),
  );
  $form['protected'] = array(
    '#value' => empty($account->protected) ? t('No') : t('Yes'),
  );
  $form['import'] = array(
    '#type' => 'checkbox',
    '#default_value' => $account->import ? $account->import : '',
  );
  if ($account->import == TRUE) {
    $form['import']['#suffix'] = l('View', 'tweets/' . $account->screen_name, array(
      'attributes' => array(
        'target' => '_blank',
      ),
    ));
  }
  if ($account
    ->is_auth()) {
    $form['mentions'] = array(
      '#type' => 'checkbox',
      '#default_value' => $account->mentions ? $account->mentions : '',
    );
    $form['is_global'] = array(
      '#type' => 'checkbox',
      '#default_value' => $account->is_global ? $account->is_global : '',
      '#attributes' => array(
        'title' => t('By enabling this option, anyone may post using it.'),
      ),
    );
  }
  else {
    $form['mentions'] = array(
      '#value' => '',
    );
    $form['is_global'] = array(
      '#value' => '',
    );
  }
  $form['delete'] = array(
    '#type' => 'checkbox',
  );
  return $form;
}