You are here

Theming documentation in Privatemsg 6.2

Same name and namespace in other branches
  1. 6 privatemsg.theme.inc \theming
  2. 7.2 privatemsg.theme.inc \theming
  3. 7 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 overriden 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.
phptemplate_privatemsg_list_field__count ./privatemsg.theme.inc Theme the replies field.
phptemplate_privatemsg_list_field__last_updated ./privatemsg.theme.inc Theme the last updated column.
phptemplate_privatemsg_list_field__participants ./privatemsg.theme.inc Theme the participants field.
phptemplate_privatemsg_list_field__subject ./privatemsg.theme.inc Theme the subject of the thread.
phptemplate_privatemsg_list_field__thread_started ./privatemsg.theme.inc Theme the thread started column.
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 ./privatemsg.theme.inc Theme to display the privatemsg list.
theme_privatemsg_new_block ./privatemsg.theme.inc Theme a block which displays the number of new messages a user has.
theme_privatemsg_username ./privatemsg.theme.inc Used to theme and display user recipients.