Commit fe082d1dc6e9ec9df1280be08e33d5043aa1d69d
1 parent
5a512aaa
Add registerTemplateLocation to the plugin object.
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5743 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
11 additions
and
0 deletions
lib/plugins/plugin.inc.php
| @@ -55,6 +55,7 @@ class KTPlugin { | @@ -55,6 +55,7 @@ class KTPlugin { | ||
| 55 | var $_aColumns = array(); | 55 | var $_aColumns = array(); |
| 56 | var $_aViews = array(); | 56 | var $_aViews = array(); |
| 57 | var $_aNotificationHandlers = array(); | 57 | var $_aNotificationHandlers = array(); |
| 58 | + var $_aTemplateLocations = array(); | ||
| 58 | 59 | ||
| 59 | function KTPlugin($sFilename = null) { | 60 | function KTPlugin($sFilename = null) { |
| 60 | $this->sFilename = $sFilename; | 61 | $this->sFilename = $sFilename; |
| @@ -158,6 +159,11 @@ class KTPlugin { | @@ -158,6 +159,11 @@ class KTPlugin { | ||
| 158 | $this->_aNotificationHandlers[$sNamespace] = array($sNamespace, $sName, $sPath); | 159 | $this->_aNotificationHandlers[$sNamespace] = array($sNamespace, $sName, $sPath); |
| 159 | } | 160 | } |
| 160 | 161 | ||
| 162 | + function registerTemplateLocation($sName, $sPath) { | ||
| 163 | + $sPath = $this->_fixFilename($sPath); | ||
| 164 | + $this->_aTemplateLocations[$sName] = array($sName, $sPath); | ||
| 165 | + } | ||
| 166 | + | ||
| 161 | function _fixFilename($sFilename) { | 167 | function _fixFilename($sFilename) { |
| 162 | if (empty($sFilename)) { | 168 | if (empty($sFilename)) { |
| 163 | $sFilename = $this->sFilename; | 169 | $sFilename = $this->sFilename; |
| @@ -229,6 +235,7 @@ class KTPlugin { | @@ -229,6 +235,7 @@ class KTPlugin { | ||
| 229 | $oWFTriggerRegistry =& KTWorkflowTriggerRegistry::getSingleton(); | 235 | $oWFTriggerRegistry =& KTWorkflowTriggerRegistry::getSingleton(); |
| 230 | $oColumnRegistry =& KTColumnRegistry::getSingleton(); | 236 | $oColumnRegistry =& KTColumnRegistry::getSingleton(); |
| 231 | $oNotificationHandlerRegistry =& KTNotificationRegistry::getSingleton(); | 237 | $oNotificationHandlerRegistry =& KTNotificationRegistry::getSingleton(); |
| 238 | + $oTemplating =& KTTemplating::getSingleton(); | ||
| 232 | 239 | ||
| 233 | foreach ($this->_aPortlets as $k => $v) { | 240 | foreach ($this->_aPortlets as $k => $v) { |
| 234 | call_user_func_array(array(&$oPRegistry, 'registerPortlet'), $v); | 241 | call_user_func_array(array(&$oPRegistry, 'registerPortlet'), $v); |
| @@ -293,6 +300,10 @@ class KTPlugin { | @@ -293,6 +300,10 @@ class KTPlugin { | ||
| 293 | foreach ($this->_aNotificationHandlers as $k => $v) { | 300 | foreach ($this->_aNotificationHandlers as $k => $v) { |
| 294 | call_user_func_array(array(&$oNotificationHandlerRegistry, 'registerNotificationHandler'), $v); | 301 | call_user_func_array(array(&$oNotificationHandlerRegistry, 'registerNotificationHandler'), $v); |
| 295 | } | 302 | } |
| 303 | + | ||
| 304 | + foreach ($this->_aTemplateLocations as $k => $v) { | ||
| 305 | + call_user_func_array(array(&$oTemplating, 'addLocation'), $v); | ||
| 306 | + } | ||
| 296 | } | 307 | } |
| 297 | 308 | ||
| 298 | function setup() { | 309 | function setup() { |