$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)) {