Commit | Line | Data |
---|---|---|
60488185 M |
1 | {* HEADER *} |
2 | ||
3 | <div class="crm-submit-buttons"> | |
4 | {include file="CRM/common/formButtons.tpl" location="top"} | |
5 | </div> | |
6 | ||
7 | {* FIELD EXAMPLE: OPTION 1 (AUTOMATIC LAYOUT) *} | |
8 | ||
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} | |
16 | ||
1e92ea19 | 17 | {* {if $form.title.value != ""} *} |
7d8ac5b7 J |
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); | |
851c37a8 J |
24 | if($data["override"] == 0) { |
25 | $template->template_dir[] = getWciWidgetTemplatePath(); | |
26 | $wcidata = $template->fetch('wciwidget.tpl'); | |
27 | } else { | |
851c37a8 J |
28 | $wcidata = $template->fetch('string:' . base64_decode($wid_page[$dao->id]['custom_template'])); |
29 | } | |
58bba978 | 30 | $widget_controller_path = getWciWidgetControllerPath(); |
cb59e7c2 | 31 | $extension_root_path = getExtensionRootPath(); |
7d8ac5b7 J |
32 | } |
33 | {/php} | |
34 | ||
58bba978 M |
35 | <div class="crm-section"> |
36 | <div class="label"> | |
37 | <label for="embd_code">Code to embed:</label> | |
38 | </div> | |
39 | <div class="content"> | |
40 | <div class="resizable-textarea"> | |
41 | <span>{literal} | |
2082fcdf M |
42 | <textarea rows="5" name="embd_code" id="embd_code" class="form-textarea textarea-processed"> |
43 | <script type="text/javascript" src="{/literal}{php}echo $widget_controller_path;{/php}{literal}?widgetId={/literal}{php}echo $wid_id;{/php}{literal}&embed=1"></script> | |
cb59e7c2 | 44 | <script type="text/javascript" src="{/literal}{php}echo $extension_root_path;{/php}{literal}/extern/wciembed.js"></script> |
b7a6e5f3 | 45 | <div id='widgetwci'></div></textarea>{/literal} |
58bba978 M |
46 | <div class="grippie" style="margin-right: 18px;"></div> |
47 | </span> | |
48 | </div> | |
49 | </div> | |
50 | <div class="clear"></div> | |
51 | </div> | |
7d8ac5b7 J |
52 | <div class="crm-section"> |
53 | <div class="content"> | |
851c37a8 J |
54 | {* {include file="CRM/Wci/Page/wciwidget.tpl"} *} |
55 | ||
2082fcdf | 56 | <script type="text/javascript" src="{php}echo $widget_controller_path;{/php}?widgetId={php}echo $wid_id;{/php}&embed=0"></script> |
cb59e7c2 | 57 | <script type="text/javascript" src="{/literal}{php}echo $extension_root_path;{/php}{literal}/extern/wciembed.js"></script> |
851c37a8 J |
58 | <div id='widgetwci'></div> |
59 | ||
7d8ac5b7 J |
60 | </div> |
61 | </div> | |
1e92ea19 | 62 | {* {/if} *} |
7d8ac5b7 | 63 | |
60488185 M |
64 | {* FIELD EXAMPLE: OPTION 2 (MANUAL LAYOUT) |
65 | ||
66 | <div> | |
67 | <span>{$form.favorite_color.label}</span> | |
68 | <span>{$form.favorite_color.html}</span> | |
69 | </div> | |
70 | ||
71 | {* FOOTER *} | |
7d8ac5b7 | 72 | |
60488185 M |
73 | <div class="crm-submit-buttons"> |
74 | {include file="CRM/common/formButtons.tpl" location="bottom"} | |
75 | </div> | |
7d8ac5b7 | 76 |