You are here

function _twitter_account_list_row in Twitter 6.3

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.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()
1 call to _twitter_account_list_row()
twitter_account_list_form in ./twitter.pages.inc

File

./twitter.pages.inc, line 93

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(
    '#type' => 'markup',
    '#value' => theme('image', $account->profile_image_url, '', '', array(), FALSE),
  );
  $form['visible_name'] = array(
    '#type' => 'markup',
    '#value' => l($account->screen_name, 'http://www.twitter.com/' . $account->screen_name),
  );
  $form['description'] = array(
    '#type' => 'markup',
    '#value' => filter_xss($account->description),
  );
  $form['protected'] = array(
    '#type' => 'markup',
    '#value' => 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' => user_access('import own tweets') ? $account->import : '',
    );
    $form['include_retweets'] = array(
      '#type' => 'checkbox',
      '#default_value' => user_access('import own tweets') ? $account->include_retweets : '',
    );
  }
  $form['delete'] = array(
    '#type' => 'checkbox',
  );
  return $form;
}