|
@@ -101,7 +101,7 @@ discard block |
|
|
block discarded – undo |
|
101
|
101
|
// Translation category |
|
102
|
102
|
$i18n = Craft::$app->getI18n(); |
|
103
|
103
|
/** @noinspection UnSafeIsSetOverArrayInspection */ |
|
104
|
|
- if (!isset($i18n->translations[$this->id]) && !isset($i18n->translations[$this->id . '*'])) { |
|
|
104
|
+ if (!isset($i18n->translations[$this->id]) && !isset($i18n->translations[$this->id.'*'])) { |
|
105
|
105
|
$i18n->translations[$this->id] = [ |
|
106
|
106
|
'class' => PhpMessageSource::class, |
|
107
|
107
|
'sourceLanguage' => 'en-US', |
|
@@ -135,15 +135,15 @@ discard block |
|
|
block discarded – undo |
|
135
|
135
|
public function registerEventHandlers(): void |
|
136
|
136
|
{ |
|
137
|
137
|
// Base CP templates directory |
|
138
|
|
- Event::on(View::class, View::EVENT_REGISTER_CP_TEMPLATE_ROOTS, function (RegisterTemplateRootsEvent $e) { |
|
139
|
|
- if (is_dir($baseDir = $this->getBasePath() . DIRECTORY_SEPARATOR . 'templates')) { |
|
|
138
|
+ Event::on(View::class, View::EVENT_REGISTER_CP_TEMPLATE_ROOTS, function(RegisterTemplateRootsEvent $e) { |
|
|
139
|
+ if (is_dir($baseDir = $this->getBasePath().DIRECTORY_SEPARATOR.'templates')) { |
|
140
|
140
|
$e->roots[$this->id] = $baseDir; |
|
141
|
141
|
} |
|
142
|
142
|
}); |
|
143
|
143
|
// Base Site templates directory |
|
144
|
144
|
if (self::$settings->allowTemplateAccess) { |
|
145
|
|
- Event::on(View::class, View::EVENT_REGISTER_SITE_TEMPLATE_ROOTS, function (RegisterTemplateRootsEvent $e) { |
|
146
|
|
- if (is_dir($baseDir = $this->getBasePath() . DIRECTORY_SEPARATOR . 'templates')) { |
|
|
145
|
+ Event::on(View::class, View::EVENT_REGISTER_SITE_TEMPLATE_ROOTS, function(RegisterTemplateRootsEvent $e) { |
|
|
146
|
+ if (is_dir($baseDir = $this->getBasePath().DIRECTORY_SEPARATOR.'templates')) { |
|
147
|
147
|
$e->roots[$this->id] = $baseDir; |
|
148
|
148
|
} |
|
149
|
149
|
}); |