? .DS_Store
? project_issue.patch-help.patch
Index: issue.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue/issue.inc,v
retrieving revision 1.354
diff -u -p -r1.354 issue.inc
--- issue.inc 18 Jun 2009 03:28:55 -0000 1.354
+++ issue.inc 31 Oct 2009 10:57:16 -0000
@@ -366,3 +366,17 @@ function theme_project_issue_create_forb
return t('Login to create an issue', array('@login' => url('user/login', array('query' => $destination))));
}
}
+
+/**
+ * Create a help link for patch file attachments.
+ */
+function theme_project_issue_patch_help() {
+ $path = variable_get('project_issue_patch_help_path', '');
+ if ($path) {
+ $url = url($path);
+ // Rather graceless insertion of an extra link inside the link that
+ // comment-upload-attachments.tpl.php will make.
+ $output = ' - Get help with patches';
+ return $output;
+ }
+}
Index: project_issue.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue/project_issue.module,v
retrieving revision 1.174
diff -u -p -r1.174 project_issue.module
--- project_issue.module 6 Aug 2009 23:35:34 -0000 1.174
+++ project_issue.module 31 Oct 2009 10:57:18 -0000
@@ -382,6 +382,10 @@ function project_issue_theme() {
'file' => 'includes/issue_cockpit.inc',
'template' => 'theme/project-issue-issue-cockpit',
),
+ 'project_issue_patch_help' => array(
+ 'file' => 'issue.inc',
+ 'arguments' => array(),
+ ),
);
}
@@ -1761,3 +1765,19 @@ function project_issue_project_page_link
}
}
+
+
+
+/**
+ * Implementation of theme preprocessor for comment_upload_attachments.
+ *
+ * Adds a link to patch help to patch files.
+ */
+function project_issue_preprocess_comment_upload_attachments(&$variables) {
+ foreach ($variables['attachments'] as $id => $attachment) {
+ if (end(explode(".", $attachment['text'])) == 'patch') {
+ $variables['attachments'][$id]['text'] .= theme('project_issue_patch_help');
+ }
+ }
+}
+
Index: includes/admin.settings.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue/includes/admin.settings.inc,v
retrieving revision 1.2
diff -u -p -r1.2 admin.settings.inc
--- includes/admin.settings.inc 4 Apr 2009 06:30:21 -0000 1.2
+++ includes/admin.settings.inc 31 Oct 2009 10:57:18 -0000
@@ -93,6 +93,15 @@ function project_issue_settings_form(&$f
'#default_value' => variable_get('project_issue_autocomplete', 0),
'#options' => array(t('Select Menu'), t('Autocomplete')),
);
+
+ $form['project_issue_patch_help_path'] = array(
+ '#title' => t('Path to patch documentation'),
+ '#type' => 'textfield',
+ '#default_value' => variable_get('project_issue_patch_help_path', ''),
+ '#maxlength' => 60,
+ '#description' => t('A page to link to alongsite a file attachment that is a patch. Use this to give users help with applying patches.'),
+ );
+
$form['project_issue_site_help'] = array(
'#title' => t('Site-wide help text for new issues'),