Theming documentation in Privatemsg 6.2
Same name and namespace in other branches
- 6 privatemsg.theme.inc \theming
- 7.2 privatemsg.theme.inc \theming
- 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.