Commit | Line | Data |
---|---|---|
60488185 | 1 | {* HEADER *} |
4d4d53e3 M |
2 | <div class="crm-block crm-form-block"> |
3 | <div class="crm-submit-buttons"> | |
4 | {include file="CRM/common/formButtons.tpl" location="top"} | |
5 | </div> | |
60488185 | 6 | |
4d4d53e3 M |
7 | {if $form.title.value != ""} |
8 | {php} | |
9 | if(isset($_REQUEST['id'])) { | |
10 | $wid_id = $_REQUEST['id']; | |
11 | $data = CRM_Wci_BAO_Widget::getWidgetData($wid_id); | |
12 | $template = CRM_Core_Smarty::singleton(); | |
13 | $template->assign('wciform', $data); | |
14 | if($data["override"] == 0) { | |
15 | $template->template_dir[] = getWciWidgetTemplatePath(); | |
16 | $wcidata = $template->fetch('wciwidget.tpl'); | |
17 | } else { | |
46dee7f2 | 18 | $wcidata = $template->fetch('string:' . $wid_page[$dao->id]['custom_template']); |
4d4d53e3 M |
19 | } |
20 | $widget_controller_path = getWciWidgetControllerPath(); | |
21 | $extension_root_path = getExtensionRootPath(); | |
851c37a8 | 22 | } |
4d4d53e3 | 23 | {/php} |
7d8ac5b7 | 24 | |
4d4d53e3 | 25 | <div class="crm-section"> |
fbe9a7d4 J |
26 | <div class="label">Widget Preview</div> |
27 | <div class="content"> | |
28 | ||
4d4d53e3 M |
29 | <div class="col1"> |
30 | <div class="description"> | |
31 | Click <strong>Save & Preview</strong> to save any changes to your settings, and preview the widget again on this page. | |
32 | </div> | |
fbe9a7d4 | 33 | <script type="text/javascript" src="{php}echo $widget_controller_path;{/php}?widgetId={php}echo $wid_id;{/php}&preview=1&referalid=2442"></script></script> |
4d4d53e3 M |
34 | <div id='widgetwci'></div> |
35 | </div> | |
13e70378 | 36 | <!-- <div class="col2"> |
4d4d53e3 M |
37 | <div class="description"> |
38 | Add this widget to any web page by copying and pasting the code below. | |
39 | </div> | |
7f5d2a78 | 40 | <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> |
059e13b7 | 41 | <div id='widgetwci'></div></textarea> |
4d4d53e3 M |
42 | <br> |
43 | <strong> | |
44 | <a href="#" onclick="CreateWidget.widget_code.select(); return false;">ยป Select Code</a> | |
45 | </strong> | |
13e70378 | 46 | </div> --> |
fbe9a7d4 J |
47 | </div> |
48 | <div class="clear"></div> | |
58bba978 | 49 | </div> |
4d4d53e3 M |
50 | {/if} |
51 | ||
fbe9a7d4 J |
52 | {* FIELD EXAMPLE: OPTION 1 (AUTOMATIC LAYOUT) *} |
53 | ||
54 | {foreach from=$elementNames item=elementName} | |
55 | <div class="crm-section"> | |
56 | <div class="label">{$form.$elementName.label}</div> | |
57 | <div class="content">{$form.$elementName.html}</div> | |
58 | <div class="clear"></div> | |
59 | </div> | |
60 | {/foreach} | |
61 | ||
4d4d53e3 | 62 | {* FIELD EXAMPLE: OPTION 2 (MANUAL LAYOUT) |
851c37a8 | 63 | |
4d4d53e3 M |
64 | <div> |
65 | <span>{$form.favorite_color.label}</span> | |
66 | <span>{$form.favorite_color.html}</span> | |
7d8ac5b7 | 67 | </div> |
7d8ac5b7 | 68 | |
4d4d53e3 | 69 | {* FOOTER *} |
60488185 | 70 | |
4d4d53e3 M |
71 | <div class="crm-submit-buttons"> |
72 | {include file="CRM/common/formButtons.tpl" location="bottom"} | |
60488185 | 73 | </div> |
60488185 | 74 | </div> |