* @category file system * @copyright */ /** * Implementation of hook_menu(). */ function xsend_menu() { $items = array(); $items['admin/settings/file-system/x-send'] = array( 'title' => 'X-Send File Settings', 'description' => 'Control how files may transfer to the users.', 'page callback' => 'drupal_get_form', 'page arguments' => array('xsend_admin_settings'), 'access arguments' => array('administer site configuration'), ); return $items; } /** * menu call back for admin settings */ function xsend_admin_settings() { $form = array(); if(!in_array('mod_xsendfile', apache_get_modules())) { drupal_set_message('X-send file module for apache2 is not installed in your system. Untill you correctly install it do not enable this module.', 'error'); } else { $form['settings_general'] = array( '#type' => 'fieldset', '#title' => 'Fast private file transfer settings', '#collapsible' => TRUE, ); $form['settings_general']['file_transfer_handler'] = array( '#type' => 'radios', '#title' => 'Xsend private file transfer support', '#default_value' => variable_get('file_transfer_handler', "file_transfer_default"), '#options' => array("file_transfer_default"=>t('Disabled'), "file_transfer_xsendfile"=>t('Enabled - files are transferred by Drupal.')), '#description' => 'Enable X-send files support.' ); $form['settings_general']['path_to_drupal_root'] = array( '#type' => 'textfield', '#title' => 'Absolute path to Drupal installation directory', '#default_value' => variable_get('path_to_drupal_root', dirname(__FILE__)), '#description' => t('Please set the correct path otherwise the file transfer will fail. eg:/usr/www/apache/htdocs/'), ); return system_settings_form($form); } }