From 0f5afbb40b1ebb0ed450968c6c729fdeaab9950c Mon Sep 17 00:00:00 2001 From: Martin Cording Date: Tue, 15 Jul 2014 09:36:31 +0200 Subject: [PATCH 01/20] case 4349 - Clear cache upon saving rules. Signed-off-by: Martin Cording --- ding_campaign.admin.inc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ding_campaign.admin.inc b/ding_campaign.admin.inc index 133e47d..de63f3e 100644 --- a/ding_campaign.admin.inc +++ b/ding_campaign.admin.inc @@ -136,13 +136,16 @@ function ding_campaign_add_rule($form, $form_state) { */ function ding_campaign_campaign_rule_form_submit($form, &$form_state) { $c = count($form_state['input']['rule_type']); + $nid = $form_state['build_info']['args'][0]->nid; if ($c > 0) { // Delete existing rules. db_delete('ding_campaign_rules') - ->condition('cid', $form_state['build_info']['args'][0]->nid) + ->condition('cid', $nid) ->execute(); + entity_get_controller('node')->resetCache(array($nid)); + // Add new rules. for ($i = 0; $i < $c; $i++) { if ($form_state['input']['rule_value'][$i] != '' || $form_state['input']['rule_type'][$i] == 'rule_generic') { From 9b0e9e5ddc8726d8f4d7838265aad7675ddc1828 Mon Sep 17 00:00:00 2001 From: Martin Cording Date: Tue, 15 Jul 2014 09:40:58 +0200 Subject: [PATCH 02/20] case 4384 - Prevent empty rendered campaigns. Signed-off-by: Martin Cording --- ding_campaign.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ding_campaign.module b/ding_campaign.module index dc75fb7..075e964 100644 --- a/ding_campaign.module +++ b/ding_campaign.module @@ -193,7 +193,7 @@ function ding_campaign_display($context, $count, $offset, $style = 'medium') { $text = !empty($text) ? $text : $wrapper->field_camp_text_full->value(); if (!empty($text)) { $current['#text'] = array( - 'content' => $text, + '#markup' => is_array($text) ? $text['safe_value'] : $text, ); } From 8bcd90de8ff83ff77a491693bed8c4e9f85d4225 Mon Sep 17 00:00:00 2001 From: Martin Cording Date: Fri, 22 Aug 2014 17:27:27 +0200 Subject: [PATCH 03/20] DDBEASY-65 - Possibility of opening campaigns in new tab. Signed-off-by: Martin Cording --- ding_campaign.module | 6 +- ...ing_campaign_ctype.features.field_base.inc | 27 +++++++++ ...campaign_ctype.features.field_instance.inc | 57 +++++++++++++++++++ .../ding_campaign_ctype.features.inc | 3 +- .../ding_campaign_ctype.field_group.inc | 7 ++- .../ding_campaign_ctype.info | 5 +- 6 files changed, 97 insertions(+), 8 deletions(-) diff --git a/ding_campaign.module b/ding_campaign.module index dc75fb7..baf9749 100644 --- a/ding_campaign.module +++ b/ding_campaign.module @@ -170,6 +170,7 @@ function ding_campaign_display($context, $count, $offset, $style = 'medium') { // Get link value. $link = $wrapper->field_camp_link->value(); + if (!empty($link)) { $current['#link'] = array( '#theme' => 'link', @@ -180,12 +181,15 @@ function ding_campaign_display($context, $count, $offset, $style = 'medium') { 'class' => array( 'ding-campaing--link', ), - 'target' => '_blank', ), 'html' => FALSE, 'absolute' => TRUE, ), ); + + if ($wrapper->field_camp_behavior->value()) { + $current['#link']['#options']['attributes']['target'] = '_blank'; + } } // Get text both plain and full. diff --git a/modules/ding_campaign_ctype/ding_campaign_ctype.features.field_base.inc b/modules/ding_campaign_ctype/ding_campaign_ctype.features.field_base.inc index 050ae98..9e88321 100644 --- a/modules/ding_campaign_ctype/ding_campaign_ctype.features.field_base.inc +++ b/modules/ding_campaign_ctype/ding_campaign_ctype.features.field_base.inc @@ -62,6 +62,33 @@ function ding_campaign_ctype_field_default_field_bases() { 'type' => 'entityreference', ); + // Exported field_base: 'field_camp_behavior' + $field_bases['field_camp_behavior'] = array( + 'active' => 1, + 'cardinality' => 1, + 'deleted' => 0, + 'entity_types' => array(), + 'field_name' => 'field_camp_behavior', + 'foreign keys' => array(), + 'indexes' => array( + 'value' => array( + 0 => 'value', + ), + ), + 'locked' => 0, + 'module' => 'list', + 'settings' => array( + 'allowed_values' => array( + 0 => '', + 1 => '', + ), + 'allowed_values_function' => '', + 'profile2_private' => FALSE, + ), + 'translatable' => 0, + 'type' => 'list_boolean', + ); + // Exported field_base: 'field_camp_image' $field_bases['field_camp_image'] = array( 'active' => 1, diff --git a/modules/ding_campaign_ctype/ding_campaign_ctype.features.field_instance.inc b/modules/ding_campaign_ctype/ding_campaign_ctype.features.field_instance.inc index 1753c37..c953c12 100644 --- a/modules/ding_campaign_ctype/ding_campaign_ctype.features.field_instance.inc +++ b/modules/ding_campaign_ctype/ding_campaign_ctype.features.field_instance.inc @@ -82,6 +82,61 @@ function ding_campaign_ctype_field_default_field_instances() { ), ); + // Exported field_instance: 'node-ding_campaign-field_camp_behavior' + $field_instances['node-ding_campaign-field_camp_behavior'] = array( + 'bundle' => 'ding_campaign', + 'default_value' => array( + 0 => array( + 'value' => 0, + ), + ), + 'deleted' => 0, + 'description' => 'If set, the clicked campaign will open in a new tab/window.', + 'display' => array( + 'default' => array( + 'label' => 'above', + 'module' => 'list', + 'settings' => array(), + 'type' => 'list_default', + 'weight' => 8, + ), + 'full' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + 'teaser' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + 'teaser_highlight' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + ), + 'entity_type' => 'node', + 'field_name' => 'field_camp_behavior', + 'label' => 'Open in new tab/window', + 'required' => 0, + 'settings' => array( + 'user_register_form' => FALSE, + ), + 'widget' => array( + 'active' => 1, + 'module' => 'options', + 'settings' => array( + 'display_label' => 1, + ), + 'type' => 'options_onoff', + 'weight' => 7, + ), + ); + // Exported field_instance: 'node-ding_campaign-field_camp_image' $field_instances['node-ding_campaign-field_camp_image'] = array( 'bundle' => 'ding_campaign', @@ -429,7 +484,9 @@ function ding_campaign_ctype_field_default_field_instances() { t('Campaign link'); t('Campaign settings'); t('Campaign text'); + t('If set, the clicked campaign will open in a new tab/window'); t('Libraries and Groups'); + t('Open in new tab/window'); t('Weight'); return $field_instances; diff --git a/modules/ding_campaign_ctype/ding_campaign_ctype.features.inc b/modules/ding_campaign_ctype/ding_campaign_ctype.features.inc index 5c7282b..af7937a 100644 --- a/modules/ding_campaign_ctype/ding_campaign_ctype.features.inc +++ b/modules/ding_campaign_ctype/ding_campaign_ctype.features.inc @@ -7,12 +7,11 @@ /** * Implements hook_ctools_plugin_api(). */ -function ding_campaign_ctype_ctools_plugin_api() { +function ding_campaign_ctype_ctools_plugin_api($module = NULL, $api = NULL) { list($module, $api) = func_get_args(); if ($module == "field_group" && $api == "field_group") { return array("version" => "1"); } - list($module, $api) = func_get_args(); if ($module == "strongarm" && $api == "strongarm") { return array("version" => "1"); } diff --git a/modules/ding_campaign_ctype/ding_campaign_ctype.field_group.inc b/modules/ding_campaign_ctype/ding_campaign_ctype.field_group.inc index 60df614..a9aeda5 100644 --- a/modules/ding_campaign_ctype/ding_campaign_ctype.field_group.inc +++ b/modules/ding_campaign_ctype/ding_campaign_ctype.field_group.inc @@ -26,6 +26,7 @@ function ding_campaign_ctype_field_group_info() { 0 => 'field_camp_link', 1 => 'field_camp_text_full', 2 => 'field_camp_text_plain', + 3 => 'field_camp_behavior', ), 'format_type' => 'fieldset', 'format_settings' => array( @@ -79,9 +80,9 @@ function ding_campaign_ctype_field_group_info() { 'label' => 'Settings', 'weight' => '1', 'children' => array( - 0 => 'field_camp_settings', - 1 => 'field_camp_weight', - 2 => 'ding_campaign_group_ref', + 0 => 'ding_campaign_group_ref', + 1 => 'field_camp_settings', + 2 => 'field_camp_weight', ), 'format_type' => 'fieldset', 'format_settings' => array( diff --git a/modules/ding_campaign_ctype/ding_campaign_ctype.info b/modules/ding_campaign_ctype/ding_campaign_ctype.info index c58359a..f992051 100644 --- a/modules/ding_campaign_ctype/ding_campaign_ctype.info +++ b/modules/ding_campaign_ctype/ding_campaign_ctype.info @@ -2,7 +2,6 @@ name = Ding campaign ctype description = Content type and image styles for ding_campaign module core = 7.x package = Ding! -php = 5.2.4 dependencies[] = ctools dependencies[] = ding_campaign dependencies[] = ding_event @@ -12,6 +11,7 @@ dependencies[] = field_group dependencies[] = image dependencies[] = list dependencies[] = media +dependencies[] = node dependencies[] = og dependencies[] = og_ui dependencies[] = options @@ -19,7 +19,7 @@ dependencies[] = strongarm dependencies[] = text features[ctools][] = field_group:field_group:1 features[ctools][] = strongarm:strongarm:1 -features[features_api][] = api:1 +features[features_api][] = api:2 features[field_base][] = ding_campaign_group_ref features[field_base][] = field_camp_image features[field_base][] = field_camp_link @@ -31,6 +31,7 @@ features[field_group][] = group_ding_campaign_content|node|ding_campaign|form features[field_group][] = group_ding_campaign_images|node|ding_campaign|form features[field_group][] = group_ding_campaign_settings|node|ding_campaign|form features[field_instance][] = node-ding_campaign-ding_campaign_group_ref +features[field_instance][] = node-ding_campaign-field_camp_behavior features[field_instance][] = node-ding_campaign-field_camp_image features[field_instance][] = node-ding_campaign-field_camp_link features[field_instance][] = node-ding_campaign-field_camp_settings From 9f817cf3dcb7eace3abf97d2f576c1da4cbc156e Mon Sep 17 00:00:00 2001 From: Martin Cording Date: Fri, 22 Aug 2014 20:14:46 +0200 Subject: [PATCH 04/20] DDBEASY-65 - Typo. Signed-off-by: Martin Cording --- .../ding_campaign_ctype.features.field_instance.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ding_campaign_ctype/ding_campaign_ctype.features.field_instance.inc b/modules/ding_campaign_ctype/ding_campaign_ctype.features.field_instance.inc index c953c12..1433f94 100644 --- a/modules/ding_campaign_ctype/ding_campaign_ctype.features.field_instance.inc +++ b/modules/ding_campaign_ctype/ding_campaign_ctype.features.field_instance.inc @@ -91,7 +91,7 @@ function ding_campaign_ctype_field_default_field_instances() { ), ), 'deleted' => 0, - 'description' => 'If set, the clicked campaign will open in a new tab/window.', + 'description' => 'If set, the clicked campaign will open in a new tab/window', 'display' => array( 'default' => array( 'label' => 'above', From 9f206cf67734f58ae2ddb283699fc63ab54b6458 Mon Sep 17 00:00:00 2001 From: Martin Cording Date: Thu, 5 Feb 2015 16:48:06 +0100 Subject: [PATCH 05/20] DDBEASY-229 - Add scheduler to Campign CT. Signed-off-by: Martin Cording --- ding_campaign.features.inc | 16 ++++++++++ ding_campaign.info | 12 +++++++ ding_campaign.module | 2 ++ ding_campaign.strongarm.inc | 64 +++++++++++++++++++++++++++++++++++++ 4 files changed, 94 insertions(+) create mode 100644 ding_campaign.features.inc create mode 100644 ding_campaign.strongarm.inc diff --git a/ding_campaign.features.inc b/ding_campaign.features.inc new file mode 100644 index 0000000..fce55ff --- /dev/null +++ b/ding_campaign.features.inc @@ -0,0 +1,16 @@ + "1"); + } +} + diff --git a/ding_campaign.info b/ding_campaign.info index 41b2ca3..9262b63 100644 --- a/ding_campaign.info +++ b/ding_campaign.info @@ -9,3 +9,15 @@ dependencies[] = image dependencies[] = features dependencies[] = ctools dependencies[] = ding_campaign_ctype +dependencies[] = scheduler +dependencies[] = strongarm +features[ctools][] = strongarm:strongarm:1 +features[features_api][] = api:1 +features[variable][] = scheduler_publish_enable_ding_campaign +features[variable][] = scheduler_publish_required_ding_campaign +features[variable][] = scheduler_publish_revision_ding_campaign +features[variable][] = scheduler_publish_touch_ding_campaign +features[variable][] = scheduler_unpublish_enable_ding_campaign +features[variable][] = scheduler_unpublish_required_ding_campaign +features[variable][] = scheduler_unpublish_revision_ding_campaign + diff --git a/ding_campaign.module b/ding_campaign.module index dc75fb7..0aae961 100644 --- a/ding_campaign.module +++ b/ding_campaign.module @@ -4,6 +4,8 @@ * Provides campaign feature to various node types in Ding. */ +include_once 'ding_campaign.features.inc'; + /** * Implements hook_menu(). */ diff --git a/ding_campaign.strongarm.inc b/ding_campaign.strongarm.inc new file mode 100644 index 0000000..4caacb2 --- /dev/null +++ b/ding_campaign.strongarm.inc @@ -0,0 +1,64 @@ +disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'scheduler_publish_enable_ding_campaign'; + $strongarm->value = 1; + $export['scheduler_publish_enable_ding_campaign'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'scheduler_publish_required_ding_campaign'; + $strongarm->value = 1; + $export['scheduler_publish_required_ding_campaign'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'scheduler_publish_revision_ding_campaign'; + $strongarm->value = 0; + $export['scheduler_publish_revision_ding_campaign'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'scheduler_publish_touch_ding_campaign'; + $strongarm->value = 0; + $export['scheduler_publish_touch_ding_campaign'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'scheduler_unpublish_enable_ding_campaign'; + $strongarm->value = 1; + $export['scheduler_unpublish_enable_ding_campaign'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'scheduler_unpublish_required_ding_campaign'; + $strongarm->value = 0; + $export['scheduler_unpublish_required_ding_campaign'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'scheduler_unpublish_revision_ding_campaign'; + $strongarm->value = 0; + $export['scheduler_unpublish_revision_ding_campaign'] = $strongarm; + + return $export; +} + From 5848a2ee1fdfe416a22e6b2e5b6711e8adce81fd Mon Sep 17 00:00:00 2001 From: Martin Cording Date: Thu, 5 Feb 2015 16:51:44 +0100 Subject: [PATCH 06/20] DDBEASY-458 - Extend the rule field length. Signed-off-by: Martin Cording --- ding_campaign.admin.inc | 4 ++-- ding_campaign.install | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ding_campaign.admin.inc b/ding_campaign.admin.inc index 133e47d..acc0ad4 100644 --- a/ding_campaign.admin.inc +++ b/ding_campaign.admin.inc @@ -206,8 +206,8 @@ function ding_campaign_rule_form($rule = NULL, $type = NULL) { '#type' => 'textfield', '#title' => t('Rule value'), '#default_value' => ($rule) ? $rule : '', - '#size' => 24, - '#maxlength' => 24, + '#size' => 64, + '#maxlength' => 255, '#prefix' => '
', '#suffix' => '
', '#autocomplete_path' => 'ding_campaign/autocomplete/' . $type, diff --git a/ding_campaign.install b/ding_campaign.install index 0907213..43ffc8e 100644 --- a/ding_campaign.install +++ b/ding_campaign.install @@ -117,3 +117,16 @@ function ding_campaign_update_7002(&$sandbox) { function ding_campaign_update_7003(&$sandbox) { return db_drop_field('ding_campaign', 'pane_id'); } + +/** + * Expand the rule column max length. + */ +function ding_campaign_update_7004() { + $new_def = array( + 'type' => 'varchar', + 'length' => 255, + ); + + db_change_field('ding_campaign_rules', 'rule', 'rule', $new_def); +} + From 22bed503c0aa9addb1ba29228a4d7f2f0ab5cab6 Mon Sep 17 00:00:00 2001 From: Martin Cording Date: Wed, 8 Apr 2015 11:05:02 +0200 Subject: [PATCH 07/20] DDBEASY-613 - New image styles for easyDDB layout. --- ding_campaign.features.inc | 152 +++++++++++++++++++++++++++++ ding_campaign.info | 6 ++ plugins/content_types/campaign.inc | 14 +-- 3 files changed, 166 insertions(+), 6 deletions(-) diff --git a/ding_campaign.features.inc b/ding_campaign.features.inc index fce55ff..f355549 100644 --- a/ding_campaign.features.inc +++ b/ding_campaign.features.inc @@ -14,3 +14,155 @@ function ding_campaign_ctools_plugin_api() { } } +/** + * Implements hook_image_default_styles(). + */ +function ding_campaign_image_default_styles() { + $styles = array(); + + // Exported image style: ding_campaign_p_100. + $styles['ding_campaign_p_100'] = array( + 'name' => 'ding_campaign_p_100', + 'label' => 'Campaign (100% - 1200px)', + 'effects' => array( + 7 => array( + 'label' => 'Scale', + 'help' => 'Scaling will maintain the aspect-ratio of the original image. If only a single dimension is specified, the other dimension will be calculated.', + 'effect callback' => 'image_scale_effect', + 'dimensions callback' => 'image_scale_dimensions', + 'form callback' => 'image_scale_form', + 'summary theme' => 'image_scale_summary', + 'module' => 'image', + 'name' => 'image_scale', + 'data' => array( + 'width' => 1200, + 'height' => '', + 'upscale' => 1, + ), + 'weight' => 1, + ), + ), + ); + + // Exported image style: ding_campaign_p_25. + $styles['ding_campaign_p_25'] = array( + 'name' => 'ding_campaign_p_25', + 'label' => 'Campaign (25% - 280px)', + 'effects' => array( + 1 => array( + 'label' => 'Scale', + 'help' => 'Scaling will maintain the aspect-ratio of the original image. If only a single dimension is specified, the other dimension will be calculated.', + 'effect callback' => 'image_scale_effect', + 'dimensions callback' => 'image_scale_dimensions', + 'form callback' => 'image_scale_form', + 'summary theme' => 'image_scale_summary', + 'module' => 'image', + 'name' => 'image_scale', + 'data' => array( + 'width' => 280, + 'height' => '', + 'upscale' => 1, + ), + 'weight' => 1, + ), + ), + ); + + // Exported image style: ding_campaign_p_33. + $styles['ding_campaign_p_33'] = array( + 'name' => 'ding_campaign_p_33', + 'label' => 'Campaign (33% - 380px)', + 'effects' => array( + 3 => array( + 'label' => 'Scale', + 'help' => 'Scaling will maintain the aspect-ratio of the original image. If only a single dimension is specified, the other dimension will be calculated.', + 'effect callback' => 'image_scale_effect', + 'dimensions callback' => 'image_scale_dimensions', + 'form callback' => 'image_scale_form', + 'summary theme' => 'image_scale_summary', + 'module' => 'image', + 'name' => 'image_scale', + 'data' => array( + 'width' => 380, + 'height' => '', + 'upscale' => 1, + ), + 'weight' => 1, + ), + ), + ); + + // Exported image style: ding_campaign_p_50. + $styles['ding_campaign_p_50'] = array( + 'name' => 'ding_campaign_p_50', + 'label' => 'Campaign (50% - 580px)', + 'effects' => array( + 4 => array( + 'label' => 'Scale', + 'help' => 'Scaling will maintain the aspect-ratio of the original image. If only a single dimension is specified, the other dimension will be calculated.', + 'effect callback' => 'image_scale_effect', + 'dimensions callback' => 'image_scale_dimensions', + 'form callback' => 'image_scale_form', + 'summary theme' => 'image_scale_summary', + 'module' => 'image', + 'name' => 'image_scale', + 'data' => array( + 'width' => 580, + 'height' => '', + 'upscale' => 1, + ), + 'weight' => 1, + ), + ), + ); + + // Exported image style: ding_campaign_p_66. + $styles['ding_campaign_p_66'] = array( + 'name' => 'ding_campaign_p_66', + 'label' => 'Campaign (66% - 780px)', + 'effects' => array( + 5 => array( + 'label' => 'Scale', + 'help' => 'Scaling will maintain the aspect-ratio of the original image. If only a single dimension is specified, the other dimension will be calculated.', + 'effect callback' => 'image_scale_effect', + 'dimensions callback' => 'image_scale_dimensions', + 'form callback' => 'image_scale_form', + 'summary theme' => 'image_scale_summary', + 'module' => 'image', + 'name' => 'image_scale', + 'data' => array( + 'width' => 780, + 'height' => '', + 'upscale' => 1, + ), + 'weight' => 1, + ), + ), + ); + + // Exported image style: ding_campaign_p_75. + $styles['ding_campaign_p_75'] = array( + 'name' => 'ding_campaign_p_75', + 'label' => 'Campaign (75% - 880px)', + 'effects' => array( + 6 => array( + 'label' => 'Scale', + 'help' => 'Scaling will maintain the aspect-ratio of the original image. If only a single dimension is specified, the other dimension will be calculated.', + 'effect callback' => 'image_scale_effect', + 'dimensions callback' => 'image_scale_dimensions', + 'form callback' => 'image_scale_form', + 'summary theme' => 'image_scale_summary', + 'module' => 'image', + 'name' => 'image_scale', + 'data' => array( + 'width' => 880, + 'height' => '', + 'upscale' => 1, + ), + 'weight' => 1, + ), + ), + ); + + return $styles; +} diff --git a/ding_campaign.info b/ding_campaign.info index 9262b63..9a88a89 100644 --- a/ding_campaign.info +++ b/ding_campaign.info @@ -20,4 +20,10 @@ features[variable][] = scheduler_publish_touch_ding_campaign features[variable][] = scheduler_unpublish_enable_ding_campaign features[variable][] = scheduler_unpublish_required_ding_campaign features[variable][] = scheduler_unpublish_revision_ding_campaign +features[image][] = ding_campaign_p_100 +features[image][] = ding_campaign_p_25 +features[image][] = ding_campaign_p_33 +features[image][] = ding_campaign_p_50 +features[image][] = ding_campaign_p_66 +features[image][] = ding_campaign_p_75 diff --git a/plugins/content_types/campaign.inc b/plugins/content_types/campaign.inc index e63512d..e11d045 100644 --- a/plugins/content_types/campaign.inc +++ b/plugins/content_types/campaign.inc @@ -71,13 +71,15 @@ function ding_campaign_campaign_content_type_edit_form($form, &$form_state) { '#title' => t('Campaign image width'), '#description' => t('Applicable for image campaigns. Image will be resized to selected width, height will be selected automatically.'), '#options' => array( - 'medium' => t('Default (medium)'), - 'ding_campaign_w_180' => t('180px'), - 'ding_campaign_w_280' => t('280px'), - 'ding_campaign_w_380' => t('380px'), - 'ding_campaign_w_480' => t('480px'), + 'ding_campaign_p_25' => t('25% (280px)'), + 'ding_campaign_p_33' => t('33% (380px)'), + 'ding_campaign_p_50' => t('50% (580px)'), + 'ding_campaign_p_66' => t('66% (780px)'), + 'ding_campaign_p_75' => t('75% (880px)'), + 'ding_campaign_p_100' => t('100% (1200px)'), + ), - '#default_value' => (isset($form_state['conf']['ding_campaign_image_style'])) ? $form_state['conf']['ding_campaign_image_style'] : 'medium', + '#default_value' => (isset($form_state['conf']['ding_campaign_image_style'])) ? $form_state['conf']['ding_campaign_image_style'] : 'ding_campaign_p_25', ); drupal_add_css(drupal_get_path('module', 'ding_campaign') . '/css/ding_campaign.admin.css'); From f744f11eaac72bb56a152e726cabde07b84b777c Mon Sep 17 00:00:00 2001 From: amd_k8 Date: Tue, 28 Apr 2015 12:25:51 +0300 Subject: [PATCH 08/20] Versions bump. --- ding_campaign.info | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ding_campaign.info b/ding_campaign.info index 9a88a89..9d358c6 100644 --- a/ding_campaign.info +++ b/ding_campaign.info @@ -1,7 +1,7 @@ name = Ding campaign description = Campaign system. Displays context-sensitive, ad-like campaigns. package = Ding! -version = "7.x-0.4" +version = 7.x-2.0.0+easy core = 7.x configure = admin/config/ding/campaign dependencies[] = field From e0ac8ef90eb13e00b1f9004cb0f45b8e3b5a9583 Mon Sep 17 00:00:00 2001 From: MM Date: Thu, 30 Apr 2015 15:41:53 +0300 Subject: [PATCH 09/20] DDBEASY 229 - Make schedule field not required. --- ding_campaign.features.inc | 3 +-- ding_campaign.info | 2 +- ding_campaign.strongarm.inc | 5 ++--- 3 files changed, 4 insertions(+), 6 deletions(-) mode change 100644 => 100755 ding_campaign.info diff --git a/ding_campaign.features.inc b/ding_campaign.features.inc index fce55ff..f357251 100644 --- a/ding_campaign.features.inc +++ b/ding_campaign.features.inc @@ -7,8 +7,7 @@ /** * Implements hook_ctools_plugin_api(). */ -function ding_campaign_ctools_plugin_api() { - list($module, $api) = func_get_args(); +function ding_campaign_ctools_plugin_api($module = NULL, $api = NULL) { if ($module == "strongarm" && $api == "strongarm") { return array("version" => "1"); } diff --git a/ding_campaign.info b/ding_campaign.info old mode 100644 new mode 100755 index 9262b63..d3cc9de --- a/ding_campaign.info +++ b/ding_campaign.info @@ -12,7 +12,7 @@ dependencies[] = ding_campaign_ctype dependencies[] = scheduler dependencies[] = strongarm features[ctools][] = strongarm:strongarm:1 -features[features_api][] = api:1 +features[features_api][] = api:2 features[variable][] = scheduler_publish_enable_ding_campaign features[variable][] = scheduler_publish_required_ding_campaign features[variable][] = scheduler_publish_revision_ding_campaign diff --git a/ding_campaign.strongarm.inc b/ding_campaign.strongarm.inc index 4caacb2..625a461 100644 --- a/ding_campaign.strongarm.inc +++ b/ding_campaign.strongarm.inc @@ -21,7 +21,7 @@ function ding_campaign_strongarm() { $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ $strongarm->api_version = 1; $strongarm->name = 'scheduler_publish_required_ding_campaign'; - $strongarm->value = 1; + $strongarm->value = 0; $export['scheduler_publish_required_ding_campaign'] = $strongarm; $strongarm = new stdClass(); @@ -35,7 +35,7 @@ function ding_campaign_strongarm() { $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ $strongarm->api_version = 1; $strongarm->name = 'scheduler_publish_touch_ding_campaign'; - $strongarm->value = 0; + $strongarm->value = 1; $export['scheduler_publish_touch_ding_campaign'] = $strongarm; $strongarm = new stdClass(); @@ -61,4 +61,3 @@ function ding_campaign_strongarm() { return $export; } - From 9c2ad002de8a4f523f6733ffe9bc1dc45403b0ff Mon Sep 17 00:00:00 2001 From: Nicolae Grigoriu Date: Thu, 14 May 2015 17:16:48 +0300 Subject: [PATCH 10/20] DDBEASY 641 - Add #states for form elements on node edit/add. --- .../ding_campaign_ctype.module | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/modules/ding_campaign_ctype/ding_campaign_ctype.module b/modules/ding_campaign_ctype/ding_campaign_ctype.module index dc2002d..6f8f879 100644 --- a/modules/ding_campaign_ctype/ding_campaign_ctype.module +++ b/modules/ding_campaign_ctype/ding_campaign_ctype.module @@ -5,3 +5,36 @@ */ include_once 'ding_campaign_ctype.features.inc'; + +/** + * Implements hook_form_FORM_ID_alter(). + */ +function ding_campaign_ctype_form_ding_campaign_node_form_alter(&$form, &$form_state, $form_id) { + if ($form_id = 'ding_campaign_node_form') { + // Add states for form elements based on Campaign settings selected options. + $form['field_camp_text_full']['#states'] = array( + 'visible' => array( + ':input[name="field_camp_settings[und]"]' => array('value' => 'full'), + ), + ); + $form['field_camp_text_plain']['#states'] = array( + 'visible' => array( + ':input[name="field_camp_settings[und]"]' => array('value' => 'plain'), + ), + ); + } +} + +/** + * Implements hook_field_group_build_pre_render_alter(). + */ +function ding_campaign_ctype_field_group_build_pre_render_alter(&$element) { + // Add states for image fieldsets. + if (!empty($element['group_ding_campaign_images'])) { + $element['group_ding_campaign_images']['#states'] = array( + 'visible' => array( + ':input[name="field_camp_settings[und]"]' => array('value' => 'image'), + ), + ); + } +} From 64852147d02a3f405c0c0b79637446e081937975 Mon Sep 17 00:00:00 2001 From: MM Date: Fri, 15 May 2015 12:49:58 +0300 Subject: [PATCH 11/20] DDBEASY 617 - Remove ding_campaign_ctype. --- ...ing_campaign_ctype.features.field_base.inc | 278 ---------- ...campaign_ctype.features.field_instance.inc | 493 ------------------ .../ding_campaign_ctype.features.inc | 140 ----- .../ding_campaign_ctype.field_group.inc | 100 ---- .../ding_campaign_ctype.info | 68 --- .../ding_campaign_ctype.module | 40 -- .../ding_campaign_ctype.strongarm.inc | 156 ------ 7 files changed, 1275 deletions(-) delete mode 100644 modules/ding_campaign_ctype/ding_campaign_ctype.features.field_base.inc delete mode 100644 modules/ding_campaign_ctype/ding_campaign_ctype.features.field_instance.inc delete mode 100644 modules/ding_campaign_ctype/ding_campaign_ctype.features.inc delete mode 100644 modules/ding_campaign_ctype/ding_campaign_ctype.field_group.inc delete mode 100644 modules/ding_campaign_ctype/ding_campaign_ctype.info delete mode 100644 modules/ding_campaign_ctype/ding_campaign_ctype.module delete mode 100644 modules/ding_campaign_ctype/ding_campaign_ctype.strongarm.inc diff --git a/modules/ding_campaign_ctype/ding_campaign_ctype.features.field_base.inc b/modules/ding_campaign_ctype/ding_campaign_ctype.features.field_base.inc deleted file mode 100644 index 9e88321..0000000 --- a/modules/ding_campaign_ctype/ding_campaign_ctype.features.field_base.inc +++ /dev/null @@ -1,278 +0,0 @@ - 1, - 'cardinality' => -1, - 'deleted' => 0, - 'entity_types' => array(), - 'field_name' => 'ding_campaign_group_ref', - 'foreign keys' => array( - 'node' => array( - 'columns' => array( - 'target_id' => 'nid', - ), - 'table' => 'node', - ), - ), - 'indexes' => array( - 'target_id' => array( - 0 => 'target_id', - ), - ), - 'locked' => 0, - 'module' => 'entityreference', - 'settings' => array( - 'handler' => 'og', - 'handler_settings' => array( - 'behaviors' => array( - 'og_behavior' => array( - 'status' => TRUE, - ), - 'views-select-list' => array( - 'status' => 0, - ), - ), - 'membership_type' => 'og_membership_type_default', - 'sort' => array( - 'direction' => 'ASC', - 'property' => 'title', - 'type' => 'property', - ), - 'target_bundles' => array( - 'ding_group' => 'ding_group', - 'ding_library' => 'ding_library', - ), - ), - 'handler_submit' => 'Change handler', - 'profile2_private' => FALSE, - 'target_type' => 'node', - ), - 'translatable' => 0, - 'type' => 'entityreference', - ); - - // Exported field_base: 'field_camp_behavior' - $field_bases['field_camp_behavior'] = array( - 'active' => 1, - 'cardinality' => 1, - 'deleted' => 0, - 'entity_types' => array(), - 'field_name' => 'field_camp_behavior', - 'foreign keys' => array(), - 'indexes' => array( - 'value' => array( - 0 => 'value', - ), - ), - 'locked' => 0, - 'module' => 'list', - 'settings' => array( - 'allowed_values' => array( - 0 => '', - 1 => '', - ), - 'allowed_values_function' => '', - 'profile2_private' => FALSE, - ), - 'translatable' => 0, - 'type' => 'list_boolean', - ); - - // Exported field_base: 'field_camp_image' - $field_bases['field_camp_image'] = array( - 'active' => 1, - 'cardinality' => 1, - 'deleted' => 0, - 'entity_types' => array(), - 'field_name' => 'field_camp_image', - 'foreign keys' => array( - 'fid' => array( - 'columns' => array( - 'fid' => 'fid', - ), - 'table' => 'file_managed', - ), - ), - 'indexes' => array( - 'fid' => array( - 0 => 'fid', - ), - ), - 'locked' => 0, - 'module' => 'image', - 'settings' => array( - 'default_image' => 0, - 'uri_scheme' => 'public', - ), - 'translatable' => 0, - 'type' => 'image', - ); - - // Exported field_base: 'field_camp_link' - $field_bases['field_camp_link'] = array( - 'active' => 1, - 'cardinality' => 1, - 'deleted' => 0, - 'entity_types' => array(), - 'field_name' => 'field_camp_link', - 'foreign keys' => array( - 'format' => array( - 'columns' => array( - 'format' => 'format', - ), - 'table' => 'filter_format', - ), - ), - 'indexes' => array( - 'format' => array( - 0 => 'format', - ), - ), - 'locked' => 0, - 'module' => 'text', - 'settings' => array( - 'max_length' => 255, - ), - 'translatable' => 0, - 'type' => 'text', - ); - - // Exported field_base: 'field_camp_settings' - $field_bases['field_camp_settings'] = array( - 'active' => 1, - 'cardinality' => 1, - 'deleted' => 0, - 'entity_types' => array(), - 'field_name' => 'field_camp_settings', - 'foreign keys' => array(), - 'indexes' => array( - 'value' => array( - 0 => 'value', - ), - ), - 'locked' => 0, - 'module' => 'list', - 'settings' => array( - 'allowed_values' => array( - 'full' => 'WYSIWYG', - 'image' => 'Image', - 'plain' => 'Plain text', - ), - 'allowed_values_function' => '', - ), - 'translatable' => 0, - 'type' => 'list_text', - ); - - // Exported field_base: 'field_camp_text_full' - $field_bases['field_camp_text_full'] = array( - 'active' => 1, - 'cardinality' => 1, - 'deleted' => 0, - 'entity_types' => array(), - 'field_name' => 'field_camp_text_full', - 'foreign keys' => array( - 'format' => array( - 'columns' => array( - 'format' => 'format', - ), - 'table' => 'filter_format', - ), - ), - 'indexes' => array( - 'format' => array( - 0 => 'format', - ), - ), - 'locked' => 0, - 'module' => 'text', - 'settings' => array(), - 'translatable' => 0, - 'type' => 'text_long', - ); - - // Exported field_base: 'field_camp_text_plain' - $field_bases['field_camp_text_plain'] = array( - 'active' => 1, - 'cardinality' => 1, - 'deleted' => 0, - 'entity_types' => array(), - 'field_name' => 'field_camp_text_plain', - 'foreign keys' => array( - 'format' => array( - 'columns' => array( - 'format' => 'format', - ), - 'table' => 'filter_format', - ), - ), - 'indexes' => array( - 'format' => array( - 0 => 'format', - ), - ), - 'locked' => 0, - 'module' => 'text', - 'settings' => array(), - 'translatable' => 0, - 'type' => 'text_long', - ); - - // Exported field_base: 'field_camp_weight' - $field_bases['field_camp_weight'] = array( - 'active' => 1, - 'cardinality' => 1, - 'deleted' => 0, - 'entity_types' => array(), - 'field_name' => 'field_camp_weight', - 'foreign keys' => array(), - 'indexes' => array( - 'value' => array( - 0 => 'value', - ), - ), - 'locked' => 0, - 'module' => 'list', - 'settings' => array( - 'allowed_values' => array( - -10 => -10, - -9 => -9, - -8 => -8, - -7 => -7, - -6 => -6, - -5 => -5, - -4 => -4, - -3 => -3, - -2 => -2, - -1 => -1, - 0 => 0, - 1 => 1, - 2 => 2, - 3 => 3, - 4 => 4, - 5 => 5, - 6 => 6, - 7 => 7, - 8 => 8, - 9 => 9, - 10 => 10, - ), - 'allowed_values_function' => '', - ), - 'translatable' => 0, - 'type' => 'list_integer', - ); - - return $field_bases; -} diff --git a/modules/ding_campaign_ctype/ding_campaign_ctype.features.field_instance.inc b/modules/ding_campaign_ctype/ding_campaign_ctype.features.field_instance.inc deleted file mode 100644 index 1433f94..0000000 --- a/modules/ding_campaign_ctype/ding_campaign_ctype.features.field_instance.inc +++ /dev/null @@ -1,493 +0,0 @@ - 'ding_campaign', - 'default_value' => NULL, - 'deleted' => 0, - 'description' => '', - 'display' => array( - 'default' => array( - 'label' => 'above', - 'module' => 'og_ui', - 'settings' => array(), - 'type' => 'og_list_default', - 'weight' => 7, - ), - 'full' => array( - 'label' => 'above', - 'settings' => array(), - 'type' => 'hidden', - 'weight' => 0, - ), - 'teaser' => array( - 'label' => 'above', - 'settings' => array(), - 'type' => 'hidden', - 'weight' => 0, - ), - 'teaser_highlight' => array( - 'label' => 'above', - 'settings' => array(), - 'type' => 'hidden', - 'weight' => 0, - ), - ), - 'entity_type' => 'node', - 'field_name' => 'ding_campaign_group_ref', - 'label' => 'Libraries and Groups', - 'required' => 0, - 'settings' => array( - 'behaviors' => array( - 'og_widget' => array( - 'admin' => array( - 'widget_type' => 'entityreference_autocomplete', - ), - 'default' => array( - 'widget_type' => 'options_select', - ), - 'status' => TRUE, - ), - ), - 'user_register_form' => FALSE, - ), - 'view modes' => array( - 'full' => array( - 'custom settings' => FALSE, - 'label' => 'Full', - 'type' => 'og_list_default', - ), - 'teaser' => array( - 'custom settings' => FALSE, - 'label' => 'Teaser', - 'type' => 'og_list_default', - ), - ), - 'widget' => array( - 'active' => 0, - 'module' => 'options', - 'settings' => array(), - 'type' => 'options_select', - 'weight' => 6, - ), - ); - - // Exported field_instance: 'node-ding_campaign-field_camp_behavior' - $field_instances['node-ding_campaign-field_camp_behavior'] = array( - 'bundle' => 'ding_campaign', - 'default_value' => array( - 0 => array( - 'value' => 0, - ), - ), - 'deleted' => 0, - 'description' => 'If set, the clicked campaign will open in a new tab/window', - 'display' => array( - 'default' => array( - 'label' => 'above', - 'module' => 'list', - 'settings' => array(), - 'type' => 'list_default', - 'weight' => 8, - ), - 'full' => array( - 'label' => 'above', - 'settings' => array(), - 'type' => 'hidden', - 'weight' => 0, - ), - 'teaser' => array( - 'label' => 'above', - 'settings' => array(), - 'type' => 'hidden', - 'weight' => 0, - ), - 'teaser_highlight' => array( - 'label' => 'above', - 'settings' => array(), - 'type' => 'hidden', - 'weight' => 0, - ), - ), - 'entity_type' => 'node', - 'field_name' => 'field_camp_behavior', - 'label' => 'Open in new tab/window', - 'required' => 0, - 'settings' => array( - 'user_register_form' => FALSE, - ), - 'widget' => array( - 'active' => 1, - 'module' => 'options', - 'settings' => array( - 'display_label' => 1, - ), - 'type' => 'options_onoff', - 'weight' => 7, - ), - ); - - // Exported field_instance: 'node-ding_campaign-field_camp_image' - $field_instances['node-ding_campaign-field_camp_image'] = array( - 'bundle' => 'ding_campaign', - 'deleted' => 0, - 'description' => '', - 'display' => array( - 'default' => array( - 'label' => 'above', - 'module' => 'image', - 'settings' => array( - 'image_link' => '', - 'image_style' => '', - ), - 'type' => 'image', - 'weight' => 2, - ), - 'full' => array( - 'label' => 'above', - 'module' => 'image', - 'settings' => array( - 'image_link' => '', - 'image_style' => '', - ), - 'type' => 'image', - 'weight' => 2, - ), - 'teaser' => array( - 'label' => 'above', - 'settings' => array(), - 'type' => 'hidden', - 'weight' => 0, - ), - 'teaser_highlight' => array( - 'label' => 'above', - 'settings' => array(), - 'type' => 'hidden', - 'weight' => 0, - ), - ), - 'entity_type' => 'node', - 'field_name' => 'field_camp_image', - 'label' => 'Campaign image', - 'required' => 0, - 'settings' => array( - 'alt_field' => 0, - 'default_image' => 0, - 'file_directory' => '', - 'file_extensions' => 'png gif jpg jpeg', - 'max_filesize' => '', - 'max_resolution' => '', - 'min_resolution' => '', - 'title_field' => 0, - 'user_register_form' => FALSE, - ), - 'widget' => array( - 'active' => 1, - 'module' => 'media', - 'settings' => array( - 'allowed_schemes' => array( - 0 => 'public', - 1 => 'private', - ), - 'allowed_types' => array( - 0 => 'image', - ), - 'browser_plugins' => array(), - 'preview_image_style' => 'thumbnail', - 'progress_indicator' => 'throbber', - ), - 'type' => 'media_generic', - 'weight' => 4, - ), - ); - - // Exported field_instance: 'node-ding_campaign-field_camp_link' - $field_instances['node-ding_campaign-field_camp_link'] = array( - 'bundle' => 'ding_campaign', - 'default_value' => NULL, - 'deleted' => 0, - 'description' => '', - 'display' => array( - 'default' => array( - 'label' => 'above', - 'module' => 'text', - 'settings' => array(), - 'type' => 'text_default', - 'weight' => 4, - ), - 'full' => array( - 'label' => 'above', - 'module' => 'text', - 'settings' => array(), - 'type' => 'text_default', - 'weight' => 4, - ), - 'teaser' => array( - 'label' => 'above', - 'settings' => array(), - 'type' => 'hidden', - 'weight' => 0, - ), - 'teaser_highlight' => array( - 'label' => 'above', - 'settings' => array(), - 'type' => 'hidden', - 'weight' => 0, - ), - ), - 'entity_type' => 'node', - 'field_name' => 'field_camp_link', - 'label' => 'Campaign link', - 'required' => 0, - 'settings' => array( - 'text_processing' => 0, - 'user_register_form' => FALSE, - ), - 'widget' => array( - 'active' => 1, - 'module' => 'text', - 'settings' => array( - 'size' => 60, - ), - 'type' => 'text_textfield', - 'weight' => 6, - ), - ); - - // Exported field_instance: 'node-ding_campaign-field_camp_settings' - $field_instances['node-ding_campaign-field_camp_settings'] = array( - 'bundle' => 'ding_campaign', - 'default_value' => array( - 0 => array( - 'value' => 'plain', - ), - ), - 'deleted' => 0, - 'description' => '', - 'display' => array( - 'default' => array( - 'label' => 'above', - 'module' => 'list', - 'settings' => array(), - 'type' => 'list_default', - 'weight' => 0, - ), - 'full' => array( - 'label' => 'above', - 'module' => 'list', - 'settings' => array(), - 'type' => 'list_default', - 'weight' => 0, - ), - 'teaser' => array( - 'label' => 'above', - 'settings' => array(), - 'type' => 'hidden', - 'weight' => 0, - ), - 'teaser_highlight' => array( - 'label' => 'above', - 'settings' => array(), - 'type' => 'hidden', - 'weight' => 0, - ), - ), - 'entity_type' => 'node', - 'field_name' => 'field_camp_settings', - 'label' => 'Campaign settings', - 'required' => 0, - 'settings' => array( - 'user_register_form' => FALSE, - ), - 'widget' => array( - 'active' => 1, - 'module' => 'options', - 'settings' => array(), - 'type' => 'options_buttons', - 'weight' => 4, - ), - ); - - // Exported field_instance: 'node-ding_campaign-field_camp_text_full' - $field_instances['node-ding_campaign-field_camp_text_full'] = array( - 'bundle' => 'ding_campaign', - 'default_value' => NULL, - 'deleted' => 0, - 'description' => '', - 'display' => array( - 'default' => array( - 'label' => 'above', - 'module' => 'text', - 'settings' => array(), - 'type' => 'text_default', - 'weight' => 3, - ), - 'full' => array( - 'label' => 'above', - 'module' => 'text', - 'settings' => array(), - 'type' => 'text_default', - 'weight' => 3, - ), - 'teaser' => array( - 'label' => 'above', - 'settings' => array(), - 'type' => 'hidden', - 'weight' => 0, - ), - 'teaser_highlight' => array( - 'label' => 'above', - 'settings' => array(), - 'type' => 'hidden', - 'weight' => 0, - ), - ), - 'entity_type' => 'node', - 'field_name' => 'field_camp_text_full', - 'label' => 'Campaign text', - 'required' => 0, - 'settings' => array( - 'text_processing' => 1, - 'user_register_form' => FALSE, - ), - 'widget' => array( - 'active' => 1, - 'module' => 'text', - 'settings' => array( - 'rows' => 5, - ), - 'type' => 'text_textarea', - 'weight' => 5, - ), - ); - - // Exported field_instance: 'node-ding_campaign-field_camp_text_plain' - $field_instances['node-ding_campaign-field_camp_text_plain'] = array( - 'bundle' => 'ding_campaign', - 'default_value' => NULL, - 'deleted' => 0, - 'description' => '', - 'display' => array( - 'default' => array( - 'label' => 'above', - 'module' => 'text', - 'settings' => array(), - 'type' => 'text_default', - 'weight' => 1, - ), - 'full' => array( - 'label' => 'above', - 'module' => 'text', - 'settings' => array(), - 'type' => 'text_default', - 'weight' => 1, - ), - 'teaser' => array( - 'label' => 'above', - 'settings' => array(), - 'type' => 'hidden', - 'weight' => 0, - ), - 'teaser_highlight' => array( - 'label' => 'above', - 'settings' => array(), - 'type' => 'hidden', - 'weight' => 0, - ), - ), - 'entity_type' => 'node', - 'field_name' => 'field_camp_text_plain', - 'label' => 'Campaign text', - 'required' => 0, - 'settings' => array( - 'text_processing' => 0, - 'user_register_form' => FALSE, - ), - 'widget' => array( - 'active' => 1, - 'module' => 'text', - 'settings' => array( - 'rows' => 5, - ), - 'type' => 'text_textarea', - 'weight' => 4, - ), - ); - - // Exported field_instance: 'node-ding_campaign-field_camp_weight' - $field_instances['node-ding_campaign-field_camp_weight'] = array( - 'bundle' => 'ding_campaign', - 'default_value' => array( - 0 => array( - 'value' => 0, - ), - ), - 'deleted' => 0, - 'description' => '', - 'display' => array( - 'default' => array( - 'label' => 'above', - 'module' => 'list', - 'settings' => array(), - 'type' => 'list_default', - 'weight' => 6, - ), - 'full' => array( - 'label' => 'above', - 'module' => 'list', - 'settings' => array(), - 'type' => 'list_default', - 'weight' => 6, - ), - 'teaser' => array( - 'label' => 'above', - 'settings' => array(), - 'type' => 'hidden', - 'weight' => 0, - ), - 'teaser_highlight' => array( - 'label' => 'above', - 'settings' => array(), - 'type' => 'hidden', - 'weight' => 0, - ), - ), - 'entity_type' => 'node', - 'field_name' => 'field_camp_weight', - 'label' => 'Weight', - 'required' => 0, - 'settings' => array( - 'user_register_form' => FALSE, - ), - 'widget' => array( - 'active' => 1, - 'module' => 'options', - 'settings' => array(), - 'type' => 'options_select', - 'weight' => 5, - ), - ); - - // Translatables - // Included for use with string extractors like potx. - t('Campaign image'); - t('Campaign link'); - t('Campaign settings'); - t('Campaign text'); - t('If set, the clicked campaign will open in a new tab/window'); - t('Libraries and Groups'); - t('Open in new tab/window'); - t('Weight'); - - return $field_instances; -} diff --git a/modules/ding_campaign_ctype/ding_campaign_ctype.features.inc b/modules/ding_campaign_ctype/ding_campaign_ctype.features.inc deleted file mode 100644 index af7937a..0000000 --- a/modules/ding_campaign_ctype/ding_campaign_ctype.features.inc +++ /dev/null @@ -1,140 +0,0 @@ - "1"); - } - if ($module == "strongarm" && $api == "strongarm") { - return array("version" => "1"); - } -} - -/** - * Implements hook_image_default_styles(). - */ -function ding_campaign_ctype_image_default_styles() { - $styles = array(); - - // Exported image style: ding_campaign_w_180. - $styles['ding_campaign_w_180'] = array( - 'name' => 'ding_campaign_w_180', - 'effects' => array( - 3 => array( - 'label' => 'Scale', - 'help' => 'Scaling will maintain the aspect-ratio of the original image. If only a single dimension is specified, the other dimension will be calculated.', - 'effect callback' => 'image_scale_effect', - 'dimensions callback' => 'image_scale_dimensions', - 'form callback' => 'image_scale_form', - 'summary theme' => 'image_scale_summary', - 'module' => 'image', - 'name' => 'image_scale', - 'data' => array( - 'width' => 180, - 'height' => '', - 'upscale' => 1, - ), - 'weight' => 1, - ), - ), - 'label' => 'ding_campaign_w_180', - ); - - // Exported image style: ding_campaign_w_280. - $styles['ding_campaign_w_280'] = array( - 'name' => 'ding_campaign_w_280', - 'effects' => array( - 4 => array( - 'label' => 'Scale', - 'help' => 'Scaling will maintain the aspect-ratio of the original image. If only a single dimension is specified, the other dimension will be calculated.', - 'effect callback' => 'image_scale_effect', - 'dimensions callback' => 'image_scale_dimensions', - 'form callback' => 'image_scale_form', - 'summary theme' => 'image_scale_summary', - 'module' => 'image', - 'name' => 'image_scale', - 'data' => array( - 'width' => 280, - 'height' => '', - 'upscale' => 1, - ), - 'weight' => 1, - ), - ), - 'label' => 'ding_campaign_w_280', - ); - - // Exported image style: ding_campaign_w_380. - $styles['ding_campaign_w_380'] = array( - 'name' => 'ding_campaign_w_380', - 'effects' => array( - 5 => array( - 'label' => 'Scale', - 'help' => 'Scaling will maintain the aspect-ratio of the original image. If only a single dimension is specified, the other dimension will be calculated.', - 'effect callback' => 'image_scale_effect', - 'dimensions callback' => 'image_scale_dimensions', - 'form callback' => 'image_scale_form', - 'summary theme' => 'image_scale_summary', - 'module' => 'image', - 'name' => 'image_scale', - 'data' => array( - 'width' => 380, - 'height' => '', - 'upscale' => 1, - ), - 'weight' => 1, - ), - ), - 'label' => 'ding_campaign_w_380', - ); - - // Exported image style: ding_campaign_w_480. - $styles['ding_campaign_w_480'] = array( - 'name' => 'ding_campaign_w_480', - 'effects' => array( - 6 => array( - 'label' => 'Scale', - 'help' => 'Scaling will maintain the aspect-ratio of the original image. If only a single dimension is specified, the other dimension will be calculated.', - 'effect callback' => 'image_scale_effect', - 'dimensions callback' => 'image_scale_dimensions', - 'form callback' => 'image_scale_form', - 'summary theme' => 'image_scale_summary', - 'module' => 'image', - 'name' => 'image_scale', - 'data' => array( - 'width' => 480, - 'height' => '', - 'upscale' => 1, - ), - 'weight' => 1, - ), - ), - 'label' => 'ding_campaign_w_480', - ); - - return $styles; -} - -/** - * Implements hook_node_info(). - */ -function ding_campaign_ctype_node_info() { - $items = array( - 'ding_campaign' => array( - 'name' => t('Campaign'), - 'base' => 'node_content', - 'description' => t('Create a new campaign that based on different rules will be shown in a given context on the site.'), - 'has_title' => '1', - 'title_label' => t('Campaign name'), - 'help' => '', - ), - ); - return $items; -} diff --git a/modules/ding_campaign_ctype/ding_campaign_ctype.field_group.inc b/modules/ding_campaign_ctype/ding_campaign_ctype.field_group.inc deleted file mode 100644 index a9aeda5..0000000 --- a/modules/ding_campaign_ctype/ding_campaign_ctype.field_group.inc +++ /dev/null @@ -1,100 +0,0 @@ -disabled = FALSE; /* Edit this to true to make a default field_group disabled initially */ - $field_group->api_version = 1; - $field_group->identifier = 'group_ding_campaign_content|node|ding_campaign|form'; - $field_group->group_name = 'group_ding_campaign_content'; - $field_group->entity_type = 'node'; - $field_group->bundle = 'ding_campaign'; - $field_group->mode = 'form'; - $field_group->parent_name = ''; - $field_group->data = array( - 'label' => 'Content', - 'weight' => '3', - 'children' => array( - 0 => 'field_camp_link', - 1 => 'field_camp_text_full', - 2 => 'field_camp_text_plain', - 3 => 'field_camp_behavior', - ), - 'format_type' => 'fieldset', - 'format_settings' => array( - 'formatter' => 'collapsible', - 'instance_settings' => array( - 'description' => '', - 'classes' => '', - 'required_fields' => 1, - ), - ), - ); - $export['group_ding_campaign_content|node|ding_campaign|form'] = $field_group; - - $field_group = new stdClass(); - $field_group->disabled = FALSE; /* Edit this to true to make a default field_group disabled initially */ - $field_group->api_version = 1; - $field_group->identifier = 'group_ding_campaign_images|node|ding_campaign|form'; - $field_group->group_name = 'group_ding_campaign_images'; - $field_group->entity_type = 'node'; - $field_group->bundle = 'ding_campaign'; - $field_group->mode = 'form'; - $field_group->parent_name = ''; - $field_group->data = array( - 'label' => 'Images', - 'weight' => '2', - 'children' => array( - 0 => 'field_camp_image', - ), - 'format_type' => 'fieldset', - 'format_settings' => array( - 'formatter' => 'collapsible', - 'instance_settings' => array( - 'description' => '', - 'classes' => '', - 'required_fields' => 1, - ), - ), - ); - $export['group_ding_campaign_images|node|ding_campaign|form'] = $field_group; - - $field_group = new stdClass(); - $field_group->disabled = FALSE; /* Edit this to true to make a default field_group disabled initially */ - $field_group->api_version = 1; - $field_group->identifier = 'group_ding_campaign_settings|node|ding_campaign|form'; - $field_group->group_name = 'group_ding_campaign_settings'; - $field_group->entity_type = 'node'; - $field_group->bundle = 'ding_campaign'; - $field_group->mode = 'form'; - $field_group->parent_name = ''; - $field_group->data = array( - 'label' => 'Settings', - 'weight' => '1', - 'children' => array( - 0 => 'ding_campaign_group_ref', - 1 => 'field_camp_settings', - 2 => 'field_camp_weight', - ), - 'format_type' => 'fieldset', - 'format_settings' => array( - 'formatter' => 'collapsible', - 'instance_settings' => array( - 'description' => '', - 'classes' => '', - 'required_fields' => 1, - ), - ), - ); - $export['group_ding_campaign_settings|node|ding_campaign|form'] = $field_group; - - return $export; -} diff --git a/modules/ding_campaign_ctype/ding_campaign_ctype.info b/modules/ding_campaign_ctype/ding_campaign_ctype.info deleted file mode 100644 index f992051..0000000 --- a/modules/ding_campaign_ctype/ding_campaign_ctype.info +++ /dev/null @@ -1,68 +0,0 @@ -name = Ding campaign ctype -description = Content type and image styles for ding_campaign module -core = 7.x -package = Ding! -dependencies[] = ctools -dependencies[] = ding_campaign -dependencies[] = ding_event -dependencies[] = entityreference -dependencies[] = features -dependencies[] = field_group -dependencies[] = image -dependencies[] = list -dependencies[] = media -dependencies[] = node -dependencies[] = og -dependencies[] = og_ui -dependencies[] = options -dependencies[] = strongarm -dependencies[] = text -features[ctools][] = field_group:field_group:1 -features[ctools][] = strongarm:strongarm:1 -features[features_api][] = api:2 -features[field_base][] = ding_campaign_group_ref -features[field_base][] = field_camp_image -features[field_base][] = field_camp_link -features[field_base][] = field_camp_settings -features[field_base][] = field_camp_text_full -features[field_base][] = field_camp_text_plain -features[field_base][] = field_camp_weight -features[field_group][] = group_ding_campaign_content|node|ding_campaign|form -features[field_group][] = group_ding_campaign_images|node|ding_campaign|form -features[field_group][] = group_ding_campaign_settings|node|ding_campaign|form -features[field_instance][] = node-ding_campaign-ding_campaign_group_ref -features[field_instance][] = node-ding_campaign-field_camp_behavior -features[field_instance][] = node-ding_campaign-field_camp_image -features[field_instance][] = node-ding_campaign-field_camp_link -features[field_instance][] = node-ding_campaign-field_camp_settings -features[field_instance][] = node-ding_campaign-field_camp_text_full -features[field_instance][] = node-ding_campaign-field_camp_text_plain -features[field_instance][] = node-ding_campaign-field_camp_weight -features[image][] = ding_campaign_w_180 -features[image][] = ding_campaign_w_280 -features[image][] = ding_campaign_w_380 -features[image][] = ding_campaign_w_480 -features[node][] = ding_campaign -features[variable][] = comment_anonymous_ding_campaign -features[variable][] = comment_default_mode_ding_campaign -features[variable][] = comment_default_per_page_ding_campaign -features[variable][] = comment_ding_campaign -features[variable][] = comment_form_location_ding_campaign -features[variable][] = comment_preview_ding_campaign -features[variable][] = comment_subject_field_ding_campaign -features[variable][] = field_bundle_settings_node__ding_campaign -features[variable][] = language_content_type_ding_campaign -features[variable][] = menu_options_ding_campaign -features[variable][] = menu_parent_ding_campaign -features[variable][] = node_options_ding_campaign -features[variable][] = node_preview_ding_campaign -features[variable][] = node_submitted_ding_campaign -features[variable][] = opening_hours_enabled_ding_campaign -features_exclude[field][node-ding_campaign-field_camp_image] = node-ding_campaign-field_camp_image -features_exclude[field][node-ding_campaign-field_camp_link] = node-ding_campaign-field_camp_link -features_exclude[field][node-ding_campaign-field_camp_settings] = node-ding_campaign-field_camp_settings -features_exclude[field][node-ding_campaign-field_camp_text_full] = node-ding_campaign-field_camp_text_full -features_exclude[field][node-ding_campaign-field_camp_text_plain] = node-ding_campaign-field_camp_text_plain -features_exclude[field][node-ding_campaign-field_camp_weight] = node-ding_campaign-field_camp_weight -features_exclude[field][node-ding_campaign-og_group_ref] = node-ding_campaign-og_group_ref -features_exclude[field][node-ding_campaign-ding_campaign_group_ref] = node-ding_campaign-ding_campaign_group_ref diff --git a/modules/ding_campaign_ctype/ding_campaign_ctype.module b/modules/ding_campaign_ctype/ding_campaign_ctype.module deleted file mode 100644 index 6f8f879..0000000 --- a/modules/ding_campaign_ctype/ding_campaign_ctype.module +++ /dev/null @@ -1,40 +0,0 @@ - array( - ':input[name="field_camp_settings[und]"]' => array('value' => 'full'), - ), - ); - $form['field_camp_text_plain']['#states'] = array( - 'visible' => array( - ':input[name="field_camp_settings[und]"]' => array('value' => 'plain'), - ), - ); - } -} - -/** - * Implements hook_field_group_build_pre_render_alter(). - */ -function ding_campaign_ctype_field_group_build_pre_render_alter(&$element) { - // Add states for image fieldsets. - if (!empty($element['group_ding_campaign_images'])) { - $element['group_ding_campaign_images']['#states'] = array( - 'visible' => array( - ':input[name="field_camp_settings[und]"]' => array('value' => 'image'), - ), - ); - } -} diff --git a/modules/ding_campaign_ctype/ding_campaign_ctype.strongarm.inc b/modules/ding_campaign_ctype/ding_campaign_ctype.strongarm.inc deleted file mode 100644 index 1ea55dd..0000000 --- a/modules/ding_campaign_ctype/ding_campaign_ctype.strongarm.inc +++ /dev/null @@ -1,156 +0,0 @@ -disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ - $strongarm->api_version = 1; - $strongarm->name = 'comment_anonymous_ding_campaign'; - $strongarm->value = 0; - $export['comment_anonymous_ding_campaign'] = $strongarm; - - $strongarm = new stdClass(); - $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ - $strongarm->api_version = 1; - $strongarm->name = 'comment_default_mode_ding_campaign'; - $strongarm->value = 0; - $export['comment_default_mode_ding_campaign'] = $strongarm; - - $strongarm = new stdClass(); - $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ - $strongarm->api_version = 1; - $strongarm->name = 'comment_default_per_page_ding_campaign'; - $strongarm->value = '50'; - $export['comment_default_per_page_ding_campaign'] = $strongarm; - - $strongarm = new stdClass(); - $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ - $strongarm->api_version = 1; - $strongarm->name = 'comment_ding_campaign'; - $strongarm->value = '1'; - $export['comment_ding_campaign'] = $strongarm; - - $strongarm = new stdClass(); - $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ - $strongarm->api_version = 1; - $strongarm->name = 'comment_form_location_ding_campaign'; - $strongarm->value = 0; - $export['comment_form_location_ding_campaign'] = $strongarm; - - $strongarm = new stdClass(); - $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ - $strongarm->api_version = 1; - $strongarm->name = 'comment_preview_ding_campaign'; - $strongarm->value = '0'; - $export['comment_preview_ding_campaign'] = $strongarm; - - $strongarm = new stdClass(); - $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ - $strongarm->api_version = 1; - $strongarm->name = 'comment_subject_field_ding_campaign'; - $strongarm->value = 0; - $export['comment_subject_field_ding_campaign'] = $strongarm; - - $strongarm = new stdClass(); - $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ - $strongarm->api_version = 1; - $strongarm->name = 'field_bundle_settings_node__ding_campaign'; - $strongarm->value = array( - 'view_modes' => array( - 'full' => array( - 'custom_settings' => TRUE, - ), - 'teaser' => array( - 'custom_settings' => TRUE, - ), - 'teaser_highlight' => array( - 'custom_settings' => TRUE, - ), - 'rss' => array( - 'custom_settings' => FALSE, - ), - 'search_index' => array( - 'custom_settings' => FALSE, - ), - 'search_result' => array( - 'custom_settings' => FALSE, - ), - 'token' => array( - 'custom_settings' => FALSE, - ), - ), - 'extra_fields' => array( - 'form' => array( - 'title' => array( - 'weight' => '0', - ), - 'path' => array( - 'weight' => '4', - ), - ), - 'display' => array(), - ), - ); - $export['field_bundle_settings_node__ding_campaign'] = $strongarm; - - $strongarm = new stdClass(); - $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ - $strongarm->api_version = 1; - $strongarm->name = 'language_content_type_ding_campaign'; - $strongarm->value = '0'; - $export['language_content_type_ding_campaign'] = $strongarm; - - $strongarm = new stdClass(); - $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ - $strongarm->api_version = 1; - $strongarm->name = 'menu_options_ding_campaign'; - $strongarm->value = array(); - $export['menu_options_ding_campaign'] = $strongarm; - - $strongarm = new stdClass(); - $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ - $strongarm->api_version = 1; - $strongarm->name = 'menu_parent_ding_campaign'; - $strongarm->value = 'main-menu:0'; - $export['menu_parent_ding_campaign'] = $strongarm; - - $strongarm = new stdClass(); - $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ - $strongarm->api_version = 1; - $strongarm->name = 'node_options_ding_campaign'; - $strongarm->value = array( - 0 => 'status', - ); - $export['node_options_ding_campaign'] = $strongarm; - - $strongarm = new stdClass(); - $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ - $strongarm->api_version = 1; - $strongarm->name = 'node_preview_ding_campaign'; - $strongarm->value = '0'; - $export['node_preview_ding_campaign'] = $strongarm; - - $strongarm = new stdClass(); - $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ - $strongarm->api_version = 1; - $strongarm->name = 'node_submitted_ding_campaign'; - $strongarm->value = 0; - $export['node_submitted_ding_campaign'] = $strongarm; - - $strongarm = new stdClass(); - $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ - $strongarm->api_version = 1; - $strongarm->name = 'opening_hours_enabled_ding_campaign'; - $strongarm->value = 0; - $export['opening_hours_enabled_ding_campaign'] = $strongarm; - - return $export; -} From 41a0998833016af8fbba9c5ce6a0b91a75d1f514 Mon Sep 17 00:00:00 2001 From: MM Date: Fri, 15 May 2015 12:50:45 +0300 Subject: [PATCH 12/20] DDBEASY 617 - Moce CT and image styles in main module. --- ding_campaign.features.field_base.inc | 278 ++++++++++++ ding_campaign.features.field_instance.inc | 493 ++++++++++++++++++++++ ding_campaign.features.inc | 113 +++++ ding_campaign.info | 68 ++- ding_campaign.strongarm.inc | 135 ++++++ 5 files changed, 1073 insertions(+), 14 deletions(-) create mode 100644 ding_campaign.features.field_base.inc create mode 100644 ding_campaign.features.field_instance.inc diff --git a/ding_campaign.features.field_base.inc b/ding_campaign.features.field_base.inc new file mode 100644 index 0000000..9c5b515 --- /dev/null +++ b/ding_campaign.features.field_base.inc @@ -0,0 +1,278 @@ + 1, + 'cardinality' => -1, + 'deleted' => 0, + 'entity_types' => array(), + 'field_name' => 'ding_campaign_group_ref', + 'foreign keys' => array( + 'node' => array( + 'columns' => array( + 'target_id' => 'nid', + ), + 'table' => 'node', + ), + ), + 'indexes' => array( + 'target_id' => array( + 0 => 'target_id', + ), + ), + 'locked' => 0, + 'module' => 'entityreference', + 'settings' => array( + 'handler' => 'og', + 'handler_settings' => array( + 'behaviors' => array( + 'og_behavior' => array( + 'status' => TRUE, + ), + 'views-select-list' => array( + 'status' => 0, + ), + ), + 'membership_type' => 'og_membership_type_default', + 'sort' => array( + 'direction' => 'ASC', + 'property' => 'title', + 'type' => 'property', + ), + 'target_bundles' => array( + 'ding_group' => 'ding_group', + 'ding_library' => 'ding_library', + ), + ), + 'handler_submit' => 'Change handler', + 'profile2_private' => FALSE, + 'target_type' => 'node', + ), + 'translatable' => 0, + 'type' => 'entityreference', + ); + + // Exported field_base: 'field_camp_behavior' + $field_bases['field_camp_behavior'] = array( + 'active' => 1, + 'cardinality' => 1, + 'deleted' => 0, + 'entity_types' => array(), + 'field_name' => 'field_camp_behavior', + 'foreign keys' => array(), + 'indexes' => array( + 'value' => array( + 0 => 'value', + ), + ), + 'locked' => 0, + 'module' => 'list', + 'settings' => array( + 'allowed_values' => array( + 0 => '', + 1 => '', + ), + 'allowed_values_function' => '', + 'profile2_private' => FALSE, + ), + 'translatable' => 0, + 'type' => 'list_boolean', + ); + + // Exported field_base: 'field_camp_image' + $field_bases['field_camp_image'] = array( + 'active' => 1, + 'cardinality' => 1, + 'deleted' => 0, + 'entity_types' => array(), + 'field_name' => 'field_camp_image', + 'foreign keys' => array( + 'fid' => array( + 'columns' => array( + 'fid' => 'fid', + ), + 'table' => 'file_managed', + ), + ), + 'indexes' => array( + 'fid' => array( + 0 => 'fid', + ), + ), + 'locked' => 0, + 'module' => 'image', + 'settings' => array( + 'default_image' => 0, + 'uri_scheme' => 'public', + ), + 'translatable' => 0, + 'type' => 'image', + ); + + // Exported field_base: 'field_camp_link' + $field_bases['field_camp_link'] = array( + 'active' => 1, + 'cardinality' => 1, + 'deleted' => 0, + 'entity_types' => array(), + 'field_name' => 'field_camp_link', + 'foreign keys' => array( + 'format' => array( + 'columns' => array( + 'format' => 'format', + ), + 'table' => 'filter_format', + ), + ), + 'indexes' => array( + 'format' => array( + 0 => 'format', + ), + ), + 'locked' => 0, + 'module' => 'text', + 'settings' => array( + 'max_length' => 255, + ), + 'translatable' => 0, + 'type' => 'text', + ); + + // Exported field_base: 'field_camp_settings' + $field_bases['field_camp_settings'] = array( + 'active' => 1, + 'cardinality' => 1, + 'deleted' => 0, + 'entity_types' => array(), + 'field_name' => 'field_camp_settings', + 'foreign keys' => array(), + 'indexes' => array( + 'value' => array( + 0 => 'value', + ), + ), + 'locked' => 0, + 'module' => 'list', + 'settings' => array( + 'allowed_values' => array( + 'full' => 'WYSIWYG', + 'image' => 'Image', + 'plain' => 'Plain text', + ), + 'allowed_values_function' => '', + ), + 'translatable' => 0, + 'type' => 'list_text', + ); + + // Exported field_base: 'field_camp_text_full' + $field_bases['field_camp_text_full'] = array( + 'active' => 1, + 'cardinality' => 1, + 'deleted' => 0, + 'entity_types' => array(), + 'field_name' => 'field_camp_text_full', + 'foreign keys' => array( + 'format' => array( + 'columns' => array( + 'format' => 'format', + ), + 'table' => 'filter_format', + ), + ), + 'indexes' => array( + 'format' => array( + 0 => 'format', + ), + ), + 'locked' => 0, + 'module' => 'text', + 'settings' => array(), + 'translatable' => 0, + 'type' => 'text_long', + ); + + // Exported field_base: 'field_camp_text_plain' + $field_bases['field_camp_text_plain'] = array( + 'active' => 1, + 'cardinality' => 1, + 'deleted' => 0, + 'entity_types' => array(), + 'field_name' => 'field_camp_text_plain', + 'foreign keys' => array( + 'format' => array( + 'columns' => array( + 'format' => 'format', + ), + 'table' => 'filter_format', + ), + ), + 'indexes' => array( + 'format' => array( + 0 => 'format', + ), + ), + 'locked' => 0, + 'module' => 'text', + 'settings' => array(), + 'translatable' => 0, + 'type' => 'text_long', + ); + + // Exported field_base: 'field_camp_weight' + $field_bases['field_camp_weight'] = array( + 'active' => 1, + 'cardinality' => 1, + 'deleted' => 0, + 'entity_types' => array(), + 'field_name' => 'field_camp_weight', + 'foreign keys' => array(), + 'indexes' => array( + 'value' => array( + 0 => 'value', + ), + ), + 'locked' => 0, + 'module' => 'list', + 'settings' => array( + 'allowed_values' => array( + -10 => -10, + -9 => -9, + -8 => -8, + -7 => -7, + -6 => -6, + -5 => -5, + -4 => -4, + -3 => -3, + -2 => -2, + -1 => -1, + 0 => 0, + 1 => 1, + 2 => 2, + 3 => 3, + 4 => 4, + 5 => 5, + 6 => 6, + 7 => 7, + 8 => 8, + 9 => 9, + 10 => 10, + ), + 'allowed_values_function' => '', + ), + 'translatable' => 0, + 'type' => 'list_integer', + ); + + return $field_bases; +} diff --git a/ding_campaign.features.field_instance.inc b/ding_campaign.features.field_instance.inc new file mode 100644 index 0000000..3803463 --- /dev/null +++ b/ding_campaign.features.field_instance.inc @@ -0,0 +1,493 @@ + 'ding_campaign', + 'default_value' => NULL, + 'deleted' => 0, + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'above', + 'module' => 'og_ui', + 'settings' => array(), + 'type' => 'og_list_default', + 'weight' => 7, + ), + 'full' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + 'teaser' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + 'teaser_highlight' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + ), + 'entity_type' => 'node', + 'field_name' => 'ding_campaign_group_ref', + 'label' => 'Libraries and Groups', + 'required' => 0, + 'settings' => array( + 'behaviors' => array( + 'og_widget' => array( + 'admin' => array( + 'widget_type' => 'entityreference_autocomplete', + ), + 'default' => array( + 'widget_type' => 'options_select', + ), + 'status' => TRUE, + ), + ), + 'user_register_form' => FALSE, + ), + 'view modes' => array( + 'full' => array( + 'custom settings' => FALSE, + 'label' => 'Full', + 'type' => 'og_list_default', + ), + 'teaser' => array( + 'custom settings' => FALSE, + 'label' => 'Teaser', + 'type' => 'og_list_default', + ), + ), + 'widget' => array( + 'active' => 0, + 'module' => 'options', + 'settings' => array(), + 'type' => 'options_select', + 'weight' => 6, + ), + ); + + // Exported field_instance: 'node-ding_campaign-field_camp_behavior' + $field_instances['node-ding_campaign-field_camp_behavior'] = array( + 'bundle' => 'ding_campaign', + 'default_value' => array( + 0 => array( + 'value' => 0, + ), + ), + 'deleted' => 0, + 'description' => 'If set, the clicked campaign will open in a new tab/window', + 'display' => array( + 'default' => array( + 'label' => 'above', + 'module' => 'list', + 'settings' => array(), + 'type' => 'list_default', + 'weight' => 8, + ), + 'full' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + 'teaser' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + 'teaser_highlight' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + ), + 'entity_type' => 'node', + 'field_name' => 'field_camp_behavior', + 'label' => 'Open in new tab/window', + 'required' => 0, + 'settings' => array( + 'user_register_form' => FALSE, + ), + 'widget' => array( + 'active' => 1, + 'module' => 'options', + 'settings' => array( + 'display_label' => 1, + ), + 'type' => 'options_onoff', + 'weight' => 7, + ), + ); + + // Exported field_instance: 'node-ding_campaign-field_camp_image' + $field_instances['node-ding_campaign-field_camp_image'] = array( + 'bundle' => 'ding_campaign', + 'deleted' => 0, + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'above', + 'module' => 'image', + 'settings' => array( + 'image_link' => '', + 'image_style' => '', + ), + 'type' => 'image', + 'weight' => 2, + ), + 'full' => array( + 'label' => 'above', + 'module' => 'image', + 'settings' => array( + 'image_link' => '', + 'image_style' => '', + ), + 'type' => 'image', + 'weight' => 2, + ), + 'teaser' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + 'teaser_highlight' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + ), + 'entity_type' => 'node', + 'field_name' => 'field_camp_image', + 'label' => 'Campaign image', + 'required' => 0, + 'settings' => array( + 'alt_field' => 0, + 'default_image' => 0, + 'file_directory' => '', + 'file_extensions' => 'png gif jpg jpeg', + 'max_filesize' => '', + 'max_resolution' => '', + 'min_resolution' => '', + 'title_field' => 0, + 'user_register_form' => FALSE, + ), + 'widget' => array( + 'active' => 1, + 'module' => 'media', + 'settings' => array( + 'allowed_schemes' => array( + 0 => 'public', + 1 => 'private', + ), + 'allowed_types' => array( + 0 => 'image', + ), + 'browser_plugins' => array(), + 'preview_image_style' => 'thumbnail', + 'progress_indicator' => 'throbber', + ), + 'type' => 'media_generic', + 'weight' => 4, + ), + ); + + // Exported field_instance: 'node-ding_campaign-field_camp_link' + $field_instances['node-ding_campaign-field_camp_link'] = array( + 'bundle' => 'ding_campaign', + 'default_value' => NULL, + 'deleted' => 0, + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'above', + 'module' => 'text', + 'settings' => array(), + 'type' => 'text_default', + 'weight' => 4, + ), + 'full' => array( + 'label' => 'above', + 'module' => 'text', + 'settings' => array(), + 'type' => 'text_default', + 'weight' => 4, + ), + 'teaser' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + 'teaser_highlight' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + ), + 'entity_type' => 'node', + 'field_name' => 'field_camp_link', + 'label' => 'Campaign link', + 'required' => 0, + 'settings' => array( + 'text_processing' => 0, + 'user_register_form' => FALSE, + ), + 'widget' => array( + 'active' => 1, + 'module' => 'text', + 'settings' => array( + 'size' => 60, + ), + 'type' => 'text_textfield', + 'weight' => 6, + ), + ); + + // Exported field_instance: 'node-ding_campaign-field_camp_settings' + $field_instances['node-ding_campaign-field_camp_settings'] = array( + 'bundle' => 'ding_campaign', + 'default_value' => array( + 0 => array( + 'value' => 'plain', + ), + ), + 'deleted' => 0, + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'above', + 'module' => 'list', + 'settings' => array(), + 'type' => 'list_default', + 'weight' => 0, + ), + 'full' => array( + 'label' => 'above', + 'module' => 'list', + 'settings' => array(), + 'type' => 'list_default', + 'weight' => 0, + ), + 'teaser' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + 'teaser_highlight' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + ), + 'entity_type' => 'node', + 'field_name' => 'field_camp_settings', + 'label' => 'Campaign settings', + 'required' => 0, + 'settings' => array( + 'user_register_form' => FALSE, + ), + 'widget' => array( + 'active' => 1, + 'module' => 'options', + 'settings' => array(), + 'type' => 'options_buttons', + 'weight' => 4, + ), + ); + + // Exported field_instance: 'node-ding_campaign-field_camp_text_full' + $field_instances['node-ding_campaign-field_camp_text_full'] = array( + 'bundle' => 'ding_campaign', + 'default_value' => NULL, + 'deleted' => 0, + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'above', + 'module' => 'text', + 'settings' => array(), + 'type' => 'text_default', + 'weight' => 3, + ), + 'full' => array( + 'label' => 'above', + 'module' => 'text', + 'settings' => array(), + 'type' => 'text_default', + 'weight' => 3, + ), + 'teaser' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + 'teaser_highlight' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + ), + 'entity_type' => 'node', + 'field_name' => 'field_camp_text_full', + 'label' => 'Campaign text', + 'required' => 0, + 'settings' => array( + 'text_processing' => 1, + 'user_register_form' => FALSE, + ), + 'widget' => array( + 'active' => 1, + 'module' => 'text', + 'settings' => array( + 'rows' => 5, + ), + 'type' => 'text_textarea', + 'weight' => 5, + ), + ); + + // Exported field_instance: 'node-ding_campaign-field_camp_text_plain' + $field_instances['node-ding_campaign-field_camp_text_plain'] = array( + 'bundle' => 'ding_campaign', + 'default_value' => NULL, + 'deleted' => 0, + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'above', + 'module' => 'text', + 'settings' => array(), + 'type' => 'text_default', + 'weight' => 1, + ), + 'full' => array( + 'label' => 'above', + 'module' => 'text', + 'settings' => array(), + 'type' => 'text_default', + 'weight' => 1, + ), + 'teaser' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + 'teaser_highlight' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + ), + 'entity_type' => 'node', + 'field_name' => 'field_camp_text_plain', + 'label' => 'Campaign text', + 'required' => 0, + 'settings' => array( + 'text_processing' => 0, + 'user_register_form' => FALSE, + ), + 'widget' => array( + 'active' => 1, + 'module' => 'text', + 'settings' => array( + 'rows' => 5, + ), + 'type' => 'text_textarea', + 'weight' => 4, + ), + ); + + // Exported field_instance: 'node-ding_campaign-field_camp_weight' + $field_instances['node-ding_campaign-field_camp_weight'] = array( + 'bundle' => 'ding_campaign', + 'default_value' => array( + 0 => array( + 'value' => 0, + ), + ), + 'deleted' => 0, + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'above', + 'module' => 'list', + 'settings' => array(), + 'type' => 'list_default', + 'weight' => 6, + ), + 'full' => array( + 'label' => 'above', + 'module' => 'list', + 'settings' => array(), + 'type' => 'list_default', + 'weight' => 6, + ), + 'teaser' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + 'teaser_highlight' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + ), + 'entity_type' => 'node', + 'field_name' => 'field_camp_weight', + 'label' => 'Weight', + 'required' => 0, + 'settings' => array( + 'user_register_form' => FALSE, + ), + 'widget' => array( + 'active' => 1, + 'module' => 'options', + 'settings' => array(), + 'type' => 'options_select', + 'weight' => 5, + ), + ); + + // Translatables + // Included for use with string extractors like potx. + t('Campaign image'); + t('Campaign link'); + t('Campaign settings'); + t('Campaign text'); + t('If set, the clicked campaign will open in a new tab/window'); + t('Libraries and Groups'); + t('Open in new tab/window'); + t('Weight'); + + return $field_instances; +} diff --git a/ding_campaign.features.inc b/ding_campaign.features.inc index c7b174d..c8c743f 100644 --- a/ding_campaign.features.inc +++ b/ding_campaign.features.inc @@ -163,5 +163,118 @@ function ding_campaign_image_default_styles() { ), ); + // Exported image style: ding_campaign_w_180. + $styles['ding_campaign_w_180'] = array( + 'name' => 'ding_campaign_w_180', + 'effects' => array( + 3 => array( + 'label' => 'Scale', + 'help' => 'Scaling will maintain the aspect-ratio of the original image. If only a single dimension is specified, the other dimension will be calculated.', + 'effect callback' => 'image_scale_effect', + 'dimensions callback' => 'image_scale_dimensions', + 'form callback' => 'image_scale_form', + 'summary theme' => 'image_scale_summary', + 'module' => 'image', + 'name' => 'image_scale', + 'data' => array( + 'width' => 180, + 'height' => '', + 'upscale' => 1, + ), + 'weight' => 1, + ), + ), + 'label' => 'ding_campaign_w_180', + ); + + // Exported image style: ding_campaign_w_280. + $styles['ding_campaign_w_280'] = array( + 'name' => 'ding_campaign_w_280', + 'effects' => array( + 4 => array( + 'label' => 'Scale', + 'help' => 'Scaling will maintain the aspect-ratio of the original image. If only a single dimension is specified, the other dimension will be calculated.', + 'effect callback' => 'image_scale_effect', + 'dimensions callback' => 'image_scale_dimensions', + 'form callback' => 'image_scale_form', + 'summary theme' => 'image_scale_summary', + 'module' => 'image', + 'name' => 'image_scale', + 'data' => array( + 'width' => 280, + 'height' => '', + 'upscale' => 1, + ), + 'weight' => 1, + ), + ), + 'label' => 'ding_campaign_w_280', + ); + + // Exported image style: ding_campaign_w_380. + $styles['ding_campaign_w_380'] = array( + 'name' => 'ding_campaign_w_380', + 'effects' => array( + 5 => array( + 'label' => 'Scale', + 'help' => 'Scaling will maintain the aspect-ratio of the original image. If only a single dimension is specified, the other dimension will be calculated.', + 'effect callback' => 'image_scale_effect', + 'dimensions callback' => 'image_scale_dimensions', + 'form callback' => 'image_scale_form', + 'summary theme' => 'image_scale_summary', + 'module' => 'image', + 'name' => 'image_scale', + 'data' => array( + 'width' => 380, + 'height' => '', + 'upscale' => 1, + ), + 'weight' => 1, + ), + ), + 'label' => 'ding_campaign_w_380', + ); + + // Exported image style: ding_campaign_w_480. + $styles['ding_campaign_w_480'] = array( + 'name' => 'ding_campaign_w_480', + 'effects' => array( + 6 => array( + 'label' => 'Scale', + 'help' => 'Scaling will maintain the aspect-ratio of the original image. If only a single dimension is specified, the other dimension will be calculated.', + 'effect callback' => 'image_scale_effect', + 'dimensions callback' => 'image_scale_dimensions', + 'form callback' => 'image_scale_form', + 'summary theme' => 'image_scale_summary', + 'module' => 'image', + 'name' => 'image_scale', + 'data' => array( + 'width' => 480, + 'height' => '', + 'upscale' => 1, + ), + 'weight' => 1, + ), + ), + 'label' => 'ding_campaign_w_480', + ); + return $styles; } + +/** + * Implements hook_node_info(). + */ +function ding_campaign_node_info() { + $items = array( + 'ding_campaign' => array( + 'name' => t('Campaign'), + 'base' => 'node_content', + 'description' => t('Create a new campaign that based on different rules will be shown in a given context on the site.'), + 'has_title' => '1', + 'title_label' => t('Campaign name'), + 'help' => '', + ), + ); + return $items; +} diff --git a/ding_campaign.info b/ding_campaign.info index 35761e5..c696176 100755 --- a/ding_campaign.info +++ b/ding_campaign.info @@ -1,18 +1,63 @@ name = Ding campaign description = Campaign system. Displays context-sensitive, ad-like campaigns. -package = Ding! -version = 7.x-2.0.0+easy core = 7.x -configure = admin/config/ding/campaign -dependencies[] = field -dependencies[] = image -dependencies[] = features +package = Ding! +version = 7.x-2.0 +project = ding_campaign dependencies[] = ctools -dependencies[] = ding_campaign_ctype +dependencies[] = entityreference +dependencies[] = features +dependencies[] = image +dependencies[] = list +dependencies[] = media +dependencies[] = og_ui dependencies[] = scheduler dependencies[] = strongarm +dependencies[] = text +configure = admin/config/ding/campaign features[ctools][] = strongarm:strongarm:1 features[features_api][] = api:2 +features[field_base][] = ding_campaign_group_ref +features[field_base][] = field_camp_behavior +features[field_base][] = field_camp_image +features[field_base][] = field_camp_link +features[field_base][] = field_camp_settings +features[field_base][] = field_camp_text_full +features[field_base][] = field_camp_text_plain +features[field_base][] = field_camp_weight +features[field_instance][] = node-ding_campaign-ding_campaign_group_ref +features[field_instance][] = node-ding_campaign-field_camp_behavior +features[field_instance][] = node-ding_campaign-field_camp_image +features[field_instance][] = node-ding_campaign-field_camp_link +features[field_instance][] = node-ding_campaign-field_camp_settings +features[field_instance][] = node-ding_campaign-field_camp_text_full +features[field_instance][] = node-ding_campaign-field_camp_text_plain +features[field_instance][] = node-ding_campaign-field_camp_weight +features[image][] = ding_campaign_p_100 +features[image][] = ding_campaign_p_25 +features[image][] = ding_campaign_p_33 +features[image][] = ding_campaign_p_50 +features[image][] = ding_campaign_p_66 +features[image][] = ding_campaign_p_75 +features[image][] = ding_campaign_w_180 +features[image][] = ding_campaign_w_280 +features[image][] = ding_campaign_w_380 +features[image][] = ding_campaign_w_480 +features[node][] = ding_campaign +features[variable][] = comment_anonymous_ding_campaign +features[variable][] = comment_default_mode_ding_campaign +features[variable][] = comment_default_per_page_ding_campaign +features[variable][] = comment_ding_campaign +features[variable][] = comment_form_location_ding_campaign +features[variable][] = comment_preview_ding_campaign +features[variable][] = comment_subject_field_ding_campaign +features[variable][] = field_bundle_settings_node__ding_campaign +features[variable][] = language_content_type_ding_campaign +features[variable][] = menu_options_ding_campaign +features[variable][] = menu_parent_ding_campaign +features[variable][] = node_options_ding_campaign +features[variable][] = node_preview_ding_campaign +features[variable][] = node_submitted_ding_campaign features[variable][] = scheduler_publish_enable_ding_campaign features[variable][] = scheduler_publish_required_ding_campaign features[variable][] = scheduler_publish_revision_ding_campaign @@ -20,10 +65,5 @@ features[variable][] = scheduler_publish_touch_ding_campaign features[variable][] = scheduler_unpublish_enable_ding_campaign features[variable][] = scheduler_unpublish_required_ding_campaign features[variable][] = scheduler_unpublish_revision_ding_campaign -features[image][] = ding_campaign_p_100 -features[image][] = ding_campaign_p_25 -features[image][] = ding_campaign_p_33 -features[image][] = ding_campaign_p_50 -features[image][] = ding_campaign_p_66 -features[image][] = ding_campaign_p_75 - +features_exclude[dependencies][options] = options +mtime = 1431613941 diff --git a/ding_campaign.strongarm.inc b/ding_campaign.strongarm.inc index 625a461..078fc1a 100644 --- a/ding_campaign.strongarm.inc +++ b/ding_campaign.strongarm.inc @@ -10,6 +10,141 @@ function ding_campaign_strongarm() { $export = array(); + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'comment_anonymous_ding_campaign'; + $strongarm->value = 0; + $export['comment_anonymous_ding_campaign'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'comment_default_mode_ding_campaign'; + $strongarm->value = 0; + $export['comment_default_mode_ding_campaign'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'comment_default_per_page_ding_campaign'; + $strongarm->value = '50'; + $export['comment_default_per_page_ding_campaign'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'comment_ding_campaign'; + $strongarm->value = '1'; + $export['comment_ding_campaign'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'comment_form_location_ding_campaign'; + $strongarm->value = 0; + $export['comment_form_location_ding_campaign'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'comment_preview_ding_campaign'; + $strongarm->value = '0'; + $export['comment_preview_ding_campaign'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'comment_subject_field_ding_campaign'; + $strongarm->value = 0; + $export['comment_subject_field_ding_campaign'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'field_bundle_settings_node__ding_campaign'; + $strongarm->value = array( + 'view_modes' => array( + 'full' => array( + 'custom_settings' => TRUE, + ), + 'teaser' => array( + 'custom_settings' => TRUE, + ), + 'teaser_highlight' => array( + 'custom_settings' => TRUE, + ), + 'rss' => array( + 'custom_settings' => FALSE, + ), + 'search_index' => array( + 'custom_settings' => FALSE, + ), + 'search_result' => array( + 'custom_settings' => FALSE, + ), + 'token' => array( + 'custom_settings' => FALSE, + ), + ), + 'extra_fields' => array( + 'form' => array( + 'title' => array( + 'weight' => '0', + ), + 'path' => array( + 'weight' => '4', + ), + ), + 'display' => array(), + ), + ); + $export['field_bundle_settings_node__ding_campaign'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'language_content_type_ding_campaign'; + $strongarm->value = '0'; + $export['language_content_type_ding_campaign'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'menu_options_ding_campaign'; + $strongarm->value = array(); + $export['menu_options_ding_campaign'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'menu_parent_ding_campaign'; + $strongarm->value = 'main-menu:0'; + $export['menu_parent_ding_campaign'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'node_options_ding_campaign'; + $strongarm->value = array( + 0 => 'status', + ); + $export['node_options_ding_campaign'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'node_preview_ding_campaign'; + $strongarm->value = '0'; + $export['node_preview_ding_campaign'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'node_submitted_ding_campaign'; + $strongarm->value = 0; + $export['node_submitted_ding_campaign'] = $strongarm; + $strongarm = new stdClass(); $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ $strongarm->api_version = 1; From be48d8004d6dd8fc04ab560a5520cf958583f77c Mon Sep 17 00:00:00 2001 From: Nicolae Grigoriu Date: Fri, 15 May 2015 17:41:01 +0300 Subject: [PATCH 13/20] DDBEASY 641 - Add #states for form elements on node edit/add. --- ding_campaign.features.field_instance.inc | 2 +- ding_campaign.module | 24 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/ding_campaign.features.field_instance.inc b/ding_campaign.features.field_instance.inc index 3803463..9fc4396 100644 --- a/ding_campaign.features.field_instance.inc +++ b/ding_campaign.features.field_instance.inc @@ -314,7 +314,7 @@ function ding_campaign_field_default_field_instances() { 'module' => 'options', 'settings' => array(), 'type' => 'options_buttons', - 'weight' => 4, + 'weight' => 2, ), ); diff --git a/ding_campaign.module b/ding_campaign.module index caad369..694c984 100644 --- a/ding_campaign.module +++ b/ding_campaign.module @@ -453,6 +453,30 @@ function ding_campaign_form_alter(&$form, &$form_state, $form_id) { } } +/** + * Implements hook_form_FORM_ID_alter(). + */ +function ding_campaign_form_ding_campaign_node_form_alter(&$form, &$form_state, $form_id) { + if ($form_id = 'ding_campaign_node_form') { + // Add states for form elements based on Campaign settings selected options. + $form['field_camp_text_full']['#states'] = array( + 'visible' => array( + ':input[name="field_camp_settings[und]"]' => array('value' => 'full'), + ), + ); + $form['field_camp_text_plain']['#states'] = array( + 'visible' => array( + ':input[name="field_camp_settings[und]"]' => array('value' => 'plain'), + ), + ); + $form['field_camp_image']['#states'] = array( + 'visible' => array( + ':input[name="field_camp_settings[und]"]' => array('value' => 'image'), + ), + ); + } +} + /** * Implements hook_node_insert(). */ From 9fcb85e9067a84343de9c687f730b022c497747d Mon Sep 17 00:00:00 2001 From: Nicolae Grigoriu Date: Mon, 18 May 2015 13:11:59 +0300 Subject: [PATCH 14/20] DDBEASY 641 - Clear fields base on campaign settings selected option. --- ding_campaign.module | 53 +++++++++++++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 18 deletions(-) diff --git a/ding_campaign.module b/ding_campaign.module index 694c984..80f7074 100644 --- a/ding_campaign.module +++ b/ding_campaign.module @@ -456,24 +456,41 @@ function ding_campaign_form_alter(&$form, &$form_state, $form_id) { /** * Implements hook_form_FORM_ID_alter(). */ -function ding_campaign_form_ding_campaign_node_form_alter(&$form, &$form_state, $form_id) { - if ($form_id = 'ding_campaign_node_form') { - // Add states for form elements based on Campaign settings selected options. - $form['field_camp_text_full']['#states'] = array( - 'visible' => array( - ':input[name="field_camp_settings[und]"]' => array('value' => 'full'), - ), - ); - $form['field_camp_text_plain']['#states'] = array( - 'visible' => array( - ':input[name="field_camp_settings[und]"]' => array('value' => 'plain'), - ), - ); - $form['field_camp_image']['#states'] = array( - 'visible' => array( - ':input[name="field_camp_settings[und]"]' => array('value' => 'image'), - ), - ); +function ding_campaign_form_ding_campaign_node_form_alter(&$form, &$form_state) { + // Add states for form elements based on Campaign settings selected options. + $form['field_camp_text_full']['#states'] = array( + 'visible' => array( + ':input[name="field_camp_settings[und]"]' => array('value' => 'full'), + ), + ); + $form['field_camp_text_plain']['#states'] = array( + 'visible' => array( + ':input[name="field_camp_settings[und]"]' => array('value' => 'plain'), + ), + ); + $form['field_camp_image']['#states'] = array( + 'visible' => array( + ':input[name="field_camp_settings[und]"]' => array('value' => 'image'), + ), + ); + array_unshift($form['actions']['submit']['#submit'], 'ding_campaign_form_ding_campaign_node_form_submit'); +} + +function ding_campaign_form_ding_campaign_node_form_submit(&$form, &$form_state) { + $field_camp_settings = $form_state['values']['field_camp_settings'][LANGUAGE_NONE][0]['value']; + switch ($field_camp_settings) { + case 'full': + $form_state['values']['field_camp_text_plain'][LANGUAGE_NONE][0]['value'] = ''; + $form_state['values']['field_camp_image'][LANGUAGE_NONE][0]['fid'] = ''; + break; + case 'plain': + $form_state['values']['field_camp_text_full'][LANGUAGE_NONE][0]['value'] = ''; + $form_state['values']['field_camp_image'][LANGUAGE_NONE][0]['fid'] = ''; + break; + case 'image': + $form_state['values']['field_camp_text_full'][LANGUAGE_NONE][0]['value'] = ''; + $form_state['values']['field_camp_text_plain'][LANGUAGE_NONE][0]['value'] = ''; + break; } } From ad2d57d3aa514317e6500fc9b177f1fec06f7357 Mon Sep 17 00:00:00 2001 From: Nicolae Grigoriu Date: Wed, 17 Jun 2015 12:49:27 +0300 Subject: [PATCH 15/20] DDBEASY-696 - Move link into image and unset link. --- ding_campaign.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ding_campaign.module b/ding_campaign.module index 80f7074..352f1b4 100644 --- a/ding_campaign.module +++ b/ding_campaign.module @@ -221,9 +221,9 @@ function ding_campaign_display($context, $count, $offset, $style = 'medium') { $current['#image'] = $current['#link']; $current['#image']['#text'] = drupal_render($image); $current['#image']['#options']['html'] = TRUE; + unset($current['#link']); } } - // Get weight. $weight = $wrapper->field_camp_weight->value(); if (!empty($weight)) { From c49cbc68f2139055d37dfce0562cf32a777add04 Mon Sep 17 00:00:00 2001 From: Martin Cording Date: Thu, 18 Jun 2015 13:09:41 +0200 Subject: [PATCH 16/20] Release: 7.x-2.1.0+easy --- ding_campaign.info | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ding_campaign.info b/ding_campaign.info index c696176..d246a3f 100755 --- a/ding_campaign.info +++ b/ding_campaign.info @@ -2,7 +2,7 @@ name = Ding campaign description = Campaign system. Displays context-sensitive, ad-like campaigns. core = 7.x package = Ding! -version = 7.x-2.0 +version = 7.x-2.1.0+easy project = ding_campaign dependencies[] = ctools dependencies[] = entityreference From 7c04777da7201fca1f52aed64afb9f49cae017cd Mon Sep 17 00:00:00 2001 From: Nicolae Grigoriu Date: Mon, 20 Jul 2015 14:20:23 +0300 Subject: [PATCH 17/20] DDBEASY-696 - Remove title on campaign of type text. --- ding_campaign.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ding_campaign.module b/ding_campaign.module index 352f1b4..466e1a0 100644 --- a/ding_campaign.module +++ b/ding_campaign.module @@ -201,6 +201,7 @@ function ding_campaign_display($context, $count, $offset, $style = 'medium') { $current['#text'] = array( '#markup' => is_array($text) ? $text['safe_value'] : $text, ); + unset($current['#link']); } // Get image. @@ -221,7 +222,6 @@ function ding_campaign_display($context, $count, $offset, $style = 'medium') { $current['#image'] = $current['#link']; $current['#image']['#text'] = drupal_render($image); $current['#image']['#options']['html'] = TRUE; - unset($current['#link']); } } // Get weight. From bf0894ad388cce75d1908859fcc432780ea0836f Mon Sep 17 00:00:00 2001 From: Martin Cording Date: Tue, 25 Aug 2015 20:41:12 +0200 Subject: [PATCH 18/20] Release: 7.x-2.2.0 --- ding_campaign.info | 138 ++++++++++++++++++++++----------------------- 1 file changed, 69 insertions(+), 69 deletions(-) diff --git a/ding_campaign.info b/ding_campaign.info index d246a3f..89b13a4 100755 --- a/ding_campaign.info +++ b/ding_campaign.info @@ -1,69 +1,69 @@ -name = Ding campaign -description = Campaign system. Displays context-sensitive, ad-like campaigns. -core = 7.x -package = Ding! -version = 7.x-2.1.0+easy -project = ding_campaign -dependencies[] = ctools -dependencies[] = entityreference -dependencies[] = features -dependencies[] = image -dependencies[] = list -dependencies[] = media -dependencies[] = og_ui -dependencies[] = scheduler -dependencies[] = strongarm -dependencies[] = text -configure = admin/config/ding/campaign -features[ctools][] = strongarm:strongarm:1 -features[features_api][] = api:2 -features[field_base][] = ding_campaign_group_ref -features[field_base][] = field_camp_behavior -features[field_base][] = field_camp_image -features[field_base][] = field_camp_link -features[field_base][] = field_camp_settings -features[field_base][] = field_camp_text_full -features[field_base][] = field_camp_text_plain -features[field_base][] = field_camp_weight -features[field_instance][] = node-ding_campaign-ding_campaign_group_ref -features[field_instance][] = node-ding_campaign-field_camp_behavior -features[field_instance][] = node-ding_campaign-field_camp_image -features[field_instance][] = node-ding_campaign-field_camp_link -features[field_instance][] = node-ding_campaign-field_camp_settings -features[field_instance][] = node-ding_campaign-field_camp_text_full -features[field_instance][] = node-ding_campaign-field_camp_text_plain -features[field_instance][] = node-ding_campaign-field_camp_weight -features[image][] = ding_campaign_p_100 -features[image][] = ding_campaign_p_25 -features[image][] = ding_campaign_p_33 -features[image][] = ding_campaign_p_50 -features[image][] = ding_campaign_p_66 -features[image][] = ding_campaign_p_75 -features[image][] = ding_campaign_w_180 -features[image][] = ding_campaign_w_280 -features[image][] = ding_campaign_w_380 -features[image][] = ding_campaign_w_480 -features[node][] = ding_campaign -features[variable][] = comment_anonymous_ding_campaign -features[variable][] = comment_default_mode_ding_campaign -features[variable][] = comment_default_per_page_ding_campaign -features[variable][] = comment_ding_campaign -features[variable][] = comment_form_location_ding_campaign -features[variable][] = comment_preview_ding_campaign -features[variable][] = comment_subject_field_ding_campaign -features[variable][] = field_bundle_settings_node__ding_campaign -features[variable][] = language_content_type_ding_campaign -features[variable][] = menu_options_ding_campaign -features[variable][] = menu_parent_ding_campaign -features[variable][] = node_options_ding_campaign -features[variable][] = node_preview_ding_campaign -features[variable][] = node_submitted_ding_campaign -features[variable][] = scheduler_publish_enable_ding_campaign -features[variable][] = scheduler_publish_required_ding_campaign -features[variable][] = scheduler_publish_revision_ding_campaign -features[variable][] = scheduler_publish_touch_ding_campaign -features[variable][] = scheduler_unpublish_enable_ding_campaign -features[variable][] = scheduler_unpublish_required_ding_campaign -features[variable][] = scheduler_unpublish_revision_ding_campaign -features_exclude[dependencies][options] = options -mtime = 1431613941 +name = Ding campaign +description = Campaign system. Displays context-sensitive, ad-like campaigns. +core = 7.x +package = Ding! +version = 7.x-2.2.0+easy +project = ding_campaign +dependencies[] = ctools +dependencies[] = entityreference +dependencies[] = features +dependencies[] = image +dependencies[] = list +dependencies[] = media +dependencies[] = og_ui +dependencies[] = scheduler +dependencies[] = strongarm +dependencies[] = text +configure = admin/config/ding/campaign +features[ctools][] = strongarm:strongarm:1 +features[features_api][] = api:2 +features[field_base][] = ding_campaign_group_ref +features[field_base][] = field_camp_behavior +features[field_base][] = field_camp_image +features[field_base][] = field_camp_link +features[field_base][] = field_camp_settings +features[field_base][] = field_camp_text_full +features[field_base][] = field_camp_text_plain +features[field_base][] = field_camp_weight +features[field_instance][] = node-ding_campaign-ding_campaign_group_ref +features[field_instance][] = node-ding_campaign-field_camp_behavior +features[field_instance][] = node-ding_campaign-field_camp_image +features[field_instance][] = node-ding_campaign-field_camp_link +features[field_instance][] = node-ding_campaign-field_camp_settings +features[field_instance][] = node-ding_campaign-field_camp_text_full +features[field_instance][] = node-ding_campaign-field_camp_text_plain +features[field_instance][] = node-ding_campaign-field_camp_weight +features[image][] = ding_campaign_p_100 +features[image][] = ding_campaign_p_25 +features[image][] = ding_campaign_p_33 +features[image][] = ding_campaign_p_50 +features[image][] = ding_campaign_p_66 +features[image][] = ding_campaign_p_75 +features[image][] = ding_campaign_w_180 +features[image][] = ding_campaign_w_280 +features[image][] = ding_campaign_w_380 +features[image][] = ding_campaign_w_480 +features[node][] = ding_campaign +features[variable][] = comment_anonymous_ding_campaign +features[variable][] = comment_default_mode_ding_campaign +features[variable][] = comment_default_per_page_ding_campaign +features[variable][] = comment_ding_campaign +features[variable][] = comment_form_location_ding_campaign +features[variable][] = comment_preview_ding_campaign +features[variable][] = comment_subject_field_ding_campaign +features[variable][] = field_bundle_settings_node__ding_campaign +features[variable][] = language_content_type_ding_campaign +features[variable][] = menu_options_ding_campaign +features[variable][] = menu_parent_ding_campaign +features[variable][] = node_options_ding_campaign +features[variable][] = node_preview_ding_campaign +features[variable][] = node_submitted_ding_campaign +features[variable][] = scheduler_publish_enable_ding_campaign +features[variable][] = scheduler_publish_required_ding_campaign +features[variable][] = scheduler_publish_revision_ding_campaign +features[variable][] = scheduler_publish_touch_ding_campaign +features[variable][] = scheduler_unpublish_enable_ding_campaign +features[variable][] = scheduler_unpublish_required_ding_campaign +features[variable][] = scheduler_unpublish_revision_ding_campaign +features_exclude[dependencies][options] = options +mtime = 1431613941 From 4e382d73fb98d3ef41cad4ce887da16fd0714095 Mon Sep 17 00:00:00 2001 From: MM Date: Mon, 19 Oct 2015 17:51:01 +0300 Subject: [PATCH 19/20] DDBEASY-719 - Fix notices. --- ding_campaign.info | 0 ding_campaign.module | 6 +++--- 2 files changed, 3 insertions(+), 3 deletions(-) mode change 100755 => 100644 ding_campaign.info diff --git a/ding_campaign.info b/ding_campaign.info old mode 100755 new mode 100644 diff --git a/ding_campaign.module b/ding_campaign.module index 466e1a0..f03023f 100644 --- a/ding_campaign.module +++ b/ding_campaign.module @@ -196,10 +196,10 @@ function ding_campaign_display($context, $count, $offset, $style = 'medium') { // Get text both plain and full. $text = $wrapper->field_camp_text_plain->value(); - $text = !empty($text) ? $text : $wrapper->field_camp_text_full->value(); + $text = (!empty($text)) ? $text : $wrapper->field_camp_text_full->value(); if (!empty($text)) { $current['#text'] = array( - '#markup' => is_array($text) ? $text['safe_value'] : $text, + '#markup' => (is_array($text) && isset($text['safe_value'])) ? $text['safe_value'] : $text, ); unset($current['#link']); } @@ -219,7 +219,7 @@ function ding_campaign_display($context, $count, $offset, $style = 'medium') { if (!empty($link)) { // Sadly the link theme function do not generate children. $image = $current['#image']; - $current['#image'] = $current['#link']; + $current['#image'] = (isset($current['#link'])) ? $current['#link'] : NULL; $current['#image']['#text'] = drupal_render($image); $current['#image']['#options']['html'] = TRUE; } From 34bc873d866b81d0da8ef2bf783d0017eb55d270 Mon Sep 17 00:00:00 2001 From: Martin Cording Date: Mon, 26 Oct 2015 15:00:39 +0100 Subject: [PATCH 20/20] Release: 7.x-2.3.1+easy --- ding_campaign.info | 2 +- ding_campaign.make | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ding_campaign.info b/ding_campaign.info index 89b13a4..c3c3d61 100644 --- a/ding_campaign.info +++ b/ding_campaign.info @@ -2,7 +2,7 @@ name = Ding campaign description = Campaign system. Displays context-sensitive, ad-like campaigns. core = 7.x package = Ding! -version = 7.x-2.2.0+easy +version = 7.x-2.3.1+easy project = ding_campaign dependencies[] = ctools dependencies[] = entityreference diff --git a/ding_campaign.make b/ding_campaign.make index 5453998..1c8bf0b 100644 --- a/ding_campaign.make +++ b/ding_campaign.make @@ -1,10 +1,10 @@ -core = 7.x -api = 2 - -; Projects -projects[ctools][subdir] = "contrib" -projects[ctools][version] = "1.5" - -projects[features][subdir] = "contrib" -projects[features][version] = "2.0" - +core = 7.x +api = 2 + +; Projects +projects[ctools][subdir] = "contrib" +projects[ctools][version] = "1.5" + +projects[features][subdir] = "contrib" +projects[features][version] = "2.0" +