Changeset 4796 for extensions/upload_form/upload.php
- Timestamp:
- Jan 29, 2010, 11:14:41 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/upload_form/upload.php
r4789 r4796 37 37 38 38 // +-----------------------------------------------------------------------+ 39 // | functions|39 // | process form | 40 40 // +-----------------------------------------------------------------------+ 41 41 42 42 if (isset($_POST['submit_upload'])) 43 43 { 44 // echo '<pre>'; print_r($_FILES); echo '</pre>'; exit(); 44 $category_id = null; 45 if ('existing' == $_POST['category_type']) 46 { 47 $category_id = $_POST['category']; 48 } 49 elseif ('new' == $_POST['category_type']) 50 { 51 $output_create = create_virtual_category( 52 $_POST['category_name'], 53 (0 == $_POST['category_parent'] ? null : $_POST['category_parent']) 54 ); 55 56 if (isset($output_create['error'])) 57 { 58 array_push($page['errors'], $output_create['error']); 59 } 60 else 61 { 62 // information 63 array_push( 64 $page['infos'], 65 sprintf( 66 l10n('Category "%s" has been added'), 67 '<em>'.get_cat_display_name_from_id($output_create['id']).'</em>' 68 ) 69 ); 70 } 71 72 $category_id = $output_create['id']; 73 } 45 74 46 75 $starttime = get_moment(); … … 52 81 $source_filepath = $_FILES['image_upload']['tmp_name'][$idx]; 53 82 $original_filename = $_FILES['image_upload']['name'][$idx]; 54 add_uploaded_file($source_filepath, $original_filename, array($ _POST['category']));83 add_uploaded_file($source_filepath, $original_filename, array($category_id)); 55 84 } 56 85 }
Note: See TracChangeset
for help on using the changeset viewer.