diff --git a/bl-kernel/abstract/plugin.class.php b/bl-kernel/abstract/plugin.class.php old mode 100644 new mode 100755 index 13acf26c..eacaeaf7 --- a/bl-kernel/abstract/plugin.class.php +++ b/bl-kernel/abstract/plugin.class.php @@ -21,9 +21,14 @@ class Plugin { // (array) Plugin's information. public $metadata; + + // (dbLanguage) Plugin's localisation. + public $language; function __construct() { + global $Site; + $this->dbFields = array(); $reflector = new ReflectionClass(get_class($this)); @@ -47,6 +52,16 @@ class Plugin { $metadataString = file_get_contents($this->filenameMetadata); $this->metadata = json_decode($metadataString, true); + // Load localisation + $tmp = new dbLanguage($Site->locale(), PATH_PLUGINS.$this->directoryName.DS.'languages'.DS); + // Set name and description from the language file. + $this->setMetadata('name',$tmp->db['plugin-data']['name']); + $this->setMetadata('description',$tmp->db['plugin-data']['description']); + + // Remove name and description + unset($tmp->db['plugin-data']); + $this->language = $tmp; + // If the plugin is installed then get the database. if($this->installed()) { @@ -218,8 +233,12 @@ class Plugin { public function init() { - // This method is used on childre classes. - // The user can define your own dbFields. + // This method is used on child classes. + // The user can define their own dbFields. } + public function L($key) + { + return $this->language->get($key); + } } \ No newline at end of file diff --git a/bl-kernel/admin/themes/default/index.php b/bl-kernel/admin/themes/default/index.php old mode 100644 new mode 100755 index 5c78acac..ef631a7c --- a/bl-kernel/admin/themes/default/index.php +++ b/bl-kernel/admin/themes/default/index.php @@ -30,134 +30,136 @@
- - + + - - - -