Commit 4f25b8f9d05665bd90c39b79de60d7f9fbf99eda
1 parent
e6d943e1
Add an addQS block function to run KTUtil::addQueryStringSelf on the
block contents. git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4768 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
8 additions
and
0 deletions
lib/templating/smartytemplate.inc.php
| ... | ... | @@ -80,6 +80,7 @@ class KTSmartyTemplate extends KTTemplate { |
| 80 | 80 | $smarty->register_modifier('addQS', array('KTSmartyTemplate', 'addQueryString')); |
| 81 | 81 | $smarty->register_modifier('addQueryStringSelf', array('KTSmartyTemplate', 'addQueryStringSelf')); |
| 82 | 82 | $smarty->register_modifier('addQSSelf', array('KTSmartyTemplate', 'addQueryStringSelf')); |
| 83 | + $smarty->register_block('addQS', array('KTSmartyTemplate', 'addQueryStringBlock'), false); | |
| 83 | 84 | return $smarty->fetch($this->sPath); |
| 84 | 85 | } |
| 85 | 86 | |
| ... | ... | @@ -117,6 +118,13 @@ class KTSmartyTemplate extends KTTemplate { |
| 117 | 118 | return str_replace(array_keys($replacements), array_values($replacements), $content); |
| 118 | 119 | } |
| 119 | 120 | |
| 121 | + function addQueryStringBlock($params, $content, &$smarty, &$repeat) { | |
| 122 | + if (empty($content)) { | |
| 123 | + return; | |
| 124 | + } | |
| 125 | + return KTUtil::addQueryStringSelf($content); | |
| 126 | + } | |
| 127 | + | |
| 120 | 128 | function entity_select ($params, &$smarty) { |
| 121 | 129 | require_once $smarty->_get_plugin_filepath('function', 'html_options'); |
| 122 | 130 | ... | ... |