Commit 347f044f authored by Nicolas Widart's avatar Nicolas Widart

Merge commit 'd95b4afd'

* commit 'd95b4afd':
  Squashed 'Modules/Setting/' changes from e875263..d8d036c
parents 3cf4e6d3 d95b4afd
......@@ -34,7 +34,7 @@ class SettingServiceProvider extends ServiceProvider {
$this->app->booting(function()
{
$loader = AliasLoader::getInstance();
$loader->alias('Modules\Setting\Facades\Settings', 'Settings');
$loader->alias('Settings', 'Modules\Setting\Facades\Settings');
});
}
......
......@@ -36,19 +36,19 @@ class Settings implements Setting
{
if (!$this->cache->has("setting.$name")) {
$setting = $this->setting->get($name);
$this->cache->put("setting.$name", $setting, '3600');
}
$setting = $this->cache->get("setting.$name");
if ($setting) {
if ($setting->isTranslatable) {
return $setting->translate($locale)->value;
if ($setting) {
if ($setting->isTranslatable) {
$this->cache->put("setting.$name", $setting->translate($locale)->value, '3600');
} else {
$this->cache->put("setting.$name", $setting->plainValue, '3600');
}
} else {
$default = is_null($default) ? '' : $default;
$this->cache->put("setting.$name", $default, '3600');
}
return $setting->plainValue;
}
return $default;
return $this->cache->get("setting.$name");
}
/**
......
{
"name": "asgardcms/setting-module",
"type": "asgard-module",
"description": "Setting module for AsgardCMS. Handles all the site settings.",
"keywords": [
"asgardcms",
"settings"
],
"license": "MIT",
"authors": [
{
"name": "Nicolas Widart",
"email": "info@asgardcms.com",
"role": "Developer"
}
],
"support": {
"email": "support@asgardcms.com",
"issues": "https://github.com/AsgardCms/Setting/issues",
"source": "https://github.com/AsgardCms/Setting"
},
"require": {
"php": ">=5.4",
"composer/installers": "~1.0"
},
"minimum-stability": "dev"
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment