From: Manoj K
Date: Tue, 21 Oct 2014 10:45:19 +0000 (+0530)
Subject: #29759 - Included newsletter signup in widget.
X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=2575ba7d23532356bf230819152c9302db875120;p=com.zyxware.civiwci.git
#29759 - Included newsletter signup in widget.
---
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.embed}
+ {if $wciform.email_signup_group_id}
+ {if $wciform.embed == 1}
+
+
+
+
+ {if $wciform.embed == 1}
+
+ {/if}
+ {/if}