function _collclaim_add_claim($uid, $collection_id, $hd, $copyright, $display, $note, $openmosaic) { db_set_active(CLAIM_DB); // Use CLAIM database if (!db_table_exists(CLAIM_COLL)) { _build_claiming_table(); } $obj = array('cid' => $collection_id, 'uid' => $uid, 'hd' => $hd, 'copyright' => $copyright, 'display' => $display, 'note' => $note, 'created' => time(), 'openmosaic' => $openmosaic); $claim_id = 0; try { $query = db_insert(CLAIM_COLL)->fields($obj); $claim_id = $query->execute(); } catch (Exception $e) { dbug_message($e->errorInfo[2]); } db_set_active(); return $claim_id; }
function reorder_collection_files($nid) { $targets = get_store_of_collection($nid); $archive = drupal_realpath($targets[0]); $archive0 = drupal_realpath($targets[1]); $archive_mosbk = drupal_realpath($targets[2]); $public = drupal_realpath($targets[3]); $public0 = drupal_realpath($targets[4]); $all_files = get_collection_files($nid); $archive_files = $all_files['archive']; $archive0_files = $all_files['archive0']; $archive_mosbk_files = $all_files['archive_mosbk']; $public_files = $all_files['public']; $public0_files = $all_files['public0']; try { __reorder_files($nid, $archive_files, $archive); __reorder_files($nid, $archive0_files, $archive0); __reorder_files($nid, $archive_mosbk_files, $archive_mosbk); __reorder_files($nid, $public_files, $public); __reorder_files($nid, $public0_files, $public0); } catch (Exception $e) { dbug_message($e); } }