You are here

function theme_drupagram_account_list_form in Drupagram 6

Same name and namespace in other branches
  1. 7 drupagram.pages.inc \theme_drupagram_account_list_form()

File

./drupagram.pages.inc, line 307
Provieds drupagram forms.

Code

function theme_drupagram_account_list_form($form) {

  //$form = $variables;
  if (variable_get('drupagram_import', TRUE) && user_access('import own media')) {
    $header = array(
      '',
      t('Name'),
      t('Description'),
      t('Import'),
      t('Delete'),
    );
  }
  else {
    $header = array(
      '',
      t('Name'),
      t('Description'),
      t('Delete'),
    );
  }
  $rows = array();
  foreach (element_children($form['accounts']) as $key) {
    $element =& $form['accounts'][$key];
    if (variable_get('drupagram_import', TRUE) && user_access('import own media')) {
      $row = array(
        drupal_render($element['image']),
        drupal_render($element['id']) . drupal_render($element['username']) . drupal_render($element['visible_name']),
        drupal_render($element['description']),
        drupal_render($element['import']),
        drupal_render($element['delete']),
      );
    }
    else {
      $row = array(
        drupal_render($element['image']),
        drupal_render($element['id']) . drupal_render($element['username']) . drupal_render($element['visible_name']),
        drupal_render($element['description']),
        drupal_render($element['delete']),
      );
    }
    $rows[] = $row;
  }
  $output = theme('table', $header, $rows);
  $output .= drupal_render($form);
  return $output;
}