shareaholic_reset_plugin_form.php in Share Buttons, Related Posts, Content Analytics - Shareaholic 7.3
Same filename and directory in other branches
This file is responsible for the reset plugin form (rendering/handling)
File
includes/shareaholic_reset_plugin_form.phpView source
<?php
/**
* @file
*
* This file is responsible for the reset
* plugin form (rendering/handling)
*/
/**
* The form object for the reset plugin
* The form will have button to reset the plugin
*
*/
function shareaholic_reset_plugin_form() {
$form['reset'] = array(
'#prefix' => '<fieldset class="app"><legend><h2>' . t('Reset') . '</h2></legend>',
'#suffix' => '</fieldset>',
);
$form['reset']['submit'] = array(
'#type' => 'submit',
'#prefix' => '<p>' . t('This will reset all of your settings and start you from scratch. This can not be undone.') . '</p>',
'#value' => t('Reset Module'),
);
$form['reset']['submit']['#attributes']['class'][] = 'settings';
$form['reset']['submit']['#attributes']['onclick'][] = 'this.value="Resetting..."';
return $form;
}
/**
* The submit handler for the reset plugin form
* When the user resets the plugin, destroy settings
* and get a new api key
*
*/
function shareaholic_reset_plugin_form_submit($form, &$form_state) {
ShareaholicUtilities::reset_settings();
drupal_set_message(t('Module has been reset. Please clear your cache.'), 'status');
}
Functions
Name | Description |
---|---|
shareaholic_reset_plugin_form | The form object for the reset plugin The form will have button to reset the plugin |
shareaholic_reset_plugin_form_submit | The submit handler for the reset plugin form When the user resets the plugin, destroy settings and get a new api key |