diff options
author | zotlabs <mike@macgirvin.com> | 2018-08-20 20:20:57 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2018-08-20 20:20:57 -0700 |
commit | 066febdf4092a308d70e9989b322afb470253132 (patch) | |
tree | bc74661ddc623c6a8e2525355bb12c8f439529bf /include/plugin.php | |
parent | 9b620b2a35e256c905b6e3bd0e6f0228a0426e07 (diff) | |
parent | e25db4d1b57116353ad4e4909eb93824a673ffb3 (diff) | |
download | volse-hubzilla-066febdf4092a308d70e9989b322afb470253132.tar.gz volse-hubzilla-066febdf4092a308d70e9989b322afb470253132.tar.bz2 volse-hubzilla-066febdf4092a308d70e9989b322afb470253132.zip |
Merge branch 'dev' of https://framagit.org/hubzilla/core into xdev_merge
Diffstat (limited to 'include/plugin.php')
-rwxr-xr-x | include/plugin.php | 55 |
1 files changed, 42 insertions, 13 deletions
diff --git a/include/plugin.php b/include/plugin.php index 13652c620..23cb2b5f6 100755 --- a/include/plugin.php +++ b/include/plugin.php @@ -959,9 +959,8 @@ function format_js_if_exists($source) { function theme_include($file, $root = '') { // Make sure $root ends with a slash / if it's not blank - if($root !== '' && $root[strlen($root)-1] !== '/') + if($root !== '' && substr($root,-1) !== '/') $root = $root . '/'; - $theme_info = App::$theme_info; if(array_key_exists('extends',$theme_info)) @@ -992,21 +991,51 @@ function theme_include($file, $root = '') { return ''; } - function get_intltext_template($s, $root = '') { - - $t = App::template_engine(); - - $template = $t->get_intltext_template($s, $root); - return $template; + $testroot = ($root=='') ? $testroot = "ROOT" : $root; + $t = App::template_engine(); + + if (isset(\App::$override_intltext_templates[$testroot][$s]["content"])) { + return \App::$override_intltext_templates[$testroot][$s]["content"]; + } else { + if (isset(\App::$override_intltext_templates[$testroot][$s]["root"]) && + isset(\App::$override_intltext_templates[$testroot][$s]["file"])) { + $s = \App::$override_intltext_templates[$testroot][$s]["file"]; + $root = \App::$override_intltext_templates[$testroot][$s]["root"]; + } elseif (\App::$override_templateroot) { + $newroot = \App::$override_templateroot.$root; + if ($newroot != '' && substr($newroot,-1) != '/' ) { + $newroot .= '/'; + } + $template = $t->get_intltext_template($s, $newroot); + } + $template = $t->get_intltext_template($s, $root); + return $template; + } } - function get_markup_template($s, $root = '') { - - $t = App::template_engine(); - $template = $t->get_markup_template($s, $root); - return $template; + $testroot = ($root=='') ? $testroot = "ROOT" : $root; + + $t = App::template_engine(); + + if (isset(\App::$override_markup_templates[$testroot][$s]["content"])) { + return \App::$override_markup_templates[$testroot][$s]["content"]; + } else { + if (isset(\App::$override_markup_templates[$testroot][$s]["root"]) && + isset(\App::$override_markup_templates[$testroot][$s]["file"])) { + $s = \App::$override_markup_templates[$testroot][$s]["file"]; + $root = \App::$override_markup_templates[$testroot][$s]["root"]; + } elseif (\App::$override_templateroot) { + $newroot = \App::$override_templateroot.$root; + if ($newroot != '' && substr($newroot,-1) != '/' ) { + $newroot .= '/'; + } + $template = $t->get_markup_template($s, $newroot); + } + $template = $t->get_markup_template($s, $root); + return $template; + } } /** |