]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
low-level hook for loading templates
authorEvan Prodromou <evan@status.net>
Wed, 4 May 2011 18:28:49 +0000 (11:28 -0700)
committerEvan Prodromou <evan@status.net>
Wed, 4 May 2011 18:28:49 +0000 (11:28 -0700)
lib/docfile.php

index 982177315a3f9bb0ec139dbc63f3ba74278d0117..e3968706953003e5a88e752930c956f22ec0967f 100644 (file)
@@ -63,24 +63,29 @@ class DocFile
 
         $filename = null;
 
-        foreach ($paths as $path) {
+        if (Event::handle('StartDocFileForTitle', array($title, &$paths, &$filename))) {
 
-            $def = $path.'/'.$title;
+            foreach ($paths as $path) {
 
-            if (!file_exists($def)) {
-                $def = null;
-            }
+                $def = $path.'/'.$title;
 
-            $lang = glob($path.'/'.$title.'.*');
+                if (!file_exists($def)) {
+                    $def = null;
+                }
 
-            if ($lang === false) {
-                $lang = array();
-            }
+                $lang = glob($path.'/'.$title.'.*');
 
-            if (!empty($lang) || !empty($def)) {
-                $filename = self::negotiateLanguage($lang, $def);
-                break;
+                if ($lang === false) {
+                    $lang = array();
+                }
+
+                if (!empty($lang) || !empty($def)) {
+                    $filename = self::negotiateLanguage($lang, $def);
+                    break;
+                }
             }
+
+            Event::handle('EndDocFileForTitle', array($title, $paths, &$filename));
         }
 
         if (empty($filename)) {