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:
@ -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>
|
||||
|
||||
|
@ -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 : */
|
||||
|
Reference in New Issue
Block a user