/**
 * Unsets all plugin settings for a plugin.
 *
 * @param string $plugin_id Optional plugin name, if not specified
 *                          then it is detected from where you are calling from.
 *
 * @return bool
 * @deprecated 1.8 Use elgg_unset_all_plugin_settings() or ElggPlugin->unsetAllSettings()
 * @since 1.7.0
 */
function clear_all_plugin_settings($plugin_id = "")
{
    elgg_deprecated_notice('clear_all_plugin_settings() is deprecated by elgg_unset_all_plugin_setting()', 1.8);
    return elgg_unset_all_plugin_settings($plugin_id);
}
Beispiel #2
0
<?php

/**
 * iZAP Videos plugin by iionly
 * (based on version 3.71b of the original izap_videos plugin for Elgg 1.7)
 * Contact: iionly@gmx.de
 * https://github.com/iionly
 *
 * Original developer of the iZAP Videos plugin:
 * @package Elgg videotizer, by iZAP Web Solutions
 * @license GNU Public License version 2
 * @Contact iZAP Team "<*****@*****.**>"
 * @Founder Tarun Jangra "<*****@*****.**>"
 * @link http://www.izap.in/
 *
 */
$cleared = elgg_unset_all_plugin_settings('izap_videos');
if ($cleared) {
    system_message(elgg_echo('izap_videos:success:adminSettingsReset'));
} else {
    register_error(elgg_echo('izap_videos:error:adminSettingsReset'));
}
forward(REFERER);
<?php

// If a previous version of the hypeWall-iZAP Videos plugin with the old name was installed
// handle the change of plugin name / id
$current_version = elgg_get_plugin_setting('version', 'hypewall_izap_videos_tidypics');
$new_version = '1.9.2';
if (!$current_version) {
    // show hidden entities (in this case disabled plugins)
    $old_access = access_get_show_hidden_status();
    access_show_hidden_entities(true);
    $old_plugin_previously_installed = elgg_get_plugin_from_id('hypeWall_izap_videos');
    if ($old_plugin_previously_installed) {
        elgg_unset_all_plugin_settings('hypeWall_izap_videos');
    }
    access_show_hidden_entities($old_access);
}
if (version_compare($current_version, $new_version, '!=')) {
    // Set new version
    elgg_set_plugin_setting('version', $new_version, 'hypewall_izap_videos_tidypics');
}
<?php

// If a previous version of the Set No Notification plugin was installed convert the plugin settings,
// if the old version had the former plugin name / id setNoNotifications instead of the new name / id
$current_version = elgg_get_plugin_setting('version', 'set_no_notifications');
$new_version = '1.9.3';
if (!$current_version) {
    // show hidden entities (in this case disabled plugins)
    $old_access = access_get_show_hidden_status();
    access_show_hidden_entities(true);
    $old_plugin_previously_installed = elgg_get_plugin_from_id('setNoNotifications');
    if ($old_plugin_previously_installed) {
        $old_setNoNotif_time = $old_plugin_previously_installed->setNoNotif_time;
        $old_setNoNotif_type = $old_plugin_previously_installed->setNoNotif_type;
        elgg_unset_all_plugin_settings('setNoNotifications');
        elgg_set_plugin_setting('setNoNotif_time', $old_setNoNotif_time, 'set_no_notifications');
        elgg_set_plugin_setting('setNoNotif_type', $old_setNoNotif_type, 'set_no_notifications');
    }
    access_show_hidden_entities($old_access);
}
if (version_compare($current_version, $new_version, '!=')) {
    // Set new version
    elgg_set_plugin_setting('version', $new_version, 'set_no_notifications');
}
Beispiel #5
0
    elgg_set_plugin_setting('comment', $pointssettings->generic_comment, 'elggx_userpoints');
    elgg_set_plugin_setting('riverpost', $pointssettings->riverpost, 'elggx_userpoints');
    elgg_set_plugin_setting('thewire', $pointssettings->thewire, 'elggx_userpoints');
    elgg_set_plugin_setting('image', $pointssettings->upload_photo, 'elggx_userpoints');
    elgg_set_plugin_setting('poll', $pointssettings->poll, 'elggx_userpoints');
    elgg_set_plugin_setting('pollvote', $pointssettings->pollvote, 'elggx_userpoints');
    elgg_set_plugin_setting('phototag', $pointssettings->phototag, 'elggx_userpoints');
    elgg_set_plugin_setting('discussion_reply', $pointssettings->group_topic_post, 'elggx_userpoints');
    elgg_set_plugin_setting('login', $pointssettings->login, 'elggx_userpoints');
    elgg_set_plugin_setting('delete', $pointssettings->delete, 'elggx_userpoints');
    elgg_set_plugin_setting('invite', $pointssettings->invite, 'elggx_userpoints');
    elgg_set_plugin_setting('verify_email', $pointssettings->verify_email, 'elggx_userpoints');
    elgg_set_plugin_setting('require_registration', $pointssettings->require_registration, 'elggx_userpoints');
    elgg_set_plugin_setting('expire_invite', $pointssettings->expire_invite, 'elggx_userpoints');
    elgg_unset_all_plugin_settings('userpoints');
    elgg_unset_all_plugin_settings('userpoints_standard');
    // Set new version
    elgg_set_plugin_setting('version', $new_version, 'elggx_userpoints');
} else {
    if (version_compare($current_version, '1.9.7', '<')) {
        $pointssettings = elgg_get_plugin_from_id('elggx_userpoints');
        elgg_set_plugin_setting('discussion_reply', $pointssettings->group_topic_post, 'elggx_userpoints');
        elgg_set_plugin_setting('comment', $pointssettings->generic_comment, 'elggx_userpoints');
        elgg_unset_plugin_setting('group_topic_post', 'elggx_userpoints');
        elgg_unset_plugin_setting('generic_comment', 'elggx_userpoints');
        // Set new version
        elgg_set_plugin_setting('version', $new_version, 'elggx_userpoints');
    } else {
        if (version_compare($current_version, '1.9.8', '<')) {
            $pointssettings = elgg_get_plugin_from_id('elggx_userpoints');
            elgg_set_plugin_setting('discussion', $pointssettings->groupforumtopic, 'elggx_userpoints');