mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2024-12-27 06:29:19 +08:00
add support for using trans id in plugin title/description
This commit is contained in:
parent
cc6afebfec
commit
2125e05bc2
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user