Skip to content
This repository was archived by the owner on Oct 29, 2020. It is now read-only.

Commit c99403d

Browse files
Merge pull request #2177 from aaronschachter/confirmation_group
Confirmation page tweaks
2 parents 7a7b258 + 28f2f3f commit c99403d

File tree

6 files changed

+63
-13
lines changed

6 files changed

+63
-13
lines changed

lib/modules/dosomething/dosomething_campaign/dosomething_campaign.field_group.inc

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,34 @@ function dosomething_campaign_field_group_info() {
4141
);
4242
$export['group_basic_info|node|campaign|form'] = $field_group;
4343

44+
$field_group = new stdClass();
45+
$field_group->disabled = FALSE; /* Edit this to true to make a default field_group disabled initially */
46+
$field_group->api_version = 1;
47+
$field_group->identifier = 'group_confirmation|node|campaign|form';
48+
$field_group->group_name = 'group_confirmation';
49+
$field_group->entity_type = 'node';
50+
$field_group->bundle = 'campaign';
51+
$field_group->mode = 'form';
52+
$field_group->parent_name = '';
53+
$field_group->data = array(
54+
'label' => 'Confirmation',
55+
'weight' => '7',
56+
'children' => array(
57+
0 => 'field_reportback_confirm_msg',
58+
),
59+
'format_type' => 'fieldset',
60+
'format_settings' => array(
61+
'label' => 'Confirmation',
62+
'instance_settings' => array(
63+
'required_fields' => 1,
64+
'classes' => 'group-confirmation field-group-fieldset',
65+
'description' => '',
66+
),
67+
'formatter' => 'collapsed',
68+
),
69+
);
70+
$export['group_confirmation|node|campaign|form'] = $field_group;
71+
4472
$field_group = new stdClass();
4573
$field_group->disabled = FALSE; /* Edit this to true to make a default field_group disabled initially */
4674
$field_group->api_version = 1;
@@ -87,7 +115,7 @@ function dosomething_campaign_field_group_info() {
87115
$field_group->parent_name = '';
88116
$field_group->data = array(
89117
'label' => 'Incentives',
90-
'weight' => '7',
118+
'weight' => '8',
91119
'children' => array(
92120
0 => 'field_official_rules',
93121
1 => 'field_scholarship_amount',
@@ -181,7 +209,7 @@ function dosomething_campaign_field_group_info() {
181209
$field_group->parent_name = '';
182210
$field_group->data = array(
183211
'label' => 'Sponsors and Partners',
184-
'weight' => '9',
212+
'weight' => '10',
185213
'children' => array(
186214
0 => 'field_partners',
187215
),
@@ -245,10 +273,9 @@ function dosomething_campaign_field_group_info() {
245273
'weight' => '6',
246274
'children' => array(
247275
0 => 'field_image_reportback_gallery',
248-
1 => 'field_reportback_confirm_msg',
249-
2 => 'field_reportback_copy',
250-
3 => 'field_reportback_noun',
251-
4 => 'field_reportback_verb',
276+
1 => 'field_reportback_copy',
277+
2 => 'field_reportback_noun',
278+
3 => 'field_reportback_verb',
252279
),
253280
'format_type' => 'fieldset',
254281
'format_settings' => array(
@@ -302,7 +329,7 @@ function dosomething_campaign_field_group_info() {
302329
$field_group->parent_name = '';
303330
$field_group->data = array(
304331
'label' => 'Taxonomy and Discovery',
305-
'weight' => '8',
332+
'weight' => '9',
306333
'children' => array(
307334
0 => 'field_action_type',
308335
1 => 'field_active_hours',

lib/modules/dosomething/dosomething_campaign/dosomething_campaign.info

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ features[field_base][] = field_step_pre
7070
features[field_base][] = field_time_and_place
7171
features[field_base][] = field_vips
7272
features[field_group][] = group_basic_info|node|campaign|form
73+
features[field_group][] = group_confirmation|node|campaign|form
7374
features[field_group][] = group_do_it|node|campaign|form
7475
features[field_group][] = group_incentives|node|campaign|form
7576
features[field_group][] = group_know_it|node|campaign|form

lib/modules/dosomething/dosomething_campaign/dosomething_campaign.module

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ function dosomething_campaign_menu() {
4848
);
4949
// User reportback confirmation page.
5050
$items['node/%node/confirmation'] = array(
51-
'title' => 'You Did It!',
51+
'title callback' => 'dosomething_campaign_reportback_confirmation_page_title',
52+
'title arguments' => array(1),
5253
'page callback' => 'dosomething_campaign_reportback_confirmation_page',
5354
'page arguments' => array(1),
5455
'access callback' => 'dosomething_campaign_reportback_confirmation_page_access',
@@ -149,6 +150,24 @@ function _dosomething_campaign_pitch_view_mode($node) {
149150
return $node_rendered;
150151
}
151152

153+
/**
154+
* Determines page title of the reportback confirmation page.
155+
*
156+
* @param object $node
157+
* The loaded campaign node.
158+
*
159+
* @return string
160+
*/
161+
function dosomething_campaign_reportback_confirmation_page_title($node) {
162+
if (dosomething_campaign_get_campaign_type($node) == 'sms_game') {
163+
$title = 'Thanks for sharing!';
164+
}
165+
else {
166+
$title = 'You did it!';
167+
}
168+
return t($title);
169+
}
170+
152171
/**
153172
* Determines whether a user has access to the user reportback confirmation page.
154173
*
@@ -218,6 +237,7 @@ function dosomething_campaign_theme($existing, $type, $theme, $path) {
218237
'template' => 'reportback-confirmation',
219238
'path' => drupal_get_path('module', 'dosomething_campaign') . '/theme',
220239
'variables' => array(
240+
'page_title' => NULL,
221241
'copy' => NULL,
222242
'more_campaigns_link' => NULL,
223243
'back_to_campaign_link' => NULL,

lib/modules/dosomething/dosomething_campaign/dosomething_campaign.pages.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ function dosomething_campaign_reportback_confirmation_page($node) {
3535
$rec_vars[] = dosomething_campaign_get_campaign_block_vars($nid);
3636
}
3737
return theme('reportback_confirmation', array(
38+
'page_title' => dosomething_campaign_reportback_confirmation_page_title($node),
3839
'copy' => $wrapper->field_reportback_confirm_msg->value(),
3940
'more_campaigns_link' => $more_campaigns_link,
4041
'back_to_campaign_link' => $back_to_campaign_link,

lib/modules/dosomething/dosomething_campaign/dosomething_campaign.strongarm.inc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ function dosomething_campaign_strongarm() {
2222
'weight' => '1',
2323
),
2424
'path' => array(
25-
'weight' => '10',
25+
'weight' => '11',
2626
),
2727
'metatags' => array(
28-
'weight' => '11',
28+
'weight' => '12',
2929
),
3030
'redirect' => array(
31-
'weight' => '12',
31+
'weight' => '13',
3232
),
3333
'xmlsitemap' => array(
34-
'weight' => '13',
34+
'weight' => '14',
3535
),
3636
),
3737
'display' => array(),

lib/themes/dosomething/paraneue_dosomething/templates/campaign/reportback-confirmation.tpl.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Returns the HTML for the Campaign Reportback Confirmation.
44
*
55
* Available Variables
6+
* - $page_title: The page title (string).
67
* - $copy: Positive note message copy (string).
78
* - $more_campaigns_link: Link to find more campaigns (string).
89
* - $back_to_campaign_link: Link to head back to originating campagin (string).
@@ -22,7 +23,7 @@
2223

2324
<header role="banner" class="-basic">
2425
<div class="wrapper">
25-
<h1 class="__title">You Did It!</h1>
26+
<h1 class="__title"><?php print $page_title; ?></h1>
2627
<?php if (isset($copy)): ?>
2728
<h2 class="__subtitle"><?php print $copy; ?></h2>
2829
<?php endif; ?>

0 commit comments

Comments
 (0)