$data = CRM_Wci_BAO_Widget::getWidgetData($wid_id);
$template = CRM_Core_Smarty::singleton();
$template->assign('wciform', $data);
- $template->template_dir[] = getWciWidgetTemplatePath();
- $wcidata = $template->fetch('wciwidget.tpl');
+ if($data["override"] == 0) {
+ $template->template_dir[] = getWciWidgetTemplatePath();
+ $wcidata = $template->fetch('wciwidget.tpl');
+ } else {
+ echo "hi";
+ $wcidata = $template->fetch('string:' . base64_decode($wid_page[$dao->id]['custom_template']));
+ }
$widget_controller_path = getWciWidgetControllerPath();
}
{/php}
</div>
<div class="crm-section">
<div class="content">
- {include file="CRM/Wci/Page/wciwidget.tpl"}
+ {* {include file="CRM/Wci/Page/wciwidget.tpl"} *}
+
+<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>
+
</div>
</div>
{/if}
-khtml-border-radius: 4px;
border-radius: 4px;
border:1px solid #96C0E7;
+ background-color: {/literal}{$wciform.color_widget_bg}{literal}; /* background color */
+ border-color:{/literal}{$wciform.color_border}{literal}; /* border color */
+ background: {/literal}{if $wciform.image}url('{$wciform.image}'){/if}{literal}; /* background image */
}
.crm-wci-widget.thin {
-webkit-border-radius: 4px;
-khtml-border-radius: 4px;
border-radius: 4px;
- }
+ color: {/literal}{$wciform.color_title}{literal};
+ background-color: {/literal}{$wciform.color_title_bg}{literal};
+ } /* title */
.crm-wci-widget .crm-amounts {
height:1em;
margin:0px 30%;
text-align:center;
}
- .crm-wci-widget .crm-amount-bar {
+ .crm-wci-widget .crm-amount-bar { /* progress bar */
background-color:#FFF;
width:100%;
display:block;
border-radius: 4px;
margin-bottom:.8em;
text-align:left;
+
+ background-color:{/literal}{$wciform.color_bar}{literal};
+ border-color:#CECECE;
}
.crm-wci-widget .crm-amount-fill {
background-color:#2786C2;
}
.crm-wci-widget .crm-amount-raised {
font-weight:bold;
+ color:#000;
}
.crm-wci-widget .crm-logo {
.crm-wci-widget .crm-campaign {
font-size:11px;
margin-bottom:.8em;
+ color:{/literal}{$wciform.color_description}{literal} /* other color*/
}
.crm-wci-widget .crm-wci-button {
.crm-wci-widget .crm-home-url {
text-decoration:none;
border:0px;
+ color:{/literal}{$wciform.color_homepage_link}{literal} /* home page link color*/
}
-</style>
-<style>
- .crm-wci-widget {
- background-color: {/literal}{$wciform.color_widget_bg}{literal}; /* background color */
- border-color:{/literal}{$wciform.color_border}{literal}; /* border color */
- background: {/literal}{if $wciform.image}url('{$wciform.image}'){else}none{/if}{literal}; /* background image */
- }
-
- .crm-wci-widget h5 {
- color: {/literal}{$wciform.color_title}{literal};
- background-color: {/literal}{$wciform.color_title_bg}{literal};
- } /* title */
-
- .crm-wci-widget .crm-amount-raised { color:#000; }
- .crm-wci-widget .crm-amount-bar /* progress bar */
- background-color:{/literal}{$wciform.color_bar}{literal};
- border-color:#CECECE;
- }
- .crm-wci-widget .crm-amount-fill { background-color:#2786C2; }
-
.crm-wci-widget a.crm-wci-button { /* button color */
background-color:{/literal}{$wciform.color_button_bg}{literal};
}
color:{/literal}{$wciform.color_button}{literal};
}
- .crm-wci-widget .crm-comments,
- .crm-wci-widget .crm-donors,
- .crm-wci-widget .crm-campaign {
- color:{/literal}{$wciform.color_description}{literal} /* other color*/
- }
-
- .crm-wci-widget .crm-home-url {
- color:{/literal}{$wciform.color_homepage_link}{literal} /* home page link color*/
- }
-
</style>
+
<style>
{/literal}
{$wciform.style_rules}
</style>
{/literal}
-<div id="crm_wid_{$widgetId}" class="crm-wci-widget {$wciform.size_variant}">
- <h5 id="crm_wid_{$widgetId}_title">
+<div id="crm_wid_{$wciform.widgetId}" class="crm-wci-widget {$wciform.size_variant}">
+ <h5 id="crm_wid_{$wciform.widgetId}_title">
{if $wciform.logo_image}
<span class="crm-logo">
<img src="{$wciform.logo_image}" alt={ts}Logo{/ts}>
{$wciform.title}
</h5>
<div class="crm-amounts">
- <div id="crm_wid_{$widgetId}_amt_hi" class="crm-amount-high"></div>
- <div id="crm_wid_{$widgetId}_amt_low" class="crm-amount-low"></div>
- <div id="crm_wid_{$widgetId}_percentage" class="crm-percentage"></div>
+ <div id="crm_wid_{$wciform.widgetId}_amt_hi" class="crm-amount-high"></div>
+ <div id="crm_wid_{$wciform.widgetId}_amt_low" class="crm-amount-low"></div>
+ <div id="crm_wid_{$wciform.widgetId}_percentage" class="crm-percentage"></div>
</div>
<div class="crm-amount-bar">
- <div class="crm-amount-fill" id="crm_wid_{$widgetId}_amt_fill"></div>
+ <div class="crm-amount-fill" id="crm_wid_{$wciform.widgetId}_amt_fill"></div>
</div>
- <div id="crm_wid_{$widgetId}_donors" class="crm-donors">
+ <div id="crm_wid_{$wciform.widgetId}_donors" class="crm-donors">
</div>
- <div id="crm_wid_{$widgetId}_comments" class="crm-comments">
+ <div id="crm_wid_{$wciform.widgetId}_comments" class="crm-comments">
{$wciform.description}
</div>
- <div id="crm_wid_{$widgetId}_campaign" class="crm-campaign">
+ <div id="crm_wid_{$wciform.widgetId}_campaign" class="crm-campaign">
</div>
- <div class="crm-wci-button-wrapper" id="crm_wid_{$widgetId}_button">
- <a href='{crmURL p="civicrm/contribute/transact" q="reset=1&id=$cpageId" h=0 a=1 fe=1}' class="crm-wci-button"><span class="crm-wci-button-inner" id="crm_wid_{$widgetId}_btn_txt">{$wciform.button_title}</span></a>
+ <div class="crm-wci-button-wrapper" id="crm_wid_{$wciform.widgetId}_button">
+ <a href='{crmURL p="civicrm/contribute/transact" q="reset=1&id=$cpageId" h=0 a=1 fe=1}' class="crm-wci-button"><span class="crm-wci-button-inner" id="crm_wid_{$wciform.widgetId}_btn_txt">{$wciform.button_title}</span></a>
</div>
</div>