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