Merge pull request #2327 from burakcakirel/setting-key
Get dynamic setting key for apps
This commit is contained in:
commit
a3c6fc8f64
@ -1187,8 +1187,10 @@ abstract class DocumentShow extends Base
|
||||
return $textDocumentTitle;
|
||||
}
|
||||
|
||||
if (!empty(setting($type . '.title'))) {
|
||||
return setting($type . '.title');
|
||||
$key = $this->getSettingKey($type, 'title');
|
||||
|
||||
if (!empty(setting($key))) {
|
||||
return setting($key);
|
||||
}
|
||||
|
||||
$translation = $this->getTextFromConfig($type, 'document_title', Str::plural($type), 'trans_choice');
|
||||
@ -1206,8 +1208,10 @@ abstract class DocumentShow extends Base
|
||||
return $textDocumentSubheading;
|
||||
}
|
||||
|
||||
if (!empty(setting($type . '.subheading'))) {
|
||||
return setting($type . '.subheading');
|
||||
$key = $this->getSettingKey($type, 'subheading');
|
||||
|
||||
if (!empty(setting($key))) {
|
||||
return setting($key);
|
||||
}
|
||||
|
||||
$translation = $this->getTextFromConfig($type, 'document_subheading', 'subheading');
|
||||
|
@ -272,8 +272,10 @@ abstract class DocumentTemplate extends Base
|
||||
return $textDocumentTitle;
|
||||
}
|
||||
|
||||
if (!empty(setting($type . '.title'))) {
|
||||
return setting($type . '.title');
|
||||
$key = $this->getSettingKey($type, 'title');
|
||||
|
||||
if (!empty(setting($key))) {
|
||||
return setting($key);
|
||||
}
|
||||
|
||||
$translation = $this->getTextFromConfig($type, 'document_title', Str::plural($type));
|
||||
@ -291,8 +293,10 @@ abstract class DocumentTemplate extends Base
|
||||
return $textDocumentSubheading;
|
||||
}
|
||||
|
||||
if (!empty(setting($type . '.subheading'))) {
|
||||
return setting($type . '.subheading');
|
||||
$key = $this->getSettingKey($type, 'subheading');
|
||||
|
||||
if (!empty(setting($key))) {
|
||||
return setting($key);
|
||||
}
|
||||
|
||||
$translation = $this->getTextFromConfig($type, 'document_subheading', 'subheading');
|
||||
|
@ -42,7 +42,7 @@ class SettingFieldCreated
|
||||
continue;
|
||||
}
|
||||
|
||||
$real_key = $type . '.' . $key;
|
||||
$real_key = $this->getSettingKey($type, $key);
|
||||
|
||||
setting()->set($real_key, $value);
|
||||
}
|
||||
@ -66,7 +66,7 @@ class SettingFieldCreated
|
||||
continue;
|
||||
}
|
||||
|
||||
$real_key = $type . '.' . $key;
|
||||
$real_key = setting($this->getSettingKey($type, $key));
|
||||
|
||||
setting()->set($real_key, $value);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user