function theme_pm_block_user_actions in Privatemsg 6.2
Same name and namespace in other branches
- 6 pm_block_user/pm_block_user.module \theme_pm_block_user_actions()
- 7.2 pm_block_user/pm_block_user.module \theme_pm_block_user_actions()
- 7 pm_block_user/pm_block_user.module \theme_pm_block_user_actions()
Theme the user actions form.
1 theme call to theme_pm_block_user_actions()
- pm_block_user_settings in pm_block_user/
pm_block_user.admin.inc - Menu callback for blocked user settings.
File
- pm_block_user/
pm_block_user.admin.inc, line 261 - Administration menu callbacks for pm_block_user.module.
Code
function theme_pm_block_user_actions($form) {
$rows = array();
$headers = array(
t('If the author has the role'),
t('And the recipient has the role'),
t('Action'),
t('Enabled'),
'',
);
$form_data = element_children($form);
foreach ($form_data as $key) {
// Build the table row.
$row = array(
'data' => array(
array(
'data' => drupal_render($form[$key]['author']),
),
array(
'data' => drupal_render($form[$key]['recipient']),
),
array(
'data' => drupal_render($form[$key]['action']),
),
array(
'data' => drupal_render($form[$key]['enabled']),
),
array(
'data' => drupal_render($form[$key]['remove']),
),
),
);
// Add additional attributes to the row, such as a class for this row.
if (isset($form[$key]['#attributes'])) {
$row = array_merge($row, $form[$key]['#attributes']);
}
$rows[] = $row;
}
// If there are no rows, output some instructions for the user.
if (empty($form_data)) {
$rows[] = array(
array(
'data' => t("No rules have been added. All users may block private messages from each other. To limit which users may be blocked, click 'Add new rule'."),
'colspan' => '5',
),
);
}
$output = theme('table', $headers, $rows);
$output .= drupal_render($form);
return $output;
}