From b5cef4394165c06694d63de5a063b795cbd4a0b5 Mon Sep 17 00:00:00 2001 From: Rune Schjellerup Philosof Date: Fri, 26 Oct 2012 10:26:50 +0200 Subject: [PATCH 01/76] Remove the commented out theme field --- .../ding_campaign_ctype.features.field.inc | 71 ------------------- ding_campaign_ctype/ding_campaign_ctype.info | 1 - 2 files changed, 72 deletions(-) diff --git a/ding_campaign_ctype/ding_campaign_ctype.features.field.inc b/ding_campaign_ctype/ding_campaign_ctype.features.field.inc index beb384a..09b8242 100644 --- a/ding_campaign_ctype/ding_campaign_ctype.features.field.inc +++ b/ding_campaign_ctype/ding_campaign_ctype.features.field.inc @@ -355,76 +355,6 @@ function ding_campaign_ctype_field_default_fields() { ), ); -/* #588 Campaign theme skal fjernes fra Campaign sidetypen, fordi kampagnerne nu følger designet - // Exported field: node-ding_campaign-field_camp_theme. - $fields['node-ding_campaign-field_camp_theme'] = array( - 'field_config' => array( - 'active' => '1', - 'cardinality' => '1', - 'deleted' => '0', - 'entity_types' => array(), - 'field_name' => 'field_camp_theme', - 'foreign keys' => array(), - 'indexes' => array( - 'value' => array( - 0 => 'value', - ), - ), - 'module' => 'list', - 'settings' => array( - 'allowed_values' => array( - 'theme_blue' => 'Blue', - 'theme_green' => 'Green', - 'theme_orange' => 'Orange', - 'theme_pink' => 'Pink', - ), - 'allowed_values_function' => '', - ), - 'translatable' => '0', - 'type' => 'list_text', - ), - 'field_instance' => array( - 'bundle' => 'ding_campaign', - 'default_value' => array( - 0 => array( - 'value' => 'theme_orange', - ), - ), - 'deleted' => '0', - 'description' => '', - 'display' => array( - 'default' => array( - 'label' => 'above', - 'module' => 'list', - 'settings' => array(), - 'type' => 'list_default', - 'weight' => 5, - ), - 'teaser' => array( - 'label' => 'above', - 'settings' => array(), - 'type' => 'hidden', - 'weight' => 0, - ), - ), - 'entity_type' => 'node', - 'field_name' => 'field_camp_theme', - 'label' => 'Campaign theme', - 'required' => 0, - 'settings' => array( - 'user_register_form' => FALSE, - ), - 'widget' => array( - 'active' => 1, - 'module' => 'options', - 'settings' => array(), - 'type' => 'options_select', - 'weight' => '1', - ), - ), - ); -*/ - // Exported field: node-ding_campaign-field_camp_weight. $fields['node-ding_campaign-field_camp_weight'] = array( 'field_config' => array( @@ -515,7 +445,6 @@ function ding_campaign_ctype_field_default_fields() { t('Campaign link'); t('Campaign settings'); t('Campaign text'); - t('Campaign theme'); t('Weight'); return $fields; diff --git a/ding_campaign_ctype/ding_campaign_ctype.info b/ding_campaign_ctype/ding_campaign_ctype.info index 80a5c2f..39757a4 100644 --- a/ding_campaign_ctype/ding_campaign_ctype.info +++ b/ding_campaign_ctype/ding_campaign_ctype.info @@ -10,7 +10,6 @@ features[field][] = "node-ding_campaign-field_camp_link" features[field][] = "node-ding_campaign-field_camp_settings" features[field][] = "node-ding_campaign-field_camp_text_full" features[field][] = "node-ding_campaign-field_camp_text_plain" -// features[field][] = "node-ding_campaign-field_camp_theme" features[field][] = "node-ding_campaign-field_camp_weight" features[node][] = "ding_campaign" features[variable][] = "language_content_type_ding_campaign" From 571c5dfba92d8a985f79a0a8aec5e341b4a22ad3 Mon Sep 17 00:00:00 2001 From: Rune Schjellerup Philosof Date: Fri, 26 Oct 2012 10:31:40 +0200 Subject: [PATCH 02/76] Added version 7.x-0.1, changed order and removed quotations due to features upgrade --- ding_campaign_ctype/ding_campaign_ctype.info | 40 ++++++++++---------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/ding_campaign_ctype/ding_campaign_ctype.info b/ding_campaign_ctype/ding_campaign_ctype.info index 39757a4..2f744e5 100644 --- a/ding_campaign_ctype/ding_campaign_ctype.info +++ b/ding_campaign_ctype/ding_campaign_ctype.info @@ -1,19 +1,21 @@ -core = "7.x" -dependencies[] = "features" -dependencies[] = "image" -dependencies[] = "list" -dependencies[] = "strongarm" -description = "Ding Campaign Content type" -features[ctools][] = "strongarm:strongarm:1" -features[field][] = "node-ding_campaign-field_camp_image" -features[field][] = "node-ding_campaign-field_camp_link" -features[field][] = "node-ding_campaign-field_camp_settings" -features[field][] = "node-ding_campaign-field_camp_text_full" -features[field][] = "node-ding_campaign-field_camp_text_plain" -features[field][] = "node-ding_campaign-field_camp_weight" -features[node][] = "ding_campaign" -features[variable][] = "language_content_type_ding_campaign" -features[variable][] = "node_options_ding_campaign" -name = "Ding Campaign" -package = "Ding!" -php = "5.2.4" +name = Ding Campaign +description = Ding Campaign Content type +core = 7.x +package = Ding! +php = 5.2.4 +version = 7.x-0.1 +dependencies[] = features +dependencies[] = image +dependencies[] = list +dependencies[] = strongarm +features[ctools][] = strongarm:strongarm:1 +features[features_api][] = api:1 +features[field][] = node-ding_campaign-field_camp_image +features[field][] = node-ding_campaign-field_camp_link +features[field][] = node-ding_campaign-field_camp_settings +features[field][] = node-ding_campaign-field_camp_text_full +features[field][] = node-ding_campaign-field_camp_text_plain +features[field][] = node-ding_campaign-field_camp_weight +features[node][] = ding_campaign +features[variable][] = language_content_type_ding_campaign +features[variable][] = node_options_ding_campaign From 6681995850e0874a733bb3ec826fcf80c297ae7d Mon Sep 17 00:00:00 2001 From: Rune Schjellerup Philosof Date: Fri, 26 Oct 2012 10:33:20 +0200 Subject: [PATCH 03/76] code style changes - no functional changes --- .../ding_campaign_ctype.features.field.inc | 17 +++++++++-------- .../ding_campaign_ctype.features.inc | 2 +- .../ding_campaign_ctype.strongarm.inc | 6 +++--- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/ding_campaign_ctype/ding_campaign_ctype.features.field.inc b/ding_campaign_ctype/ding_campaign_ctype.features.field.inc index 09b8242..02998d1 100644 --- a/ding_campaign_ctype/ding_campaign_ctype.features.field.inc +++ b/ding_campaign_ctype/ding_campaign_ctype.features.field.inc @@ -1,7 +1,7 @@ array( 'active' => '1', @@ -88,7 +88,7 @@ function ding_campaign_ctype_field_default_fields() { ), ); - // Exported field: node-ding_campaign-field_camp_link. + // Exported field: 'node-ding_campaign-field_camp_link'. $fields['node-ding_campaign-field_camp_link'] = array( 'field_config' => array( 'active' => '1', @@ -156,7 +156,7 @@ function ding_campaign_ctype_field_default_fields() { ), ); - // Exported field: node-ding_campaign-field_camp_settings. + // Exported field: 'node-ding_campaign-field_camp_settings'. $fields['node-ding_campaign-field_camp_settings'] = array( 'field_config' => array( 'active' => '1', @@ -223,7 +223,7 @@ function ding_campaign_ctype_field_default_fields() { ), ); - // Exported field: node-ding_campaign-field_camp_text_full. + // Exported field: 'node-ding_campaign-field_camp_text_full'. $fields['node-ding_campaign-field_camp_text_full'] = array( 'field_config' => array( 'active' => '1', @@ -289,7 +289,7 @@ function ding_campaign_ctype_field_default_fields() { ), ); - // Exported field: node-ding_campaign-field_camp_text_plain. + // Exported field: 'node-ding_campaign-field_camp_text_plain'. $fields['node-ding_campaign-field_camp_text_plain'] = array( 'field_config' => array( 'active' => '1', @@ -355,7 +355,7 @@ function ding_campaign_ctype_field_default_fields() { ), ); - // Exported field: node-ding_campaign-field_camp_weight. + // Exported field: 'node-ding_campaign-field_camp_weight'. $fields['node-ding_campaign-field_camp_weight'] = array( 'field_config' => array( 'active' => '1', @@ -440,7 +440,8 @@ function ding_campaign_ctype_field_default_fields() { ), ); - // Translatables - included for use with string extractors like potx. + // Translatables + // Included for use with string extractors like potx. t('Campaign image'); t('Campaign link'); t('Campaign settings'); diff --git a/ding_campaign_ctype/ding_campaign_ctype.features.inc b/ding_campaign_ctype/ding_campaign_ctype.features.inc index 97e8ef7..6179821 100644 --- a/ding_campaign_ctype/ding_campaign_ctype.features.inc +++ b/ding_campaign_ctype/ding_campaign_ctype.features.inc @@ -1,7 +1,7 @@ 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 = '1'; $export['language_content_type_ding_campaign'] = $strongarm; - $strongarm = new stdClass; + $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'; From 65d100fad373143b512175f55d8f010ff6d2287c Mon Sep 17 00:00:00 2001 From: Rune Schjellerup Philosof Date: Fri, 26 Oct 2012 10:36:20 +0200 Subject: [PATCH 04/76] Default settings A new view-mode was added, but no settings about the field visibility. This commit is just for making sure the feature doen't show as overridden in a brand new install, no considerations on whether the fields should be visible or not. Field 'locked' settings are now also exported (because of features update http://drupal.org/node/1567506). --- .../ding_campaign_ctype.features.field.inc | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/ding_campaign_ctype/ding_campaign_ctype.features.field.inc b/ding_campaign_ctype/ding_campaign_ctype.features.field.inc index 02998d1..59e8f89 100644 --- a/ding_campaign_ctype/ding_campaign_ctype.features.field.inc +++ b/ding_campaign_ctype/ding_campaign_ctype.features.field.inc @@ -31,6 +31,7 @@ function ding_campaign_ctype_field_default_fields() { 0 => 'fid', ), ), + 'locked' => '0', 'module' => 'image', 'settings' => array( 'default_image' => 0, @@ -60,6 +61,12 @@ function ding_campaign_ctype_field_default_fields() { 'type' => 'hidden', 'weight' => 0, ), + 'teaser_highlight' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), ), 'entity_type' => 'node', 'field_name' => 'field_camp_image', @@ -67,6 +74,7 @@ function ding_campaign_ctype_field_default_fields() { 'required' => 0, 'settings' => array( 'alt_field' => 0, + 'default_image' => 0, 'file_directory' => '', 'file_extensions' => 'png gif jpg jpeg', 'max_filesize' => '', @@ -109,6 +117,7 @@ function ding_campaign_ctype_field_default_fields() { 0 => 'format', ), ), + 'locked' => '0', 'module' => 'text', 'settings' => array( 'max_length' => '255', @@ -135,6 +144,12 @@ function ding_campaign_ctype_field_default_fields() { 'type' => 'hidden', 'weight' => 0, ), + 'teaser_highlight' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), ), 'entity_type' => 'node', 'field_name' => 'field_camp_link', @@ -170,6 +185,7 @@ function ding_campaign_ctype_field_default_fields() { 0 => 'value', ), ), + 'locked' => '0', 'module' => 'list', 'settings' => array( 'allowed_values' => array( @@ -205,6 +221,12 @@ function ding_campaign_ctype_field_default_fields() { 'type' => 'hidden', 'weight' => 0, ), + 'teaser_highlight' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), ), 'entity_type' => 'node', 'field_name' => 'field_camp_settings', @@ -244,6 +266,7 @@ function ding_campaign_ctype_field_default_fields() { 0 => 'format', ), ), + 'locked' => '0', 'module' => 'text', 'settings' => array(), 'translatable' => '0', @@ -268,6 +291,12 @@ function ding_campaign_ctype_field_default_fields() { 'type' => 'hidden', 'weight' => 0, ), + 'teaser_highlight' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), ), 'entity_type' => 'node', 'field_name' => 'field_camp_text_full', @@ -310,6 +339,7 @@ function ding_campaign_ctype_field_default_fields() { 0 => 'format', ), ), + 'locked' => '0', 'module' => 'text', 'settings' => array(), 'translatable' => '0', @@ -334,6 +364,12 @@ function ding_campaign_ctype_field_default_fields() { 'type' => 'hidden', 'weight' => 0, ), + 'teaser_highlight' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), ), 'entity_type' => 'node', 'field_name' => 'field_camp_text_plain', @@ -369,6 +405,7 @@ function ding_campaign_ctype_field_default_fields() { 0 => 'value', ), ), + 'locked' => '0', 'module' => 'list', 'settings' => array( 'allowed_values' => array( @@ -422,6 +459,12 @@ function ding_campaign_ctype_field_default_fields() { 'type' => 'hidden', 'weight' => 0, ), + 'teaser_highlight' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), ), 'entity_type' => 'node', 'field_name' => 'field_camp_weight', From 0f9376a434890a3798042c9f8672cf83eeb1d387 Mon Sep 17 00:00:00 2001 From: Jesper Kristensen Date: Wed, 14 Nov 2012 14:10:43 +0100 Subject: [PATCH 05/76] Updaed codeing style to match Drupal --- ding_campaign.install | 3 +-- ding_campaign.module | 14 ++++++++------ plugins/content_types/campaign.inc | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/ding_campaign.install b/ding_campaign.install index a7da26d..a05c73a 100644 --- a/ding_campaign.install +++ b/ding_campaign.install @@ -88,10 +88,9 @@ function ding_campaign_uninstall() { } /** - * Implements hook_update_N(). * Remove column 'theme' from table 'ding_campaign' */ function ding_campaign_update_7001(&$sandbox) { - return db_drop_field('ding_campaign','theme'); + return db_drop_field('ding_campaign', 'theme'); } diff --git a/ding_campaign.module b/ding_campaign.module index ee673a8..8ee7b5d 100644 --- a/ding_campaign.module +++ b/ding_campaign.module @@ -61,8 +61,7 @@ function ding_campaign_admin_paths() { * Implements hook_node_access(). */ function ding_campaign_node_access($node) { - - if ( isset($node->type) && $node->type == 'ding_campaign') { + if (isset($node->type) && $node->type == 'ding_campaign') { return TRUE; } return FALSE; @@ -74,7 +73,7 @@ function ding_campaign_node_access($node) { function ding_campaign_theme($existing, $type, $theme, $path) { $hooks = array(); - $hooks['ding_campaign'] = array( + $hooks['ding_campaign'] = array( 'variables' => array('content' => NULL), 'template' => 'ding_campaign', 'path' => DING_CAMPAIGN_PATH . '/templates/', @@ -116,17 +115,20 @@ function ding_campaign_display($context, $count, $offset) { case 'plain': $camp_link = field_get_items('node', $node, 'field_camp_link'); $camp_text_plain = field_get_items('node', $node, 'field_camp_text_plain'); - $content = ''; + $content = ''; break; + case 'image': $camp_link = field_get_items('node', $node, 'field_camp_link'); $camp_image = field_get_items('node', $node, 'field_camp_image'); - $content = '
'; + $content = '
'; break; + case 'full': $camp_text_full = field_get_items('node', $node, 'field_camp_text_full'); - $content = '
' . $camp_text_full[0]['safe_value'] . '
'; + $content = '
' . $camp_text_full[0]['safe_value'] . '
'; break; + } $theme = 'ding_campaign'; diff --git a/plugins/content_types/campaign.inc b/plugins/content_types/campaign.inc index 114e14b..4a5c564 100644 --- a/plugins/content_types/campaign.inc +++ b/plugins/content_types/campaign.inc @@ -75,7 +75,7 @@ function ding_campaign_campaign_content_type_edit_form_validate($form, &$form_st // Give an error if a value less than 1 was entered. if (!empty($val) && $count < $min_value) { - form_set_error($value, t('%value must be a number larger than zero.', array('%value' => ucfirst(str_replace('_', ' ', $value))))); + form_set_error($value, t('%value must be a number larger than zero.', array('%value' => drupal_ucfirst(str_replace('_', ' ', $value))))); } // Otherwise, store the sanitised value in the form state. else { From b871d096f060862d409627f809d38daa83888b2d Mon Sep 17 00:00:00 2001 From: Rasmus Frey Date: Mon, 21 Jan 2013 14:21:11 +0100 Subject: [PATCH 06/76] Updated feature to get rid of constant overridden status --- ding_campaign_ctype/ding_campaign_ctype.info | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ding_campaign_ctype/ding_campaign_ctype.info b/ding_campaign_ctype/ding_campaign_ctype.info index 2f744e5..25bc2a3 100644 --- a/ding_campaign_ctype/ding_campaign_ctype.info +++ b/ding_campaign_ctype/ding_campaign_ctype.info @@ -3,11 +3,11 @@ description = Ding Campaign Content type core = 7.x package = Ding! php = 5.2.4 -version = 7.x-0.1 dependencies[] = features dependencies[] = image dependencies[] = list dependencies[] = strongarm +// features[field][] = node-ding_campaign-field_camp_theme features[ctools][] = strongarm:strongarm:1 features[features_api][] = api:1 features[field][] = node-ding_campaign-field_camp_image From 9ae9bf76525604fce7036422782f24be66cd7403 Mon Sep 17 00:00:00 2001 From: Rasmus Frey Date: Tue, 29 Jan 2013 12:18:53 +0100 Subject: [PATCH 07/76] Updated content type setting, disabled language translation --- ding_campaign_ctype/ding_campaign_ctype.info | 11 +++ .../ding_campaign_ctype.strongarm.inc | 81 ++++++++++++++++++- 2 files changed, 91 insertions(+), 1 deletion(-) diff --git a/ding_campaign_ctype/ding_campaign_ctype.info b/ding_campaign_ctype/ding_campaign_ctype.info index 25bc2a3..3680294 100644 --- a/ding_campaign_ctype/ding_campaign_ctype.info +++ b/ding_campaign_ctype/ding_campaign_ctype.info @@ -17,5 +17,16 @@ features[field][] = node-ding_campaign-field_camp_text_full features[field][] = node-ding_campaign-field_camp_text_plain features[field][] = node-ding_campaign-field_camp_weight 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][] = 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 diff --git a/ding_campaign_ctype/ding_campaign_ctype.strongarm.inc b/ding_campaign_ctype/ding_campaign_ctype.strongarm.inc index 0475b28..9be3ef2 100644 --- a/ding_campaign_ctype/ding_campaign_ctype.strongarm.inc +++ b/ding_campaign_ctype/ding_campaign_ctype.strongarm.inc @@ -13,10 +13,75 @@ function ding_campaign_ctype_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->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 = 1; + $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 = '2'; + $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 = 1; + $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 = '1'; + $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 = 1; + $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 = '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( + 0 => 'main-menu', + ); + $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; @@ -26,5 +91,19 @@ function ding_campaign_ctype_strongarm() { ); $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 = '1'; + $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 = 1; + $export['node_submitted_ding_campaign'] = $strongarm; + return $export; } From 7d18678478bbc65a97a231d7d29c1378b19c609f Mon Sep 17 00:00:00 2001 From: Jesper Kristensen Date: Mon, 22 Apr 2013 17:33:49 +0200 Subject: [PATCH 08/76] Updated features to the 2.x branch --- ding_campaign.make | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ding_campaign.make b/ding_campaign.make index 2a5a817..e7cf07a 100644 --- a/ding_campaign.make +++ b/ding_campaign.make @@ -5,5 +5,5 @@ projects[ctools][subdir] = "contrib" projects[ctools][version] = "1.1" projects[features][subdir] = contrib -projects[features][version] = "1.0" +projects[features][version] = "2.0-beta2" From 0b8b737a87f3ba694caa619bc71ec48d0e7492e7 Mon Sep 17 00:00:00 2001 From: Jesper Kristensen Date: Mon, 22 Apr 2013 19:38:51 +0200 Subject: [PATCH 09/76] Updated ctools version in the make file --- ding_campaign.make | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ding_campaign.make b/ding_campaign.make index e7cf07a..a91b8fc 100644 --- a/ding_campaign.make +++ b/ding_campaign.make @@ -1,9 +1,12 @@ -api = 2 +; This file was auto-generated by drush make + core = 7.x +api = 2 +; Projects projects[ctools][subdir] = "contrib" -projects[ctools][version] = "1.1" +projects[ctools][version] = "1.3" -projects[features][subdir] = contrib +projects[features][subdir] = "contrib" projects[features][version] = "2.0-beta2" From 1d67123caf6a6b7b60739e3660fafdee7a7cc82d Mon Sep 17 00:00:00 2001 From: Rasmus Frey Date: Wed, 24 Apr 2013 14:51:14 +0200 Subject: [PATCH 10/76] Updated feature with latest version of features module (features 2) --- .../ding_campaign_ctype.features.field.inc | 495 ------------------ ...ing_campaign_ctype.features.field_base.inc | 199 +++++++ ...campaign_ctype.features.field_instance.inc | 310 +++++++++++ ding_campaign_ctype/ding_campaign_ctype.info | 22 +- 4 files changed, 525 insertions(+), 501 deletions(-) delete mode 100644 ding_campaign_ctype/ding_campaign_ctype.features.field.inc create mode 100644 ding_campaign_ctype/ding_campaign_ctype.features.field_base.inc create mode 100644 ding_campaign_ctype/ding_campaign_ctype.features.field_instance.inc diff --git a/ding_campaign_ctype/ding_campaign_ctype.features.field.inc b/ding_campaign_ctype/ding_campaign_ctype.features.field.inc deleted file mode 100644 index 59e8f89..0000000 --- a/ding_campaign_ctype/ding_campaign_ctype.features.field.inc +++ /dev/null @@ -1,495 +0,0 @@ - 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', - ), - 'field_instance' => 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, - ), - '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' => 'image', - 'settings' => array( - 'preview_image_style' => 'thumbnail', - 'progress_indicator' => 'throbber', - ), - 'type' => 'image_image', - 'weight' => '-2', - ), - ), - ); - - // Exported field: 'node-ding_campaign-field_camp_link'. - $fields['node-ding_campaign-field_camp_link'] = array( - 'field_config' => 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', - ), - 'field_instance' => 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, - ), - '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' => '0', - ), - ), - ); - - // Exported field: 'node-ding_campaign-field_camp_settings'. - $fields['node-ding_campaign-field_camp_settings'] = array( - 'field_config' => 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', - ), - 'field_instance' => 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, - ), - '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: 'node-ding_campaign-field_camp_text_full'. - $fields['node-ding_campaign-field_camp_text_full'] = array( - 'field_config' => 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', - ), - 'field_instance' => 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, - ), - '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' => '-1', - ), - ), - ); - - // Exported field: 'node-ding_campaign-field_camp_text_plain'. - $fields['node-ding_campaign-field_camp_text_plain'] = array( - 'field_config' => 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', - ), - 'field_instance' => 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, - ), - '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' => '-3', - ), - ), - ); - - // Exported field: 'node-ding_campaign-field_camp_weight'. - $fields['node-ding_campaign-field_camp_weight'] = array( - 'field_config' => 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', - ), - 'field_instance' => 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, - ), - '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' => '2', - ), - ), - ); - - // Translatables - // Included for use with string extractors like potx. - t('Campaign image'); - t('Campaign link'); - t('Campaign settings'); - t('Campaign text'); - t('Weight'); - - return $fields; -} diff --git a/ding_campaign_ctype/ding_campaign_ctype.features.field_base.inc b/ding_campaign_ctype/ding_campaign_ctype.features.field_base.inc new file mode 100644 index 0000000..853a6ae --- /dev/null +++ b/ding_campaign_ctype/ding_campaign_ctype.features.field_base.inc @@ -0,0 +1,199 @@ + 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_ctype/ding_campaign_ctype.features.field_instance.inc b/ding_campaign_ctype/ding_campaign_ctype.features.field_instance.inc new file mode 100644 index 0000000..cacbb1e --- /dev/null +++ b/ding_campaign_ctype/ding_campaign_ctype.features.field_instance.inc @@ -0,0 +1,310 @@ + 'ding_campaign', + 'deleted' => 0, + 'description' => '', + 'display' => array( + 'default' => 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' => 'image', + 'settings' => array( + 'preview_image_style' => 'thumbnail', + 'progress_indicator' => 'throbber', + ), + 'type' => 'image_image', + 'weight' => -2, + ), + ); + + // 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, + ), + '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' => 0, + ), + ); + + // 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, + ), + '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, + ), + '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' => -1, + ), + ); + + // 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, + ), + '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' => -3, + ), + ); + + // 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, + ), + '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' => 2, + ), + ); + + // Translatables + // Included for use with string extractors like potx. + t('Campaign image'); + t('Campaign link'); + t('Campaign settings'); + t('Campaign text'); + t('Weight'); + + return $field_instances; +} diff --git a/ding_campaign_ctype/ding_campaign_ctype.info b/ding_campaign_ctype/ding_campaign_ctype.info index 3680294..c01f8f1 100644 --- a/ding_campaign_ctype/ding_campaign_ctype.info +++ b/ding_campaign_ctype/ding_campaign_ctype.info @@ -3,19 +3,29 @@ description = Ding Campaign Content type core = 7.x package = Ding! php = 5.2.4 +dependencies[] = ctools dependencies[] = features dependencies[] = image dependencies[] = list +dependencies[] = node +dependencies[] = options dependencies[] = strongarm +dependencies[] = text // features[field][] = node-ding_campaign-field_camp_theme features[ctools][] = strongarm:strongarm:1 features[features_api][] = api:1 -features[field][] = node-ding_campaign-field_camp_image -features[field][] = node-ding_campaign-field_camp_link -features[field][] = node-ding_campaign-field_camp_settings -features[field][] = node-ding_campaign-field_camp_text_full -features[field][] = node-ding_campaign-field_camp_text_plain -features[field][] = node-ding_campaign-field_camp_weight +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-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[node][] = ding_campaign features[variable][] = comment_anonymous_ding_campaign features[variable][] = comment_default_mode_ding_campaign From e07fca903eb9bec1ef4636dc42d4cc392b45ae2a Mon Sep 17 00:00:00 2001 From: Rasmus Frey Date: Thu, 25 Apr 2013 12:19:17 +0200 Subject: [PATCH 11/76] Exported with features 2 and language as english --- ding_campaign_ctype/ding_campaign_ctype.info | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ding_campaign_ctype/ding_campaign_ctype.info b/ding_campaign_ctype/ding_campaign_ctype.info index c01f8f1..5c58768 100644 --- a/ding_campaign_ctype/ding_campaign_ctype.info +++ b/ding_campaign_ctype/ding_campaign_ctype.info @@ -40,3 +40,9 @@ 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_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 From 4f93fb9bfa9e7b27741c0cbd33b37ce616119d77 Mon Sep 17 00:00:00 2001 From: Jesper Kristensen Date: Mon, 29 Apr 2013 10:18:14 +0200 Subject: [PATCH 12/76] Added ctools patch to fix filter_xss_admin call --- ding_campaign.make | 1 + 1 file changed, 1 insertion(+) diff --git a/ding_campaign.make b/ding_campaign.make index a91b8fc..3743274 100644 --- a/ding_campaign.make +++ b/ding_campaign.make @@ -6,6 +6,7 @@ api = 2 ; Projects projects[ctools][subdir] = "contrib" projects[ctools][version] = "1.3" +projects[ctools][patch][0] = "http://drupal.org/files/ctools-n1925018-12.patch" projects[features][subdir] = "contrib" projects[features][version] = "2.0-beta2" From 2c4ae329f8dfe467910ef64c7b08e02ab7fd8bed Mon Sep 17 00:00:00 2001 From: Rasmus Frey Date: Fri, 3 May 2013 14:28:48 +0200 Subject: [PATCH 13/76] Added Features_extra to make file, so it's possible to add menu_blocks etc. to features --- ding_campaign.make | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ding_campaign.make b/ding_campaign.make index 3743274..a223146 100644 --- a/ding_campaign.make +++ b/ding_campaign.make @@ -11,3 +11,5 @@ projects[ctools][patch][0] = "http://drupal.org/files/ctools-n1925018-12.patch" projects[features][subdir] = "contrib" projects[features][version] = "2.0-beta2" +projects[features_extra][subdir] = "contrib" +projects[features_extra][version] = "1.0-beta1" From 81073d6302eca76da91ccbea8ec622ac41f17c53 Mon Sep 17 00:00:00 2001 From: wiredloose Date: Sat, 8 Jun 2013 13:51:09 +0200 Subject: [PATCH 14/76] adding user permissions --- ...ampaign_ctype.features.user_permission.inc | 69 +++++++++++++++++++ ding_campaign_ctype/ding_campaign_ctype.info | 5 ++ 2 files changed, 74 insertions(+) create mode 100644 ding_campaign_ctype/ding_campaign_ctype.features.user_permission.inc diff --git a/ding_campaign_ctype/ding_campaign_ctype.features.user_permission.inc b/ding_campaign_ctype/ding_campaign_ctype.features.user_permission.inc new file mode 100644 index 0000000..30de5c2 --- /dev/null +++ b/ding_campaign_ctype/ding_campaign_ctype.features.user_permission.inc @@ -0,0 +1,69 @@ + 'create ding_campaign content', + 'roles' => array( + 'administrator' => 'administrator', + 'lokalredaktør' => 'lokalredaktør', + 'redaktør' => 'redaktør', + ), + 'module' => 'node', + ); + + // Exported permission: delete any ding_campaign content. + $permissions['delete any ding_campaign content'] = array( + 'name' => 'delete any ding_campaign content', + 'roles' => array( + 'administrator' => 'administrator', + 'lokalredaktør' => 'lokalredaktør', + 'redaktør' => 'redaktør', + ), + 'module' => 'node', + ); + + // Exported permission: delete own ding_campaign content. + $permissions['delete own ding_campaign content'] = array( + 'name' => 'delete own ding_campaign content', + 'roles' => array( + 'administrator' => 'administrator', + 'lokalredaktør' => 'lokalredaktør', + 'redaktør' => 'redaktør', + ), + 'module' => 'node', + ); + + // Exported permission: edit any ding_campaign content. + $permissions['edit any ding_campaign content'] = array( + 'name' => 'edit any ding_campaign content', + 'roles' => array( + 'administrator' => 'administrator', + 'lokalredaktør' => 'lokalredaktør', + 'redaktør' => 'redaktør', + ), + 'module' => 'node', + ); + + // Exported permission: edit own ding_campaign content. + $permissions['edit own ding_campaign content'] = array( + 'name' => 'edit own ding_campaign content', + 'roles' => array( + 'administrator' => 'administrator', + 'lokalredaktør' => 'lokalredaktør', + 'redaktør' => 'redaktør', + ), + 'module' => 'node', + ); + + return $permissions; +} diff --git a/ding_campaign_ctype/ding_campaign_ctype.info b/ding_campaign_ctype/ding_campaign_ctype.info index 5c58768..77da28d 100644 --- a/ding_campaign_ctype/ding_campaign_ctype.info +++ b/ding_campaign_ctype/ding_campaign_ctype.info @@ -27,6 +27,11 @@ 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[node][] = ding_campaign +features[user_permission][] = create ding_campaign content +features[user_permission][] = delete any ding_campaign content +features[user_permission][] = delete own ding_campaign content +features[user_permission][] = edit any ding_campaign content +features[user_permission][] = edit own ding_campaign content features[variable][] = comment_anonymous_ding_campaign features[variable][] = comment_default_mode_ding_campaign features[variable][] = comment_default_per_page_ding_campaign From 769e67c156869bcfa947d8e9628f859ca4444305 Mon Sep 17 00:00:00 2001 From: Jesper Kristensen Date: Tue, 25 Jun 2013 13:10:53 +0200 Subject: [PATCH 15/76] Added ding_campaing dependency to sub-feature --- ding_campaign_ctype/ding_campaign_ctype.info | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/ding_campaign_ctype/ding_campaign_ctype.info b/ding_campaign_ctype/ding_campaign_ctype.info index 77da28d..807f723 100644 --- a/ding_campaign_ctype/ding_campaign_ctype.info +++ b/ding_campaign_ctype/ding_campaign_ctype.info @@ -11,7 +11,7 @@ dependencies[] = node dependencies[] = options dependencies[] = strongarm dependencies[] = text -// features[field][] = node-ding_campaign-field_camp_theme +dependencies[] = ding_campaign features[ctools][] = strongarm:strongarm:1 features[features_api][] = api:1 features[field_base][] = field_camp_image @@ -45,9 +45,3 @@ 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_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 From c80f8dfa1f5bfbae0bc1bde129801e566cd28f48 Mon Sep 17 00:00:00 2001 From: Jesper Kristensen Date: Thu, 27 Jun 2013 12:30:53 +0200 Subject: [PATCH 16/76] Fixed undefined property warning during installation profile execution --- ding_campaign.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ding_campaign.module b/ding_campaign.module index 8ee7b5d..b5323d1 100644 --- a/ding_campaign.module +++ b/ding_campaign.module @@ -339,7 +339,7 @@ function ding_campaign_node_insert($node) { $enabled_types = variable_get('ding_campaign_node_types', array()); // Process other types of nodes (selected in backend). - if (isset($enabled_types[$node->form_id]) && $enabled_types[$node->form_id] === $node->form_id) { + if (isset($node->form_id) && isset($enabled_types[$node->form_id]) && $enabled_types[$node->form_id] === $node->form_id) { if (isset($node->ding_campaigns) && is_array($node->ding_campaigns)) { foreach ($node->ding_campaigns as $k => $v) { $data = array( From 535405f0240952c215887e156f34136c0bafe882 Mon Sep 17 00:00:00 2001 From: lexor Date: Fri, 26 Oct 2012 16:31:47 +0300 Subject: [PATCH 17/76] Resolved merge conflict in campaign.inc --- plugins/content_types/campaign.inc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/content_types/campaign.inc b/plugins/content_types/campaign.inc index 4a5c564..b2914bd 100644 --- a/plugins/content_types/campaign.inc +++ b/plugins/content_types/campaign.inc @@ -11,10 +11,11 @@ $plugin = array( 'single' => TRUE, 'defaults' => array('ding_campaign_count' => 3, 'ding_campaign_offset' => 0), 'required context' => array( - new ctools_context_optional(t('Page node'), 'node'), - new ctools_context_optional(t('Related library'), 'node'), - new ctools_context_optional(t('Search term'), 'string'), - new ctools_context_optional(t('Taxonomy terms'), 'terms')), + new ctools_context_optional(t('Page node'), 'node'), + new ctools_context_optional(t('Related library'), 'node'), + new ctools_context_optional(t('Search term'), 'string'), + new ctools_context_optional(t('Taxonomy term'), array('entity:taxonomy_term', 'taxonomy_term')), + ), 'category' => t('Ding!'), ); From 1e22722ef0015c2314c15a63cd9a2beb01eae53d Mon Sep 17 00:00:00 2001 From: AnatolyMuntean Date: Thu, 29 Nov 2012 12:47:13 +0200 Subject: [PATCH 18/76] Fixed merge conflict in main module --- ding_campaign.module | 1 + 1 file changed, 1 insertion(+) diff --git a/ding_campaign.module b/ding_campaign.module index b5323d1..87583fe 100644 --- a/ding_campaign.module +++ b/ding_campaign.module @@ -372,6 +372,7 @@ function ding_campaign_node_update($node) { $data = array( 'type' => $node_type[0]['value'], 'weight' => $node_weight[0]['value'], + 'pane_id' => !empty($node_pane_id[0]['value']) ? $node_pane_id[0]['value'] : '0', ); db_update('ding_campaign') From 64f5dbbba873d537d4dc7a10a83572ff2f10abb6 Mon Sep 17 00:00:00 2001 From: lexor Date: Wed, 26 Dec 2012 12:18:30 +0200 Subject: [PATCH 19/76] Resolved merge conflict in feature fields --- ding_campaign.module | 10 +- .../ding_campaign_ctype.features.field.inc | 521 ++++++++++++++++++ 2 files changed, 530 insertions(+), 1 deletion(-) create mode 100644 ding_campaign_ctype/ding_campaign_ctype.features.field.inc diff --git a/ding_campaign.module b/ding_campaign.module index 87583fe..af77e10 100644 --- a/ding_campaign.module +++ b/ding_campaign.module @@ -121,7 +121,15 @@ function ding_campaign_display($context, $count, $offset) { case 'image': $camp_link = field_get_items('node', $node, 'field_camp_link'); $camp_image = field_get_items('node', $node, 'field_camp_image'); - $content = '
'; + + $image_title = field_get_items('file', (object)($camp_image[0]), 'field_dams_title'); + $image_title = isset($image_title[0]['safe_value']) ? $image_title[0]['safe_value'] : ''; + $image_alt = field_get_items('file', (object)($camp_image[0]), 'field_dams_alt_name'); + $image_alt = isset($image_alt[0]['safe_value']) ? $image_alt[0]['safe_value'] : ''; + + $content = + ''; break; case 'full': diff --git a/ding_campaign_ctype/ding_campaign_ctype.features.field.inc b/ding_campaign_ctype/ding_campaign_ctype.features.field.inc new file mode 100644 index 0000000..f862f24 --- /dev/null +++ b/ding_campaign_ctype/ding_campaign_ctype.features.field.inc @@ -0,0 +1,521 @@ + 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', + ), + ), + 'module' => 'image', + 'settings' => array( + 'default_image' => 0, + 'uri_scheme' => 'public', + ), + 'translatable' => '0', + 'type' => 'image', + ), + 'field_instance' => 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, + ), + 'teaser' => 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, + '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' => 'image', + 'settings' => array( + 'preview_image_style' => 'thumbnail', + 'progress_indicator' => 'throbber', + ), + 'type' => 'media_generic', + 'weight' => '-2', + ), + ), + ); + + // Exported field: node-ding_campaign-field_camp_link. + $fields['node-ding_campaign-field_camp_link'] = array( + 'field_config' => 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', + ), + ), + 'module' => 'text', + 'settings' => array( + 'max_length' => '255', + ), + 'translatable' => '0', + 'type' => 'text', + ), + 'field_instance' => 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, + ), + 'teaser' => 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' => '0', + ), + ), + ); + + // Exported field: node-ding_campaign-field_camp_settings. + $fields['node-ding_campaign-field_camp_settings'] = array( + 'field_config' => array( + 'active' => '1', + 'cardinality' => '1', + 'deleted' => '0', + 'entity_types' => array(), + 'field_name' => 'field_camp_settings', + 'foreign keys' => array(), + 'indexes' => array( + 'value' => array( + 0 => 'value', + ), + ), + 'module' => 'list', + 'settings' => array( + 'allowed_values' => array( + 'full' => 'WYSIWYG', + 'image' => 'Image', + 'plain' => 'Plain text', + ), + 'allowed_values_function' => '', + ), + 'translatable' => '0', + 'type' => 'list_text', + ), + 'field_instance' => 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, + ), + 'teaser' => 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: node-ding_campaign-field_camp_text_full. + $fields['node-ding_campaign-field_camp_text_full'] = array( + 'field_config' => 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', + ), + ), + 'module' => 'text', + 'settings' => array(), + 'translatable' => '0', + 'type' => 'text_long', + ), + 'field_instance' => 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, + ), + 'teaser' => 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' => '-1', + ), + ), + ); + + // Exported field: node-ding_campaign-field_camp_text_plain. + $fields['node-ding_campaign-field_camp_text_plain'] = array( + 'field_config' => 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', + ), + ), + 'module' => 'text', + 'settings' => array(), + 'translatable' => '0', + 'type' => 'text_long', + ), + 'field_instance' => 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, + ), + 'teaser' => 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' => '-3', + ), + ), + ); + + // Exported field: node-ding_campaign-field_camp_pane_id. + $fields['node-ding_campaign-field_camp_pane_id'] = array( + 'field_config' => array( + 'active' => '1', + 'cardinality' => '1', + 'deleted' => '0', + 'entity_types' => array(), + 'field_name' => 'field_camp_pane_id', + 'foreign keys' => array(), + 'indexes' => array( + 'value' => array( + 0 => 'value', + ), + ), + 'module' => 'list', + 'settings' => array( + 'allowed_values' => array( + '1' => '1', + '2' => '2', + '3' => '3', + '4' => '4', + '5' => '5', + ), + 'allowed_values_function' => '', + ), + 'translatable' => '0', + 'type' => 'list_text', + ), + 'field_instance' => array( + 'bundle' => 'ding_campaign', + 'default_value' => array( + 0 => array( + 'value' => '', + ), + ), + 'deleted' => '0', + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'above', + 'module' => 'list', + 'settings' => array(), + 'type' => 'list_default', + 'weight' => 5, + ), + 'teaser' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + ), + 'entity_type' => 'node', + 'field_name' => 'field_camp_pane_id', + 'label' => 'Campaign panel pane number', + 'required' => 0, + 'settings' => array( + 'user_register_form' => FALSE, + ), + 'widget' => array( + 'active' => 1, + 'module' => 'options', + 'settings' => array(), + 'type' => 'options_select', + 'weight' => '1', + ), + ), + ); + + // Exported field: node-ding_campaign-field_camp_weight. + $fields['node-ding_campaign-field_camp_weight'] = array( + 'field_config' => array( + 'active' => '1', + 'cardinality' => '1', + 'deleted' => '0', + 'entity_types' => array(), + 'field_name' => 'field_camp_weight', + 'foreign keys' => array(), + 'indexes' => array( + 'value' => array( + 0 => 'value', + ), + ), + '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', + ), + 'field_instance' => 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, + ), + 'teaser' => 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' => '2', + ), + ), + ); + + // Translatables - included for use with string extractors like potx. + t('Campaign image'); + t('Campaign link'); + t('Campaign settings'); + t('Campaign text'); + t('Campaign theme'); + t('Weight'); + + return $fields; +} From f41bc16872f999367a301debde58c5cbfe842be9 Mon Sep 17 00:00:00 2001 From: Anatoly Muntean Date: Mon, 11 Feb 2013 14:18:02 +0200 Subject: [PATCH 20/76] Resolved merge conflict in edit access callback --- ding_campaign.module | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/ding_campaign.module b/ding_campaign.module index af77e10..46ccff3 100644 --- a/ding_campaign.module +++ b/ding_campaign.module @@ -39,7 +39,7 @@ function ding_campaign_menu() { 'description' => 'Autocomplete field for campaign rule values.', 'page callback' => 'ding_campaign_admin_autocomplete', 'page arguments' => array(2), - 'access arguments' => array('access administration pages'), + 'access arguments' => array('access campaign rules'), 'file' => 'ding_campaign.admin.inc', 'type' => MENU_CALLBACK, ); @@ -47,6 +47,20 @@ function ding_campaign_menu() { return $items; } +/** + * Implements hook_perimission(). + */ +function ding_campaign_permission() { + $perm = array(); + + $perm['access campaign rules'] = array( + 'title' => t('Access campaign rules'), + 'description' => t('Enable access to campaign nodes display rules'), + ); + + return $perm; +} + /** * Implements hook_admin_paths(). */ @@ -61,7 +75,7 @@ function ding_campaign_admin_paths() { * Implements hook_node_access(). */ function ding_campaign_node_access($node) { - if (isset($node->type) && $node->type == 'ding_campaign') { + if (isset($node->type) && $node->type == 'ding_campaign' && user_access('access campaign rules')) { return TRUE; } return FALSE; From a5bf8b347a26912007b047afd501c12280f4b9c5 Mon Sep 17 00:00:00 2001 From: Alex Semeniuc Date: Thu, 21 Mar 2013 12:42:44 +0200 Subject: [PATCH 21/76] Resolved merge conflict in sub-module info file --- ding_campaign.module | 3 +- .../ding_campaign_ctype.features.inc | 47 +++++++++++++++++++ ding_campaign_ctype/ding_campaign_ctype.info | 1 + 3 files changed, 50 insertions(+), 1 deletion(-) diff --git a/ding_campaign.module b/ding_campaign.module index 46ccff3..62900d3 100644 --- a/ding_campaign.module +++ b/ding_campaign.module @@ -143,7 +143,8 @@ function ding_campaign_display($context, $count, $offset) { $content = ''; + . '' . $image_alt . '' + . ''; break; case 'full': diff --git a/ding_campaign_ctype/ding_campaign_ctype.features.inc b/ding_campaign_ctype/ding_campaign_ctype.features.inc index 6179821..b521d3e 100644 --- a/ding_campaign_ctype/ding_campaign_ctype.features.inc +++ b/ding_campaign_ctype/ding_campaign_ctype.features.inc @@ -14,6 +14,53 @@ function ding_campaign_ctype_ctools_plugin_api() { } } +/** + * Implements hook_image_default_styles(). + */ +function ding_campaign_ctype_image_default_styles() { + $styles = array(); + + // Exported image style: ding_campaign_small. + $styles['ding_campaign_small'] = array( + 'name' => 'ding_campaign_small', + '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' => '360', + 'height' => '', + 'upscale' => 0, + ), + 'weight' => '1', + ), + 4 => array( + 'label' => 'Scale and crop', + 'help' => 'Scale and crop will maintain the aspect-ratio of the original image, then crop the larger dimension. This is most useful for creating perfectly square thumbnails without stretching the image.', + 'effect callback' => 'image_scale_and_crop_effect', + 'dimensions callback' => 'image_resize_dimensions', + 'form callback' => 'image_resize_form', + 'summary theme' => 'image_resize_summary', + 'module' => 'image', + 'name' => 'image_scale_and_crop', + 'data' => array( + 'width' => '360', + 'height' => '240', + ), + 'weight' => '2', + ), + ), + ); + + return $styles; +} + /** * Implements hook_node_info(). */ diff --git a/ding_campaign_ctype/ding_campaign_ctype.info b/ding_campaign_ctype/ding_campaign_ctype.info index 807f723..c80c2cc 100644 --- a/ding_campaign_ctype/ding_campaign_ctype.info +++ b/ding_campaign_ctype/ding_campaign_ctype.info @@ -26,6 +26,7 @@ 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_small features[node][] = ding_campaign features[user_permission][] = create ding_campaign content features[user_permission][] = delete any ding_campaign content From f1822acc09cce29ec38eea04976084ba460f7380 Mon Sep 17 00:00:00 2001 From: Alex Semeniuc Date: Tue, 26 Mar 2013 14:04:30 +0200 Subject: [PATCH 22/76] case 2416 - Fixed campaign rule settings. --- ding_campaign.admin.inc | 3 +- js/ding_campaign_scripts.js | 82 +++++++++++++++---------------------- 2 files changed, 34 insertions(+), 51 deletions(-) diff --git a/ding_campaign.admin.inc b/ding_campaign.admin.inc index f7134af..fa245e5 100644 --- a/ding_campaign.admin.inc +++ b/ding_campaign.admin.inc @@ -245,13 +245,12 @@ function ding_campaign_admin_autocomplete($type, $input) { } break; case 'rule_library': - $q = db_query_range("SELECT nid, title FROM {node} WHERE type='library' AND title LIKE(:term)", 0, 5, array(':term' => '%%' . $input . '%%'))->fetchAll(); + $q = db_query_range("SELECT nid, title FROM {node} WHERE type='ding_library' AND title LIKE(:term)", 0, 5, array(':term' => '%%' . $input . '%%'))->fetchAll(); foreach ($q as $k => $v) { $matches['[nid:' . $v->nid . ']'] = $v->title; } break; } - drupal_json_output($matches); } diff --git a/js/ding_campaign_scripts.js b/js/ding_campaign_scripts.js index 24197ed..9f45f30 100644 --- a/js/ding_campaign_scripts.js +++ b/js/ding_campaign_scripts.js @@ -1,61 +1,45 @@ (function ($) { - campaign_content_click = function(type) { - $('#edit-field-camp-text-plain, #edit-field-camp-image, #edit-field-camp-text-full, #edit-field-camp-link').hide(); - - switch(type) { - case 'plain': - $('#edit-field-camp-text-plain, #edit-field-camp-link').show(); - break; - case 'image': - $('#edit-field-camp-image, #edit-field-camp-link').show(); - break; - case 'full': - $('#edit-field-camp-text-full').show(); - break; - } - } Drupal.behaviors.ding_campaing_init = { - bindAutocomplete: function(obj, type) { - $(obj).find('input.autocomplete') + bindAutocomplete: function(obj, type) { + // Add autocomplete bevavior to 'rule value' input. + $(obj).find('input.autocomplete') .val(Drupal.settings.ding_campaing_init.autocompleteUrl + type) .removeClass('autocomplete-processed') - .end() + .end() .find('input.form-text') .addClass('form-autocomplete'); - Drupal.attachBehaviors($(obj)); - }, - attach: function(context) { - campaign_content_click($('.node-ding_campaign-form #edit-field-camp-settings input[type=radio]:checked').attr('value')); + Drupal.attachBehaviors($(obj)); + }, + + attach: function (context, settings) { + // OnChange event for 'rule type' dropdown. + $('.ding-campaign-rule select', context).once('ding_campaign_init').change(function () { + var $context = $(this).parent().parent().parent(); + var value = $(this).selected().val(); + if (value == 'rule_generic') { + // Generic does not need a 'rule value'. + $('.rule-value', $context).hide(); + } + else { + // Add/remove autocomplete for 'rule value'. + $('.rule-value', $context).show(); - $('.node-ding_campaign-form #edit-field-camp-settings input[type=radio]').click(function() { - var type = $(this).attr('value'); - campaign_content_click(type); - }); + // Remove autocomplete. + // Needed to prevent duplicating autocomplete behavior. + var $obj = $('input.form-text', $context); + $obj.unbind().removeClass('form-autocomplete'); + $('#'+$obj.attr('id')+'-autocomplete-aria-live', $context).remove(); - $('.ding-campaign-rule select').change(function() { - if ($(this).selected().attr('value') == 'rule_generic') { - $(this).parent().parent().parent().find('.rule-value').hide(); - } - else { - $(this).parent().parent().parent().find('.rule-value').show(); - var select_value = $(this).selected().attr('value'); - if (select_value == 'rule_path' || select_value == 'rule_term' || select_value == 'rule_generic') { - $(this).parent().parent().parent().find('input.form-text').unbind().removeClass('form-autocomplete'); - } else { - Drupal.behaviors.ding_campaing_init.bindAutocomplete( - $(this).parent().parent().parent(), - select_value); + if (value == 'rule_page' || value == 'rule_taxonomy' || value == 'rule_library') { + // Add autocomplete. + Drupal.behaviors.ding_campaing_init.bindAutocomplete($context, value); + } } - } - $(this).parent().parent().parent().find('input.form-text').val(''); - }); + // Crear rule value on rule type change. + $('input.form-text', $context).val(''); + }); + } + }; - $('#ding-campaign-rules .ding-campaign-rule').each(function() { - if ($(this).find('.rule-type select').selected().attr('value') == 'rule_generic') { - $(this).find('.rule-value').hide(); - } - }); - } - } })(jQuery); From 49450b2ca8dbc11e4d84460b0f452f0b78b19bfc Mon Sep 17 00:00:00 2001 From: Alex Semeniuc Date: Tue, 26 Mar 2013 14:28:52 +0200 Subject: [PATCH 23/76] Resolved merge conflict in fields --- README.markdown | 10 --- css/ding_campaign_admin.css | 19 +++++ ding_campaign.install | 24 +++++++ ding_campaign.module | 2 +- .../ding_campaign_ctype.features.field.inc | 69 ------------------- ding_campaign_ctype/ding_campaign_ctype.info | 20 ------ plugins/content_types/campaign.inc | 2 + 7 files changed, 46 insertions(+), 100 deletions(-) delete mode 100644 README.markdown create mode 100644 css/ding_campaign_admin.css diff --git a/README.markdown b/README.markdown deleted file mode 100644 index 40cab2f..0000000 --- a/README.markdown +++ /dev/null @@ -1,10 +0,0 @@ -Ding Campaign -============= - -Simple context-sensitive campaign/ad module for [Drupal][]. - -A part of the [Artesis][] project. - -[Drupal]: http://drupal.org/ -[Artesis]: http://github.com/ding2 - diff --git a/css/ding_campaign_admin.css b/css/ding_campaign_admin.css new file mode 100644 index 0000000..faa187f --- /dev/null +++ b/css/ding_campaign_admin.css @@ -0,0 +1,19 @@ +#ding-campaign-campaign-content-type-edit-form > div > div, +#ding-campaign-campaign-content-type-edit-form > div > div.form-type-select.form-item-context-2 { + clear: both; +} + +#ding-campaign-campaign-content-type-edit-form > div > div.form-type-select, +#ding-campaign-campaign-content-type-edit-form > div > div.form-type-textfield { + width: 25em; + float: left; + clear: none; +} + +#ding-campaign-campaign-content-type-edit-form > div > div.form-type-select label, +#ding-campaign-campaign-content-type-edit-form > div > div.form-type-textfield label { + display: block; + width: 12em; + float: left; + font-weight: bold +} diff --git a/ding_campaign.install b/ding_campaign.install index a05c73a..6468eb0 100644 --- a/ding_campaign.install +++ b/ding_campaign.install @@ -8,6 +8,8 @@ * Implements hook_schema(). */ function ding_campaign_schema() { + $schema = array(); + $schema['ding_campaign'] = array( 'description' => 'Table holding campaign types types for easier access', 'fields' => array( @@ -94,3 +96,25 @@ function ding_campaign_update_7001(&$sandbox) { return db_drop_field('ding_campaign', 'theme'); } +/** + * Implements hook_update_N(). + * + * Add pane_id column to table 'ding_campaign' + */ +function ding_campaign_update_7002(&$sandbox) { + return db_add_field('ding_campaign', 'pane_id', array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ) + ); +} + +/** + * Implements hook_update_N(). + * + * Remove column 'pane_id' from table 'ding_campaign' + */ +function ding_campaign_update_7003(&$sandbox) { + return db_drop_field('ding_campaign', 'pane_id'); +} diff --git a/ding_campaign.module b/ding_campaign.module index 62900d3..92c9b36 100644 --- a/ding_campaign.module +++ b/ding_campaign.module @@ -391,11 +391,11 @@ function ding_campaign_node_update($node) { if ($node->type == 'ding_campaign') { $node_type = field_get_items('node', $node, 'field_camp_settings'); $node_weight = field_get_items('node', $node, 'field_camp_weight'); + // Update campaign fields. $data = array( 'type' => $node_type[0]['value'], 'weight' => $node_weight[0]['value'], - 'pane_id' => !empty($node_pane_id[0]['value']) ? $node_pane_id[0]['value'] : '0', ); db_update('ding_campaign') diff --git a/ding_campaign_ctype/ding_campaign_ctype.features.field.inc b/ding_campaign_ctype/ding_campaign_ctype.features.field.inc index f862f24..2fec5b0 100644 --- a/ding_campaign_ctype/ding_campaign_ctype.features.field.inc +++ b/ding_campaign_ctype/ding_campaign_ctype.features.field.inc @@ -355,75 +355,6 @@ function ding_campaign_ctype_field_default_fields() { ), ); - // Exported field: node-ding_campaign-field_camp_pane_id. - $fields['node-ding_campaign-field_camp_pane_id'] = array( - 'field_config' => array( - 'active' => '1', - 'cardinality' => '1', - 'deleted' => '0', - 'entity_types' => array(), - 'field_name' => 'field_camp_pane_id', - 'foreign keys' => array(), - 'indexes' => array( - 'value' => array( - 0 => 'value', - ), - ), - 'module' => 'list', - 'settings' => array( - 'allowed_values' => array( - '1' => '1', - '2' => '2', - '3' => '3', - '4' => '4', - '5' => '5', - ), - 'allowed_values_function' => '', - ), - 'translatable' => '0', - 'type' => 'list_text', - ), - 'field_instance' => array( - 'bundle' => 'ding_campaign', - 'default_value' => array( - 0 => array( - 'value' => '', - ), - ), - 'deleted' => '0', - 'description' => '', - 'display' => array( - 'default' => array( - 'label' => 'above', - 'module' => 'list', - 'settings' => array(), - 'type' => 'list_default', - 'weight' => 5, - ), - 'teaser' => array( - 'label' => 'above', - 'settings' => array(), - 'type' => 'hidden', - 'weight' => 0, - ), - ), - 'entity_type' => 'node', - 'field_name' => 'field_camp_pane_id', - 'label' => 'Campaign panel pane number', - 'required' => 0, - 'settings' => array( - 'user_register_form' => FALSE, - ), - 'widget' => array( - 'active' => 1, - 'module' => 'options', - 'settings' => array(), - 'type' => 'options_select', - 'weight' => '1', - ), - ), - ); - // Exported field: node-ding_campaign-field_camp_weight. $fields['node-ding_campaign-field_camp_weight'] = array( 'field_config' => array( diff --git a/ding_campaign_ctype/ding_campaign_ctype.info b/ding_campaign_ctype/ding_campaign_ctype.info index c80c2cc..96750e7 100644 --- a/ding_campaign_ctype/ding_campaign_ctype.info +++ b/ding_campaign_ctype/ding_campaign_ctype.info @@ -26,23 +26,3 @@ 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_small -features[node][] = ding_campaign -features[user_permission][] = create ding_campaign content -features[user_permission][] = delete any ding_campaign content -features[user_permission][] = delete own ding_campaign content -features[user_permission][] = edit any ding_campaign content -features[user_permission][] = edit own ding_campaign content -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][] = 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 diff --git a/plugins/content_types/campaign.inc b/plugins/content_types/campaign.inc index b2914bd..ec7ba29 100644 --- a/plugins/content_types/campaign.inc +++ b/plugins/content_types/campaign.inc @@ -61,6 +61,8 @@ function ding_campaign_campaign_content_type_edit_form($form, &$form_state) { '#maxlength' => 3, ); + drupal_add_css( drupal_get_path('module', 'ding_campaign') . '/css/ding_campaign_admin.css' ); + return $form; } From f6f34dea2afe7847b3ca43ad06d317a95deab666 Mon Sep 17 00:00:00 2001 From: Alex Semeniuc Date: Tue, 26 Mar 2013 17:04:33 +0200 Subject: [PATCH 24/76] case 2416 - Added new rule types. --- ding_campaign.admin.inc | 29 +++++++++++++--- ding_campaign.module | 69 +++++++++++++++++++++++++++++++++++-- js/ding_campaign_scripts.js | 2 +- 3 files changed, 91 insertions(+), 9 deletions(-) diff --git a/ding_campaign.admin.inc b/ding_campaign.admin.inc index fa245e5..10455e5 100644 --- a/ding_campaign.admin.inc +++ b/ding_campaign.admin.inc @@ -152,13 +152,15 @@ function ding_campaign_campaign_rule_form_submit($form, &$form_state) { if ($form_state['input']['rule_value'][$i] != '' || $form_state['input']['rule_type'][$i] == 'rule_generic') { $nid = NULL; - if ($form_state['input']['rule_type'][$i] == 'rule_page' || $form_state['input']['rule_type'][$i] == 'rule_taxonomy' || $form_state['input']['rule_type'][$i] == 'rule_library') { - $nid = array(); - preg_match('/\d{1,9}/', $form_state['input']['rule_value'][$i], $nid); + if (in_array($form_state['input']['rule_type'][$i], array('rule_page', 'rule_news', 'rule_event', 'rule_taxonomy', 'rule_library'))) { + preg_match('/\d{1,9}/', $form_state['input']['rule_value'][$i], $matches); + if (!empty($matches[0])) { + $nid = $matches[0]; + } } $dt = array( - 'nid' => isset($nid[0]) ? $nid[0] : NULL, + 'nid' => $nid, 'cid' => $form_state['build_info']['args'][0]->nid, 'rule' => ($form_state['input']['rule_type'][$i] == 'rule_generic') ? '' : $form_state['input']['rule_value'][$i], 'type' => $form_state['input']['rule_type'][$i], @@ -190,6 +192,8 @@ function ding_campaign_rule_form($rule = NULL, $type = NULL) { '#default_value' => ($type) ? $type : 'rule_page', '#options' => array( 'rule_page' => 'Page', + 'rule_event' => 'Event', + 'rule_news' => 'News', 'rule_path' => 'Path', 'rule_term' => 'Search term', 'rule_taxonomy' => 'Taxonomy term', @@ -211,7 +215,8 @@ function ding_campaign_rule_form($rule = NULL, $type = NULL) { // '#autocomplete_path' => 'ding_campaign/autocomplete/567', ); - if ($type == 'rule_page' || $type == 'rule_taxonomy') { + // Add autocomplete for some rule types. + if (in_array($type, array('rule_page', 'rule_event', 'rule_news', 'rule_taxonomy', 'rule_library'))) { $form['rule_value[]']['#autocomplete_path'] = 'ding_campaign/autocomplete/' . $type; } @@ -247,6 +252,20 @@ function ding_campaign_admin_autocomplete($type, $input) { case 'rule_library': $q = db_query_range("SELECT nid, title FROM {node} WHERE type='ding_library' AND title LIKE(:term)", 0, 5, array(':term' => '%%' . $input . '%%'))->fetchAll(); + foreach ($q as $k => $v) { + $matches['[nid:' . $v->nid . ']'] = $v->title; + } + break; + case 'rule_event': + $q = db_query_range("SELECT nid, title FROM {node} WHERE type='ding_event' AND title LIKE(:term)", 0, 5, array(':term' => '%%' . $input . '%%'))->fetchAll(); + + foreach ($q as $k => $v) { + $matches['[nid:' . $v->nid . ']'] = $v->title; + } + break; + case 'rule_news': + $q = db_query_range("SELECT nid, title FROM {node} WHERE type='ding_news' AND title LIKE(:term)", 0, 5, array(':term' => '%%' . $input . '%%'))->fetchAll(); + foreach ($q as $k => $v) { $matches['[nid:' . $v->nid . ']'] = $v->title; } diff --git a/ding_campaign.module b/ding_campaign.module index 92c9b36..fce31cd 100644 --- a/ding_campaign.module +++ b/ding_campaign.module @@ -173,6 +173,44 @@ function ding_campaign_display($context, $count, $offset) { function ding_campaign_get_campaigns($context, $limit, $offset) { $campaigns = array(); + // Process event campaigns. + if ($context['page'] != NULL && isset($context['page']->nid) && $context['page']->type == 'ding_event') { + $nid = $context['page']->nid; + + $result = db_query('SELECT r.cid + FROM {ding_campaign_rules} r, {ding_campaign} d, {node} n + WHERE r.nid = :nid + AND r.type = \'rule_event\' + AND n.status = 1 + AND r.cid = d.cid + AND r.cid = n.nid + ORDER BY d.weight DESC', array(':nid' => (int) $nid)) + ->fetchAll(); + + foreach ($result as $k => $v) { + @$campaigns[$v->cid] += 11; + } + } + + // Process news campaigns. + if ($context['page'] != NULL && isset($context['page']->nid) && $context['page']->type == 'ding_news') { + $nid = $context['page']->nid; + + $result = db_query('SELECT r.cid + FROM {ding_campaign_rules} r, {ding_campaign} d, {node} n + WHERE r.nid = :nid + AND r.type = \'rule_news\' + AND n.status = 1 + AND r.cid = d.cid + AND r.cid = n.nid + ORDER BY d.weight DESC', array(':nid' => (int) $nid)) + ->fetchAll(); + + foreach ($result as $k => $v) { + @$campaigns[$v->cid] += 10; + } + } + // Process page campaigns. if ($context['page'] != NULL && isset($context['page']->nid)) { $nid = $context['page']->nid; @@ -365,11 +403,12 @@ function ding_campaign_node_insert($node) { if (isset($node->form_id) && isset($enabled_types[$node->form_id]) && $enabled_types[$node->form_id] === $node->form_id) { if (isset($node->ding_campaigns) && is_array($node->ding_campaigns)) { foreach ($node->ding_campaigns as $k => $v) { + $type = _ding_campaign_rule_by_type($node->type); $data = array( 'nid' => $node->nid, 'cid' => $v, 'rule' => '[nid:' . $node->nid . ']', - 'type' => ($node->type == 'library') ? 'rule_library' : 'rule_page', + 'type' => $type, ); // Skip the unused campaigns. @@ -417,11 +456,13 @@ function ding_campaign_node_update($node) { ->execute(); foreach ($node->ding_campaigns as $k => $v) { + $type = _ding_campaign_rule_by_type($node->type); + $data = array( 'nid' => $node->nid, 'cid' => $v, 'rule' => '[nid:' . $node->nid . ']', - 'type' => ($node->type == 'library') ? 'rule_library' : 'rule_page', + 'type' => $type, ); // Skip the unused campaigns. @@ -464,7 +505,7 @@ function ding_campaign_node_load($node) { // Process other types of nodes (selected in backend). if (isset($enabled_types[$node[$nids[0]]->type . '_node_form']) && $enabled_types[$node[$nids[0]]->type . '_node_form'] === $node[$nids[0]]->type . '_node_form') { $nids = array_keys($node); - $or = db_or()->condition('type', 'rule_library')->condition('type', 'rule_page'); + $or = db_or()->condition('type', 'rule_library')->condition('type', 'rule_page')->condition('type', 'rule_news')->condition('type', 'rule_event'); $result = db_select('ding_campaign_rules') ->fields('ding_campaign_rules', array('cid')) ->condition('nid', $node[$nids[0]]->nid) @@ -541,4 +582,26 @@ function ding_campaign_campaign_node_form_validate($form, &$form_state) { } } } +/** + * Get rule name by node type + * @param string $node_type Node type + * @return string Rule name + */ +function _ding_campaign_rule_by_type($node_type) { + // Set rule type + switch ($node_type) { + case 'library': + $type = 'rule_library'; + break; + case 'ding_event': + $type = 'rule_event'; + break; + case 'ding_news': + $type = 'rule_news'; + break; + default: + $type = 'rule_page'; + } + return $type; +} diff --git a/js/ding_campaign_scripts.js b/js/ding_campaign_scripts.js index 9f45f30..46acc8c 100644 --- a/js/ding_campaign_scripts.js +++ b/js/ding_campaign_scripts.js @@ -31,7 +31,7 @@ $obj.unbind().removeClass('form-autocomplete'); $('#'+$obj.attr('id')+'-autocomplete-aria-live', $context).remove(); - if (value == 'rule_page' || value == 'rule_taxonomy' || value == 'rule_library') { + if (value == 'rule_page' || value == 'rule_event' || value == 'rule_news' || value == 'rule_taxonomy' || value == 'rule_library') { // Add autocomplete. Drupal.behaviors.ding_campaing_init.bindAutocomplete($context, value); } From f3962f618bf105f9aa91d643ed9eb7d57a8b31ee Mon Sep 17 00:00:00 2001 From: Alex Semeniuc Date: Tue, 26 Mar 2013 18:04:57 +0200 Subject: [PATCH 25/76] case 2416 - Fixed coding style. --- ding_campaign.module | 8 +++++--- js/ding_campaign_scripts.js | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ding_campaign.module b/ding_campaign.module index fce31cd..a99047e 100644 --- a/ding_campaign.module +++ b/ding_campaign.module @@ -583,9 +583,11 @@ function ding_campaign_campaign_node_form_validate($form, &$form_state) { } } /** - * Get rule name by node type - * @param string $node_type Node type - * @return string Rule name + * Get rule name by node type. + * @param string $node_type + * Node type. + * @return string + * Rule name. */ function _ding_campaign_rule_by_type($node_type) { // Set rule type diff --git a/js/ding_campaign_scripts.js b/js/ding_campaign_scripts.js index 46acc8c..0807805 100644 --- a/js/ding_campaign_scripts.js +++ b/js/ding_campaign_scripts.js @@ -29,7 +29,7 @@ // Needed to prevent duplicating autocomplete behavior. var $obj = $('input.form-text', $context); $obj.unbind().removeClass('form-autocomplete'); - $('#'+$obj.attr('id')+'-autocomplete-aria-live', $context).remove(); + $('#' + $obj.attr('id') + '-autocomplete-aria-live', $context).remove(); if (value == 'rule_page' || value == 'rule_event' || value == 'rule_news' || value == 'rule_taxonomy' || value == 'rule_library') { // Add autocomplete. From cac506986a573362536ea2639414fa58c67c42a5 Mon Sep 17 00:00:00 2001 From: Alex Semeniuc Date: Wed, 27 Mar 2013 15:27:33 +0200 Subject: [PATCH 26/76] case 2416 - Fixed library rule. --- ding_campaign.module | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ding_campaign.module b/ding_campaign.module index a99047e..234a33d 100644 --- a/ding_campaign.module +++ b/ding_campaign.module @@ -285,8 +285,8 @@ function ding_campaign_get_campaigns($context, $limit, $offset) { } // Process library campaigns. - if ($context['library'] != NULL && isset($context['library']->nid) && $context['library']->type == 'ding_library' ) { - $nid = $context['library']->nid; + if ($context['page'] != NULL && isset($context['page']->nid) && $context['page']->type == 'ding_library' ) { + $nid = $context['page']->nid; $result = db_query('SELECT r.cid FROM {ding_campaign_rules} r, {ding_campaign} d, {node} n From 9213169e11f3d413c8f5531a408af7a094b9e705 Mon Sep 17 00:00:00 2001 From: Alex Semeniuc Date: Thu, 28 Mar 2013 15:03:47 +0200 Subject: [PATCH 27/76] Resolved merge conflict in info file --- ding_campaign.admin.inc | 12 +++++------ ding_campaign.info | 10 +++++++-- js/ding_campaign_scripts.js | 43 ++++++++++++++++++++++++++++--------- 3 files changed, 47 insertions(+), 18 deletions(-) diff --git a/ding_campaign.admin.inc b/ding_campaign.admin.inc index 10455e5..b688dc8 100644 --- a/ding_campaign.admin.inc +++ b/ding_campaign.admin.inc @@ -116,6 +116,11 @@ function ding_campaign_edit_rules_form($form, &$form_state, $node = NULL) { $form['#submit'] = array('ding_campaign_campaign_rule_form_submit'); + drupal_add_js( + drupal_get_path('module', 'ding_campaign') . '/js/ding_campaign_scripts.js', + array('weight' => 10) + ); + return $form; } @@ -212,14 +217,9 @@ function ding_campaign_rule_form($rule = NULL, $type = NULL) { '#maxlength' => 24, '#prefix' => '
', '#suffix' => '
', - // '#autocomplete_path' => 'ding_campaign/autocomplete/567', + '#autocomplete_path' => 'ding_campaign/autocomplete/' . $type, ); - // Add autocomplete for some rule types. - if (in_array($type, array('rule_page', 'rule_event', 'rule_news', 'rule_taxonomy', 'rule_library'))) { - $form['rule_value[]']['#autocomplete_path'] = 'ding_campaign/autocomplete/' . $type; - } - return $form; } diff --git a/ding_campaign.info b/ding_campaign.info index 9db43ef..2bbf089 100644 --- a/ding_campaign.info +++ b/ding_campaign.info @@ -8,5 +8,11 @@ dependencies[] = field dependencies[] = image dependencies[] = features dependencies[] = ctools -;stylesheets[all][] = css/ding_campaign.css -scripts[] = js/ding_campaign_scripts.js +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][] = "language_content_type_ding_campaign" diff --git a/js/ding_campaign_scripts.js b/js/ding_campaign_scripts.js index 0807805..7da8944 100644 --- a/js/ding_campaign_scripts.js +++ b/js/ding_campaign_scripts.js @@ -2,7 +2,7 @@ Drupal.behaviors.ding_campaing_init = { bindAutocomplete: function(obj, type) { - // Add autocomplete bevavior to 'rule value' input. + // Add autocomplete behavior to 'rule value' input. $(obj).find('input.autocomplete') .val(Drupal.settings.ding_campaing_init.autocompleteUrl + type) .removeClass('autocomplete-processed') @@ -12,7 +12,36 @@ Drupal.attachBehaviors($(obj)); }, + rebuildAutocomplete: function ($context, value) { + var $obj = $('input.form-text', $context); + $obj.unbind().removeClass('form-autocomplete').addClass('autocomplete-processed'); + + // Remove span element (will be recreated). + $('#' + $obj.attr('id') + '-autocomplete-aria-live', $context).remove(); + + if (value == undefined) { + value = $('select option:selected', $context).val(); + } + + if (value == 'rule_page' || value == 'rule_event' || value == 'rule_news' || value == 'rule_taxonomy' || value == 'rule_library') { + // Add autocomplete. + Drupal.behaviors.ding_campaing_init.bindAutocomplete($context, value); + } + }, + attach: function (context, settings) { + // OnLoad actions. + $('.ding-campaign-rule', context).once('ding_campaign_init_start').each(function(){ + var $context = $(this); + // Rebuild autocomplete. + Drupal.behaviors.ding_campaing_init.rebuildAutocomplete($context); + + // Hide rule value for generic type. + if ($('select option:selected', $context).val() == 'rule_generic') { + $('.rule-value', $context).hide(); + } + }); + // OnChange event for 'rule type' dropdown. $('.ding-campaign-rule select', context).once('ding_campaign_init').change(function () { var $context = $(this).parent().parent().parent(); @@ -27,16 +56,10 @@ // Remove autocomplete. // Needed to prevent duplicating autocomplete behavior. - var $obj = $('input.form-text', $context); - $obj.unbind().removeClass('form-autocomplete'); - $('#' + $obj.attr('id') + '-autocomplete-aria-live', $context).remove(); - - if (value == 'rule_page' || value == 'rule_event' || value == 'rule_news' || value == 'rule_taxonomy' || value == 'rule_library') { - // Add autocomplete. - Drupal.behaviors.ding_campaing_init.bindAutocomplete($context, value); - } + Drupal.behaviors.ding_campaing_init.rebuildAutocomplete($context, value); } - // Crear rule value on rule type change. + + // Clear rule value on rule type change. $('input.form-text', $context).val(''); }); } From 9eec434f7795767b504f89a3e869d4ad38b52dd9 Mon Sep 17 00:00:00 2001 From: Martin Cording Date: Fri, 29 Mar 2013 23:00:39 +0100 Subject: [PATCH 28/76] Resolved merge conflict --- ding_campaign.admin.inc | 6 ++++-- ding_campaign.install | 9 ++++----- ding_campaign.module | 6 +++--- plugins/content_types/campaign.inc | 12 +++++++++--- 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/ding_campaign.admin.inc b/ding_campaign.admin.inc index b688dc8..d3342d5 100644 --- a/ding_campaign.admin.inc +++ b/ding_campaign.admin.inc @@ -50,8 +50,8 @@ function ding_campaign_configure($form, $form_state) { */ function ding_campaign_rules_admin($node) { drupal_add_js(array('ding_campaing_init' => array( - 'autocompleteUrl' => url('ding_campaign/autocomplete/'), - )), 'setting'); + 'autocompleteUrl' => url('ding_campaign/autocomplete/'), + )), 'setting'); return drupal_get_form('ding_campaign_edit_rules_form', $node); } @@ -191,6 +191,8 @@ function ding_campaign_campaign_rule_form_submit($form, &$form_state) { * Rule fields structure. */ function ding_campaign_rule_form($rule = NULL, $type = NULL) { + $form = array(); + $form['rule_type[]'] = array( '#type' => 'select', '#title' => t('Rule type'), diff --git a/ding_campaign.install b/ding_campaign.install index 6468eb0..0907213 100644 --- a/ding_campaign.install +++ b/ding_campaign.install @@ -103,11 +103,10 @@ function ding_campaign_update_7001(&$sandbox) { */ function ding_campaign_update_7002(&$sandbox) { return db_add_field('ding_campaign', 'pane_id', array( - 'type' => 'int', - 'not null' => TRUE, - 'default' => 0, - ) - ); + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + )); } /** diff --git a/ding_campaign.module b/ding_campaign.module index 234a33d..b44ebf8 100644 --- a/ding_campaign.module +++ b/ding_campaign.module @@ -136,9 +136,9 @@ function ding_campaign_display($context, $count, $offset) { $camp_link = field_get_items('node', $node, 'field_camp_link'); $camp_image = field_get_items('node', $node, 'field_camp_image'); - $image_title = field_get_items('file', (object)($camp_image[0]), 'field_dams_title'); + $image_title = field_get_items('file', (object) ($camp_image[0]), 'field_dams_title'); $image_title = isset($image_title[0]['safe_value']) ? $image_title[0]['safe_value'] : ''; - $image_alt = field_get_items('file', (object)($camp_image[0]), 'field_dams_alt_name'); + $image_alt = field_get_items('file', (object) ($camp_image[0]), 'field_dams_alt_name'); $image_alt = isset($image_alt[0]['safe_value']) ? $image_alt[0]['safe_value'] : ''; $content = @@ -285,7 +285,7 @@ function ding_campaign_get_campaigns($context, $limit, $offset) { } // Process library campaigns. - if ($context['page'] != NULL && isset($context['page']->nid) && $context['page']->type == 'ding_library' ) { + if ($context['page'] != NULL && isset($context['page']->nid) && $context['page']->type == 'ding_library') { $nid = $context['page']->nid; $result = db_query('SELECT r.cid diff --git a/plugins/content_types/campaign.inc b/plugins/content_types/campaign.inc index ec7ba29..788a9a2 100644 --- a/plugins/content_types/campaign.inc +++ b/plugins/content_types/campaign.inc @@ -9,7 +9,10 @@ $plugin = array( 'title' => t('Relevant campaigns'), 'description' => t('Display ad-like campaigns'), 'single' => TRUE, - 'defaults' => array('ding_campaign_count' => 3, 'ding_campaign_offset' => 0), + 'defaults' => array( + 'ding_campaign_count' => 3, + 'ding_campaign_offset' => 0, + ), 'required context' => array( new ctools_context_optional(t('Page node'), 'node'), new ctools_context_optional(t('Related library'), 'node'), @@ -61,7 +64,7 @@ function ding_campaign_campaign_content_type_edit_form($form, &$form_state) { '#maxlength' => 3, ); - drupal_add_css( drupal_get_path('module', 'ding_campaign') . '/css/ding_campaign_admin.css' ); + drupal_add_css(drupal_get_path('module', 'ding_campaign') . '/css/ding_campaign_admin.css'); return $form; } @@ -71,7 +74,10 @@ function ding_campaign_campaign_content_type_edit_form($form, &$form_state) { */ function ding_campaign_campaign_content_type_edit_form_validate($form, &$form_state) { // Sanitise the submitted values. - $values = array('ding_campaign_count' => 1, 'ding_campaign_offset' => 0); + $values = array( + 'ding_campaign_count' => 1, + 'ding_campaign_offset' => 0, + ); foreach ($values as $value => $min_value) { $val = trim($form_state['values'][$value]); $count = intval($val); From c01a7006e708b6b444d27024dc32adc4dee15012 Mon Sep 17 00:00:00 2001 From: Anatoly Muntean Date: Tue, 9 Apr 2013 13:02:42 +0300 Subject: [PATCH 29/76] Resovled merge conflict in main module --- css/ding_campaign_admin.css | 5 +++++ ding_campaign.module | 17 ++++++++++++----- plugins/content_types/campaign.inc | 18 +++++++++++++++++- 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/css/ding_campaign_admin.css b/css/ding_campaign_admin.css index faa187f..e6a7c0b 100644 --- a/css/ding_campaign_admin.css +++ b/css/ding_campaign_admin.css @@ -10,6 +10,11 @@ clear: none; } +#ding-campaign-campaign-content-type-edit-form > div > div.form-item-ding-campaign-image-style { + float: none; + clear: both; +} + #ding-campaign-campaign-content-type-edit-form > div > div.form-type-select label, #ding-campaign-campaign-content-type-edit-form > div > div.form-type-textfield label { display: block; diff --git a/ding_campaign.module b/ding_campaign.module index b44ebf8..9853753 100644 --- a/ding_campaign.module +++ b/ding_campaign.module @@ -109,7 +109,8 @@ function ding_campaign_theme($existing, $type, $theme, $path) { * @return * HTML formatted string. */ -function ding_campaign_display($context, $count, $offset) { + +function ding_campaign_display($context, $count, $offset, $style = 'medium') { $campaigns = ding_campaign_get_campaigns($context, $count, $offset); // There is at least one result. @@ -141,10 +142,16 @@ function ding_campaign_display($context, $count, $offset) { $image_alt = field_get_items('file', (object) ($camp_image[0]), 'field_dams_alt_name'); $image_alt = isset($image_alt[0]['safe_value']) ? $image_alt[0]['safe_value'] : ''; - $content = - ''; + $image_tag = theme_image_style(array( + 'style_name' => $style, + 'path' => $camp_image[0]['uri'], + 'width' => '', + 'height' => '', + 'alt' => $image_alt, + 'title' => $image_title, + )); + $link_tag = l($image_tag, $camp_link[0]['value'], array('html' => TRUE, 'absolute' => TRUE, 'aatributes' => array('_target' => 'blank'))); + $content = '
' . $link_tag . '
'; break; case 'full': diff --git a/plugins/content_types/campaign.inc b/plugins/content_types/campaign.inc index 788a9a2..cc856a1 100644 --- a/plugins/content_types/campaign.inc +++ b/plugins/content_types/campaign.inc @@ -35,8 +35,9 @@ function ding_campaign_campaign_content_type_render($subtype, $conf, $panel_args ); $count = $conf['ding_campaign_count']; $offset = $conf['ding_campaign_offset']; + $style = $conf['ding_campaign_image_style']; - $block->content = ding_campaign_display($context_data, $count, $offset); + $block->content = ding_campaign_display($context_data, $count, $offset, $style); return $block; } @@ -64,6 +65,20 @@ function ding_campaign_campaign_content_type_edit_form($form, &$form_state) { '#maxlength' => 3, ); + $form['ding_campaign_image_style'] = array( + '#type' => 'select', + '#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'), + ), + '#default_value' => (isset($form_state['conf']['ding_campaign_image_style'])) ? $form_state['conf']['ding_campaign_image_style'] : 'medium', + ); + drupal_add_css(drupal_get_path('module', 'ding_campaign') . '/css/ding_campaign_admin.css'); return $form; @@ -99,4 +114,5 @@ function ding_campaign_campaign_content_type_edit_form_validate($form, &$form_st function ding_campaign_campaign_content_type_edit_form_submit($form, &$form_state) { $form_state['conf']['ding_campaign_count'] = $form_state['values']['ding_campaign_count']; $form_state['conf']['ding_campaign_offset'] = $form_state['values']['ding_campaign_offset']; + $form_state['conf']['ding_campaign_image_style'] = $form_state['values']['ding_campaign_image_style']; } From 4dc279fa6e21f108931a477bdf80915bb8f1a4c7 Mon Sep 17 00:00:00 2001 From: Anatoly Muntean Date: Tue, 9 Apr 2013 13:07:36 +0300 Subject: [PATCH 30/76] Resovled merge conflict in info file --- ding_campaign.info | 9 +- .../ding_campaign_ctype.features.field.inc | 548 ++++++++++++++++++ .../ding_campaign_ctype.features.inc | 133 +++++ .../ding_campaign_ctype.info | 48 ++ .../ding_campaign_ctype.module | 7 + .../ding_campaign_ctype.strongarm.inc | 191 ++++++ 6 files changed, 928 insertions(+), 8 deletions(-) create mode 100644 modules/ding_campaign_ctype/ding_campaign_ctype.features.field.inc create mode 100644 modules/ding_campaign_ctype/ding_campaign_ctype.features.inc create mode 100644 modules/ding_campaign_ctype/ding_campaign_ctype.info create mode 100644 modules/ding_campaign_ctype/ding_campaign_ctype.module create mode 100644 modules/ding_campaign_ctype/ding_campaign_ctype.strongarm.inc diff --git a/ding_campaign.info b/ding_campaign.info index 2bbf089..41b2ca3 100644 --- a/ding_campaign.info +++ b/ding_campaign.info @@ -8,11 +8,4 @@ dependencies[] = field dependencies[] = image dependencies[] = features dependencies[] = ctools -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][] = "language_content_type_ding_campaign" +dependencies[] = ding_campaign_ctype diff --git a/modules/ding_campaign_ctype/ding_campaign_ctype.features.field.inc b/modules/ding_campaign_ctype/ding_campaign_ctype.features.field.inc new file mode 100644 index 0000000..a1e61de --- /dev/null +++ b/modules/ding_campaign_ctype/ding_campaign_ctype.features.field.inc @@ -0,0 +1,548 @@ + 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', + ), + 'field_instance' => 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' => '-2', + ), + ), + ); + + // Exported field: 'node-ding_campaign-field_camp_link'. + $fields['node-ding_campaign-field_camp_link'] = array( + 'field_config' => 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', + ), + 'field_instance' => 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' => '0', + ), + ), + ); + + // Exported field: 'node-ding_campaign-field_camp_settings'. + $fields['node-ding_campaign-field_camp_settings'] = array( + 'field_config' => 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', + ), + 'field_instance' => 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: 'node-ding_campaign-field_camp_text_full'. + $fields['node-ding_campaign-field_camp_text_full'] = array( + 'field_config' => 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', + ), + 'field_instance' => 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' => '-1', + ), + ), + ); + + // Exported field: 'node-ding_campaign-field_camp_text_plain'. + $fields['node-ding_campaign-field_camp_text_plain'] = array( + 'field_config' => 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', + ), + 'field_instance' => 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' => '-3', + ), + ), + ); + + // Exported field: 'node-ding_campaign-field_camp_weight'. + $fields['node-ding_campaign-field_camp_weight'] = array( + 'field_config' => 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', + ), + 'field_instance' => 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' => '2', + ), + ), + ); + + // Translatables + // Included for use with string extractors like potx. + t('Campaign image'); + t('Campaign link'); + t('Campaign settings'); + t('Campaign text'); + t('Weight'); + + return $fields; +} diff --git a/modules/ding_campaign_ctype/ding_campaign_ctype.features.inc b/modules/ding_campaign_ctype/ding_campaign_ctype.features.inc new file mode 100644 index 0000000..15ca067 --- /dev/null +++ b/modules/ding_campaign_ctype/ding_campaign_ctype.features.inc @@ -0,0 +1,133 @@ + "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', + ), + ), + ); + + // 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', + ), + ), + ); + + // 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', + ), + ), + ); + + // 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', + ), + ), + ); + + return $styles; +} + +/** + * Implements hook_node_info(). + */ +function ding_campaign_ctype_node_info() { + $items = array( + 'ding_campaign' => array( + 'name' => t('Campaign'), + 'base' => 'node_content', + 'description' => '', + 'has_title' => '1', + 'title_label' => t('Campaign name'), + 'help' => '', + ), + ); + return $items; +} diff --git a/modules/ding_campaign_ctype/ding_campaign_ctype.info b/modules/ding_campaign_ctype/ding_campaign_ctype.info new file mode 100644 index 0000000..b21fa4f --- /dev/null +++ b/modules/ding_campaign_ctype/ding_campaign_ctype.info @@ -0,0 +1,48 @@ +name = Ding campaign ctype +description = Content type and image styles for ding_campaign module +core = 7.x +package = Ding! +dependencies[] = ctools +dependencies[] = features +dependencies[] = field_sql_storage +dependencies[] = image +dependencies[] = list +dependencies[] = media +dependencies[] = node +dependencies[] = options +dependencies[] = strongarm +dependencies[] = text +features[ctools][] = strongarm:strongarm:1 +features[features_api][] = api:1 +features[field][] = node-ding_campaign-field_camp_image +features[field][] = node-ding_campaign-field_camp_link +features[field][] = node-ding_campaign-field_camp_settings +features[field][] = node-ding_campaign-field_camp_text_full +features[field][] = node-ding_campaign-field_camp_text_plain +features[field][] = 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][] = additional_settings__active_tab_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][] = og_group_content_type_ding_campaign +features[variable][] = opening_hours_enabled_ding_campaign +features[variable][] = pathauto_node_ding_campaign_da_pattern +features[variable][] = pathauto_node_ding_campaign_en_pattern +features[variable][] = pathauto_node_ding_campaign_pattern +features[variable][] = pathauto_node_ding_campaign_und_pattern diff --git a/modules/ding_campaign_ctype/ding_campaign_ctype.module b/modules/ding_campaign_ctype/ding_campaign_ctype.module new file mode 100644 index 0000000..dc2002d --- /dev/null +++ b/modules/ding_campaign_ctype/ding_campaign_ctype.module @@ -0,0 +1,7 @@ +disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'additional_settings__active_tab_ding_campaign'; + $strongarm->value = 'edit-workflow'; + $export['additional_settings__active_tab_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_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 = 1; + $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 = '0'; + $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 = 1; + $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 = '1'; + $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 = 1; + $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(), + '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 = '2'; + $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 = '1'; + $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 = 1; + $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 = 'og_group_content_type_ding_campaign'; + $strongarm->value = 'omitted'; + $export['og_group_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 = 'opening_hours_enabled_ding_campaign'; + $strongarm->value = 0; + $export['opening_hours_enabled_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 = 'pathauto_node_ding_campaign_da_pattern'; + $strongarm->value = 'biblioteker/[node:ding_campaign_slug]'; + $export['pathauto_node_ding_campaign_da_pattern'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'pathauto_node_ding_campaign_en_pattern'; + $strongarm->value = ''; + $export['pathauto_node_ding_campaign_en_pattern'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'pathauto_node_ding_campaign_pattern'; + $strongarm->value = 'library/[node:ding_campaign_slug]'; + $export['pathauto_node_ding_campaign_pattern'] = $strongarm; + + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'pathauto_node_ding_campaign_und_pattern'; + $strongarm->value = ''; + $export['pathauto_node_ding_campaign_und_pattern'] = $strongarm; + + return $export; +} From d8f4a4c39c1f1a5018dd51afebad9175e61d5a18 Mon Sep 17 00:00:00 2001 From: Alex Semeniuc Date: Thu, 11 Apr 2013 17:04:47 +0300 Subject: [PATCH 31/76] Case 2600 - Fixed default value for image style. --- ding_campaign.module | 2 +- plugins/content_types/campaign.inc | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ding_campaign.module b/ding_campaign.module index 9853753..858abde 100644 --- a/ding_campaign.module +++ b/ding_campaign.module @@ -150,7 +150,7 @@ function ding_campaign_display($context, $count, $offset, $style = 'medium') { 'alt' => $image_alt, 'title' => $image_title, )); - $link_tag = l($image_tag, $camp_link[0]['value'], array('html' => TRUE, 'absolute' => TRUE, 'aatributes' => array('_target' => 'blank'))); + $link_tag = l($image_tag, $camp_link[0]['value'], array('html' => TRUE, 'absolute' => TRUE, 'attributes' => array('target' => '_blank'))); $content = '
' . $link_tag . '
'; break; diff --git a/plugins/content_types/campaign.inc b/plugins/content_types/campaign.inc index cc856a1..7c03dd4 100644 --- a/plugins/content_types/campaign.inc +++ b/plugins/content_types/campaign.inc @@ -35,7 +35,8 @@ function ding_campaign_campaign_content_type_render($subtype, $conf, $panel_args ); $count = $conf['ding_campaign_count']; $offset = $conf['ding_campaign_offset']; - $style = $conf['ding_campaign_image_style']; + // Set default value if it was not set in panel settings. + $style = (!empty($conf['ding_campaign_image_style'])) ? $conf['ding_campaign_image_style'] : 'medium'; $block->content = ding_campaign_display($context_data, $count, $offset, $style); From 0661dc95908c541ec53892cb8b58ca8c1aa9d973 Mon Sep 17 00:00:00 2001 From: Alex Semeniuc Date: Fri, 12 Apr 2013 10:34:38 +0300 Subject: [PATCH 32/76] Case 2490 - Fixed alt attribute for image. --- ding_campaign.module | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ding_campaign.module b/ding_campaign.module index 858abde..a70e8e2 100644 --- a/ding_campaign.module +++ b/ding_campaign.module @@ -142,14 +142,17 @@ function ding_campaign_display($context, $count, $offset, $style = 'medium') { $image_alt = field_get_items('file', (object) ($camp_image[0]), 'field_dams_alt_name'); $image_alt = isset($image_alt[0]['safe_value']) ? $image_alt[0]['safe_value'] : ''; - $image_tag = theme_image_style(array( + if (empty($image_alt)) { + $image_alt = $image_title; + } + + $image_tag = theme('image_style', array( 'style_name' => $style, 'path' => $camp_image[0]['uri'], - 'width' => '', - 'height' => '', 'alt' => $image_alt, 'title' => $image_title, )); + $link_tag = l($image_tag, $camp_link[0]['value'], array('html' => TRUE, 'absolute' => TRUE, 'attributes' => array('target' => '_blank'))); $content = '
' . $link_tag . '
'; break; From 98267b9816c02fde508bbba0d83bc863d4c00f3b Mon Sep 17 00:00:00 2001 From: Rune Schjellerup Philosof Date: Wed, 24 Apr 2013 10:59:55 +0200 Subject: [PATCH 33/76] Don't export active_tab, this is the tab that was active the last time the content type was saved. It isn't used for anything, and will cause overridden status too easily for no reason. --- modules/ding_campaign_ctype/ding_campaign_ctype.info | 1 - .../ding_campaign_ctype/ding_campaign_ctype.strongarm.inc | 7 ------- 2 files changed, 8 deletions(-) diff --git a/modules/ding_campaign_ctype/ding_campaign_ctype.info b/modules/ding_campaign_ctype/ding_campaign_ctype.info index b21fa4f..c62179e 100644 --- a/modules/ding_campaign_ctype/ding_campaign_ctype.info +++ b/modules/ding_campaign_ctype/ding_campaign_ctype.info @@ -25,7 +25,6 @@ features[image][] = ding_campaign_w_280 features[image][] = ding_campaign_w_380 features[image][] = ding_campaign_w_480 features[node][] = ding_campaign -features[variable][] = additional_settings__active_tab_ding_campaign features[variable][] = comment_anonymous_ding_campaign features[variable][] = comment_default_mode_ding_campaign features[variable][] = comment_default_per_page_ding_campaign diff --git a/modules/ding_campaign_ctype/ding_campaign_ctype.strongarm.inc b/modules/ding_campaign_ctype/ding_campaign_ctype.strongarm.inc index 090cc39..a99211b 100644 --- a/modules/ding_campaign_ctype/ding_campaign_ctype.strongarm.inc +++ b/modules/ding_campaign_ctype/ding_campaign_ctype.strongarm.inc @@ -10,13 +10,6 @@ function ding_campaign_ctype_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 = 'additional_settings__active_tab_ding_campaign'; - $strongarm->value = 'edit-workflow'; - $export['additional_settings__active_tab_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 0f842e5f20a40e648033255b433616718b5e699d Mon Sep 17 00:00:00 2001 From: Rune Schjellerup Philosof Date: Wed, 24 Apr 2013 11:02:05 +0200 Subject: [PATCH 34/76] Don't export pathauto, ding_campaigns are shown as blocks/panes they don't have a path. Furthermore, the pathauto was configured to use a field that ding_campaign doesn't have (slug). --- .../ding_campaign_ctype.info | 4 --- .../ding_campaign_ctype.strongarm.inc | 28 ------------------- 2 files changed, 32 deletions(-) diff --git a/modules/ding_campaign_ctype/ding_campaign_ctype.info b/modules/ding_campaign_ctype/ding_campaign_ctype.info index c62179e..3575455 100644 --- a/modules/ding_campaign_ctype/ding_campaign_ctype.info +++ b/modules/ding_campaign_ctype/ding_campaign_ctype.info @@ -41,7 +41,3 @@ features[variable][] = node_preview_ding_campaign features[variable][] = node_submitted_ding_campaign features[variable][] = og_group_content_type_ding_campaign features[variable][] = opening_hours_enabled_ding_campaign -features[variable][] = pathauto_node_ding_campaign_da_pattern -features[variable][] = pathauto_node_ding_campaign_en_pattern -features[variable][] = pathauto_node_ding_campaign_pattern -features[variable][] = pathauto_node_ding_campaign_und_pattern diff --git a/modules/ding_campaign_ctype/ding_campaign_ctype.strongarm.inc b/modules/ding_campaign_ctype/ding_campaign_ctype.strongarm.inc index a99211b..41e3690 100644 --- a/modules/ding_campaign_ctype/ding_campaign_ctype.strongarm.inc +++ b/modules/ding_campaign_ctype/ding_campaign_ctype.strongarm.inc @@ -152,33 +152,5 @@ function ding_campaign_ctype_strongarm() { $strongarm->value = 0; $export['opening_hours_enabled_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 = 'pathauto_node_ding_campaign_da_pattern'; - $strongarm->value = 'biblioteker/[node:ding_campaign_slug]'; - $export['pathauto_node_ding_campaign_da_pattern'] = $strongarm; - - $strongarm = new stdClass(); - $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ - $strongarm->api_version = 1; - $strongarm->name = 'pathauto_node_ding_campaign_en_pattern'; - $strongarm->value = ''; - $export['pathauto_node_ding_campaign_en_pattern'] = $strongarm; - - $strongarm = new stdClass(); - $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ - $strongarm->api_version = 1; - $strongarm->name = 'pathauto_node_ding_campaign_pattern'; - $strongarm->value = 'library/[node:ding_campaign_slug]'; - $export['pathauto_node_ding_campaign_pattern'] = $strongarm; - - $strongarm = new stdClass(); - $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ - $strongarm->api_version = 1; - $strongarm->name = 'pathauto_node_ding_campaign_und_pattern'; - $strongarm->value = ''; - $export['pathauto_node_ding_campaign_und_pattern'] = $strongarm; - return $export; } From 9dffd35577aeceb68fe7f686f5be849bdb15c66b Mon Sep 17 00:00:00 2001 From: Alex Semeniuc Date: Mon, 29 Apr 2013 11:44:42 +0300 Subject: [PATCH 35/76] Case 2672 - Removed DAMS alt/title. --- ding_campaign.module | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ding_campaign.module b/ding_campaign.module index a70e8e2..5acc016 100644 --- a/ding_campaign.module +++ b/ding_campaign.module @@ -137,10 +137,10 @@ function ding_campaign_display($context, $count, $offset, $style = 'medium') { $camp_link = field_get_items('node', $node, 'field_camp_link'); $camp_image = field_get_items('node', $node, 'field_camp_image'); - $image_title = field_get_items('file', (object) ($camp_image[0]), 'field_dams_title'); - $image_title = isset($image_title[0]['safe_value']) ? $image_title[0]['safe_value'] : ''; - $image_alt = field_get_items('file', (object) ($camp_image[0]), 'field_dams_alt_name'); - $image_alt = isset($image_alt[0]['safe_value']) ? $image_alt[0]['safe_value'] : ''; + $image_title = field_get_items('file', (object) ($camp_image[0]), 'field_file_image_title_text'); + $image_title = $image_title[0]['safe_value']; + $image_alt = field_get_items('file', (object) ($camp_image[0]), 'field_file_image_alt_text'); + $image_alt = $image_alt[0]['safe_value']; if (empty($image_alt)) { $image_alt = $image_title; From bce22f6fc90a6bf7e402bb17201bc7abb1c8b06c Mon Sep 17 00:00:00 2001 From: Anatoly Muntean Date: Mon, 27 May 2013 16:12:52 +0300 Subject: [PATCH 36/76] Resolved merge conflict in node access --- ding_campaign.module | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ding_campaign.module b/ding_campaign.module index 5acc016..488b8a5 100644 --- a/ding_campaign.module +++ b/ding_campaign.module @@ -74,11 +74,11 @@ function ding_campaign_admin_paths() { /** * Implements hook_node_access(). */ -function ding_campaign_node_access($node) { - if (isset($node->type) && $node->type == 'ding_campaign' && user_access('access campaign rules')) { - return TRUE; +function ding_campaign_node_access($node, $op, $account) { + if (isset($node->type) && $node->type == 'ding_campaign' && !user_access('access campaign rules')) { + return NODE_ACCESS_DENY; } - return FALSE; + return NODE_ACCESS_IGNORE; } /** From 04de60a45345e033f77b38fe7b9eccc82e019cb0 Mon Sep 17 00:00:00 2001 From: Anatoly Muntean Date: Tue, 25 Jun 2013 16:00:53 +0300 Subject: [PATCH 37/76] Resolved merge conflict in access function --- ding_campaign.module | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/ding_campaign.module b/ding_campaign.module index 488b8a5..0b285b1 100644 --- a/ding_campaign.module +++ b/ding_campaign.module @@ -27,10 +27,9 @@ function ding_campaign_menu() { 'description' => 'Edit campaign rules', 'page callback' => 'ding_campaign_rules_admin', 'page arguments' => array(1), - 'access arguments' => array(1), + 'access arguments' => array('access campaign rules'), 'file' => 'ding_campaign.admin.inc', 'type' => MENU_LOCAL_TASK, - 'access callback' => 'ding_campaign_node_access', 'weight' => 2, ); @@ -71,16 +70,6 @@ function ding_campaign_admin_paths() { return $paths; } -/** - * Implements hook_node_access(). - */ -function ding_campaign_node_access($node, $op, $account) { - if (isset($node->type) && $node->type == 'ding_campaign' && !user_access('access campaign rules')) { - return NODE_ACCESS_DENY; - } - return NODE_ACCESS_IGNORE; -} - /** * Implements hook_theme(). */ From e4df1079a8caa36ad7eba2c57975857f199d8ee1 Mon Sep 17 00:00:00 2001 From: Anatoly Muntean Date: Tue, 2 Jul 2013 11:51:55 +0300 Subject: [PATCH 38/76] case 2986 - Proper check for campaign rules menu access. --- ding_campaign.module | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/ding_campaign.module b/ding_campaign.module index 0b285b1..fe8b829 100644 --- a/ding_campaign.module +++ b/ding_campaign.module @@ -28,6 +28,7 @@ function ding_campaign_menu() { 'page callback' => 'ding_campaign_rules_admin', 'page arguments' => array(1), 'access arguments' => array('access campaign rules'), + 'access callback' => array('ding_campaign_rules_access'), 'file' => 'ding_campaign.admin.inc', 'type' => MENU_LOCAL_TASK, 'weight' => 2, @@ -46,6 +47,30 @@ function ding_campaign_menu() { return $items; } +/** + * Custom access callback. + * + * Used to define access to ding campaign rules. Limits the menu item only for + * ding_campaign node types. + * + * @return boolean + * TRUE or FALSE value. + */ +function ding_campaign_rules_access() { + $item = menu_get_item(); + $node = NULL; + + if (isset($item['page_arguments'][0]->type)) { + $node = $item['page_arguments'][0]; + + if ($node->type == 'ding_campaign') { + return TRUE; + } + } + + return FALSE; +} + /** * Implements hook_perimission(). */ From 7795eb3bb2b08588b4db73ad51c15298aa68f492 Mon Sep 17 00:00:00 2001 From: Jesper Kristensen Date: Tue, 26 Nov 2013 11:36:16 +0100 Subject: [PATCH 39/76] Removed the 2x ctype feature --- .../ding_campaign_ctype.features.field.inc | 452 ------------------ ...ing_campaign_ctype.features.field_base.inc | 199 -------- ...campaign_ctype.features.field_instance.inc | 310 ------------ .../ding_campaign_ctype.features.inc | 79 --- ...ampaign_ctype.features.user_permission.inc | 69 --- ding_campaign_ctype/ding_campaign_ctype.info | 28 -- .../ding_campaign_ctype.module | 8 - .../ding_campaign_ctype.strongarm.inc | 109 ----- 8 files changed, 1254 deletions(-) delete mode 100644 ding_campaign_ctype/ding_campaign_ctype.features.field.inc delete mode 100644 ding_campaign_ctype/ding_campaign_ctype.features.field_base.inc delete mode 100644 ding_campaign_ctype/ding_campaign_ctype.features.field_instance.inc delete mode 100644 ding_campaign_ctype/ding_campaign_ctype.features.inc delete mode 100644 ding_campaign_ctype/ding_campaign_ctype.features.user_permission.inc delete mode 100644 ding_campaign_ctype/ding_campaign_ctype.info delete mode 100644 ding_campaign_ctype/ding_campaign_ctype.module delete mode 100644 ding_campaign_ctype/ding_campaign_ctype.strongarm.inc diff --git a/ding_campaign_ctype/ding_campaign_ctype.features.field.inc b/ding_campaign_ctype/ding_campaign_ctype.features.field.inc deleted file mode 100644 index 2fec5b0..0000000 --- a/ding_campaign_ctype/ding_campaign_ctype.features.field.inc +++ /dev/null @@ -1,452 +0,0 @@ - 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', - ), - ), - 'module' => 'image', - 'settings' => array( - 'default_image' => 0, - 'uri_scheme' => 'public', - ), - 'translatable' => '0', - 'type' => 'image', - ), - 'field_instance' => 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, - ), - 'teaser' => 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, - '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' => 'image', - 'settings' => array( - 'preview_image_style' => 'thumbnail', - 'progress_indicator' => 'throbber', - ), - 'type' => 'media_generic', - 'weight' => '-2', - ), - ), - ); - - // Exported field: node-ding_campaign-field_camp_link. - $fields['node-ding_campaign-field_camp_link'] = array( - 'field_config' => 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', - ), - ), - 'module' => 'text', - 'settings' => array( - 'max_length' => '255', - ), - 'translatable' => '0', - 'type' => 'text', - ), - 'field_instance' => 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, - ), - 'teaser' => 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' => '0', - ), - ), - ); - - // Exported field: node-ding_campaign-field_camp_settings. - $fields['node-ding_campaign-field_camp_settings'] = array( - 'field_config' => array( - 'active' => '1', - 'cardinality' => '1', - 'deleted' => '0', - 'entity_types' => array(), - 'field_name' => 'field_camp_settings', - 'foreign keys' => array(), - 'indexes' => array( - 'value' => array( - 0 => 'value', - ), - ), - 'module' => 'list', - 'settings' => array( - 'allowed_values' => array( - 'full' => 'WYSIWYG', - 'image' => 'Image', - 'plain' => 'Plain text', - ), - 'allowed_values_function' => '', - ), - 'translatable' => '0', - 'type' => 'list_text', - ), - 'field_instance' => 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, - ), - 'teaser' => 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: node-ding_campaign-field_camp_text_full. - $fields['node-ding_campaign-field_camp_text_full'] = array( - 'field_config' => 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', - ), - ), - 'module' => 'text', - 'settings' => array(), - 'translatable' => '0', - 'type' => 'text_long', - ), - 'field_instance' => 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, - ), - 'teaser' => 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' => '-1', - ), - ), - ); - - // Exported field: node-ding_campaign-field_camp_text_plain. - $fields['node-ding_campaign-field_camp_text_plain'] = array( - 'field_config' => 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', - ), - ), - 'module' => 'text', - 'settings' => array(), - 'translatable' => '0', - 'type' => 'text_long', - ), - 'field_instance' => 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, - ), - 'teaser' => 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' => '-3', - ), - ), - ); - - // Exported field: node-ding_campaign-field_camp_weight. - $fields['node-ding_campaign-field_camp_weight'] = array( - 'field_config' => array( - 'active' => '1', - 'cardinality' => '1', - 'deleted' => '0', - 'entity_types' => array(), - 'field_name' => 'field_camp_weight', - 'foreign keys' => array(), - 'indexes' => array( - 'value' => array( - 0 => 'value', - ), - ), - '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', - ), - 'field_instance' => 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, - ), - 'teaser' => 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' => '2', - ), - ), - ); - - // Translatables - included for use with string extractors like potx. - t('Campaign image'); - t('Campaign link'); - t('Campaign settings'); - t('Campaign text'); - t('Campaign theme'); - t('Weight'); - - return $fields; -} diff --git a/ding_campaign_ctype/ding_campaign_ctype.features.field_base.inc b/ding_campaign_ctype/ding_campaign_ctype.features.field_base.inc deleted file mode 100644 index 853a6ae..0000000 --- a/ding_campaign_ctype/ding_campaign_ctype.features.field_base.inc +++ /dev/null @@ -1,199 +0,0 @@ - 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_ctype/ding_campaign_ctype.features.field_instance.inc b/ding_campaign_ctype/ding_campaign_ctype.features.field_instance.inc deleted file mode 100644 index cacbb1e..0000000 --- a/ding_campaign_ctype/ding_campaign_ctype.features.field_instance.inc +++ /dev/null @@ -1,310 +0,0 @@ - 'ding_campaign', - 'deleted' => 0, - 'description' => '', - 'display' => array( - 'default' => 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' => 'image', - 'settings' => array( - 'preview_image_style' => 'thumbnail', - 'progress_indicator' => 'throbber', - ), - 'type' => 'image_image', - 'weight' => -2, - ), - ); - - // 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, - ), - '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' => 0, - ), - ); - - // 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, - ), - '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, - ), - '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' => -1, - ), - ); - - // 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, - ), - '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' => -3, - ), - ); - - // 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, - ), - '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' => 2, - ), - ); - - // Translatables - // Included for use with string extractors like potx. - t('Campaign image'); - t('Campaign link'); - t('Campaign settings'); - t('Campaign text'); - t('Weight'); - - return $field_instances; -} diff --git a/ding_campaign_ctype/ding_campaign_ctype.features.inc b/ding_campaign_ctype/ding_campaign_ctype.features.inc deleted file mode 100644 index b521d3e..0000000 --- a/ding_campaign_ctype/ding_campaign_ctype.features.inc +++ /dev/null @@ -1,79 +0,0 @@ - "1"); - } -} - -/** - * Implements hook_image_default_styles(). - */ -function ding_campaign_ctype_image_default_styles() { - $styles = array(); - - // Exported image style: ding_campaign_small. - $styles['ding_campaign_small'] = array( - 'name' => 'ding_campaign_small', - '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' => '360', - 'height' => '', - 'upscale' => 0, - ), - 'weight' => '1', - ), - 4 => array( - 'label' => 'Scale and crop', - 'help' => 'Scale and crop will maintain the aspect-ratio of the original image, then crop the larger dimension. This is most useful for creating perfectly square thumbnails without stretching the image.', - 'effect callback' => 'image_scale_and_crop_effect', - 'dimensions callback' => 'image_resize_dimensions', - 'form callback' => 'image_resize_form', - 'summary theme' => 'image_resize_summary', - 'module' => 'image', - 'name' => 'image_scale_and_crop', - 'data' => array( - 'width' => '360', - 'height' => '240', - ), - 'weight' => '2', - ), - ), - ); - - return $styles; -} - -/** - * Implements hook_node_info(). - */ -function ding_campaign_ctype_node_info() { - $items = array( - 'ding_campaign' => array( - 'name' => t('Campaign'), - 'base' => 'node_content', - 'description' => '', - 'has_title' => '1', - 'title_label' => t('Campaign name'), - 'help' => '', - ), - ); - return $items; -} diff --git a/ding_campaign_ctype/ding_campaign_ctype.features.user_permission.inc b/ding_campaign_ctype/ding_campaign_ctype.features.user_permission.inc deleted file mode 100644 index 30de5c2..0000000 --- a/ding_campaign_ctype/ding_campaign_ctype.features.user_permission.inc +++ /dev/null @@ -1,69 +0,0 @@ - 'create ding_campaign content', - 'roles' => array( - 'administrator' => 'administrator', - 'lokalredaktør' => 'lokalredaktør', - 'redaktør' => 'redaktør', - ), - 'module' => 'node', - ); - - // Exported permission: delete any ding_campaign content. - $permissions['delete any ding_campaign content'] = array( - 'name' => 'delete any ding_campaign content', - 'roles' => array( - 'administrator' => 'administrator', - 'lokalredaktør' => 'lokalredaktør', - 'redaktør' => 'redaktør', - ), - 'module' => 'node', - ); - - // Exported permission: delete own ding_campaign content. - $permissions['delete own ding_campaign content'] = array( - 'name' => 'delete own ding_campaign content', - 'roles' => array( - 'administrator' => 'administrator', - 'lokalredaktør' => 'lokalredaktør', - 'redaktør' => 'redaktør', - ), - 'module' => 'node', - ); - - // Exported permission: edit any ding_campaign content. - $permissions['edit any ding_campaign content'] = array( - 'name' => 'edit any ding_campaign content', - 'roles' => array( - 'administrator' => 'administrator', - 'lokalredaktør' => 'lokalredaktør', - 'redaktør' => 'redaktør', - ), - 'module' => 'node', - ); - - // Exported permission: edit own ding_campaign content. - $permissions['edit own ding_campaign content'] = array( - 'name' => 'edit own ding_campaign content', - 'roles' => array( - 'administrator' => 'administrator', - 'lokalredaktør' => 'lokalredaktør', - 'redaktør' => 'redaktør', - ), - 'module' => 'node', - ); - - return $permissions; -} diff --git a/ding_campaign_ctype/ding_campaign_ctype.info b/ding_campaign_ctype/ding_campaign_ctype.info deleted file mode 100644 index 96750e7..0000000 --- a/ding_campaign_ctype/ding_campaign_ctype.info +++ /dev/null @@ -1,28 +0,0 @@ -name = Ding Campaign -description = Ding Campaign Content type -core = 7.x -package = Ding! -php = 5.2.4 -dependencies[] = ctools -dependencies[] = features -dependencies[] = image -dependencies[] = list -dependencies[] = node -dependencies[] = options -dependencies[] = strongarm -dependencies[] = text -dependencies[] = ding_campaign -features[ctools][] = strongarm:strongarm:1 -features[features_api][] = api:1 -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-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 diff --git a/ding_campaign_ctype/ding_campaign_ctype.module b/ding_campaign_ctype/ding_campaign_ctype.module deleted file mode 100644 index 2e8a6af..0000000 --- a/ding_campaign_ctype/ding_campaign_ctype.module +++ /dev/null @@ -1,8 +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 = 1; - $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 = '2'; - $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 = 1; - $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 = '1'; - $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 = 1; - $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 = '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( - 0 => 'main-menu', - ); - $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 = '1'; - $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 = 1; - $export['node_submitted_ding_campaign'] = $strongarm; - - return $export; -} From adbcad70c1d43279184cd28b9b51ed18f833eeb8 Mon Sep 17 00:00:00 2001 From: Jesper Kristensen Date: Tue, 26 Nov 2013 11:37:43 +0100 Subject: [PATCH 40/76] Updated campaing ctype to match the news features version --- ...ing_campaign_ctype.features.field_base.inc | 199 ++++++++ ...campaign_ctype.features.field_instance.inc | 435 ++++++++++++++++++ .../ding_campaign_ctype.features.inc | 20 +- .../ding_campaign_ctype.info | 22 +- .../ding_campaign_ctype.strongarm.inc | 7 - 5 files changed, 661 insertions(+), 22 deletions(-) create mode 100644 modules/ding_campaign_ctype/ding_campaign_ctype.features.field_base.inc create mode 100644 modules/ding_campaign_ctype/ding_campaign_ctype.features.field_instance.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 new file mode 100644 index 0000000..853a6ae --- /dev/null +++ b/modules/ding_campaign_ctype/ding_campaign_ctype.features.field_base.inc @@ -0,0 +1,199 @@ + 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 new file mode 100644 index 0000000..b00ab96 --- /dev/null +++ b/modules/ding_campaign_ctype/ding_campaign_ctype.features.field_instance.inc @@ -0,0 +1,435 @@ + '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' => -2, + ), + ); + + // 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' => 0, + ), + ); + + // 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' => -1, + ), + ); + + // 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' => -3, + ), + ); + + // 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' => 2, + ), + ); + + // Exported field_instance: 'node-ding_campaign-og_group_ref' + $field_instances['node-ding_campaign-og_group_ref'] = array( + 'bundle' => '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' => 'og_group_ref', + 'label' => 'Groups audience', + 'required' => FALSE, + '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( + 'module' => 'og', + 'settings' => array(), + 'type' => 'og_complex', + 'weight' => 31, + ), + ); + + // Translatables + // Included for use with string extractors like potx. + t('Campaign image'); + t('Campaign link'); + t('Campaign settings'); + t('Campaign text'); + t('Groups audience'); + 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 15ca067..d090ca1 100644 --- a/modules/ding_campaign_ctype/ding_campaign_ctype.features.inc +++ b/modules/ding_campaign_ctype/ding_campaign_ctype.features.inc @@ -34,13 +34,14 @@ function ding_campaign_ctype_image_default_styles() { 'module' => 'image', 'name' => 'image_scale', 'data' => array( - 'width' => '180', + 'width' => 180, 'height' => '', 'upscale' => 1, ), - 'weight' => '1', + 'weight' => 1, ), ), + 'label' => 'ding_campaign_w_180', ); // Exported image style: ding_campaign_w_280. @@ -57,13 +58,14 @@ function ding_campaign_ctype_image_default_styles() { 'module' => 'image', 'name' => 'image_scale', 'data' => array( - 'width' => '280', + 'width' => 280, 'height' => '', 'upscale' => 1, ), - 'weight' => '1', + 'weight' => 1, ), ), + 'label' => 'ding_campaign_w_280', ); // Exported image style: ding_campaign_w_380. @@ -80,13 +82,14 @@ function ding_campaign_ctype_image_default_styles() { 'module' => 'image', 'name' => 'image_scale', 'data' => array( - 'width' => '380', + 'width' => 380, 'height' => '', 'upscale' => 1, ), - 'weight' => '1', + 'weight' => 1, ), ), + 'label' => 'ding_campaign_w_380', ); // Exported image style: ding_campaign_w_480. @@ -103,13 +106,14 @@ function ding_campaign_ctype_image_default_styles() { 'module' => 'image', 'name' => 'image_scale', 'data' => array( - 'width' => '480', + 'width' => 480, 'height' => '', 'upscale' => 1, ), - 'weight' => '1', + 'weight' => 1, ), ), + 'label' => 'ding_campaign_w_480', ); return $styles; diff --git a/modules/ding_campaign_ctype/ding_campaign_ctype.info b/modules/ding_campaign_ctype/ding_campaign_ctype.info index 3575455..c3becd7 100644 --- a/modules/ding_campaign_ctype/ding_campaign_ctype.info +++ b/modules/ding_campaign_ctype/ding_campaign_ctype.info @@ -2,7 +2,9 @@ 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_event dependencies[] = features dependencies[] = field_sql_storage dependencies[] = image @@ -14,12 +16,19 @@ dependencies[] = strongarm dependencies[] = text features[ctools][] = strongarm:strongarm:1 features[features_api][] = api:1 -features[field][] = node-ding_campaign-field_camp_image -features[field][] = node-ding_campaign-field_camp_link -features[field][] = node-ding_campaign-field_camp_settings -features[field][] = node-ding_campaign-field_camp_text_full -features[field][] = node-ding_campaign-field_camp_text_plain -features[field][] = node-ding_campaign-field_camp_weight +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-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[field_instance][] = node-ding_campaign-og_group_ref features[image][] = ding_campaign_w_180 features[image][] = ding_campaign_w_280 features[image][] = ding_campaign_w_380 @@ -39,5 +48,4 @@ 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][] = og_group_content_type_ding_campaign features[variable][] = opening_hours_enabled_ding_campaign diff --git a/modules/ding_campaign_ctype/ding_campaign_ctype.strongarm.inc b/modules/ding_campaign_ctype/ding_campaign_ctype.strongarm.inc index 41e3690..af608ae 100644 --- a/modules/ding_campaign_ctype/ding_campaign_ctype.strongarm.inc +++ b/modules/ding_campaign_ctype/ding_campaign_ctype.strongarm.inc @@ -138,13 +138,6 @@ function ding_campaign_ctype_strongarm() { $strongarm->value = 1; $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 = 'og_group_content_type_ding_campaign'; - $strongarm->value = 'omitted'; - $export['og_group_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; From 63ef129161f8af5fb6c4f785dba6afe50c2ceb71 Mon Sep 17 00:00:00 2001 From: Jesper Kristensen Date: Tue, 26 Nov 2013 11:41:06 +0100 Subject: [PATCH 41/76] Removed old features field inc file --- .../ding_campaign_ctype.features.field.inc | 548 ------------------ .../ding_campaign_ctype.info | 12 +- 2 files changed, 10 insertions(+), 550 deletions(-) delete mode 100644 modules/ding_campaign_ctype/ding_campaign_ctype.features.field.inc diff --git a/modules/ding_campaign_ctype/ding_campaign_ctype.features.field.inc b/modules/ding_campaign_ctype/ding_campaign_ctype.features.field.inc deleted file mode 100644 index a1e61de..0000000 --- a/modules/ding_campaign_ctype/ding_campaign_ctype.features.field.inc +++ /dev/null @@ -1,548 +0,0 @@ - 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', - ), - 'field_instance' => 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' => '-2', - ), - ), - ); - - // Exported field: 'node-ding_campaign-field_camp_link'. - $fields['node-ding_campaign-field_camp_link'] = array( - 'field_config' => 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', - ), - 'field_instance' => 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' => '0', - ), - ), - ); - - // Exported field: 'node-ding_campaign-field_camp_settings'. - $fields['node-ding_campaign-field_camp_settings'] = array( - 'field_config' => 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', - ), - 'field_instance' => 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: 'node-ding_campaign-field_camp_text_full'. - $fields['node-ding_campaign-field_camp_text_full'] = array( - 'field_config' => 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', - ), - 'field_instance' => 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' => '-1', - ), - ), - ); - - // Exported field: 'node-ding_campaign-field_camp_text_plain'. - $fields['node-ding_campaign-field_camp_text_plain'] = array( - 'field_config' => 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', - ), - 'field_instance' => 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' => '-3', - ), - ), - ); - - // Exported field: 'node-ding_campaign-field_camp_weight'. - $fields['node-ding_campaign-field_camp_weight'] = array( - 'field_config' => 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', - ), - 'field_instance' => 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' => '2', - ), - ), - ); - - // Translatables - // Included for use with string extractors like potx. - t('Campaign image'); - t('Campaign link'); - t('Campaign settings'); - t('Campaign text'); - t('Weight'); - - return $fields; -} diff --git a/modules/ding_campaign_ctype/ding_campaign_ctype.info b/modules/ding_campaign_ctype/ding_campaign_ctype.info index c3becd7..b720192 100644 --- a/modules/ding_campaign_ctype/ding_campaign_ctype.info +++ b/modules/ding_campaign_ctype/ding_campaign_ctype.info @@ -4,13 +4,14 @@ core = 7.x package = Ding! php = 5.2.4 dependencies[] = ctools +dependencies[] = ding_campaign dependencies[] = ding_event dependencies[] = features -dependencies[] = field_sql_storage dependencies[] = image dependencies[] = list dependencies[] = media -dependencies[] = node +dependencies[] = og +dependencies[] = og_ui dependencies[] = options dependencies[] = strongarm dependencies[] = text @@ -49,3 +50,10 @@ 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 From f2a869dcdb7a19dfdfd6753bcf00cb39bb6bf729 Mon Sep 17 00:00:00 2001 From: Jesper Kristensen Date: Thu, 12 Dec 2013 15:21:37 +0100 Subject: [PATCH 42/76] Update feature with new field groups on the content type --- ...aign_admin.css => ding_campaign.admin.css} | 0 ding_campaign.admin.inc | 14 +- ding_campaign.make | 2 - ding_campaign.module | 69 ++++---- ...ing_campaign_ctype.features.field_base.inc | 52 ++++++ ...campaign_ctype.features.field_instance.inc | 157 +++++++++--------- .../ding_campaign_ctype.features.inc | 2 +- .../ding_campaign_ctype.field_group.inc | 99 +++++++++++ .../ding_campaign_ctype.info | 9 +- .../ding_campaign_ctype.strongarm.inc | 25 ++- plugins/content_types/campaign.inc | 2 +- templates/ding_campaign.tpl.php | 4 +- 12 files changed, 300 insertions(+), 135 deletions(-) rename css/{ding_campaign_admin.css => ding_campaign.admin.css} (100%) create mode 100644 modules/ding_campaign_ctype/ding_campaign_ctype.field_group.inc diff --git a/css/ding_campaign_admin.css b/css/ding_campaign.admin.css similarity index 100% rename from css/ding_campaign_admin.css rename to css/ding_campaign.admin.css diff --git a/ding_campaign.admin.inc b/ding_campaign.admin.inc index d3342d5..9675edd 100644 --- a/ding_campaign.admin.inc +++ b/ding_campaign.admin.inc @@ -1,5 +1,4 @@ nid . ']'] = $v->title; } break; + case 'rule_taxonomy': $q = db_query_range("SELECT tid, name FROM {taxonomy_term_data} WHERE name LIKE(:term)", 0, 5, array(':term' => '%%' . $input . '%%'))->fetchAll(); @@ -251,6 +243,7 @@ function ding_campaign_admin_autocomplete($type, $input) { $matches['[tid:' . $v->tid . ']'] = $v->name; } break; + case 'rule_library': $q = db_query_range("SELECT nid, title FROM {node} WHERE type='ding_library' AND title LIKE(:term)", 0, 5, array(':term' => '%%' . $input . '%%'))->fetchAll(); @@ -258,6 +251,7 @@ function ding_campaign_admin_autocomplete($type, $input) { $matches['[nid:' . $v->nid . ']'] = $v->title; } break; + case 'rule_event': $q = db_query_range("SELECT nid, title FROM {node} WHERE type='ding_event' AND title LIKE(:term)", 0, 5, array(':term' => '%%' . $input . '%%'))->fetchAll(); @@ -265,6 +259,7 @@ function ding_campaign_admin_autocomplete($type, $input) { $matches['[nid:' . $v->nid . ']'] = $v->title; } break; + case 'rule_news': $q = db_query_range("SELECT nid, title FROM {node} WHERE type='ding_news' AND title LIKE(:term)", 0, 5, array(':term' => '%%' . $input . '%%'))->fetchAll(); @@ -273,5 +268,6 @@ function ding_campaign_admin_autocomplete($type, $input) { } break; } + drupal_json_output($matches); } diff --git a/ding_campaign.make b/ding_campaign.make index a223146..3743274 100644 --- a/ding_campaign.make +++ b/ding_campaign.make @@ -11,5 +11,3 @@ projects[ctools][patch][0] = "http://drupal.org/files/ctools-n1925018-12.patch" projects[features][subdir] = "contrib" projects[features][version] = "2.0-beta2" -projects[features_extra][subdir] = "contrib" -projects[features_extra][version] = "1.0-beta1" diff --git a/ding_campaign.module b/ding_campaign.module index fe8b829..ff56f47 100644 --- a/ding_campaign.module +++ b/ding_campaign.module @@ -53,7 +53,7 @@ function ding_campaign_menu() { * Used to define access to ding campaign rules. Limits the menu item only for * ding_campaign node types. * - * @return boolean + * @return bool * TRUE or FALSE value. */ function ding_campaign_rules_access() { @@ -72,7 +72,7 @@ function ding_campaign_rules_access() { } /** - * Implements hook_perimission(). + * Implements hook_permission(). */ function ding_campaign_permission() { $perm = array(); @@ -119,11 +119,12 @@ function ding_campaign_theme($existing, $type, $theme, $path) { * Count of campaigns to display. * @param $offset * Offset of the first campaign in the database. + * @param string $style + * The image style to use. * * @return * HTML formatted string. */ - function ding_campaign_display($context, $count, $offset, $style = 'medium') { $campaigns = ding_campaign_get_campaigns($context, $count, $offset); @@ -211,8 +212,8 @@ function ding_campaign_get_campaigns($context, $limit, $offset) { ORDER BY d.weight DESC', array(':nid' => (int) $nid)) ->fetchAll(); - foreach ($result as $k => $v) { - @$campaigns[$v->cid] += 11; + foreach ($result as $key => $value) { + @$campaigns[$value->cid] += 11; } } @@ -230,13 +231,13 @@ function ding_campaign_get_campaigns($context, $limit, $offset) { ORDER BY d.weight DESC', array(':nid' => (int) $nid)) ->fetchAll(); - foreach ($result as $k => $v) { - @$campaigns[$v->cid] += 10; + foreach ($result as $key => $value) { + @$campaigns[$value->cid] += 10; } } // Process page campaigns. - if ($context['page'] != NULL && isset($context['page']->nid)) { + if ($context['page'] != NULL && isset($context['page']->nid)) { $nid = $context['page']->nid; $result = db_query('SELECT r.cid @@ -246,11 +247,11 @@ function ding_campaign_get_campaigns($context, $limit, $offset) { AND n.status = 1 AND r.cid = d.cid AND r.cid = n.nid - ORDER BY d.weight DESC', array(':nid' => (int)$nid)) + ORDER BY d.weight DESC', array(':nid' => (int) $nid)) ->fetchAll(); - foreach ($result as $k => $v) { - @$campaigns[$v->cid] += 9; + foreach ($result as $key => $value) { + @$campaigns[$value->cid] += 9; } } @@ -265,22 +266,21 @@ function ding_campaign_get_campaigns($context, $limit, $offset) { ->fetchAll(); $path = drupal_get_path_alias($_GET['q']); - foreach ($result as $k => $v) { - $page_match = drupal_match_path($path, $v->rule); + foreach ($result as $key => $value) { + $page_match = drupal_match_path($path, $value->rule); if ($path != $_GET['q']) { - $page_match = $page_match || drupal_match_path($_GET['q'], $v->rule); + $page_match = $page_match || drupal_match_path($_GET['q'], $value->rule); } if ($page_match) { - @$campaigns[$v->cid] += 8; + @$campaigns[$value->cid] += 8; } } // Process search campaigns. if ($context['search_term'] != NULL) { $terms = trim(drupal_strtolower(check_plain($context['search_term']))); - $condition = ''; // Multiple keywords, comma and/or space separated. if (strpos($terms, ',') || strpos($terms, ' ')) { @@ -303,8 +303,8 @@ function ding_campaign_get_campaigns($context, $limit, $offset) { ORDER BY d.weight DESC') ->fetchAll(); - foreach ($result as $k => $v) { - @$campaigns[$v->cid] += 7; + foreach ($result as $key => $value) { + @$campaigns[$value->cid] += 7; } } @@ -319,11 +319,11 @@ function ding_campaign_get_campaigns($context, $limit, $offset) { AND n.status = 1 AND r.cid = d.cid AND r.cid = n.nid - ORDER BY d.weight DESC', array(':nid' => (int)$nid)) + ORDER BY d.weight DESC', array(':nid' => (int) $nid)) ->fetchAll(); - foreach ($result as $k => $v) { - @$campaigns[$v->cid] += 5; + foreach ($result as $key => $value) { + @$campaigns[$value->cid] += 5; } } @@ -338,11 +338,11 @@ function ding_campaign_get_campaigns($context, $limit, $offset) { AND n.status = 1 AND r.cid = d.cid AND r.cid = n.nid - ORDER BY d.weight DESC', array(':tid' => (int)$tid)) + ORDER BY d.weight DESC', array(':tid' => (int) $tid)) ->fetchAll(); - foreach ($result as $k => $v) { - @$campaigns[$v->cid] += 3; + foreach ($result as $key => $value) { + @$campaigns[$value->cid] += 3; } } @@ -356,9 +356,9 @@ function ding_campaign_get_campaigns($context, $limit, $offset) { ORDER BY d.weight DESC') ->fetchAll(); - foreach ($result as $k => $v) { - if (!isset($campaigns[$v->cid]) || $campaigns[$v->cid] == 0) { - $campaigns[$v->cid] = (mt_rand(1, 10) / 10); + foreach ($result as $key => $value) { + if (!isset($campaigns[$value->cid]) || $campaigns[$value->cid] == 0) { + $campaigns[$value->cid] = (mt_rand(1, 10) / 10); } } @@ -372,9 +372,9 @@ function ding_campaign_get_campaigns($context, $limit, $offset) { function ding_campaign_form_alter(&$form, &$form_state, $form_id) { // Alter the Campaign addition form. if ($form_id == 'ding_campaign_node_form') { - // Remove the 'N/A' type radiobox. + // Remove the 'N/A' type radio box. unset($form['field_camp_settings'][$form['field_camp_settings']['#language']]['#options']['_none']); - // Remove the 'None' value from weight dropdown. + // Remove the 'None' value from weight drop-down. unset($form['field_camp_weight'][$form['field_camp_weight']['#language']]['#options']['_none']); $form['#validate'] = array('ding_campaign_campaign_node_form_validate'); @@ -571,7 +571,7 @@ function ding_campaign_node_delete($node) { /** * Fetch available campaigns. * - * @return + * @return array * Array of campaigns with ids and titles. */ function ding_campaign_get_list() { @@ -608,26 +608,33 @@ function ding_campaign_campaign_node_form_validate($form, &$form_state) { } /** * Get rule name by node type. + * * @param string $node_type * Node type. + * * @return string * Rule name. */ function _ding_campaign_rule_by_type($node_type) { - // Set rule type + // Set rule type. switch ($node_type) { case 'library': $type = 'rule_library'; break; + case 'ding_event': $type = 'rule_event'; break; + case 'ding_news': $type = 'rule_news'; break; + default: $type = 'rule_page'; + break; } + return $type; } 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 853a6ae..050ae98 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 @@ -10,6 +10,58 @@ function ding_campaign_ctype_field_default_field_bases() { $field_bases = array(); + // Exported field_base: 'ding_campaign_group_ref' + $field_bases['ding_campaign_group_ref'] = array( + 'active' => 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_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 b00ab96..1753c37 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 @@ -10,6 +10,78 @@ function ding_campaign_ctype_field_default_field_instances() { $field_instances = array(); + // Exported field_instance: 'node-ding_campaign-ding_campaign_group_ref' + $field_instances['node-ding_campaign-ding_campaign_group_ref'] = array( + 'bundle' => '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_image' $field_instances['node-ding_campaign-field_camp_image'] = array( 'bundle' => 'ding_campaign', @@ -80,7 +152,7 @@ function ding_campaign_ctype_field_default_field_instances() { 'progress_indicator' => 'throbber', ), 'type' => 'media_generic', - 'weight' => -2, + 'weight' => 4, ), ); @@ -133,7 +205,7 @@ function ding_campaign_ctype_field_default_field_instances() { 'size' => 60, ), 'type' => 'text_textfield', - 'weight' => 0, + 'weight' => 6, ), ); @@ -187,7 +259,7 @@ function ding_campaign_ctype_field_default_field_instances() { 'module' => 'options', 'settings' => array(), 'type' => 'options_buttons', - 'weight' => -4, + 'weight' => 4, ), ); @@ -240,7 +312,7 @@ function ding_campaign_ctype_field_default_field_instances() { 'rows' => 5, ), 'type' => 'text_textarea', - 'weight' => -1, + 'weight' => 5, ), ); @@ -293,7 +365,7 @@ function ding_campaign_ctype_field_default_field_instances() { 'rows' => 5, ), 'type' => 'text_textarea', - 'weight' => -3, + 'weight' => 4, ), ); @@ -347,78 +419,7 @@ function ding_campaign_ctype_field_default_field_instances() { 'module' => 'options', 'settings' => array(), 'type' => 'options_select', - 'weight' => 2, - ), - ); - - // Exported field_instance: 'node-ding_campaign-og_group_ref' - $field_instances['node-ding_campaign-og_group_ref'] = array( - 'bundle' => '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' => 'og_group_ref', - 'label' => 'Groups audience', - 'required' => FALSE, - '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( - 'module' => 'og', - 'settings' => array(), - 'type' => 'og_complex', - 'weight' => 31, + 'weight' => 5, ), ); @@ -428,7 +429,7 @@ function ding_campaign_ctype_field_default_field_instances() { t('Campaign link'); t('Campaign settings'); t('Campaign text'); - t('Groups audience'); + t('Libraries and Groups'); 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 d090ca1..29dc513 100644 --- a/modules/ding_campaign_ctype/ding_campaign_ctype.features.inc +++ b/modules/ding_campaign_ctype/ding_campaign_ctype.features.inc @@ -127,7 +127,7 @@ function ding_campaign_ctype_node_info() { 'ding_campaign' => array( 'name' => t('Campaign'), 'base' => 'node_content', - 'description' => '', + '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' => '', diff --git a/modules/ding_campaign_ctype/ding_campaign_ctype.field_group.inc b/modules/ding_campaign_ctype/ding_campaign_ctype.field_group.inc new file mode 100644 index 0000000..60df614 --- /dev/null +++ b/modules/ding_campaign_ctype/ding_campaign_ctype.field_group.inc @@ -0,0 +1,99 @@ +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', + ), + '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 => 'field_camp_settings', + 1 => 'field_camp_weight', + 2 => 'ding_campaign_group_ref', + ), + '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 index b720192..1217322 100644 --- a/modules/ding_campaign_ctype/ding_campaign_ctype.info +++ b/modules/ding_campaign_ctype/ding_campaign_ctype.info @@ -6,7 +6,9 @@ php = 5.2.4 dependencies[] = ctools dependencies[] = ding_campaign dependencies[] = ding_event +dependencies[] = entityreference dependencies[] = features +dependencies[] = field_group dependencies[] = image dependencies[] = list dependencies[] = media @@ -17,19 +19,23 @@ dependencies[] = strongarm dependencies[] = text features[ctools][] = strongarm:strongarm:1 features[features_api][] = api:1 +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_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[field_instance][] = node-ding_campaign-og_group_ref features[image][] = ding_campaign_w_180 features[image][] = ding_campaign_w_280 features[image][] = ding_campaign_w_380 @@ -57,3 +63,4 @@ features_exclude[field][node-ding_campaign-field_camp_text_full] = node-ding_cam 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.strongarm.inc b/modules/ding_campaign_ctype/ding_campaign_ctype.strongarm.inc index af608ae..1ea55dd 100644 --- a/modules/ding_campaign_ctype/ding_campaign_ctype.strongarm.inc +++ b/modules/ding_campaign_ctype/ding_campaign_ctype.strongarm.inc @@ -21,7 +21,7 @@ function ding_campaign_ctype_strongarm() { $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 = 1; + $strongarm->value = 0; $export['comment_default_mode_ding_campaign'] = $strongarm; $strongarm = new stdClass(); @@ -35,28 +35,28 @@ function ding_campaign_ctype_strongarm() { $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 = '0'; + $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 = 1; + $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 = '1'; + $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 = 1; + $strongarm->value = 0; $export['comment_subject_field_ding_campaign'] = $strongarm; $strongarm = new stdClass(); @@ -88,7 +88,14 @@ function ding_campaign_ctype_strongarm() { ), ), 'extra_fields' => array( - 'form' => array(), + 'form' => array( + 'title' => array( + 'weight' => '0', + ), + 'path' => array( + 'weight' => '4', + ), + ), 'display' => array(), ), ); @@ -98,7 +105,7 @@ function ding_campaign_ctype_strongarm() { $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 = '2'; + $strongarm->value = '0'; $export['language_content_type_ding_campaign'] = $strongarm; $strongarm = new stdClass(); @@ -128,14 +135,14 @@ function ding_campaign_ctype_strongarm() { $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 = '1'; + $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 = 1; + $strongarm->value = 0; $export['node_submitted_ding_campaign'] = $strongarm; $strongarm = new stdClass(); diff --git a/plugins/content_types/campaign.inc b/plugins/content_types/campaign.inc index 7c03dd4..ea1c90e 100644 --- a/plugins/content_types/campaign.inc +++ b/plugins/content_types/campaign.inc @@ -80,7 +80,7 @@ function ding_campaign_campaign_content_type_edit_form($form, &$form_state) { '#default_value' => (isset($form_state['conf']['ding_campaign_image_style'])) ? $form_state['conf']['ding_campaign_image_style'] : 'medium', ); - drupal_add_css(drupal_get_path('module', 'ding_campaign') . '/css/ding_campaign_admin.css'); + drupal_add_css(drupal_get_path('module', 'ding_campaign') . '/css/ding_campaign.admin.css'); return $form; } diff --git a/templates/ding_campaign.tpl.php b/templates/ding_campaign.tpl.php index 21e1683..e23e2b7 100644 --- a/templates/ding_campaign.tpl.php +++ b/templates/ding_campaign.tpl.php @@ -1,10 +1,8 @@ - - + From 0a36704fa7ce2c8943a2dce514a5e6625f30a73a Mon Sep 17 00:00:00 2001 From: Jesper Kristensen Date: Thu, 12 Dec 2013 15:25:10 +0100 Subject: [PATCH 43/76] Added field group to content type --- modules/ding_campaign_ctype/ding_campaign_ctype.features.inc | 4 ++++ modules/ding_campaign_ctype/ding_campaign_ctype.info | 1 + 2 files changed, 5 insertions(+) diff --git a/modules/ding_campaign_ctype/ding_campaign_ctype.features.inc b/modules/ding_campaign_ctype/ding_campaign_ctype.features.inc index 29dc513..5c7282b 100644 --- a/modules/ding_campaign_ctype/ding_campaign_ctype.features.inc +++ b/modules/ding_campaign_ctype/ding_campaign_ctype.features.inc @@ -8,6 +8,10 @@ * Implements hook_ctools_plugin_api(). */ function ding_campaign_ctype_ctools_plugin_api() { + 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.info b/modules/ding_campaign_ctype/ding_campaign_ctype.info index 1217322..c58359a 100644 --- a/modules/ding_campaign_ctype/ding_campaign_ctype.info +++ b/modules/ding_campaign_ctype/ding_campaign_ctype.info @@ -17,6 +17,7 @@ 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:1 features[field_base][] = ding_campaign_group_ref From bbbba9963e0f64bb04e1b8a2100592ac3cfffc3e Mon Sep 17 00:00:00 2001 From: Jesper Kristensen Date: Thu, 12 Dec 2013 16:12:06 +0100 Subject: [PATCH 44/76] Fixed campaigns rules access callback --- ding_campaign.module | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/ding_campaign.module b/ding_campaign.module index ff56f47..540d064 100644 --- a/ding_campaign.module +++ b/ding_campaign.module @@ -27,7 +27,7 @@ function ding_campaign_menu() { 'description' => 'Edit campaign rules', 'page callback' => 'ding_campaign_rules_admin', 'page arguments' => array(1), - 'access arguments' => array('access campaign rules'), + 'access arguments' => array(1), 'access callback' => array('ding_campaign_rules_access'), 'file' => 'ding_campaign.admin.inc', 'type' => MENU_LOCAL_TASK, @@ -56,16 +56,9 @@ function ding_campaign_menu() { * @return bool * TRUE or FALSE value. */ -function ding_campaign_rules_access() { - $item = menu_get_item(); - $node = NULL; - - if (isset($item['page_arguments'][0]->type)) { - $node = $item['page_arguments'][0]; - - if ($node->type == 'ding_campaign') { - return TRUE; - } +function ding_campaign_rules_access($node) { + if ($node->type == 'ding_campaign') { + return TRUE; } return FALSE; From 3fa3c66ca71be81bf71e61457b8d454293ffc004 Mon Sep 17 00:00:00 2001 From: Jesper Kristensen Date: Thu, 12 Dec 2013 20:20:21 +0100 Subject: [PATCH 45/76] Changed the output to be more dynamic using render arrays --- ding_campaign.module | 206 +++++++++++++++--------- templates/ding-campaign-wrapper.tpl.php | 9 ++ templates/ding-campaign.tpl.php | 25 +++ templates/ding_campaign.tpl.php | 8 - 4 files changed, 165 insertions(+), 83 deletions(-) create mode 100644 templates/ding-campaign-wrapper.tpl.php create mode 100644 templates/ding-campaign.tpl.php delete mode 100644 templates/ding_campaign.tpl.php diff --git a/ding_campaign.module b/ding_campaign.module index 540d064..289b19e 100644 --- a/ding_campaign.module +++ b/ding_campaign.module @@ -4,7 +4,6 @@ * Provides campaign feature to various node types in Ding. */ -define('DING_CAMPAIGN_PATH', drupal_get_path('module', 'ding_campaign')); define('DING_CAMPAIGN_DEFAULT_COUNT', 3); /** @@ -53,6 +52,9 @@ function ding_campaign_menu() { * Used to define access to ding campaign rules. Limits the menu item only for * ding_campaign node types. * + * @param entity $node + * The node loaded in the menu callback. + * * @return bool * TRUE or FALSE value. */ @@ -68,115 +70,169 @@ function ding_campaign_rules_access($node) { * Implements hook_permission(). */ function ding_campaign_permission() { - $perm = array(); - - $perm['access campaign rules'] = array( - 'title' => t('Access campaign rules'), - 'description' => t('Enable access to campaign nodes display rules'), + return array( + 'access campaign rules' => array( + 'title' => t('Access campaign rules'), + 'description' => t('Enable access to campaign nodes display rules'), + ), ); - - return $perm; } /** * Implements hook_admin_paths(). + * + * Ensures that the paths given is handled in the administration overlay. */ function ding_campaign_admin_paths() { - $paths = array( + return array( 'node/*/campaign_rules' => TRUE, ); - return $paths; } /** * Implements hook_theme(). */ function ding_campaign_theme($existing, $type, $theme, $path) { - $hooks = array(); - - $hooks['ding_campaign'] = array( - 'variables' => array('content' => NULL), - 'template' => 'ding_campaign', - 'path' => DING_CAMPAIGN_PATH . '/templates/', + return array( + 'ding_campaign_wrapper' => array( + 'variables' => array( + 'content' => NULL, + ), + 'template' => 'ding-campaign-wrapper', + 'path' => $path . '/templates', + ), + 'ding_campaign' => array( + 'variables' => array( + 'type' => NULL, + 'link' => NULL, + 'image' => NULL, + 'text' => NULL, + ), + 'template' => 'ding-campaign', + 'path' => $path . '/templates', + ), ); +} - return $hooks; +/** + * Implements hook_preprocess_ding_campaign(). + * + * Add template suggestions that can be used by the base theme. + */ +function template_preprocess_ding_campaign(&$variables) { + $variables['theme_hook_suggestions'][] = 'ding_campaign__' . $variables['type']; } /** - * Displays certain campaigns. + * Create a render array campaigns to display in a given context. * - * @param $context - * Display context used. - * @param $count - * Count of campaigns to display. - * @param $offset + * @param array $context + * Defines the context that the campaign should be displayed in. + * @param int $count + * The number of campaigns to display. + * @param int $offset * Offset of the first campaign in the database. * @param string $style - * The image style to use. + * The image style to use for the campaigns. * - * @return - * HTML formatted string. + * @return array + * Render array with the campaigns found. */ function ding_campaign_display($context, $count, $offset, $style = 'medium') { + $content = array( + '#theme' => 'ding_campaign_wrapper', + '#content' => array(), + ); + + // Get node id's for the campaign nodes matching the context. $campaigns = ding_campaign_get_campaigns($context, $count, $offset); - // There is at least one result. - if (is_array($campaigns) && count($campaigns) > 0) { - $block = ''; + // @todo whey is context null on front page. + + // @todo add cache based on the three parameters given. + + // If any campaigns where found. + if (!empty($campaigns)) { + // Load campaign nodes (use entity load to utilize entity cache). + $campaigns = entity_load('node', array_values($campaigns)); // Loop through campaigns. - foreach ($campaigns as $k => $v) { - $node = node_load($v); - $content = ''; - - $camp_settings = field_get_items('node', $node, 'field_camp_settings'); - - $base_class = 'ding-campaign-item'; - // Select the display for campaign type. - switch ($camp_settings[0]['value']) { - case 'plain': - $camp_link = field_get_items('node', $node, 'field_camp_link'); - $camp_text_plain = field_get_items('node', $node, 'field_camp_text_plain'); - $content = ''; - break; - - case 'image': - $camp_link = field_get_items('node', $node, 'field_camp_link'); - $camp_image = field_get_items('node', $node, 'field_camp_image'); - - $image_title = field_get_items('file', (object) ($camp_image[0]), 'field_file_image_title_text'); - $image_title = $image_title[0]['safe_value']; - $image_alt = field_get_items('file', (object) ($camp_image[0]), 'field_file_image_alt_text'); - $image_alt = $image_alt[0]['safe_value']; - - if (empty($image_alt)) { - $image_alt = $image_title; - } - - $image_tag = theme('image_style', array( - 'style_name' => $style, - 'path' => $camp_image[0]['uri'], - 'alt' => $image_alt, - 'title' => $image_title, - )); - - $link_tag = l($image_tag, $camp_link[0]['value'], array('html' => TRUE, 'absolute' => TRUE, 'attributes' => array('target' => '_blank'))); - $content = '
' . $link_tag . '
'; - break; - - case 'full': - $camp_text_full = field_get_items('node', $node, 'field_camp_text_full'); - $content = '
' . $camp_text_full[0]['safe_value'] . '
'; - break; + foreach ($campaigns as $campaign) { + // User entity wrapper to access fields. + $wrapper = entity_metadata_wrapper('node', $campaign); + + // Get campaign type. + $type = $wrapper->field_camp_settings->value(); + + // Default render array. + $current = array( + '#theme' => 'ding_campaign', + '#type' => $type, + '#weight' => 0, + ); + + // Get link value. + $link = $wrapper->field_camp_link->value(); + if (!empty($link)) { + $current['#link'] = array( + '#theme' => 'link', + '#text' => $campaign->title, + '#path' => $link, + '#options' => array( + 'attributes' => array( + 'class' => array( + 'ding-campaing--link', + ), + 'target' => '_blank', + ), + 'html' => FALSE, + 'absolute' => TRUE, + ), + ); + } + // Get text both plain and full. + $text = $wrapper->field_camp_text_plain->value(); + $text = !empty($text) ? $text : $wrapper->field_camp_text_full->value(); + if (!empty($text)) { + $current['#text'] = array( + 'content' => $text, + ); } - $theme = 'ding_campaign'; - $block .= theme($theme, array('content' => $content)); + // Get image. + $image = $wrapper->field_camp_image->value(); + if (!empty($image)) { + $current['#image'] = array( + '#theme' => 'image_style', + '#style_name' => $style, + '#path' => $image['uri'], + '#title' => isset($image['title']) ? $image['title'] : $campaign->title, + '#alt' => isset($image['alt']) ? $image['alt'] : $campaign->title, + ); + + // Check if a link around the image is possible. + if (!empty($link)) { + // Sadly the link theme function do not generate children. + $image = $current['#image']; + $current['#image'] = $current['#link']; + $current['#image']['#text'] = drupal_render($image); + $current['#image']['#options']['html'] = TRUE; + } + } + + // Get weight. + $weight = $wrapper->field_camp_weight->value(); + if (!empty($weight)) { + $current['#weight'] = $weight; + } + + // Add current campaign to content array. + $content['#content'][] = $current; } - return $block; } + + return $content; } /** diff --git a/templates/ding-campaign-wrapper.tpl.php b/templates/ding-campaign-wrapper.tpl.php new file mode 100644 index 0000000..f92277b --- /dev/null +++ b/templates/ding-campaign-wrapper.tpl.php @@ -0,0 +1,9 @@ + +
+ +
diff --git a/templates/ding-campaign.tpl.php b/templates/ding-campaign.tpl.php new file mode 100644 index 0000000..4f82860 --- /dev/null +++ b/templates/ding-campaign.tpl.php @@ -0,0 +1,25 @@ + +
+ + + + + + + + + +
diff --git a/templates/ding_campaign.tpl.php b/templates/ding_campaign.tpl.php deleted file mode 100644 index e23e2b7..0000000 --- a/templates/ding_campaign.tpl.php +++ /dev/null @@ -1,8 +0,0 @@ - - From 94fdc1be3f24d9538ee8dead4eda696fdcc1ecf2 Mon Sep 17 00:00:00 2001 From: Jesper Kristensen Date: Thu, 12 Dec 2013 20:27:50 +0100 Subject: [PATCH 46/76] Fixed classes in tpl files --- templates/ding-campaign-wrapper.tpl.php | 2 +- templates/ding-campaign.tpl.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/templates/ding-campaign-wrapper.tpl.php b/templates/ding-campaign-wrapper.tpl.php index f92277b..b2fdc57 100644 --- a/templates/ding-campaign-wrapper.tpl.php +++ b/templates/ding-campaign-wrapper.tpl.php @@ -4,6 +4,6 @@ * Default template for image campaigns. */ ?> -
+
diff --git a/templates/ding-campaign.tpl.php b/templates/ding-campaign.tpl.php index 4f82860..ba0bf4f 100644 --- a/templates/ding-campaign.tpl.php +++ b/templates/ding-campaign.tpl.php @@ -8,11 +8,12 @@ * Variables: * - $type: The type of campaign (image, plain, text). * - $link: Link to internal or external source. - * - $image: The image from the campaign. + * - $image: The image from the campaign, if link present the image is wrapped + * in the link. * - $text: Campaign text. */ ?> -
+
From 5b79e8d33c9622ad5e1951cc942e62c7a85aae7d Mon Sep 17 00:00:00 2001 From: Jesper Kristensen Date: Fri, 13 Dec 2013 09:57:24 +0100 Subject: [PATCH 47/76] Fixed menu callback for configuration page --- ding_campaign.admin.inc | 2 +- ding_campaign.module | 18 +++++++----------- plugins/content_types/campaign.inc | 2 +- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/ding_campaign.admin.inc b/ding_campaign.admin.inc index 9675edd..133e47d 100644 --- a/ding_campaign.admin.inc +++ b/ding_campaign.admin.inc @@ -7,7 +7,7 @@ /** * Module main settings lay here. */ -function ding_campaign_configure($form, $form_state) { +function ding_campaign_admin_settings($form, $form_state) { $types = node_type_get_names(); // Some key renaming routine, required in further module checks. diff --git a/ding_campaign.module b/ding_campaign.module index 289b19e..c952eb2 100644 --- a/ding_campaign.module +++ b/ding_campaign.module @@ -4,20 +4,18 @@ * Provides campaign feature to various node types in Ding. */ -define('DING_CAMPAIGN_DEFAULT_COUNT', 3); - /** * Implements hook_menu(). */ function ding_campaign_menu() { $items = array(); - $items['admin/config/ding/campaign'] = array( - 'title' => 'Ding! Campaign', - 'description' => 'Configure the Ding! campaign system.', + $items['admin/config/ding/campaigns'] = array( + 'title' => 'Campaigns', + 'description' => 'Configure the campaigns.', 'page callback' => 'drupal_get_form', - 'page arguments' => array('ding_campaign_configure'), - 'access arguments' => array('access administration pages'), + 'page arguments' => array('ding_campaign_admin_settings'), + 'access arguments' => array('administer site configuration'), 'file' => 'ding_campaign.admin.inc', ); @@ -147,10 +145,6 @@ function ding_campaign_display($context, $count, $offset, $style = 'medium') { // Get node id's for the campaign nodes matching the context. $campaigns = ding_campaign_get_campaigns($context, $count, $offset); - // @todo whey is context null on front page. - - // @todo add cache based on the three parameters given. - // If any campaigns where found. if (!empty($campaigns)) { // Load campaign nodes (use entity load to utilize entity cache). @@ -247,6 +241,8 @@ function ding_campaign_display($context, $count, $offset, $style = 'medium') { function ding_campaign_get_campaigns($context, $limit, $offset) { $campaigns = array(); + // @todo add cache based on the three parameters given. + // Process event campaigns. if ($context['page'] != NULL && isset($context['page']->nid) && $context['page']->type == 'ding_event') { $nid = $context['page']->nid; diff --git a/plugins/content_types/campaign.inc b/plugins/content_types/campaign.inc index ea1c90e..e63512d 100644 --- a/plugins/content_types/campaign.inc +++ b/plugins/content_types/campaign.inc @@ -52,7 +52,7 @@ function ding_campaign_campaign_content_type_edit_form($form, &$form_state) { '#type' => 'textfield', '#title' => t('Campaign count'), '#description' => t('The maximum number of campaigns to display'), - '#default_value' => (isset($form_state['conf']['ding_campaign_count'])) ? $form_state['conf']['ding_campaign_count'] : DING_CAMPAIGN_DEFAULT_COUNT, + '#default_value' => (isset($form_state['conf']['ding_campaign_count'])) ? $form_state['conf']['ding_campaign_count'] : 3, '#size' => 2, '#maxlength' => 2, ); From e621f6d85078627b97f7775f2a5ff90de2963d36 Mon Sep 17 00:00:00 2001 From: Jesper Kristensen Date: Sat, 14 Dec 2013 22:28:45 +0100 Subject: [PATCH 48/76] Ensured that the campaign wrapper div is only outputted when campaign exists --- ding_campaign.module | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ding_campaign.module b/ding_campaign.module index c952eb2..9df0be0 100644 --- a/ding_campaign.module +++ b/ding_campaign.module @@ -137,16 +137,19 @@ function template_preprocess_ding_campaign(&$variables) { * Render array with the campaigns found. */ function ding_campaign_display($context, $count, $offset, $style = 'medium') { - $content = array( - '#theme' => 'ding_campaign_wrapper', - '#content' => array(), - ); + $content = array(); // Get node id's for the campaign nodes matching the context. $campaigns = ding_campaign_get_campaigns($context, $count, $offset); // If any campaigns where found. if (!empty($campaigns)) { + // Set outer wrapper. + $content = array( + '#theme' => 'ding_campaign_wrapper', + '#content' => array(), + ); + // Load campaign nodes (use entity load to utilize entity cache). $campaigns = entity_load('node', array_values($campaigns)); From bf30f5fefab38aaa83043e74c89e15de076d47f0 Mon Sep 17 00:00:00 2001 From: Jesper Kristensen Date: Mon, 3 Feb 2014 12:28:28 +0100 Subject: [PATCH 49/76] Removed comment from drush make in the makefile --- ding_campaign.make | 2 -- 1 file changed, 2 deletions(-) diff --git a/ding_campaign.make b/ding_campaign.make index 3743274..f93e11c 100644 --- a/ding_campaign.make +++ b/ding_campaign.make @@ -1,5 +1,3 @@ -; This file was auto-generated by drush make - core = 7.x api = 2 From 1ffd61bb95799631cfbcae04be12becc5c832f04 Mon Sep 17 00:00:00 2001 From: Jesper Kristensen Date: Tue, 18 Feb 2014 10:37:45 +0100 Subject: [PATCH 50/76] Updated contrib module ctools --- ding_campaign.make | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ding_campaign.make b/ding_campaign.make index 3743274..d96c112 100644 --- a/ding_campaign.make +++ b/ding_campaign.make @@ -5,7 +5,7 @@ api = 2 ; Projects projects[ctools][subdir] = "contrib" -projects[ctools][version] = "1.3" +projects[ctools][version] = "1.4" projects[ctools][patch][0] = "http://drupal.org/files/ctools-n1925018-12.patch" projects[features][subdir] = "contrib" From 2ad11a85e8cefaab50e04aa996804f383c3ad439 Mon Sep 17 00:00:00 2001 From: Jesper Kristensen Date: Tue, 18 Feb 2014 11:05:46 +0100 Subject: [PATCH 51/76] Removed ctools patch from make file --- ding_campaign.make | 1 - 1 file changed, 1 deletion(-) diff --git a/ding_campaign.make b/ding_campaign.make index d96c112..618f585 100644 --- a/ding_campaign.make +++ b/ding_campaign.make @@ -6,7 +6,6 @@ api = 2 ; Projects projects[ctools][subdir] = "contrib" projects[ctools][version] = "1.4" -projects[ctools][patch][0] = "http://drupal.org/files/ctools-n1925018-12.patch" projects[features][subdir] = "contrib" projects[features][version] = "2.0-beta2" From 4286692ee25acbccb8666ad8dd15da5fadf80eee Mon Sep 17 00:00:00 2001 From: Jesper Kristensen Date: Wed, 30 Apr 2014 12:33:45 +0200 Subject: [PATCH 52/76] Removed array wrapper around access callback --- ding_campaign.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ding_campaign.module b/ding_campaign.module index 9df0be0..dc75fb7 100644 --- a/ding_campaign.module +++ b/ding_campaign.module @@ -25,7 +25,7 @@ function ding_campaign_menu() { 'page callback' => 'ding_campaign_rules_admin', 'page arguments' => array(1), 'access arguments' => array(1), - 'access callback' => array('ding_campaign_rules_access'), + 'access callback' => 'ding_campaign_rules_access', 'file' => 'ding_campaign.admin.inc', 'type' => MENU_LOCAL_TASK, 'weight' => 2, From 4efc739e90da4b9fd288b1b6431108bdf6cb235b Mon Sep 17 00:00:00 2001 From: Jesper Kristensen Date: Wed, 30 Apr 2014 12:33:45 +0200 Subject: [PATCH 53/76] Removed array wrapper around access callback --- ding_campaign.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ding_campaign.module b/ding_campaign.module index 9df0be0..dc75fb7 100644 --- a/ding_campaign.module +++ b/ding_campaign.module @@ -25,7 +25,7 @@ function ding_campaign_menu() { 'page callback' => 'ding_campaign_rules_admin', 'page arguments' => array(1), 'access arguments' => array(1), - 'access callback' => array('ding_campaign_rules_access'), + 'access callback' => 'ding_campaign_rules_access', 'file' => 'ding_campaign.admin.inc', 'type' => MENU_LOCAL_TASK, 'weight' => 2, From 0a5c79e95fc31b09de0d3041cbd7fc9a62ebd7fe Mon Sep 17 00:00:00 2001 From: Jesper Kristensen Date: Tue, 6 May 2014 13:46:29 +0200 Subject: [PATCH 54/76] Updated features to version 2.0 --- ding_campaign.make | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ding_campaign.make b/ding_campaign.make index 618f585..7967ba1 100644 --- a/ding_campaign.make +++ b/ding_campaign.make @@ -8,5 +8,5 @@ projects[ctools][subdir] = "contrib" projects[ctools][version] = "1.4" projects[features][subdir] = "contrib" -projects[features][version] = "2.0-beta2" +projects[features][version] = "2.0" From 9e88e50053fdd5b7b639135cc806e958dc01af0b Mon Sep 17 00:00:00 2001 From: Jesper Kristensen Date: Thu, 15 Jan 2015 10:52:45 +0100 Subject: [PATCH 55/76] Issue #137 by cableman: Updated ctools in makefile to fix missing argument warnings --- ding_campaign.make | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ding_campaign.make b/ding_campaign.make index de4ab4d..5453998 100644 --- a/ding_campaign.make +++ b/ding_campaign.make @@ -3,7 +3,7 @@ api = 2 ; Projects projects[ctools][subdir] = "contrib" -projects[ctools][version] = "1.4" +projects[ctools][version] = "1.5" projects[features][subdir] = "contrib" projects[features][version] = "2.0" From 0f5afbb40b1ebb0ed450968c6c729fdeaab9950c Mon Sep 17 00:00:00 2001 From: Martin Cording Date: Tue, 15 Jul 2014 09:36:31 +0200 Subject: [PATCH 56/76] 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 57/76] 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 58/76] 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 59/76] 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 60/76] 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 61/76] 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 62/76] 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 63/76] 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 64/76] 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 65/76] 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 66/76] 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 67/76] 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 68/76] 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 69/76] 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 70/76] 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 71/76] 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 72/76] 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 4167bf4035eaf9b8604063e233f5541c89bc54da Mon Sep 17 00:00:00 2001 From: Jesper Kristensen Date: Thu, 20 Aug 2015 12:47:23 +0200 Subject: [PATCH 73/76] Security: Updated ctools to version 1.9 --- ding_campaign.make | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ding_campaign.make b/ding_campaign.make index 5453998..c143f47 100644 --- a/ding_campaign.make +++ b/ding_campaign.make @@ -3,7 +3,7 @@ api = 2 ; Projects projects[ctools][subdir] = "contrib" -projects[ctools][version] = "1.5" +projects[ctools][version] = "1.9" projects[features][subdir] = "contrib" projects[features][version] = "2.0" From bf0894ad388cce75d1908859fcc432780ea0836f Mon Sep 17 00:00:00 2001 From: Martin Cording Date: Tue, 25 Aug 2015 20:41:12 +0200 Subject: [PATCH 74/76] 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 75/76] 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 76/76] 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" +