function ad_embed_admin_configure_settings_submit in Advertisement 5.2
Same name and namespace in other branches
- 5 embed/ad_embed.module \ad_embed_admin_configure_settings_submit()
- 6.3 embed/ad_embed.module \ad_embed_admin_configure_settings_submit()
- 6 embed/ad_embed.module \ad_embed_admin_configure_settings_submit()
- 6.2 embed/ad_embed.module \ad_embed_admin_configure_settings_submit()
- 7 embed/ad_embed.module \ad_embed_admin_configure_settings_submit()
Save changes from module settings page.
File
- embed/
ad_embed.module, line 200 - Embed ads in content.
Code
function ad_embed_admin_configure_settings_submit($form_id, $form_values) {
variable_set('ad_embed_replace_brackets', $form_values['ad_embed_replace_brackets']);
variable_set('ad_embed_replace_comments', $form_values['ad_embed_replace_comments']);
$types = node_get_types();
foreach ($types as $key => $type) {
variable_set("embed-ad-{$key}", $form_values["embed-ad-{$key}"]);
variable_set("embed-ad-{$key}-force", $form_values["embed-ad-{$key}-force"]);
if (is_array($form_values["embed-ad-{$key}-group"])) {
variable_set("embed-ad-{$key}-group", implode(',', $form_values["embed-ad-{$key}-group"]));
}
else {
variable_set("embed-ad-{$key}-group", '');
}
variable_set("embed-ad-{$key}-count", $form_values["embed-ad-{$key}-count"]);
variable_set("embed-ad-{$key}-quantity", $form_values["embed-ad-{$key}-quantity"]);
}
drupal_set_message(t('Embedded ad configuration options saved.'));
}