{* HEADER *}
-
-<div class="crm-submit-buttons">
-{include file="CRM/common/formButtons.tpl" location="top"}
-</div>
-
-{* FIELD EXAMPLE: OPTION 1 (AUTOMATIC LAYOUT) *}
-
-{foreach from=$elementNames item=elementName}
- <div class="crm-section">
- <div class="label">{$form.$elementName.label}</div>
- <div class="content">{$form.$elementName.html}</div>
- <div class="clear"></div>
+<div class="crm-block crm-form-block">
+ <div class="crm-submit-buttons">
+ {include file="CRM/common/formButtons.tpl" location="top"}
</div>
-{/foreach}
-{if $form.title.value != ""}
- {php}
- if(isset($_REQUEST['id'])) {
- $wid_id = $_REQUEST['id'];
- $data = CRM_Wci_BAO_Widget::getWidgetData($wid_id);
- $template = CRM_Core_Smarty::singleton();
- $template->assign('wciform', $data);
- if($data["override"] == 0) {
- $template->template_dir[] = getWciWidgetTemplatePath();
- $wcidata = $template->fetch('wciwidget.tpl');
- } else {
- $wcidata = $template->fetch('string:' . base64_decode($wid_page[$dao->id]['custom_template']));
- }
- $widget_controller_path = getWciWidgetControllerPath();
- }
- {/php}
-
- <div class="crm-section">
- <div class="label">
- <label for="embd_code">Code to embed:</label>
- </div>
- <div class="content">
- <div class="resizable-textarea">
- <span>{literal}
- <textarea name="embd_code" id="embd_code" class="form-textarea textarea-processed"><script type="text/javascript">
-// Cleanup functions for the document ready method
-if ( document.addEventListener ) {
- DOMContentLoaded = function() {
- document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
- onReady();
- };
-} else if ( document.attachEvent ) {
- DOMContentLoaded = function() {
- // Make sure body exists, at least, in case IE gets a little overzealous
- if ( document.readyState === "complete" ) {
- document.detachEvent( "onreadystatechange", DOMContentLoaded );
- onReady();
+ {if $form.title.value != ""}
+ {php}
+ if(isset($_REQUEST['id'])) {
+ $wid_id = $_REQUEST['id'];
+ $data = CRM_Wci_BAO_Widget::getWidgetData($wid_id);
+ $template = CRM_Core_Smarty::singleton();
+ $template->assign('wciform', $data);
+ if($data["override"] == 0) {
+ $template->template_dir[] = getWciWidgetTemplatePath();
+ $wcidata = $template->fetch('wciwidget.tpl');
+ } else {
+ $wcidata = $template->fetch('string:' . $wid_page[$dao->id]['custom_template']);
}
- };
-}
-if ( document.readyState === "complete" ) {
- // Handle it asynchronously to allow scripts the opportunity to delay ready
- setTimeout( onReady, 1 );
-}
-
-// Mozilla, Opera and webkit support this event
-if ( document.addEventListener ) {
- // Use the handy event callback
- document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
- // A fallback to window.onload, that will always work
- window.addEventListener( "load", onReady, false );
- // If IE event model is used
-} else if ( document.attachEvent ) {
- // ensure firing before onload,
- // maybe late but safe also for iframes
- document.attachEvent("onreadystatechange", DOMContentLoaded);
+ $widget_controller_path = getWciWidgetControllerPath();
+ $extension_root_path = getExtensionRootPath();
+ }
+ {/php}
- // A fallback to window.onload, that will always work
- window.attachEvent( "onload", onReady );
-}
+ <div class="crm-section">
+ <div class="label">Widget Preview</div>
+ <div class="content">
-function onReady( ) {
- document.getElementById('widgetwci').innerHTML = wciwidgetcode;
-}
-</script>
-<div id='widgetwci'></div></textarea>{/literal}
- <div class="grippie" style="margin-right: 18px;"></div>
- </span>
- </div>
+ <div class="col1">
+ <div class="description">
+ Click <strong>Save & 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}&preview=1&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&referalId=2442"> </script>
+<div id='widgetwci'></div></textarea>
+ <br>
+ <strong>
+ <a href="#" onclick="CreateWidget.widget_code.select(); return false;">ยป Select Code</a>
+ </strong>
+ </div> -->
</div>
- <div class="clear"></div>
- </div>
- <div class="crm-section">
- <div class="content">
- {* {include file="CRM/Wci/Page/wciwidget.tpl"} *}
+ <div class="clear"></div>
+ </div>
+ {/if}
+
+ {* FIELD EXAMPLE: OPTION 1 (AUTOMATIC LAYOUT) *}
-<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
-<script type="text/javascript" src="{php}echo $widget_controller_path;{/php}?widgetId={php}echo $wid_id;{/php}"></script>
-<script>
- $( document ).ready(function() {ldelim}
- $('#widgetwci').html(wciwidgetcode);
- {rdelim} );
-</script>
-<div id='widgetwci'></div>
+ {foreach from=$elementNames item=elementName}
+ <div class="crm-section">
+ <div class="label">{$form.$elementName.label}</div>
+ <div class="content">{$form.$elementName.html}</div>
+ <div class="clear"></div>
+ </div>
+ {/foreach}
+
+ {* FIELD EXAMPLE: OPTION 2 (MANUAL LAYOUT)
+ <div>
+ <span>{$form.favorite_color.label}</span>
+ <span>{$form.favorite_color.html}</span>
</div>
- </div>
-{/if}
-{* FIELD EXAMPLE: OPTION 2 (MANUAL LAYOUT)
+ {* FOOTER *}
- <div>
- <span>{$form.favorite_color.label}</span>
- <span>{$form.favorite_color.html}</span>
+ <div class="crm-submit-buttons">
+ {include file="CRM/common/formButtons.tpl" location="bottom"}
</div>
-
-{* FOOTER *}
-
-<div class="crm-submit-buttons">
-{include file="CRM/common/formButtons.tpl" location="bottom"}
</div>
-