? .DS_Store ? actions_14.patch ? actions_help.patch ? block_dnd-add_drag_drop_to_blocks-181066-86.patch ? block_sane_help.patch ? book_ahahapi_4.patch ? comment_notice.patch ? draggable-menu-181126-16.patch ? drupal_drag_and_drop_12.patch ? drupal_drag_and_drop_14.patch ? files ? fix_garland_and_menu_theme.patch ? form_expand_ahah.patch ? install_profile_notice.patch ? jquery_upgrade.patch ? lower_13.patch ? lower_14.patch ? menu_drag_and_drop_0.patch ? poll-drag-drop.patch ? powered_by_drupal.patch ? powered_by_drupal_2.patch ? tracker-union-2.patch ? upload_weight.patch ? misc/draggable.png ? misc/tabledrag.js ? misc/tree-bottom.png ? misc/tree.png ? modules/.DS_Store ? modules/block/.DS_Store ? modules/block/block.js ? modules/menu/.DS_Store ? modules/tracker/.DS_Store ? modules/translation/.DS_Store ? profiles/.DS_Store ? profiles/single_user_blog ? sites/.DS_Store ? sites/views ? sites/all/.DS_Store ? sites/all/modules ? sites/all/themes ? sites/default/settings.php ? themes/.DS_Store ? themes/engines/.DS_Store ? themes/garland/.DS_Store Index: modules/upload/upload.install =================================================================== RCS file: /cvs/drupal/drupal/modules/upload/upload.install,v retrieving revision 1.4 diff -r1.4 upload.install 62a63,68 > 'weight' => array( > 'type' => 'int', > 'not null' => FALSE, > 'default' => 0, > 'description' => t('The weight of this file among other files for the node.'), > ), 71c77,81 < --- > function upload_update_6001() { > $ret = array(); > db_add_field($ret, 'upload', 'weight', array('type' => 'int', 'not null' => FALSE, 'default' => 0)); > return $ret; > } Index: modules/upload/upload.module =================================================================== RCS file: /cvs/drupal/drupal/modules/upload/upload.module,v retrieving revision 1.188 diff -r1.188 upload.module 298c298 < upload_save($node); --- > upload_save($node, $teaser); 381c381 < function upload_save(&$node) { --- > function upload_save(&$node, $form) { 384c384 < } --- > }print_r($form); 411c411 < db_query("INSERT INTO {upload} (fid, nid, vid, list, description) VALUES (%d, %d, %d, %d, '%s')", $file->fid, $node->nid, $node->vid, $file->list, $file->description); --- > db_query("INSERT INTO {upload} (fid, nid, vid, list, weight, description) VALUES (%d, %d, %d, %d, %d, '%s')", $file->fid, $node->nid, $node->vid, $file->list, $file->weight, $file->description); 416c416 < db_query("UPDATE {upload} SET list = %d, description = '%s' WHERE fid = %d AND vid = %d", $file->list, $file->description, $file->fid, $node->vid); --- > db_query("UPDATE {upload} SET list = %d, weight = %d, description = '%s' WHERE fid = %d AND vid = %d", $file->list, $file->weight, $file->description, $file->fid, $node->vid); 462d461 < 467a467 > $delta = 0; 472c472,474 < $form['files'][$key]['description'] = array('#type' => 'textfield', '#default_value' => !empty($file->description) ? $file->description : $file->filename, '#maxlength' => 256, '#description' => $description ); --- > $weight = _upload_file_weight($file->fid); > $form['files'][$key]['description'] = array('#type' => 'textfield', '#default_value' => !empty($file->description) ? $file->description : $file->filename, '#maxlength' => 256, '#description' => $description); > $form['files'][$key]['weight'] = array('#type' => 'weight', '#default_value' => !empty($weight)? $weight : $delta++); 520c522 < $header = array(t('Delete'), t('List'), t('Description'), t('Size')); --- > $header = array(t('Delete'), t('List'), t('Description'), t('Size'), t('Weight')); 527a530 > $row[] = drupal_render($form[$key]['weight']); 548c551 < $result = db_query('SELECT * FROM {files} f INNER JOIN {upload} r ON f.fid = r.fid WHERE r.vid = %d ORDER BY f.fid', $node->vid); --- > $result = db_query('SELECT * FROM {files} f INNER JOIN {upload} r ON f.fid = r.fid WHERE r.vid = %d ORDER BY r.weight, f.fid', $node->vid); 549a553 > $file->weight = _upload_file_weight($file->fid); 556a561,564 > function _upload_file_weight($fid) { > return db_result(db_query('SELECT weight FROM {upload} WHERE fid = %d', $fid)); > } >