Commit fe082d1dc6e9ec9df1280be08e33d5043aa1d69d

Authored by nbm
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 55 var $_aColumns = array();
56 56 var $_aViews = array();
57 57 var $_aNotificationHandlers = array();
  58 + var $_aTemplateLocations = array();
58 59  
59 60 function KTPlugin($sFilename = null) {
60 61 $this->sFilename = $sFilename;
... ... @@ -158,6 +159,11 @@ class KTPlugin {
158 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 167 function _fixFilename($sFilename) {
162 168 if (empty($sFilename)) {
163 169 $sFilename = $this->sFilename;
... ... @@ -229,6 +235,7 @@ class KTPlugin {
229 235 $oWFTriggerRegistry =& KTWorkflowTriggerRegistry::getSingleton();
230 236 $oColumnRegistry =& KTColumnRegistry::getSingleton();
231 237 $oNotificationHandlerRegistry =& KTNotificationRegistry::getSingleton();
  238 + $oTemplating =& KTTemplating::getSingleton();
232 239  
233 240 foreach ($this->_aPortlets as $k => $v) {
234 241 call_user_func_array(array(&$oPRegistry, 'registerPortlet'), $v);
... ... @@ -293,6 +300,10 @@ class KTPlugin {
293 300 foreach ($this->_aNotificationHandlers as $k => $v) {
294 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 309 function setup() {
... ...