function popup_maker_enable_popup in Popup Maker - All popup types 7
1 call to popup_maker_enable_popup()
File
- ./
popup_maker.admin.inc, line 124
Code
function popup_maker_enable_popup() {
if (!isset($_POST['id'])) {
drupal_set_message('Parameter "id" is required to enable a popup', 'error');
return false;
}
$id = abs(intval($_POST['id']));
if ($id != $_POST['id']) {
drupal_set_message('Parameter "id" must be non negative integer', 'error');
return false;
}
$config = variable_get('popup_maker_settings', array(
'api_key' => null,
'popups' => array(),
'popupSettings' => array(),
'user' => array(),
));
if (empty($config['popupSettings'])) {
$config['popupSettings'] = array();
}
if (!isset($config['popupSettings'][$_POST['id']])) {
$config['popupSettings'][$_POST['id']] = array();
}
$config['popupSettings'][$_POST['id']]['enabled'] = 1;
variable_set('popup_maker_settings', $config);
drupal_set_message('Popup Enabled successfully');
}