system_modules_uninstall
modules/system/system.admin.inc, строка 999
- Версии
- 5
system_modules_uninstall(
$form_values= NULL)- 6
system_modules_uninstall($form_state = NULL)
Builds a form of currently disabled modules.
See also
system_modules_uninstall_validate()
@see system_modules_uninstall_submit()
Параметры
$form_state['values']
Submitted form values.
Возвращаемое значение
A form array representing the currently disabled modules.
Связанные темы
Код
<?php
function system_modules_uninstall($form_state = NULL) {
// Make sure the install API is available.
include_once './includes/install.inc';
// Display the confirm form if any modules have been submitted.
if (isset($form_state) && $confirm_form = system_modules_uninstall_confirm_form($form_state['storage'])) {
return $confirm_form;
}
$form = array();
// Pull all disabled modules from the system table.
$disabled_modules = db_query("SELECT name, filename, info FROM {system} WHERE type = 'module' AND status = 0 AND schema_version > %d ORDER BY name", SCHEMA_UNINSTALLED);
while ($module = db_fetch_object($disabled_modules)) {
// Grab the module info
$info = unserialize($module->info);
// Load the .install file, and check for an uninstall hook.
// If the hook exists, the module can be uninstalled.
module_load_install($module->name);
if (module_hook($module->name, 'uninstall')) {
$form['modules'][$module->name]['name'] = array('#value' => $info['name'] ? $info['name'] : $module->name);
$form['modules'][$module->name]['description'] = array('#value' => t($info['description']));
$options[$module->name] = '';
}
}
// Only build the rest of the form if there are any modules available to uninstall.
if (!empty($options)) {
$form['uninstall'] = array(
'#type' => 'checkboxes',
'#options' => $options,
);
$form['buttons']['submit'] = array(
'#type' => 'submit',
'#value' => t('Uninstall'),
);
$form['#action'] = url('admin/build/modules/uninstall/confirm');
}
else {
$form['modules'] = array();
}
return $form;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии