Definition at line 59 of file settings_manager.inc.
◆ configurationBootstrap()
static SettingsManager::configurationBootstrap |
( |
| ) |
|
|
static |
Sets the Fakoli framework configuration variables according to the settings stored in the database.
If a configuration variable already has a value (i.e. manually specified in the config.inc file) then the value is not overwritten.
The goal of this function is to aid with the migration of application-specific settings out of configuration files and into the application settings in the database.
Definition at line 152 of file settings_manager.inc.
154 global $auto_form_defaults;
157 $afDefaults = Cache::get(
"auto_form_defaults");
160 $afDefaults = array();
161 $autoFormSettings = Query::create(
Settings,
"WHERE component='settings' AND category='AutoForm'")
162 ->filter(
new InclusionFilter(
"name",
"value"))
165 foreach($autoFormSettings as
$setting)
170 Cache::put(
"auto_form_defaults", $afDefaults);
173 foreach($afDefaults as
$name => $value)
175 if (!isset($auto_form_defaults[
$name])) $auto_form_defaults[
$name] = $value;
178 $fontawesomeURL = Cache::get(
"font_awesome_URL");
179 if (!$fontawesomeURL)
183 Cache::put(
"font_awesome_URL", $fontawesomeURL);
The Settings class provides components with a common API for specifying application settings and conf...
static getValue($component, $name)
Retrieve the value of the specified Setting.
◆ getExtension()
static SettingsManager::getExtension |
( |
|
$component | ) |
|
|
static |
◆ getSubTabs()
static SettingsManager::getSubTabs |
( |
|
$component | ) |
|
|
static |
Definition at line 189 of file settings_manager.inc.
192 $settingCategories = array();
194 $categories = Query::create(
Settings,
"WHERE component = :component && (category != '' OR category != null)")
198 if(count($categories) > 0)
200 $categories = removeDuplicates($categories,
"category");
201 if(count($categories) > 1)
204 foreach($categories as $category)
206 $settingCategory =
new SettingsCategory();
207 $settingCategory->component_id =
$component->component_id;
208 $settingCategory->category_id = $idx;
209 $settingCategory->component =
$component->name;
210 $settingCategory->category = $category->category;
211 $settingCategories[] = $settingCategory;
215 $tabs =
new DataItemTabBar(
"subtabs", $settingCategories);
◆ registerExtension()
static SettingsManager::registerExtension |
( |
|
$component, |
|
|
|
$handler |
|
) |
| |
|
static |
◆ registerSerializationHandler()
static SettingsManager::registerSerializationHandler |
( |
| ) |
|
|
static |
Definition at line 227 of file settings_manager.inc.
registerHandler($component, $title, $handler)
Registers a serialization handler for a component.
◆ setDefaults()
static SettingsManager::setDefaults |
( |
| ) |
|
|
static |
Definition at line 95 of file settings_manager.inc.
97 trace(
"SettingsManager::setDefaults", 3);
101 preg_match_all(
"/([\\w\\d_]+)\.?([^}]*)/",
$config[
"http_host"], $matches, PREG_SET_ORDER);
102 if(count($matches) > 0)
104 $matches = $matches[0];
105 if(count($matches) > 1)
108 $sitename = prettify(
$path);
112 Settings::setDefaultValue(
"settings",
"prettyUrls",
true,
"Boolean",
"Whether urls are translated to CMS identifiers",
"General");
115 Settings::setDefaultValue(
"settings",
"wrap_modules",
true, Boolean,
"Specifies whether to wrap module output in a div tag, or render them bare",
"General");
116 Settings::setDefaultValue(
"settings",
"system_notification_email",
$config[
"email_contact"], String,
"The email address to which system notifications should be sent",
"General");
117 Settings::setDefaultValue(
"settings",
"local_IP_address",
"", String,
"Specifies the server's local IP address for environments (such as Microsoft Azure) where this cannot be determined automatically",
"General");
132 Settings::setDefaultValue(
"settings",
"onFormatLabel",
"addContextHelp",
"String",
"Callback function for start of field label",
"AutoForm");
134 Settings::setDefaultValue(
"settings",
"passwordEnterLabel",
"Enter",
"String",
"The text of the password entry field label",
"AutoForm");
135 Settings::setDefaultValue(
"settings",
"passwordEnterLabel",
"Confirm",
"String",
"The text of the password confirmation field label",
"AutoForm");
136 Settings::setDefaultValue(
"settings",
"buttons_at_top",
false,
"Boolean",
"Whether the form's save/cancel buttons appear at the top of the form in addition to the bottom.",
"AutoForm");
137 Settings::setDefaultValue(
"settings",
"default_layout",
"table", String,
"Specifies the default layout manager to use when rendering forms",
"AutoForm",
"table\nsimple\nmobile");
138 Settings::setDefaultValue(
"settings",
"interstitialSpinner",
"/fakoli/images/spinner.gif", String,
"Specifies the default spinner animation to use with interstitials",
"AutoForm");
140 Settings::setDefaultValue(
"settings",
"font_awesome_URL",
"",
'String',
"If you want to use a specific version of Font Awesome (for instance if you have a Pro subscription) enter the URL here",
"Font Awesome");
static setDefaultValue($component, $name, $value, $field_type="String", $annotation="", $category="", $options="", $weight=0)
Sets the default value of the given component setting.
◆ SettingsManager()
SettingsManager::SettingsManager |
( |
| ) |
|
◆ upgradeComponent()
static SettingsManager::upgradeComponent |
( |
|
$version | ) |
|
|
static |
◆ $extensionMap
SettingsManager::$extensionMap = array() |
|
static |
The documentation for this class was generated from the following file: