function update_init
update_init()
Implements hook_init().
File
- modules/update/update.module, line 111
- Handles updates of Drupal core and contributed projects.
Code
function update_init() { if (arg(0) == 'admin' && user_access('administer site configuration')) { switch ($_GET['q']) { // These pages don't need additional nagging. case 'admin/appearance/update': case 'admin/appearance/install': case 'admin/modules/update': case 'admin/modules/install': case 'admin/reports/updates': case 'admin/reports/updates/update': case 'admin/reports/updates/install': case 'admin/reports/updates/settings': case 'admin/reports/status': case 'admin/update/ready': return; // If we are on the appearance or modules list, display a detailed report // of the update status. case 'admin/appearance': case 'admin/modules': $verbose = TRUE; break; } module_load_install('update'); $status = update_requirements('runtime'); foreach (array('core', 'contrib') as $report_type) { $type = 'update_' . $report_type; if (!empty($verbose)) { if (isset($status[$type]['severity'])) { if ($status[$type]['severity'] == REQUIREMENT_ERROR) { drupal_set_message($status[$type]['description'], 'error', FALSE); } elseif ($status[$type]['severity'] == REQUIREMENT_WARNING) { drupal_set_message($status[$type]['description'], 'warning', FALSE); } } } // Otherwise, if we're on *any* admin page and there's a security // update missing, print an error message about it. else { if (isset($status[$type]) && isset($status[$type]['reason']) && $status[$type]['reason'] === UPDATE_NOT_SECURE) { drupal_set_message($status[$type]['description'], 'error', FALSE); } } } } }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!update!update.module/function/update_init/7.x