From b066e770d8cf5a237baad81eb39aca4e108d11a7 Mon Sep 17 00:00:00 2001 From: Jim Faes Date: Mon, 10 Oct 2011 22:44:03 +0200 Subject: [PATCH] cleanup formatting --- pclzip_d7.module | 62 ++++++++++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/pclzip_d7.module b/pclzip_d7.module index d7a442d..7ca090f 100755 --- a/pclzip_d7.module +++ b/pclzip_d7.module @@ -14,18 +14,18 @@ function pclzip_d7_help($path, $arg) { } /** - * Implementation of hook_menu + * Implements hook_menu(). */ function pclzip_d7_menu() { $items = array(); $items['admin/settings/pclzip'] = array( - 'title' => 'Pclzip', - 'description' => 'Settings for the pclzip module.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('pclzip_d7_settings'), - 'access arguments' => array('administer site configuration'), - 'type' => MENU_NORMAL_ITEM, + 'title' => 'Pclzip', + 'description' => 'Settings for the pclzip module.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('pclzip_d7_settings'), + 'access arguments' => array('administer site configuration'), + 'type' => MENU_NORMAL_ITEM, ); return $items; @@ -39,44 +39,44 @@ function pclzip_d7_settings() { //drupal_set_message(t('Library is installed')); $form = array(); - // get field names - $form['pclzip_fields_fieldset'] = array( - '#type' => 'fieldset', - '#title' => t('Available fields'), - '#collapsible' => TRUE, - '#collapsed' => TRUE, - ); - $form['pclzip_fields_fieldset']['pclzip_available_fields'] = array( - '#type' => 'textfield', - '#title' => t('Available fields.'), - '#default_value' => variable_get('pclzip_field_types', "'image','file'"), - '#description' => t("Enter the fields to use with pclzip sub modules. Separate with a comma, use ' or \" and remove white spaces. Default value is : 'image','file'"), - ); + // get field names + $form['pclzip_fields_fieldset'] = array( + '#type' => 'fieldset', + '#title' => t('Available fields'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + ); + $form['pclzip_fields_fieldset']['pclzip_available_fields'] = array( + '#type' => 'textfield', + '#title' => t('Available fields.'), + '#default_value' => variable_get('pclzip_field_types', "'image','file'"), + '#description' => t("Enter the fields to use with pclzip sub modules. Separate with a comma, use ' or \" and remove white spaces. Default value is : 'image','file'"), + ); + } + if (count($form)) { + return system_settings_form($form); } - if (count($form)) { - return system_settings_form($form); - } } /** - * Check if the library exists + * Check if the library exists. */ function pclzip_library_exists() { $pclzip_path = drupal_get_path('module', 'pclzip_d7') . '/pclzip/pclzip.lib.php'; if (!is_file($pclzip_path)) { - drupal_set_message(t("Could not find the PclZip library file : @pclzip_path", array('@pclzip_path' => $pclzip_path)), 'error'); + drupal_set_message(t('Could not find the PclZip library file : @pclzip_path', array('@pclzip_path' => $pclzip_path)), 'error'); return FALSE; } return TRUE; } /* - * Get extra fields form + * Get extra fields form. */ function pclzip_get_fields() { // get the fields names $fields_names = array(); - $result = db_query("SELECT field_name FROM {field_config} WHERE type IN (" . variable_get('pclzip_field_types', "'image','file'") . ")"); + $result = db_query("SELECT field_name FROM {field_config} WHERE type IN (:files)",array(':files' => variable_get('pclzip_field_types', "'image','file'"))); foreach ($result as $field) { $fields_names[$field->field_name] = $field->field_name; } @@ -84,7 +84,7 @@ function pclzip_get_fields() { } /* - * Build archive + * Build archive. */ function pclzip_build_archive($filename) { // get the temp file @@ -96,13 +96,13 @@ function pclzip_build_archive($filename) { } /** - * Send the file + * Send the file. */ function pclzip_send_file($filename) { global $_pclzip_temp_file; // send the file - header('Content-Type: application/zip') ; - header('Content-Disposition: inline; filename=' . $filename) ; + header('Content-Type: application/zip'); + header('Content-Disposition: inline; filename=' . $filename); header("Content-Transfer-Encoding: binary"); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public');