#29762 email subscription url added to data
authorJagadedes <jagadees.pillai@zyxware.com>
Thu, 30 Oct 2014 08:42:48 +0000 (14:12 +0530)
committerJagadedes <jagadees.pillai@zyxware.com>
Thu, 30 Oct 2014 08:42:48 +0000 (14:12 +0530)
CRM/Wci/BAO/Widget.php
extern/wciwidget.php
templates/CRM/Wci/Page/wciwidget.tpl
wci-helper-functions.php

index 7b1111ae76ca6019cba503fc0a0b80029c428d28..3cedbec48c0a7550718c3037938e22b61440c340 100644 (file)
@@ -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;
   }
index 85161266e62199d0067728bc67c26717f12f58c3..3e0d2e53ce799cd11a50b8491852e2f87bcf8918 100644 (file)
@@ -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();
index 537bd387439f8faa18d6ff42e6b4e94d5f5ac50b..0c8bc6a6a03dfc29a22e16f5edc212836bb77e9c 100644 (file)
     </div>
     {$wciform.embed}
     {if $wciform.email_signup_group_id}
-        <form method="post" action="{$emailSignupGroupFormURL}" name="Subscribe">
+        <form method="get" action="{$wciform.emailSignupGroupFormURL}" name="Subscribe">
         <p style="text-align:center;">
           <input type="text" id="frmEmail" name="email" size="10">
         </p>
index 9c34fca09b87ec0772c3992a7fe5b721e7d524f3..a6a0edd253b89a328c51e25ad3bd1bcd49d258c2 100644 (file)
@@ -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