You are here

function brilliant_gallery_checklist_loadall in Brilliant Gallery 5.4

Same name and namespace in other branches
  1. 5.3 brilliant_gallery.module \brilliant_gallery_checklist_loadall()
  2. 6.4 brilliant_gallery.module \brilliant_gallery_checklist_loadall()
  3. 6 brilliant_gallery.module \brilliant_gallery_checklist_loadall()
  4. 6.2 brilliant_gallery.module \brilliant_gallery_checklist_loadall()
  5. 6.3 brilliant_gallery.module \brilliant_gallery_checklist_loadall()
  6. 7.2 OLD_brilliant_gallery.module \brilliant_gallery_checklist_loadall()
  7. 7 brilliant_gallery.module \brilliant_gallery_checklist_loadall()
1 string reference to 'brilliant_gallery_checklist_loadall'
brilliant_gallery_menu in ./brilliant_gallery.module

File

./brilliant_gallery.module, line 94

Code

function brilliant_gallery_checklist_loadall($nid = '') {
  global $user;
  $GLOBALS['devel_shutdown'] = FALSE;
  $uid = $user->uid;
  $dcvals = array();

  // any checkbox id that starts with user- we remember the current user's settings
  // any other id is global and we use user=0
  $result = db_query("select qid,state from brilliant_gallery_checklist " . " where nid=%d and qid not like 'user-%' and user=0 " . " union " . "select qid,state from brilliant_gallery_checklist " . "where nid=%d and qid like 'user-%' and user=%d ", $nid, $nid, $uid);
  $count = 0;
  while ($data = db_fetch_object($result)) {
    $dcvals[$count] = array(
      qid => $data->qid,
      state => $data->state,
    );
    $count++;
  }
  print drupal_to_js($dcvals);
  exit;
}