You are here

function _twitter_account_list_row in Twitter 7.5

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.4 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 213
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(
    '#theme' => 'image',
    '#path' => $account->profile_image_url,
    '#width' => 48,
    '#height' => 48,
  );
  $form['visible_name'] = array(
    '#markup' => _twitter_user_profile($account->screen_name),
  );
  $form['description'] = array(
    '#markup' => filter_xss($account->description),
  );
  if (user_access('administer twitter accounts')) {
    $user = user_load($account->uid);
    $form['user'] = array(
      '#markup' => l($user->name, 'user/' . $account->uid),
    );
  }
  $form['auth'] = array(
    '#markup' => $account
      ->is_auth() ? t('Yes') : t('No'),
  );
  $form['protected'] = array(
    '#markup' => 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(
      '#markup' => '',
    );
    $form['is_global'] = array(
      '#markup' => '',
    );
  }
  $form['delete'] = array(
    '#type' => 'checkbox',
  );
  return $form;
}