diff --git a/README.txt b/README.txt index bfd4bb54cb58804e852ff9c95cd4168c693099c7..841a76bf1f9c1ae49d3e97dd17aa76297d091938 100644 --- a/README.txt +++ b/README.txt @@ -4,7 +4,7 @@ Installation This module requires one of several external PDF manipulation tools. You can: 1. Deploy locally -- You'll need VPS or a dedicated server so you can deploy PHP/JavaBridge on Tomcat or a similar servlet container, or - 2. Sign up for Fill PDF Service, and plug your API key into /admin/settings/fillpdf + 2. Sign up for FillPDF Service, and plug your API key into /admin/settings/fillpdf 3. Install pdftk on your server and have that be used for PDF manipulation For more information, see the full documentation on drupal.org: http://drupal.org/documentation/modules/fillpdf diff --git a/fillpdf.admin.inc b/fillpdf.admin.inc index a050a83eefc6e5a4adff9c635f9785f9c80dfb3f..8ac129e26a1030b6c7d54ddbdeccb4178a01bd3e 100644 --- a/fillpdf.admin.inc +++ b/fillpdf.admin.inc @@ -27,7 +27,7 @@ function fillpdf_settings($form, &$form_state) { $options = array( 'pdftk' => t('Use locally-installed pdftk: You will need a VPS or a dedicated server so you can install pdftk: (!see_documentation).', array('!see_documentation' => l(t('see documentation'), 'http://drupal.org/documentation/modules/fillpdf'))), 'local' => t('Use locally-installed PHP/JavaBridge: You will need a VPS or dedicated server so you can deploy PHP/JavaBridge on Apache Tomcat: (!see_documentation).', array('!see_documentation' => l(t('see documentation'), 'http://drupal.org/documentation/modules/fillpdf'))), - 'remote' => t('Use Fill PDF Service: Sign up for <a href="https://fillpdf-service.com">Fill PDF Service</a>.'), + 'remote' => t('Use FillPDF Service: Sign up for <a href="https://fillpdf-service.com">FillPDF Service</a>.'), ); // Check for JavaBridge. @@ -50,7 +50,7 @@ function fillpdf_settings($form, &$form_state) { ); $form['remote'] = array( '#type' => 'fieldset', - '#title' => t('Configure Fill PDF Service'), + '#title' => t('Configure FillPDF Service'), '#collapsible' => TRUE, '#collapsed' => $fillpdf_service !== 'remote', ); @@ -58,7 +58,7 @@ function fillpdf_settings($form, &$form_state) { '#type' => 'textfield', '#title' => t('API Key'), '#default_value' => variable_get('fillpdf_api_key', ''), - '#description' => t('You need to sign up for an API key at <a href="https://fillpdf-service.com">Fill PDF Service</a>'), + '#description' => t('You need to sign up for an API key at <a href="https://fillpdf-service.com">FillPDF Service</a>'), ); $form['remote']['fillpdf_remote_protocol'] = array( '#type' => 'radios', @@ -74,7 +74,7 @@ function fillpdf_settings($form, &$form_state) { $form['fillpdf_pdftk_path'] = array( '#type' => 'textfield', '#title' => t('Configure path to pdftk'), - '#description' => t("If Fill PDF is not detecting your pdftk installation, you can specify the full path to the program here. Include the program name as well. For example, <em>/usr/bin/pdftk</em> is a valid value. You can almost always leave this field blank. If you should set it, you'll probably know."), + '#description' => t("If FillPDF is not detecting your pdftk installation, you can specify the full path to the program here. Include the program name as well. For example, <em>/usr/bin/pdftk</em> is a valid value. You can almost always leave this field blank. If you should set it, you'll probably know."), '#default_value' => variable_get('fillpdf_pdftk_path'), ); @@ -147,9 +147,9 @@ function fillpdf_forms_admin($form, &$form_state) { } else { $form['message'] = array( - '#markup' => '<p>' . t('Before you can upload PDF files, you must !link.', array('!link' => l(t('configure Fill PDF'), 'admin/config/media/fillpdf'))) . '</p>', + '#markup' => '<p>' . t('Before you can upload PDF files, you must !link.', array('!link' => l(t('configure FillPDF'), 'admin/config/media/fillpdf'))) . '</p>', ); - drupal_set_message(t('Fill PDF is not configured.'), 'error'); + drupal_set_message(t('FillPDF is not configured.'), 'error'); } return $form; @@ -244,7 +244,7 @@ function fillpdf_form_edit($form, &$form_state, $fid) { $pdf_form = db_query("SELECT * FROM {fillpdf_forms} WHERE fid = :fid", array(':fid' => $fid))->fetch(); if ($pdf_form === FALSE) { - drupal_set_message(t('Non-existent Fill PDF Form ID.'), 'error'); + drupal_set_message(t('Non-existent FillPDF Form ID.'), 'error'); drupal_not_found(); drupal_exit(); } @@ -288,7 +288,7 @@ function fillpdf_form_edit($form, &$form_state, $fid) { $form['default_nid'] = array( '#type' => 'textfield', '#title' => t('Default Node ID'), - '#description' => t('When filling a PDF, use this node for the data source if no node is specified in the Fill PDF URL.'), + '#description' => t('When filling a PDF, use this node for the data source if no node is specified in the FillPDF URL.'), '#maxlength' => 10, '#default_value' => $pdf_form->default_nid, ); @@ -342,7 +342,7 @@ function fillpdf_form_edit($form, &$form_state, $fid) { '#title' => t('Custom path for generated PDFs'), '#description' => t("<p>By default, filled PDFs are not saved to disk; they are simply sent directly to the browser for download. Enter a path here to change this behavior (tokens allowed). - <strong>Warning! Unless you include the &download=1 flag in the Fill PDF URL, PDFs will only + <strong>Warning! Unless you include the &download=1 flag in the FillPDF URL, PDFs will only be saved to disk <em>and won't</em> be sent to the browser as well.</strong></p><p>The path you specify must be in one of the following two formats:<br /> <ul> @@ -550,16 +550,16 @@ function fillpdf_generate_mappings($pdf_form, $skip_encoding = FALSE) { } /** - * Form for exporting Fill PDF field mappings + * Form for exporting FillPDF field mappings */ function fillpdf_export_form($form, $form_state, $code) { $form = array(); $form['export'] = array( '#type' => 'textarea', - '#title' => t('Fill PDF Form Mappings'), + '#title' => t('FillPDF Form Mappings'), '#default_value' => $code, '#rows' => 30, - '#description' => t('Copy this code and then on the site you want to import to, go to the Edit page for the Fill PDF form for which you want to import these mappings, and paste it in there.'), + '#description' => t('Copy this code and then on the site you want to import to, go to the Edit page for the FillPDF form for which you want to import these mappings, and paste it in there.'), '#attributes' => array( 'style' => 'width: 97%;', ), @@ -595,7 +595,7 @@ function fillpdf_form_import_form($form, &$form_state, $pdf_form) { '#type' => 'textarea', '#default_value' => '', '#rows' => 30, - '#description' => t('Cut and paste the results of a <em>Fill PDF Field Mappings export</em> here.'), + '#description' => t('Cut and paste the results of a <em>FillPDF Field Mappings export</em> here.'), ); $form['submit'] = array( '#type' => 'submit', @@ -611,7 +611,7 @@ function fillpdf_form_import_form($form, &$form_state, $pdf_form) { function fillpdf_form_import_form_validate($form, &$form_state) { $mappings = json_decode($form_state['values']['code'], TRUE); if (empty($mappings) || !is_array($mappings)) { - form_set_error('code', t('There was a problem processing your Fill PDF Field Mappings code. Please do a fresh export from the source and try pasting it again.')); + form_set_error('code', t('There was a problem processing your FillPDF Field Mappings code. Please do a fresh export from the source and try pasting it again.')); } else { $form_state['values']['mappings'] = $mappings; @@ -631,7 +631,7 @@ function fillpdf_form_import_form_submit($form, &$form_state) { } /** - * Import an array of decoded Fill PDF mappings. + * Import an array of decoded FillPDF mappings. * For the format, * @see fillpdf_generate_mappings() */ diff --git a/fillpdf.info b/fillpdf.info index d184ead7806e976eb8a0a87a22f4b380d4c3e59e..e7c132cc5c9e1b40ab1814d4d8f12623a3795087 100644 --- a/fillpdf.info +++ b/fillpdf.info @@ -1,4 +1,4 @@ -name = Fill PDF +name = FillPDF description = Allows users to populate PDF forms from submitted node data. package = Other core = 7.x diff --git a/fillpdf.module b/fillpdf.module index f15a073239a4889dac58e51d147088e39c593ac3..00ffb068876f617917d57c0af199121dedd9e8da 100644 --- a/fillpdf.module +++ b/fillpdf.module @@ -46,8 +46,8 @@ function fillpdf_menu() { // ------- Config --------------------------- $items['admin/config/media/fillpdf'] = array( - 'title' => 'Fill PDF settings', - 'description' => 'Configure tool to use with Fill PDF', + 'title' => 'FillPDF settings', + 'description' => 'Configure tool to use with FillPDF', 'page callback' => 'drupal_get_form', 'page arguments' => array('fillpdf_settings'), 'access arguments' => $access, @@ -56,7 +56,7 @@ function fillpdf_menu() { // --------- Form ------------------------ $items['admin/structure/fillpdf'] = array( - 'title' => 'Fill PDF', + 'title' => 'FillPDF', 'description' => 'Manage your PDFs', 'page callback' => 'drupal_get_form', 'page arguments' => array('fillpdf_forms_admin'), @@ -75,13 +75,13 @@ function fillpdf_menu() { 'type' => MENU_CALLBACK, ); $items['admin/structure/fillpdf/%/export'] = array( - 'title' => 'Export Fill PDF field mappings', + 'title' => 'Export FillPDF field mappings', 'page callback' => 'fillpdf_form_export', 'page arguments' => array(3), 'access arguments' => $access, ); $items['admin/structure/fillpdf/%/import'] = array( - 'title' => 'Import Fill PDF field mappings', + 'title' => 'Import FillPDF field mappings', 'page callback' => 'drupal_get_form', 'page arguments' => array('fillpdf_form_import_form', 3), 'access arguments' => $access, @@ -110,7 +110,7 @@ function fillpdf_permission() { return array( 'administer pdfs' => array( 'title' => t('Administer PDFs'), - 'description' => t('Allows usage of the Fill PDF administration screen.'), + 'description' => t('Allows usage of the FillPDF administration screen.'), ), 'publish own pdfs' => array( 'title' => t('Publish Own PDFs'), @@ -238,7 +238,7 @@ function fillpdf_parse_uri() { function fillpdf_merge_pdf($fid, $nids = NULL, $webform_arr = NULL, $sample = NULL, $force_download = FALSE, $skip_access_check = FALSE, $flatten = TRUE, $handle = TRUE) { // Case 1: No $fid if (is_null($fid)) { - drupal_set_message(t('Fill PDF Form ID required to print a PDF.'), 'warning'); + drupal_set_message(t('FillPDF Form ID required to print a PDF.'), 'warning'); drupal_goto(); } @@ -246,7 +246,7 @@ function fillpdf_merge_pdf($fid, $nids = NULL, $webform_arr = NULL, $sample = NU // Case 1.5: $fid is not valid. if ($fillpdf_info === FALSE) { - drupal_set_message(t('Non-existent Fill PDF Form ID.'), 'error'); + drupal_set_message(t('Non-existent FillPDF Form ID.'), 'error'); drupal_not_found(); drupal_exit(); } @@ -466,7 +466,7 @@ function fillpdf_merge_pdf($fid, $nids = NULL, $webform_arr = NULL, $sample = NU break; default: - drupal_set_message(t('Fill PDF is not configured.'), 'error'); + drupal_set_message(t('FillPDF is not configured.'), 'error'); drupal_goto(); } @@ -560,7 +560,7 @@ function fillpdf_merge_handle_pdf($pdf_info, $pdf_data, $token_objects, $action $redirect_to_file = $pdf_info->destination_redirect; case 'save': fillpdf_save_to_file($pdf_info, $pdf_data, $token_objects, $output_name, !$force_download, $redirect_to_file); - // Fill PDF classic! + // FillPDF classic! case 'download': drupal_add_http_header("Pragma", "public"); drupal_add_http_header('Expires', 0); @@ -597,7 +597,7 @@ function fillpdf_save_to_file($pdf_info, $pdf_data, $token_objects, $output_name the URL contained download=1, then the PDF was still sent to the user's browser. If you were redirecting them to the PDF, they were sent to the homepage instead. If the destination path looks wrong and you have used tokens, check that you have - used the correct token and that it is available to Fill PDF at the time of PDF + used the correct token and that it is available to FillPDF at the time of PDF generation.", array('%destination_path' => $destination_path)); } @@ -779,7 +779,7 @@ function fillpdf_parse_pdf($fid) { break; default: - drupal_set_message(t('Fill PDF is not configured.'), 'error'); + drupal_set_message(t('FillPDF is not configured.'), 'error'); drupal_goto('admin/structure/fillpdf'); } @@ -890,7 +890,7 @@ function _fillpdf_xmlrpc_request($url, $method) { elseif ($result == FALSE || xmlrpc_error()) { $error = xmlrpc_error(); $ret->error = TRUE; - drupal_set_message(t('There was a problem contacting the Fill PDF service. + drupal_set_message(t('There was a problem contacting the FillPDF service. It may be down, or you may not have internet access. [ERROR @code: @message]', array('@code' => $error->code, '@message' => $error->message)), 'error'); } @@ -991,7 +991,7 @@ function _fillpdf_transform_field_value($value, $pdf_replacements, $field_replac } /** - * Whoa, a load function! Fill PDF is growing up! + * Whoa, a load function! FillPDF is growing up! */ function fillpdf_load($fid, $reset = FALSE) { static $fillpdf = array(); diff --git a/fillpdf.rules.inc b/fillpdf.rules.inc index 88ac4a4239b4ca4bdddc29f4a3ea2b0545dde082..60291e1735a23b380f4e5c6f8e05361374ff7ad2 100644 --- a/fillpdf.rules.inc +++ b/fillpdf.rules.inc @@ -21,8 +21,8 @@ function fillpdf_rules_data_info() { return array( 'fillpdf' => array( - 'label' => t('Fill PDF metadata'), - 'group' => t('Fill PDF'), + 'label' => t('FillPDF metadata'), + 'group' => t('FillPDF'), 'property info' => _fillpdf_rules_metadata_info(), ), ); @@ -30,21 +30,21 @@ function fillpdf_rules_data_info() { /** * Implements hook_rules_event_info(). - * @todo: Define the "Fill PDF has filled the PDF" event + * @todo: Define the "FillPDF has filled the PDF" event * @todo: Define the following events: - * - Fill PDF is about to prepare PDF-filling data (fillpdf_merge_pre_merge) - * - Fill PDF is ready to fill the PDF (fillpdf_merge_fields_alter) + * - FillPDF is about to prepare PDF-filling data (fillpdf_merge_pre_merge) + * - FillPDF is ready to fill the PDF (fillpdf_merge_fields_alter) */ function fillpdf_rules_event_info() { $defaults = array( - 'group' => t('Fill PDF'), + 'group' => t('FillPDF'), 'module' => 'fillpdf', ); return array( 'fillpdf_merge_pre_handle' => $defaults + array( 'label' => t('Filled PDF is about to be handled'), 'variables' => array( - 'fillpdf' => array('type' => 'fillpdf', 'label' => 'Fill PDF metadata'), + 'fillpdf' => array('type' => 'fillpdf', 'label' => 'FillPDF metadata'), ), ) );; @@ -56,27 +56,27 @@ function fillpdf_rules_event_info() { * - Fill a PDF with data from content * - Fill a PDF with data from Webform submissions * - Send PDF to user's browser - * - Generate a Fill PDF link (saves new variable - could be useful for e-mail + * - Generate a FillPDF link (saves new variable - could be useful for e-mail * templates and such) */ function fillpdf_rules_action_info() { $defaults = array( - 'group' => t('Fill PDF'), + 'group' => t('FillPDF'), ); return array( 'fillpdf_load' => $defaults + array( - 'label' => t('Load a Fill PDF configuration'), + 'label' => t('Load a FillPDF configuration'), 'base' => 'fillpdf_rules_action_load_fillpdf', 'provides' => array( 'fillpdf' => array( 'type' => 'fillpdf', - 'label' => t('Fill PDF metadata'), + 'label' => t('FillPDF metadata'), ), ), 'parameter' => array( 'fid' => array( 'type' => 'integer', - 'label' => t('Fill PDF Form ID'), + 'label' => t('FillPDF Form ID'), ) ), ), @@ -88,13 +88,13 @@ function fillpdf_rules_action_info() { 'parameter' => array( 'fillpdf' => array( 'type' => 'fillpdf', - 'label' => t('Fill PDF metadata'), + 'label' => t('FillPDF metadata'), ), 'webform_nid' => array( 'type' => 'integer', 'label' => t('Webform Node ID'), 'optional' => TRUE, - 'description' => t('If you leave this blank, the <em>Default Node ID</em> from the Fill PDF configuration will be used.'), + 'description' => t('If you leave this blank, the <em>Default Node ID</em> from the FillPDF configuration will be used.'), ), 'webform_sids' => array( 'type' => 'list<integer>', @@ -106,12 +106,12 @@ function fillpdf_rules_action_info() { ), 'fillpdf_handle_default' => $defaults + array( 'label' => t('Perform the default action on the PDF'), - 'description' => t('Handle the PDF according to its Fill PDF configuration.'), + 'description' => t('Handle the PDF according to its FillPDF configuration.'), 'base' => 'fillpdf_rules_action_handle_default', 'parameter' => array( 'fillpdf' => array( 'type' => 'fillpdf', - 'label' => t('Fill PDF metadata'), + 'label' => t('FillPDF metadata'), ) ), ), @@ -127,7 +127,7 @@ function fillpdf_rules_action_info() { 'parameter' => array( 'fillpdf' => array( 'type' => 'fillpdf', - 'label' => t('Fill PDF metadata'), + 'label' => t('FillPDF metadata'), ) ), ), @@ -171,7 +171,7 @@ function fillpdf_rules_action_load_fillpdf($fid) { } /** - * Populates a loaded Fill PDF configuration's PDF with data. + * Populates a loaded FillPDF configuration's PDF with data. */ function fillpdf_rules_action_merge_webform($fillpdf, $webform_nid = '', $webform_sids = array()) { $skip_access_check = FALSE; diff --git a/fillpdf.rules_defaults.inc b/fillpdf.rules_defaults.inc index e4a00409eedf4c30e89c7159022658daf98b5806..64c45d23a4751d3b84445919a47f2c67cbdf6c06 100644 --- a/fillpdf.rules_defaults.inc +++ b/fillpdf.rules_defaults.inc @@ -16,7 +16,7 @@ function fillpdf_default_rules_configuration() { "DO" : [ { "fillpdf_load" : { "USING" : { "fid" : "6" }, - "PROVIDE" : { "fillpdf" : { "fillpdf" : "Fill PDF metadata" } } + "PROVIDE" : { "fillpdf" : { "fillpdf" : "FillPDF metadata" } } } }, { "fillpdf_merge_webform" : {