function drush_stringoverrides_disable in String Overrides 7
Drush Callback; Disable a String Override.
File
- ./
stringoverrides.drush.inc, line 184 - Drush interface for String Overrides.
Code
function drush_stringoverrides_disable($original) {
// Get the available options.
$language = drush_get_option('language', 'en');
$context = drush_get_option('context', '');
// Load the current overrides.
$disabled = variable_get("locale_custom_disabled_strings_{$language}", array());
$enabled = variable_get("locale_custom_strings_{$language}", array());
// Make sure the override exists.
if (isset($enabled[$context][$original])) {
// Swap the values.
$disabled[$context][$original] = $enabled[$context][$original];
unset($enabled[$context][$original]);
variable_set("locale_custom_disabled_strings_{$language}", $disabled);
variable_set("locale_custom_strings_{$language}", $enabled);
drush_print(dt('The string override has been disabled.'));
}
else {
drush_print(dt('Given enabled string override not found.'));
}
}