From 2575ba7d23532356bf230819152c9302db875120 Mon Sep 17 00:00:00 2001 From: Manoj K Date: Tue, 21 Oct 2014 16:15:19 +0530 Subject: [PATCH] #29759 - Included newsletter signup in widget. --- CRM/Wci/Form/CreateWidget.php | 5 ++++- extern/wciwidget.php | 20 ++++++++------------ templates/CRM/Wci/Page/wciwidget.tpl | 15 +++++++++++++++ 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/CRM/Wci/Form/CreateWidget.php b/CRM/Wci/Form/CreateWidget.php index bc114f0..04f8262 100644 --- a/CRM/Wci/Form/CreateWidget.php +++ b/CRM/Wci/Form/CreateWidget.php @@ -348,7 +348,10 @@ where w.id=" . $this->_id; '' => ts('- select -'), ); - $result = civicrm_api3('group', 'get'); + $result = civicrm_api3('group', 'get', array( + 'group_type' => '2' + )); + foreach ($result['values'] as $group) { $options[$group['id']] = $group['title']; } diff --git a/extern/wciwidget.php b/extern/wciwidget.php index a44ea71..3f89330 100644 --- a/extern/wciwidget.php +++ b/extern/wciwidget.php @@ -54,18 +54,14 @@ if (isset($format)) { } $data = ""; -if (isset($embed) && (true == $embed)) { +$data = CRM_Wci_BAO_Widget::getWidgetData($widgetId); +$template->assign('wciform', $data); +$template->assign('cpageId', $data['button_link_to']); +$template->assign('embed', $embed); -} else { - $data = CRM_Wci_BAO_Widget::getWidgetData($widgetId); - $template->assign('wciform', $data); - $template->assign('cpageId', $data['button_link_to']); - - $template->template_dir[] = getWciWidgetTemplatePath(); - $wcidata = $template->fetch('wciwidget.tpl'); - $output = 'var wciwidgetcode = ' . json_encode($wcidata) . ';'; - echo $output; - -} +$template->template_dir[] = getWciWidgetTemplatePath(); +$wcidata = $template->fetch('wciwidget.tpl'); +$output = 'var wciwidgetcode = ' . json_encode($wcidata) . ';'; +echo $output; CRM_Utils_System::civiExit(); diff --git a/templates/CRM/Wci/Page/wciwidget.tpl b/templates/CRM/Wci/Page/wciwidget.tpl index 84e63c6..6dad7da 100644 --- a/templates/CRM/Wci/Page/wciwidget.tpl +++ b/templates/CRM/Wci/Page/wciwidget.tpl @@ -185,4 +185,19 @@
{$wciform.button_title}
+ {$wciform.embed} + {if $wciform.email_signup_group_id} + {if $wciform.embed == 1} +
+ +

+

+ +

+ {if $wciform.embed == 1} +
+ {/if} + {/if} -- 2.25.1