Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
0f5afbb
case 4349 - Clear cache upon saving rules.
Jul 15, 2014
9b0e9e5
case 4384 - Prevent empty rendered campaigns.
Jul 15, 2014
8bcd90d
DDBEASY-65 - Possibility of opening campaigns in new tab.
guddo Aug 22, 2014
9f817cf
DDBEASY-65 - Typo.
guddo Aug 22, 2014
9f206cf
DDBEASY-229 - Add scheduler to Campign CT.
guddo Feb 5, 2015
5848a2e
DDBEASY-458 - Extend the rule field length.
guddo Feb 5, 2015
faa4dfd
Merge branch 'DDBEASY-125' into easyddb
guddo Mar 13, 2015
7f72c8c
Merge branch 'DDBEASY-144' into easyddb
guddo Mar 13, 2015
8c46db4
Merge branch 'DDBEASY-65' into easyddb
guddo Mar 13, 2015
e3b5c51
Merge branch 'DDBEASY-229' into easyddb
guddo Mar 13, 2015
bb39708
Merge branch 'DDBEASY-458' into easyddb
guddo Mar 13, 2015
22bed50
DDBEASY-613 - New image styles for easyDDB layout.
guddo Apr 8, 2015
edaa4ed
Merge branch 'DDBEASY-613' into easyddb
guddo Apr 8, 2015
74f9532
Merge remote-tracking branch 'origin/easyddb'
Apr 28, 2015
f744f11
Versions bump.
Apr 28, 2015
5bf8a62
Merge branch 'master' into easyddb
Apr 28, 2015
e0ac8ef
DDBEASY 229 - Make schedule field not required.
Apr 30, 2015
4fce80b
Merge branch 'DDBEASY-229' into easyddb
Apr 30, 2015
62dcec8
Merge remote-tracking branch 'origin/DDBEASY-229' into hotfix
guddo May 6, 2015
8cd86b7
Merge branch 'hotfix'
guddo May 6, 2015
2b0ca33
Merge branch 'hotfix' into easyddb
guddo May 6, 2015
9c2ad00
DDBEASY 641 - Add #states for form elements on node edit/add.
May 14, 2015
1f75567
Merge branch 'DDBEASY-641' into easyddb
May 15, 2015
0c15eb3
Merge branch 'easyddb' of github.com:easyddb/ding_campaign into easyddb
May 15, 2015
6485214
DDBEASY 617 - Remove ding_campaign_ctype.
May 15, 2015
41a0998
DDBEASY 617 - Moce CT and image styles in main module.
May 15, 2015
069a479
Merge branch 'DDBEASY-617' into easyddb
May 15, 2015
be48d80
DDBEASY 641 - Add #states for form elements on node edit/add.
May 15, 2015
2b5aa36
Merge branch 'DDBEASY-641-A' into easyddb
May 15, 2015
9fcb85e
DDBEASY 641 - Clear fields base on campaign settings selected option.
May 18, 2015
acba6da
Merge branch 'DDBEASY-641-A' into easyddb
May 18, 2015
dff1852
Merge branch 'easyddb'
guddo May 18, 2015
ad2d57d
DDBEASY-696 - Move link into image and unset link.
Jun 17, 2015
69dd666
Merge branch 'DDBEASY-696' into easyddb
Jun 18, 2015
6823b03
Merge branch 'easyddb'
guddo Jun 18, 2015
c49cbc6
Release: 7.x-2.1.0+easy
guddo Jun 18, 2015
f88b694
Merge branch 'master' into easyddb
guddo Jun 18, 2015
7c04777
DDBEASY-696 - Remove title on campaign of type text.
Jul 20, 2015
f9e3cb2
Merge branch 'DDBEASY-696' into easyddb
Jul 21, 2015
8150aa6
Merge branch 'easyddb'
guddo Aug 25, 2015
bf0894a
Release: 7.x-2.2.0
guddo Aug 25, 2015
4e382d7
DDBEASY-719 - Fix notices.
Oct 19, 2015
f3d5e65
Merge remote-tracking branch 'origin/DDBEASY-719' into easyddb
guddo Oct 26, 2015
eb3e6a6
Merge branch 'easyddb'
guddo Oct 26, 2015
34bc873
Release: 7.x-2.3.1+easy
guddo Oct 26, 2015
1c65ef8
Merge branch 'master' into easyddb
guddo Oct 26, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions ding_campaign.admin.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would appreciate a comment describing why it is necessary to clear the cache at this point.


// Add new rules.
for ($i = 0; $i < $c; $i++) {
if ($form_state['input']['rule_value'][$i] != '' || $form_state['input']['rule_type'][$i] == 'rule_generic') {
Expand Down Expand Up @@ -206,8 +209,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' => '<div class="rule-value">',
'#suffix' => '</div><div class="clear"></div></div>',
'#autocomplete_path' => 'ding_campaign/autocomplete/' . $type,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php
/**
* @file
* ding_campaign_ctype.features.field_base.inc
* ding_campaign.features.field_base.inc
*/

/**
* Implements hook_field_default_field_bases().
*/
function ding_campaign_ctype_field_default_field_bases() {
function ding_campaign_field_default_field_bases() {
$field_bases = array();

// Exported field_base: 'ding_campaign_group_ref'
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php
/**
* @file
* ding_campaign_ctype.features.field_instance.inc
* ding_campaign.features.field_instance.inc
*/

/**
* Implements hook_field_default_field_instances().
*/
function ding_campaign_ctype_field_default_field_instances() {
function ding_campaign_field_default_field_instances() {
$field_instances = array();

// Exported field_instance: 'node-ding_campaign-ding_campaign_group_ref'
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -259,7 +314,7 @@ function ding_campaign_ctype_field_default_field_instances() {
'module' => 'options',
'settings' => array(),
'type' => 'options_buttons',
'weight' => 4,
'weight' => 2,
),
);

Expand Down Expand Up @@ -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;
Expand Down
Loading