1
0

proof-of-concept .js.tpl: Added fallback for serendipity_editor.js.tpl as serendipity_editor.js to default-template, and changed serendipity_get_file to react to .js.tpl-files in template-directories

This commit is contained in:
onli
2013-03-06 14:55:21 +01:00
parent e1526d87b8
commit 0cd974fa6d
6 changed files with 28 additions and 38 deletions

View File

@ -10,7 +10,7 @@
var view_full = '{$CONST.VIEW_FULL}';
var view_hide = '{$CONST.HIDE}';
</script>
<script src="{$serendipityBaseURL}index.php?/plugin/serendipity_editor.js"></script>
<script src="{serendipity_getFile file='admin/serendipity_editor.js'}"></script>
<h2>{$CONST.COMMENTS}</h2>

View File

@ -282,6 +282,11 @@ function serendipity_getTemplateFile($file, $key = 'serendipityHTTPPath') {
if (file_exists($serendipity['serendipityPath'] . $templateFile)) {
return $serendipity[$key] . $templateFile;
}
if (file_exists($serendipity['serendipityPath'] . $templateFile . ".tpl")) {
# catch .js.tpl files served via the template-plugin-api
return $serendipity['baseURL'] . 'index.php?/plugin/' . $file;
}
}
if (preg_match('@\.(tpl|css|php)@i', $file) && !stristr($file, 'plugin')) {
@ -2246,4 +2251,14 @@ function serendipity_passwordhash($cleartext_password) {
}
}
//function serendipity_registerHandler($handler, $link) {
//global $serendipity;
//
//if ( ! is_array($serendipity["handler"])) {
//$serendipity["handler"] = array();
//}
//$serendipity["handler"][$link] = $handler;
//
//}
/* vim: set sts=4 ts=4 expandtab : */