53 function import($doc,
$tx)
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");
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);
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);
224 $mgr->upgrade($version);
static usingFeature()
Uses the specified framework feature(s).
static using()
Import the datamodels, views and manifest for the specified component(s).
static serialize($class, $constraint="")
Serializes the specified DataItems to XML.
registerHandler($component, $title, $handler)
Registers a serialization handler for a component.
static unserialize($class, $doc, $tx, $save=true)
Instantiates DataItems from the supplied XML document and stores them in the database.
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.
static setDefaultValue($component, $name, $value, $field_type="String", $annotation="", $category="", $options="", $weight=0)
Sets the default value of the given component setting.
static getExtension($component)
static getSubTabs($component)
static registerSerializationHandler()
static upgradeComponent($version)
static registerExtension($component, $handler)
static configurationBootstrap()
Sets the Fakoli framework configuration variables according to the settings stored in the database.
SettingsSerializationHandler()