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

Commit 28f2f3f

Browse files
Fixes #2174
1 parent 97b3d14 commit 28f2f3f

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

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/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)