You are here

function abjs_condition_admin in A/B Test JS 7

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

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

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

File

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

Code

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