diff --git a/app/Http/Controllers/PluginController.php b/app/Http/Controllers/PluginController.php index 27408b34..e5182bd4 100644 --- a/app/Http/Controllers/PluginController.php +++ b/app/Http/Controllers/PluginController.php @@ -21,6 +21,10 @@ class PluginController extends Controller if ($plugins->getPlugins()->has($id)) { $plugin = $plugins->getPlugin($id); + + // pass the plugin title through the translator + $plugin->title = trans($plugin->title); + switch ($request->get('action')) { case 'enable': $plugins->enable($id); diff --git a/app/Providers/PluginServiceProvider.php b/app/Providers/PluginServiceProvider.php index 71c8824e..67a1c81a 100644 --- a/app/Providers/PluginServiceProvider.php +++ b/app/Providers/PluginServiceProvider.php @@ -22,12 +22,15 @@ class PluginServiceProvider extends ServiceProvider // make view instead of view.finder since the finder is defined as not a singleton $finder = $this->app->make('view'); - foreach ($plugins->getEnabledPlugins() as $plugin) { - $src_paths[$plugin->getNameSpace()] = $plugin->getPath()."/src"; - // add paths of translation files for namespace hints + foreach ($plugins->getPlugins() as $plugin) { + if ($plugin->isEnabled()) { + $src_paths[$plugin->getNameSpace()] = $plugin->getPath()."/src"; + // add paths of views + $finder->addNamespace($plugin->getNameSpace(), $plugin->getPath()."/views"); + } + + // always add paths of translation files for namespace hints $loader->addNamespace($plugin->getNameSpace(), $plugin->getPath()."/lang"); - // add paths of views - $finder->addNamespace($plugin->getNameSpace(), $plugin->getPath()."/views"); } $this->registerClassAutoloader($src_paths); diff --git a/app/helpers.php b/app/helpers.php index e7c4fa8f..ad41f4e6 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -253,9 +253,10 @@ if (! function_exists('option')) { * * @param array|string $key * @param mixed $default + * @param raw $raw return raw value without convertion * @return mixed */ - function option($key = null, $default = null) + function option($key = null, $default = null, $raw = false) { $options = app('options'); @@ -270,7 +271,7 @@ if (! function_exists('option')) { return; } - return $options->get($key, $default); + return $options->get($key, $default, $raw); } }