parent
59d183b3b0
commit
061d35e5fd
|
|
@ -1,11 +1,14 @@
|
|||
<?php namespace Cms;
|
||||
|
||||
use App;
|
||||
use Lang;
|
||||
use File;
|
||||
use Event;
|
||||
use Backend;
|
||||
use BackendMenu;
|
||||
use BackendAuth;
|
||||
use Backend\Models\UserRole;
|
||||
use Cms\Classes\Theme as CmsTheme;
|
||||
use Backend\Classes\WidgetManager;
|
||||
use October\Rain\Support\ModuleServiceProvider;
|
||||
use System\Classes\SettingsManager;
|
||||
|
|
@ -40,6 +43,7 @@ class ServiceProvider extends ModuleServiceProvider
|
|||
$this->registerBackendPermissions();
|
||||
$this->registerBackendWidgets();
|
||||
$this->registerBackendSettings();
|
||||
$this->registerBackendLocalization();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -284,6 +288,20 @@ class ServiceProvider extends ModuleServiceProvider
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers localization from an active theme for backend items.
|
||||
*/
|
||||
protected function registerBackendLocalization()
|
||||
{
|
||||
$theme = CmsTheme::getActiveTheme();
|
||||
|
||||
$langPath = $theme->getPath() . '/lang';
|
||||
|
||||
if (File::isDirectory($langPath)) {
|
||||
Lang::addNamespace("theme.{$theme->getId()}", $langPath);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers events for menu items.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -103,8 +103,11 @@ class ThemeOptions extends Controller
|
|||
|
||||
/**
|
||||
* Default to the active theme if user doesn't have access to manage all themes
|
||||
*
|
||||
* @param string $dirName
|
||||
* @return string
|
||||
*/
|
||||
protected function getDirName($dirName = null)
|
||||
protected function getDirName(string $dirName = null)
|
||||
{
|
||||
/*
|
||||
* Only the active theme can be managed without this permission
|
||||
|
|
|
|||
Loading…
Reference in New Issue