Skip to content
Browse files

Enhanced plugin_config_get() function

The function now works similar to config_get(), and allows the usage
of user_id and project_id parameters. With this change it is now
possible to fetch plugins config values for a specific user and/or
project.

Fixes #13346

Signed-off-by: Damien Regad <damien.regad@merckgroup.com>
1 parent 67f88a4 commit ca4da39fb73114047b532897e8a27fe17db9f905 @dominik dominik committed with dregad Sep 23, 2011
Showing with 5 additions and 2 deletions.
  1. +5 −2 core/plugin_api.php
View
7 core/plugin_api.php
@@ -180,15 +180,18 @@ function plugin_table( $p_name, $p_basename = null ) {
* Get a plugin configuration option.
* @param string Configuration option name
* @param multi Default option value
+ * @param boolean Global value
+ * @param int User ID
+ * @param int Project ID
*/
-function plugin_config_get( $p_option, $p_default = null, $p_global = false ) {
+function plugin_config_get( $p_option, $p_default = null, $p_global = false, $p_user = null, $p_project = null ) {
$t_basename = plugin_get_current();
$t_full_option = 'plugin_' . $t_basename . '_' . $p_option;
if( $p_global ) {
return config_get_global( $t_full_option, $p_default );
} else {
- return config_get( $t_full_option, $p_default );
+ return config_get( $t_full_option, $p_default, $p_user, $p_project );
}
}

0 comments on commit ca4da39

Please sign in to comment.
Something went wrong with that request. Please try again.