From 4ccaea9a772ce681b47473dc44b1c33ae2591580 Mon Sep 17 00:00:00 2001 From: Jagadedes Date: Thu, 30 Oct 2014 14:12:48 +0530 Subject: [PATCH] #29762 email subscription url added to data --- CRM/Wci/BAO/Widget.php | 1 + extern/wciwidget.php | 7 +------ templates/CRM/Wci/Page/wciwidget.tpl | 2 +- wci-helper-functions.php | 4 ---- 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/CRM/Wci/BAO/Widget.php b/CRM/Wci/BAO/Widget.php index 7b1111a..3cedbec 100644 --- a/CRM/Wci/BAO/Widget.php +++ b/CRM/Wci/BAO/Widget.php @@ -158,6 +158,7 @@ class CRM_Wci_BAO_Widget extends CRM_Wci_DAO_Widget { $data["widgetId"] = $widgetId; $data["override"] = $dao->override; $data["color_bar"] = $dao->color_progress_bar; + $data["emailSignupGroupFormURL"] = CRM_Utils_System::baseCMSURL() . 'civicrm/mailing/subscribe'; } return $data; } diff --git a/extern/wciwidget.php b/extern/wciwidget.php index 8516126..3e0d2e5 100644 --- a/extern/wciwidget.php +++ b/extern/wciwidget.php @@ -56,20 +56,15 @@ if (isset($format)) { $template->assign('wciform', $data); $template->assign('cpageId', $data['button_link_to']); - if(!empty($data['email_signup_group_id'])) { - $template->assign('emailSignupGroupFormURL', getEmailSignupFormUrl()); - } if ($data["override"] == '0') { $template->template_dir[] = getWciWidgetTemplatePath(); $wcidata = $template->fetch('wciwidget.tpl'); } else { - - $wcidata = $template->fetch('string:' . base64_decode($data['custom_template'])); + $wcidata = $template->fetch('string:' . base64_decode($data['custom_template'])); } $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 537bd38..0c8bc6a 100644 --- a/templates/CRM/Wci/Page/wciwidget.tpl +++ b/templates/CRM/Wci/Page/wciwidget.tpl @@ -179,7 +179,7 @@ {$wciform.embed} {if $wciform.email_signup_group_id} -
+

diff --git a/wci-helper-functions.php b/wci-helper-functions.php index 9c34fca..a6a0edd 100644 --- a/wci-helper-functions.php +++ b/wci-helper-functions.php @@ -28,7 +28,3 @@ return $widget_tpl_path; } - - function getEmailSignupFormUrl() { - return 'http://' . $_SERVER['SERVER_NAME'] . str_replace($_SERVER['PHP_SELF'], '', str_replace($_SERVER['DOCUMENT_ROOT'], '', $_SERVER['SCRIPT_FILENAME'])) . '/civicrm/mailing/subscribe'; - } \ No newline at end of file -- 2.25.1