Theming documentation

  1. 1 theming
  2. 7-1 theming
  3. 7-2 theming
  4. 6-2 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.


./, line 8
Theme functions for privatemsg.


Name Locationsort descending Description
theme_pm_block_user_actions pm_block_user/pm_block_user.module Theme the user actions form.
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_privatemsg_list_field__participants ./ Theme the participants field.
theme_privatemsg_list_field__subject ./ Theme the subject of the thread.
theme_privatemsg_list_field__count ./ Theme the replies field.
theme_privatemsg_list_field__last_updated ./ Theme the last updated column.
theme_privatemsg_list_field__thread_started ./ Theme the thread started column.
theme_privatemsg_new_block ./ Theme a block which displays the number of unread messages a user has.
theme_privatemsg_username ./ Used to theme and display user recipients.
theme_privatemsg_admin_settings_display_fields ./ Output the admin settings display fields and weight settings as a drag and drop sortable table.