You are here

function abjs_experience_admin in A/B Test JS 7

Lists all experiences in default table, sorted by modified date.

For each experience, link to edit form, and list created and edited info.

1 string reference to 'abjs_experience_admin'
abjs_menu in ./abjs.module
Implements hook_menu().

File

./abjs.admin.inc, line 777
Admin forms to view/add/edit/delete tests, conditions, experiences.

Code

function abjs_experience_admin() {
  $header = array(
    t('ID'),
    t('Name'),
    t('Created'),
    t('Created By'),
    t('Changed'),
    t('Changed By'),
  );
  $rows = array();
  $experiences = db_query("SELECT * FROM {abjs_experience} ORDER BY changed DESC, created DESC");
  foreach ($experiences as $experience) {
    $user_created = user_load($experience->created_by);
    $user_changed = user_load($experience->changed_by);
    $rows[] = array(
      'e_' . $experience->eid,
      l($experience->name, '/admin/config/user-interface/abjs/experiences/' . $experience->eid . '/edit/'),
      format_date($experience->created),
      theme('username', array(
        'account' => $user_created,
      )),
      format_date($experience->changed),
      theme('username', array(
        'account' => $user_changed,
      )),
    );
  }
  return l(t('Add new experience'), '/admin/config/user-interface/abjs/experiences/add/') . '<br><br>' . theme('table', array(
    'header' => $header,
    'rows' => $rows,
  ));
}