system_listing_save

Versions
4.6
system_listing_save($edit = array())

▾ 2 functions call system_listing_save()

system_modules in modules/system.module
Menu callback; displays a listing of all modules.
system_themes in modules/system.module
Menu callback; displays a listing of all themes.

Code

modules/system.module, line 506

<?php
function system_listing_save($edit = array()) {
  $op = $_POST['op'];
  $edit = $_POST['edit'];

  if ($op == t('Save configuration')) {
    db_query("UPDATE {system} SET status = 0 WHERE type = '%s'", $edit['type']);
    foreach ($edit['status'] as $name => $status) {
      // Make certain that the default theme is enabled to avoid user error
      if (($edit['type'] == 'theme') && ($edit['theme_default'] == $name)) {
        $status = 1;
      }

      db_query("UPDATE {system} SET status = %d, throttle = %d WHERE type = '%s' AND name = '%s'", $status, $edit['throttle'][$name], $edit['type'], $name);
    }

    if ($edit['type'] == 'theme') {
      variable_set('theme_default', $edit['theme_default']);
    }

    cache_clear_all();
    menu_rebuild();

    drupal_set_message(t('The configuration options have been saved.'));
    drupal_goto($_GET['q']);
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.