You are here

function _xmlsitemap_user_submit in XML sitemap 5

Same name and namespace in other branches
  1. 5.2 xmlsitemap_user/xmlsitemap_user.module \_xmlsitemap_user_submit()

Add submit actions to forms.

Return value

None

Related topics

File

xmlsitemap_user/xmlsitemap_user.module, line 136
Adds user profiles to the site map.

Code

function _xmlsitemap_user_submit($form_id, $form_values) {
  switch ($form_id) {
    case 'user_admin_settings':
      if ($form_values['xmlsitemap_user_default_priority'] != $form_values['xmlsitemap_user_old_default_priority']) {
        xmlsitemap_update_sitemap();
      }
      break;
    case 'user_admin_role':
      $priority = db_result(db_query("SELECT priority FROM {xmlsitemap_user_role} WHERE rid = %d", $form_values['rid']));
      if ($form_values['op'] == t('Delete role')) {
        db_query("DELETE FROM {xmlsitemap_user_role} WHERE rid = %d", $form_values['rid']);
        if ($priority > 0 || $priority < 0) {
          xmlsitemap_update_sitemap();
        }
      }
      elseif ($form_values['xmlsitemap_user_role_priority'] != $priority) {
        db_query("UPDATE {xmlsitemap_user_role} SET priority = %f WHERE rid = %d", $form_values['xmlsitemap_user_role_priority'], $form_values['rid']);
        xmlsitemap_update_sitemap();
      }
      break;
  }
}