| Versionen | |
|---|---|
| drupal7 | theme_system_modules_fieldset($form) |
Theme callback for the modules form.
$form An associative array containing the structure of the form.
modules/
<?php
function theme_system_modules_fieldset($form) {
// Individual table headers.
$rows = array();
// Iterate through all the modules, which are
// children of this fieldset.
foreach (element_children($form) as $key) {
// Stick it into $module for easier accessing.
$module = $form[$key];
$row = array();
unset($module['enable']['#title']);
$row[] = array('class' => 'checkbox', 'data' => drupal_render($module['enable']));
$label = '<label';
if (isset($module['enable']['#id'])) {
$label .= ' for="' . $module['enable']['#id'] . '"';
}
$row[] = $label . '><strong>' . drupal_render($module['name']) . '</strong></label>';
$row[] = drupal_render($module['version']);
$description = '';
// If we have help, it becomes the first part
// of the description - with CSS, it is float: right'd.
if (isset($module['help'])) {
$description = '<div class="module-help">' . drupal_render($module['help']) . '</div>';
}
// Add the description, along with any modules it requires.
$description .= drupal_render($module['description']);
if ($module['#requires']) {
$description .= '<div class="admin-requirements">' . t('Requires: !module-list', array('!module-list' => implode(', ', $module['#requires']))) . '</div>';
}
if ($module['#required_by']) {
$description .= '<div class="admin-requirements">' . t('Required by: !module-list', array('!module-list' => implode(', ', $module['#required_by']))) . '</div>';
}
$row[] = array('data' => $description, 'class' => 'description');
$rows[] = $row;
}
return theme('table', $form['#header'], $rows);
}
?>
Kommentare
Kommentar hinzufügen