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

Commit de6de73

Browse files
Merge pull request #1564 from aaronschachter/campaign_video
Campaign video collection
2 parents 564d52d + 3e31430 commit de6de73

10 files changed

+104
-92
lines changed

lib/modules/dosomething/dosomething_campaign/dosomething_campaign.features.field_base.inc

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,35 +1009,6 @@ function dosomething_campaign_field_default_field_bases() {
10091009
'type' => 'text_long',
10101010
);
10111011

1012-
// Exported field_base: 'field_psa'
1013-
$field_bases['field_psa'] = array(
1014-
'active' => 1,
1015-
'cardinality' => 1,
1016-
'deleted' => 0,
1017-
'entity_types' => array(),
1018-
'field_name' => 'field_psa',
1019-
'foreign keys' => array(
1020-
'format' => array(
1021-
'columns' => array(
1022-
'format' => 'format',
1023-
),
1024-
'table' => 'filter_format',
1025-
),
1026-
),
1027-
'indexes' => array(
1028-
'format' => array(
1029-
0 => 'format',
1030-
),
1031-
),
1032-
'locked' => 0,
1033-
'module' => 'text',
1034-
'settings' => array(
1035-
'max_length' => 255,
1036-
),
1037-
'translatable' => 0,
1038-
'type' => 'text',
1039-
);
1040-
10411012
// Exported field_base: 'field_reportback_confirm_msg'
10421013
$field_bases['field_reportback_confirm_msg'] = array(
10431014
'active' => 1,

lib/modules/dosomething/dosomething_campaign/dosomething_campaign.features.field_instance.inc

Lines changed: 54 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ function dosomething_campaign_field_default_field_instances() {
878878
'bundle' => 'campaign',
879879
'default_value' => NULL,
880880
'deleted' => 0,
881-
'description' => 'If there is no PSA then this image is required.',
881+
'description' => 'If there is no video, then this image is required.',
882882
'display' => array(
883883
'default' => array(
884884
'label' => 'above',
@@ -903,8 +903,10 @@ function dosomething_campaign_field_default_field_instances() {
903903
),
904904
),
905905
'entity_type' => 'node',
906+
'entityconnect_unload_add' => 0,
907+
'entityconnect_unload_edit' => 0,
906908
'field_name' => 'field_image_psa_replacement',
907-
'label' => 'PSA Replacement Image',
909+
'label' => 'Video Replacement Image',
908910
'required' => 0,
909911
'settings' => array(
910912
'user_register_form' => FALSE,
@@ -1806,52 +1808,6 @@ function dosomething_campaign_field_default_field_instances() {
18061808
),
18071809
);
18081810

1809-
// Exported field_instance: 'node-campaign-field_psa'
1810-
$field_instances['node-campaign-field_psa'] = array(
1811-
'bundle' => 'campaign',
1812-
'default_value' => NULL,
1813-
'deleted' => 0,
1814-
'description' => 'The ID of the youtube video <strong> (comes after the ?v=) </strong>',
1815-
'display' => array(
1816-
'default' => array(
1817-
'label' => 'above',
1818-
'module' => 'text',
1819-
'settings' => array(),
1820-
'type' => 'text_default',
1821-
'weight' => 51,
1822-
),
1823-
'pitch' => array(
1824-
'label' => 'above',
1825-
'settings' => array(),
1826-
'type' => 'hidden',
1827-
'weight' => 0,
1828-
),
1829-
'teaser' => array(
1830-
'label' => 'above',
1831-
'settings' => array(),
1832-
'type' => 'hidden',
1833-
'weight' => 0,
1834-
),
1835-
),
1836-
'entity_type' => 'node',
1837-
'field_name' => 'field_psa',
1838-
'label' => 'PSA',
1839-
'required' => 0,
1840-
'settings' => array(
1841-
'text_processing' => 0,
1842-
'user_register_form' => FALSE,
1843-
),
1844-
'widget' => array(
1845-
'active' => 1,
1846-
'module' => 'text',
1847-
'settings' => array(
1848-
'size' => 60,
1849-
),
1850-
'type' => 'text_textfield',
1851-
'weight' => 12,
1852-
),
1853-
);
1854-
18551811
// Exported field_instance: 'node-campaign-field_reportback_confirm_msg'
18561812
$field_instances['node-campaign-field_reportback_confirm_msg'] = array(
18571813
'bundle' => 'campaign',
@@ -2478,6 +2434,53 @@ function dosomething_campaign_field_default_field_instances() {
24782434
),
24792435
);
24802436

2437+
// Exported field_instance: 'node-campaign-field_video'
2438+
$field_instances['node-campaign-field_video'] = array(
2439+
'bundle' => 'campaign',
2440+
'deleted' => 0,
2441+
'description' => '',
2442+
'display' => array(
2443+
'default' => array(
2444+
'label' => 'above',
2445+
'module' => 'field_collection',
2446+
'settings' => array(
2447+
'add' => 'Add',
2448+
'delete' => 'Delete',
2449+
'description' => TRUE,
2450+
'edit' => 'Edit',
2451+
'view_mode' => 'full',
2452+
),
2453+
'type' => 'field_collection_view',
2454+
'weight' => 62,
2455+
),
2456+
'pitch' => array(
2457+
'label' => 'above',
2458+
'settings' => array(),
2459+
'type' => 'hidden',
2460+
'weight' => 0,
2461+
),
2462+
'teaser' => array(
2463+
'label' => 'above',
2464+
'settings' => array(),
2465+
'type' => 'hidden',
2466+
'weight' => 0,
2467+
),
2468+
),
2469+
'entity_type' => 'node',
2470+
'field_name' => 'field_video',
2471+
'label' => 'Video',
2472+
'required' => FALSE,
2473+
'settings' => array(
2474+
'user_register_form' => FALSE,
2475+
),
2476+
'widget' => array(
2477+
'module' => 'field_collection',
2478+
'settings' => array(),
2479+
'type' => 'field_collection_embed',
2480+
'weight' => 12,
2481+
),
2482+
);
2483+
24812484
// Exported field_instance: 'node-campaign-field_vips'
24822485
$field_instances['node-campaign-field_vips'] = array(
24832486
'bundle' => 'campaign',
@@ -2558,7 +2561,7 @@ function dosomething_campaign_field_default_field_instances() {
25582561
t('Hype');
25592562
t('If there is a prize to be won, you must include a PDF of the official rules.');
25602563
t('If there is a scholarship, enter the dollar amount here. If there is no scholarship, leave this field blank.');
2561-
t('If there is no PSA then this image is required.');
2564+
t('If there is no video, then this image is required.');
25622565
t('If you are not using a fact above, use this field. This is information that shows that the call to action is what to do to solve the issue.
25632566
<br />
25642567
<strong>Limit: 135 characters</strong>');
@@ -2586,8 +2589,6 @@ function dosomething_campaign_field_default_field_instances() {
25862589
<br/>
25872590
<strong> Limit 25 characters. </strong>');
25882591
t('Official Rules');
2589-
t('PSA');
2590-
t('PSA Replacement Image');
25912592
t('Primary Action Type');
25922593
t('Primary Cause');
25932594
t('Problem Fact');
@@ -2610,7 +2611,6 @@ function dosomething_campaign_field_default_field_instances() {
26102611
t('Stuff You Need');
26112612
t('Supporting Statement on the Solution');
26122613
t('Tags');
2613-
t('The ID of the youtube video <strong> (comes after the ?v=) </strong>');
26142614
t('The first thing they need to know. Could be general advice "start planning two weeks in advance" or pointing out the most important thing to do "as you plan, don\'t forget to get permission!".
26152615
<br/>
26162616
<strong> Limit: 135 characters </strong>');
@@ -2658,6 +2658,8 @@ function dosomething_campaign_field_default_field_instances() {
26582658
<br/>
26592659
<strong> Limit 20 characters. </strong>');
26602660
t('VIPs');
2661+
t('Video');
2662+
t('Video Replacement Image');
26612663
t('i.e. JEANS collected, SENIOR CITIZENS educated, FLYERS posted. Your responses should not be in all caps though, instead write - Jeans');
26622664
t('i.e. jeans COLLECTED, senior citizens EDUCATED, flyers POSTED. Your responses should not be in all caps though, instead write - Collected');
26632665

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,18 @@ function dosomething_campaign_field_group_info() {
8383
$field_group->mode = 'form';
8484
$field_group->parent_name = '';
8585
$field_group->data = array(
86-
'label' => 'Images',
86+
'label' => 'Media',
8787
'weight' => '8',
8888
'children' => array(
8989
0 => 'field_image_campaign_cover',
9090
1 => 'field_image_psa_replacement',
9191
2 => 'field_image_reportback_gallery',
9292
3 => 'field_image_step_gallery',
93-
4 => 'field_psa',
93+
4 => 'field_video',
9494
),
9595
'format_type' => 'fieldset',
9696
'format_settings' => array(
97-
'label' => 'Images',
97+
'label' => 'Media',
9898
'instance_settings' => array(
9999
'required_fields' => 0,
100100
'classes' => '',
@@ -276,7 +276,6 @@ function dosomething_campaign_field_group_info() {
276276
'weight' => '8',
277277
'children' => array(
278278
0 => 'field_partners',
279-
1 => 'field_sponsor',
280279
),
281280
'format_type' => 'fieldset',
282281
'format_settings' => array(

lib/modules/dosomething/dosomething_campaign/dosomething_campaign.info

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ dependencies[] = ctools
88
dependencies[] = date
99
dependencies[] = dosomething_image
1010
dependencies[] = dosomething_signup
11+
dependencies[] = dosomething_static_content
1112
dependencies[] = dosomething_taxonomy
1213
dependencies[] = entityreference
1314
dependencies[] = features
@@ -53,7 +54,6 @@ features[field_base][] = field_pre_step_header
5354
features[field_base][] = field_primary_action_type
5455
features[field_base][] = field_primary_cause
5556
features[field_base][] = field_promoting_tips
56-
features[field_base][] = field_psa
5757
features[field_base][] = field_reportback_confirm_msg
5858
features[field_base][] = field_reportback_copy
5959
features[field_base][] = field_reportback_noun
@@ -116,7 +116,6 @@ features[field_instance][] = node-campaign-field_pre_step_header
116116
features[field_instance][] = node-campaign-field_primary_action_type
117117
features[field_instance][] = node-campaign-field_primary_cause
118118
features[field_instance][] = node-campaign-field_promoting_tips
119-
features[field_instance][] = node-campaign-field_psa
120119
features[field_instance][] = node-campaign-field_reportback_confirm_msg
121120
features[field_instance][] = node-campaign-field_reportback_copy
122121
features[field_instance][] = node-campaign-field_reportback_noun
@@ -130,6 +129,7 @@ features[field_instance][] = node-campaign-field_step_post
130129
features[field_instance][] = node-campaign-field_step_pre
131130
features[field_instance][] = node-campaign-field_tags
132131
features[field_instance][] = node-campaign-field_time_and_place
132+
features[field_instance][] = node-campaign-field_video
133133
features[field_instance][] = node-campaign-field_vips
134134
features[node][] = campaign
135135
features[user_permission][] = create campaign content
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
/**
3+
* @file
4+
* Installation and schema hooks for dosomething_campaign.module.
5+
*/
6+
7+
8+
/**
9+
* Deletes field_psa.
10+
*/
11+
function dosomething_campaign_update_7001(&$sandbox) {
12+
field_delete_field('field_psa');
13+
}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ function dosomething_campaign_strongarm() {
2727
'metatags' => array(
2828
'weight' => '10',
2929
),
30+
'redirect' => array(
31+
'weight' => '30',
32+
),
33+
'xmlsitemap' => array(
34+
'weight' => '30',
35+
),
3036
),
3137
'display' => array(),
3238
),

lib/modules/dosomething/dosomething_campaign/dosomething_campaign.theme.inc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,12 @@ function dosomething_campaign_preprocess_action_page(&$vars, &$wrapper) {
212212
$vars[$fc] = dosomething_campaign_get_field_collection_values($wrapper, 'field_' . $fc);
213213
}
214214

215-
$psa = $wrapper->field_psa->value();
216-
if (isset($psa)) {
217-
$vars['psa'] = '<iframe id="ytplayer" type="text/html" width="640" height="390"
218-
src="http://youtube.com/embed/' . $psa . '?wmode=transparent"' . 'frameborder="0"/>';
215+
if (!empty($vars['field_video'])) {
216+
$vars['psa'] = theme('dosomething_video_embed', array(
217+
'field' => $wrapper->field_video->value(),
218+
'width' => 640,
219+
'height' => 390,
220+
));
219221
}
220222
else {
221223
if (isset($vars['field_image_psa_replacement'][0])) {

lib/modules/dosomething/dosomething_helpers/dosomething_helpers.theme.inc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ function _dosomething_helpers_insert_after_first_element(&$a, $element) {
3636
}
3737
}
3838

39+
/**
40+
* Implements hook_theme().
41+
*/
3942
function dosomething_helpers_theme($existing, $type, $theme, $path) {
4043
return array(
4144
'dosomething_video_embed' => array(
@@ -48,6 +51,9 @@ function dosomething_helpers_theme($existing, $type, $theme, $path) {
4851
);
4952
}
5053

54+
/**
55+
* Theme callback for dosomething_video_embed.
56+
*/
5157
function theme_dosomething_video_embed($variables) {
5258
$output = '<iframe';
5359
$output .= " width=\"{$variables['width']}\"";

lib/modules/dosomething/dosomething_static_content/dosomething_static_content.features.field_instance.inc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ function dosomething_static_content_field_default_field_instances() {
242242
'bundle' => 'field_video',
243243
'default_value' => NULL,
244244
'deleted' => 0,
245-
'description' => '',
245+
'description' => 'The ID of the Youtube video <strong> (comes after the ?v=) </strong>',
246246
'display' => array(
247247
'default' => array(
248248
'label' => 'above',
@@ -825,6 +825,7 @@ function dosomething_static_content_field_default_field_instances() {
825825
t('Intro Title');
826826
t('Provider');
827827
t('Subtitle');
828+
t('The ID of the Youtube video <strong> (comes after the ?v=) </strong>');
828829
t('Video');
829830
t('Video ID');
830831

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
/**
3+
* @file
4+
* Installation and schema hooks for dosomething_static_content.module.
5+
*/
6+
7+
/**
8+
* Deletes field_cta_button_text.
9+
*/
10+
function dosomething_static_content_update_7001(&$sandbox) {
11+
field_delete_field('field_cta_button_text');
12+
}

0 commit comments

Comments
 (0)