webketje / GS-Custom-Settings

A GetSimple CMS plugin for custom site, theme and plugin settings. Uses Knockout & RequireJS
http://webketje.github.io/projects/gs-custom-settings
2 stars 1 forks source link

GS Custom Settings

A GetSimple CMS plugin for custom site, theme and plugin settings.

Description

GS Custom Settings is a plugin for GetSimple CMS which lets webmasters/ site managers, theme and plugin developers implement and use their own custom settings for output, configuration, and cross-plugin/-theme communication. It's a bit like the custom fields plugin, but not for pages. The plugin offers 9 different types of input to choose from, 3 access levels, per-user editing permission, and an easy UI to create, import and export the settings. Once activated, a new tab 'Site', is added, where one will find all settings created with the plugin, grouped by sidebar tab.

Features

Plugin functions

More info

get_setting($tab, $setting, $echo=FALSE)
// @param {string} $tab - lookup property of the tab to search in
// @param {string} $setting - lookup property of the setting to output
// @param {boolean} $echo - whether to echo the string. Useful if you need output value without echoing.
get_i18n_setting($tab, $setting, $echo=TRUE)
// @param {string} $tab - lookup property of the tab to search in
// @param {string} $setting - lookup property of the multilingual setting to output
// @param {boolean} [$echo=TRUE] - (optional) Whether to echo the multilingual setting. 
return_setting($tab, $setting, $prop=NULL)
// @param {string} $tab - lookup property of the tab to search in
// @param {string} $setting - lookup property of the setting to return
// @param {string} [$prop=NULL] - (Optional) A single property of the setting to return
return_setting_group($tab, $group, $prop=NULL)
// @param {string} $tab - lookup property of the tab to search in
// @param {string} $group - prefix in the lookup property, common to all settings in the group
// @param {string|boolean} [$prop=NULL] - (Optional) A single property to return for all settings, 
// or FALSE to return them fully
set_setting($tab, $setting, $value)
// @param {string} $tab - lookup property of the tab to search in
// @param {string} $setting - lookup property of the setting to return
// @param {string|array} $value - The property (ies) to modify. 
remove_setting($tab, $setting)
// @param {string} $tab - lookup property of the tab to search in
// @param {string} $setting - lookup property of the setting to remove
get_tab_link($tab=NULL, $linkText='settings')
// @param {string} [$tab=NULL] - (Optional) Empty, lookup property of  
// lookup property of a plugin (basename) or 'theme_settings', or a site tab
// @param {string} [$linkText='settings'] - (Optional) A custom text for the <a> element

Plugin hooks

More info

add_action('custom-settings-load', $function)
// @param {string} $function - the function you want to execute before settings are loaded in the plugin UI
add_action('custom-settings-save', $function)
// @param {string} $function - the function you want to execute before settings are saved to their files
add_action('custom-settings-render-top', 'custom_settings_render', array($plugin, $function))
// @param {string} $plugin - basename of your plugin
// @param {string} $function - the function you want to execute before settings are loaded in the plugin UI
add_action('custom-settings-render-bottom', 'custom_settings_render', array($plugin, $function))
// @param {string} $plugin - basename of your plugin
// @param {string} $function - the function you want to execute before settings are loaded in the plugin UI