From: Eileen McNaughton Date: Mon, 15 Jun 2015 02:24:50 +0000 (+1200) Subject: add price-set region & placement option X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=535977d67aa9bc9bad9cf21361d3344e9f2d1e59;p=civicrm-core.git add price-set region & placement option --- diff --git a/CRM/Core/Region.php b/CRM/Core/Region.php index 7868cee238..61feec9ba1 100644 --- a/CRM/Core/Region.php +++ b/CRM/Core/Region.php @@ -170,18 +170,29 @@ class CRM_Core_Region { $smarty = CRM_Core_Smarty::singleton(); $html = ''; foreach ($this->_snippets as $snippet) { + $placement = empty($snippet['placement']) ? 'after' : $snippet['placement']; if ($snippet['disabled']) { continue; } switch ($snippet['type']) { case 'markup': - $html .= $snippet['markup']; + if ($placement == 'before') { + $html = $snippet['markup'] . $html; + } + else { + $html .= $snippet['markup']; + } break; case 'template': $tmp = $smarty->get_template_vars('snippet'); $smarty->assign('snippet', $snippet); - $html .= $smarty->fetch($snippet['template']); + if ($placement == 'before') { + $html = $smarty->fetch($snippet['template']) . $html; + } + else { + $html .= $smarty->fetch($snippet['template']); + } $smarty->assign('snippet', $tmp); break; diff --git a/templates/CRM/Price/Form/PriceSet.tpl b/templates/CRM/Price/Form/PriceSet.tpl index 52ad50410b..9ee1f2b0fc 100644 --- a/templates/CRM/Price/Form/PriceSet.tpl +++ b/templates/CRM/Price/Form/PriceSet.tpl @@ -23,6 +23,7 @@ | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ *} +{crmRegion name="price-set-1"}
{if $priceSet.help_pre}
{$priceSet.help_pre}
@@ -129,3 +130,4 @@ {include file="CRM/Price/Form/Calculate.tpl"} {/if}
+{/crmRegion}