#31102, #31060 combibed 2 script tags in embed code and added referalId
authorJagadedes <jagadees.pillai@zyxware.com>
Mon, 10 Nov 2014 04:33:30 +0000 (10:03 +0530)
committerJagadedes <jagadees.pillai@zyxware.com>
Mon, 10 Nov 2014 04:33:30 +0000 (10:03 +0530)
CRM/Wci/Form/CreateWidget.php
extern/wciwidget.php
templates/CRM/Wci/Form/CreateWidget.tpl

index 585a14972c4099e5290b9975893242c781391c4a..5517583b9da639b983764c1077032957eddedac4 100644 (file)
@@ -228,7 +228,6 @@ where w.id=" . $this->_id;*/
     }
     else {
       CRM_Utils_System::setTitle(ts('Create Widget'));
-      /** Keep template in civicrm-wci/templates folder*/
       $output = file_get_contents('templates/CRM/Wci/Page/wciwidget.tpl',FILE_USE_INCLUDE_PATH);
       $elem = $this->getElement('custom_template');
       $elem->setValue($output);
index 04373663e444a364e7406417a57af73ded823ed5..e5b6b69863a5e724c1b396ae53de8b3bcf55e913 100644 (file)
@@ -70,6 +70,9 @@ if (isset($format)) {
     $wcidata = $template->fetch('string:' . html_entity_decode($data['custom_template']));
   }
   $output = 'var wciwidgetcode =  ' . json_encode($wcidata) . ';';
+  
+  $wciembed = file_get_contents('wciembed.js',FILE_USE_INCLUDE_PATH);
+  $output = $output . $wciembed;
   echo $output;
 }
 
index 5fe77cecadd41c8624cc97367d9522640eeae4fe..ebce8013b88936bc43c1dbfd8aa992353b4251a0 100644 (file)
           <div class="description">
             Click <strong>Save &amp; Preview</strong> to save any changes to your settings, and preview the widget again on this page.
           </div>
-          <script type="text/javascript" src="{php}echo $widget_controller_path;{/php}?widgetId={php}echo $wid_id;{/php}&embed=0"></script>
-  <script type="text/javascript" src="{php}echo $extension_root_path;{/php}/extern/wciembed.js"></script>
+          <script type="text/javascript" src="{php}echo $widget_controller_path;{/php}?widgetId={php}echo $wid_id;{/php}&embed=0&referalid=2442"></script></script>
   <div id='widgetwci'></div>
         </div>
         <div class="col2">
           <div class="description">
             Add this widget to any web page by copying and pasting the code below.
           </div>
-          <textarea rows="8" cols="40" name="widget_code" id="widget_code"><script type="text/javascript" src="{php}echo $widget_controller_path;{/php}?widgetId={php}echo $wid_id;{/php}&embed=1"></script>
-<script type="text/javascript" src="{php}echo $extension_root_path;{/php}/extern/wciembed.js"></script>
+          <textarea rows="8" cols="40" name="widget_code" id="widget_code"><script type="text/javascript" src="{php}echo $widget_controller_path;{/php}?widgetId={php}echo $wid_id;{/php}&embed=1&referalId=2442"> </script> 
 <div id='widgetwci'></div></textarea>
           <br>
           <strong>