Esempio n. 1
0
function dd_button_global_setup()
{
    global $ddGlobalConfig;
    if (isset($_POST[DD_FORM_SAVE]) && check_admin_referer('digg_digg_global_save', 'digg_digg_global_nonce')) {
        //update global settings options
        foreach (array_keys($ddGlobalConfig) as $key) {
            //echo '<h1>' . $key . '</h1>';
            foreach (array_keys($ddGlobalConfig[$key]) as $option) {
                //echo '<h1>' . $option . '</h1>';
                if (isset($_POST[$option])) {
                    $ddGlobalConfig[$key][$option] = $_POST[$option];
                } else {
                    $ddGlobalConfig[$key][$option] = DD_EMPTY_VALUE;
                }
            }
        }
        update_option(DD_GLOBAL_CONFIG, $ddGlobalConfig);
        echo "<div id=\"updatemessage\" class=\"updated fade\"><p>Digg Digg settings updated.</p></div>\n";
        echo "<script type=\"text/javascript\">setTimeout(function(){jQuery('#updatemessage').hide('slow');}, 3000);</script>";
    } else {
        if (isset($_POST[DD_FORM_CLEAR])) {
            dd_clear_form_global_config(DD_FUNC_TYPE_RESET);
            echo "<div id=\"errmessage\" class=\"error fade\"><p>Digg Digg settings cleared.</p></div>\n";
            echo "<script type=\"text/javascript\">setTimeout(function(){jQuery('#errmessage').hide('slow');}, 3000);</script>";
        } else {
            if (isset($_POST[DD_FORM_CLEAR_ALL])) {
                dd_clear_all_forms_settings();
                echo "<div id=\"errmessage\" class=\"error fade\"><p>Digg Digg settings cleared.</p></div>\n";
                echo "<script type=\"text/javascript\">setTimeout(function(){jQuery('#errmessage').hide('slow');}, 3000);</script>";
            }
        }
    }
    //get back the settings from wordpress options
    $ddGlobalConfig = get_option(DD_GLOBAL_CONFIG);
    dd_print_global_form($ddGlobalConfig);
}
Esempio n. 2
0
function dd_clear_all_forms_settings()
{
    dd_clear_form_global_config(DD_FUNC_TYPE_RESET);
    dd_clear_form_normal_display(DD_FUNC_TYPE_RESET);
    dd_clear_form_float_display(DD_FUNC_TYPE_RESET);
}
function dd_upgrade_setting_version_5()
{
    dd_clear_form_global_config(DD_FUNC_TYPE_RESET);
    dd_add_button(DD_BUTTON_BUFFER, new DD_Buffer());
    dd_add_button(DD_BUTTON_PINTEREST, new DD_Pinterest());
}