function _privatemsg_list_headers in Privatemsg 6
Same name and namespace in other branches
- 7 privatemsg.module \_privatemsg_list_headers()
Returns a table header definition based on the submitted keys.
Uses theme patterns to theme single headers.
Parameters
$has_posts: TRUE when there is at least one row. Decides if the select all checkbox should be displayed.
$keys: Array with the keys which are present in the query/should be displayed.
Return value
Array with header defintions for tablesort_sql and theme('table').
2 calls to _privatemsg_list_headers()
- privatemsg_sql_list in ./
privatemsg.module - Query definition to load a list of threads.
- theme_privatemsg_list in ./
privatemsg.theme.inc - Theme to display the privatemsg list.
File
- ./
privatemsg.module, line 2255 - Allows users to send private messages to other users.
Code
function _privatemsg_list_headers($has_posts, $keys) {
$select_header = $has_posts ? theme('table_select_header_cell') : '';
$select_header['#weight'] = -50;
// theme() doesn't include the theme file for patterns, we need to do it manually.
include_once drupal_get_path('module', 'privatemsg') . '/privatemsg.theme.inc';
$header = array(
$select_header,
);
foreach ($keys as $key) {
// First, try to load a specific theme for that header, if not present, use the default.
if ($return = theme(array(
'privatemsg_list_header__' . $key,
'privatemsg_list_header',
))) {
// The default theme returns nothing, only store the value if we have something.
$header[$key] = $return;
}
}
if (count($header) == 1) {
// No header definition returned, fallback to the default.
$header += _privatemsg_list_headers_fallback($keys);
}
return $header;
}