mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-02 04:15:05 +02:00
add function conf_delete_param
git-svn-id: http://piwigo.org/svn/trunk@24350 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -1086,6 +1086,11 @@ SELECT param, value
|
||||
trigger_action('load_conf', $condition);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add or update a config parameter
|
||||
* @param string $param
|
||||
* @param string $value
|
||||
*/
|
||||
function conf_update_param($param, $value)
|
||||
{
|
||||
$query = '
|
||||
@@ -1118,6 +1123,36 @@ UPDATE '.CONFIG_TABLE.'
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete on or more config parameters
|
||||
* @since 2.6
|
||||
* @param string|string[] $params
|
||||
*/
|
||||
function conf_delete_param($params)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
if (!is_array($params))
|
||||
{
|
||||
$params = array($params);
|
||||
}
|
||||
if (empty($params))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$query = '
|
||||
DELETE FROM '.CONFIG_TABLE.'
|
||||
WHERE param IN(\''. implode('\',\'', $params) .'\')
|
||||
;';
|
||||
pwg_query($query);
|
||||
|
||||
foreach ($params as $param)
|
||||
{
|
||||
unset($conf[$param]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepends and appends a string at each value of the given array.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user