Prechádzať zdrojové kódy

Solved recursion problem and increased efficiency of template_construct hook by adding file name to the end of the hook name, such as template_construct_login.tpl. Changed hook type to use the newly reworked concat_hook_function which can support merged arrays retued from the plugins.

pdontthink 19 rokov pred
rodič
commit
1cee629ce7
1 zmenil súbory, kde vykonal 4 pridanie a 4 odobranie
  1. 4 4
      class/template/template.class.php

+ 4 - 4
class/template/template.class.php

@@ -390,8 +390,8 @@ return substr($this->template_dir, strlen(SM_PATH));
         } else {
 
             $aPluginOutput = array();
-            $aPluginOutput = do_hook_function('template_construct', 
-                                              array($aPluginOutput, $file, $this));
+            $aPluginOutput = concat_hook_function('template_construct_' . $file,
+                                                  array($aPluginOutput, $this));
             $this->assign('plugin_output', $aPluginOutput);
 
             // pull in our config file ($t?  let's try to be more verbose please :-) )
@@ -440,8 +440,8 @@ return substr($this->template_dir, strlen(SM_PATH));
         } else {
 
             $aPluginOutput = array();
-            $aPluginOutput = do_hook_function('template_construct', 
-                                              array($aPluginOutput, $file, $this));
+            $aPluginOutput = concat_hook_function('template_construct_' . $file,
+                                                  array($aPluginOutput, $this));
             $this->assign('plugin_output', $aPluginOutput);
 
             // pull in our config file ($t?  let's try to be more verbose please :-) )