'Image FUpload Settings', 'access arguments' => array('administer site configuration'), 'page callback' => 'drupal_get_form', 'page arguments' => array('image_fupload_image_admin'), 'description' => 'Configure FUpload Settings', 'type' => MENU_LOCAL_TASK, 'file' => 'image_fupload_image.admin.inc', ); $items['fupload/js/image'] = array( 'title' => 'Image FUpload', 'page callback' => 'image_fupload_image_node_create', 'access arguments' => array('mass upload images'), 'type' => MENU_CALLBACK, 'file' => 'node.pages.inc', 'file path' => drupal_get_path('module', 'node'), ); return $items; } /** * Implementation of hook_form_alter() registry. */ function image_fupload_image_form_alter(&$form, $form_state, $form_id) { global $user; // examine whether it's a new image type & the user wants to have flash if ($form_id == "image_node_form" && !isset($form['#node']->nid) && arg(0) != 'img_assist' && arg(3) != "noflash" && arg(3) != "list_images" && user_access('mass upload images')) { // Some needed JS & CSS - Files to be included $module_path = drupal_get_path('module', 'image_fupload'); drupal_add_js($module_path .'/swfupload/swfupload.js', 'module'); drupal_add_js($module_path .'/swfupload/swfupload.queue.js', 'module'); drupal_add_js($module_path .'/swfupload/fileprogress.js', 'module'); drupal_add_js($module_path .'/swfupload/handlers.js', 'module'); /* Check if another step with editing options is provided for this user*/ $redirect_url = ''; if (user_access('edit captions')) $redirect_url = url('node/add/image/list_images'); /* Check END */ drupal_add_js(theme('swfupload_settings', base_path() . $module_path, url('fupload/flash'), round(variable_get('image_max_upload_size', 800)), '*.jpg; *.jpeg; *.png; *.gif', (!empty($user->sid) ? $user->sid : session_id()), 100, 'image', 'images', 'true', '', $redirect_url), 'inline'); drupal_add_css($module_path .'/image_fupload-style.css', 'module', 'all', FALSE); // Style of swfUpload unset($form['title'], $form['rebuild_images'], $form['buttons']); //don't need this, title will be generated later using filepath isset($form['taxonomy']) ? $form['taxonomy']['#weight'] = -8 : ""; //adds ablility to sort better in this case // if user is allowed to mass edit captions, so let's prepare the form to be able to perform further steps later if (user_access('edit captions')) { $form['body_field']['body']['#disabled'] = TRUE; // not accessable when editing done by caption list $form['body_field']['#prefix'] = '