Theming documentation

  1. 1 privatemsg.theme.inc theming
  2. 7-1 privatemsg.theme.inc theming
  3. 7-2 privatemsg.theme.inc theming
  4. 6-2 privatemsg.theme.inc theming

It is possible to theme many aspect of privatemsg with theme functions.

For the thread list, so called theme patterns are used to allow flexible theming of the table and its columns (including columns added by other modules).

Columns are defined with hook_privatemsg_header_info(). The default weight and if they are enabled or not can by set by default but can be overridden in the admin user interface.

Additionally, a theme function needs to be defined that defaults to the name 'privatemsg_list_field__$key', where $key is the name of the header/column.

Every theme function will receive the $thread array as single argument, which is everything that has been returned by the query built in privatemsg_sql_list(). The theme function should return either a string or a theme_table() compatible array.

To change what information is available in that array, it is possible to either implement hook_privatemsg_sql_list_alter() or alter $form['#data'] of privatemsg_list(). See privatemsg_filter_form_privatemsg_list_alter() for an example.

To override an already existing theme function, use the following structure: themename_privatemsg_list_field_fieldname. It is possible to change the header definition with hook_privatemsg_header_info_alter() but that is often not necessary.

File

./privatemsg.theme.inc, line 8
Theme functions for privatemsg.

Functions

Namesort descending Location Description
hook_privatemsg_header_info ./privatemsg.api.php Declare headers for message listings.
hook_privatemsg_header_info_alter ./privatemsg.api.php Alter the defined header structure.
privatemsg_get_headers ./privatemsg.module Returns an array of defined column headers for message listings.
theme_pm_block_user_actions pm_block_user/pm_block_user.module Theme the user actions form.
theme_privatemsg_admin_settings_display_fields ./privatemsg.theme.inc Output the admin settings display fields and weight settings as a drag and drop sortable table.
theme_privatemsg_list_field__count ./privatemsg.theme.inc Theme the replies field.
theme_privatemsg_list_field__last_updated ./privatemsg.theme.inc Theme the last updated column.
theme_privatemsg_list_field__participants ./privatemsg.theme.inc Theme the participants field.
theme_privatemsg_list_field__subject ./privatemsg.theme.inc Theme the subject of the thread.
theme_privatemsg_list_field__thread_started ./privatemsg.theme.inc Theme the thread started column.
theme_privatemsg_new_block ./privatemsg.theme.inc Theme a block which displays the number of unread messages a user has.
theme_privatemsg_username ./privatemsg.theme.inc Used to theme and display user recipients.