1
0

* Implemented suggestion of removing boilerplate code in plugin API:

Change hack protection, introduce unified language loading, see
      http://board.s9y.org/viewtopic.php?f=11&t=16921
      Thanks to mt2!
This commit is contained in:
Garvin Hicking
2010-08-20 09:07:42 +00:00
parent 4914b3f708
commit 8ca7f04b8f
33 changed files with 54 additions and 319 deletions

View File

@ -1099,6 +1099,24 @@ class serendipity_plugin_api
return $instance;
}
/**
* Probe for a language include with constants. Still include defines later on, if some constants were missing
*
* @access public
* @param current plugin's path
* @return object Returns the plugin object or false, if failure
*/
function load_language($path) {
global $serendipity;
$probelang = $path . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php';
if (file_exists($probelang)) {
include $probelang;
}
include $path . '/lang_en.inc.php';
}
}
/**