display module hooks - Hooks created by the display module
- These are used to populate the default management tables.
hook_display_type
Parameters:
none
Returns:
array('Content_Type'...)
Description:
Return an array of content types controlled by this module. Names should
be machine readable but can be case-insensitive
hook_display_type_human_readable
Parameters:
none
Returns:
array(
'content_type' => 'Content Type',
)
Description:
Return an array of content types controled by this module. Keys must be
machine-readable. Values must be human-readable.
hook_display_teaser
Parameters:
&$node => fully-loaded node
Returns:
NULL => Default and most-common case
string => "Shortened preview of $node"
Description:
Generate a brief preview of a node for display on management tables.
Unless, $node->type is included in hook_display_type, this will usually return NULL.
hook_display_manage_table_row_alter
Parameters:
$row => array for inclusion in a table
Returns:
array => Usually a modified version of row
Description:
If a row with a key matching this module's name is added to a management form, this module may implement this hook to directly alter it immediately before display.
display module functions - Functions implemented by the display module called elsewhere
- these are mostly used for generating content management tables and content previews.
display_get_filter_form
Parameters:
$filter_type => NULL|string|array - Set default_value for Type field
Create "Add X" button[s] before form
$filter_author => bool - Add filter by author field
$filter_artist => bool - Add filter by artist field
$filter_tags => bool - Add filter by tags field
$filter_search => string - default value for search field
$show_type => bool - display filter by type field
$filter_other_terms => NULL - no extra terms field
OR array(
'name' => string - display name of field
'type' => string - taxonomy type - mutually exclusive with options
'options' => array - select field optons - mutually exclusive with type
'value' => int - default_value
) - create an extra taxonomy terms filter field
Returns:
array() - per forms API
Description:
Create a form array to generate filter form on manage pages.
display_get_content_form
Parameters:
$filter_type => NULL - don't filter on type
OR array('type1','type2') - Display only 'type1' and 'type2' content
OR string='type' - display only 'type' content
$filter_author => NULL - don't filter on author
OR int - only display content authored by matching Author taxonomy
$filter_artist => NULL - don't filter on artist
OR int - only display content with matching Additional Artist taxonomy
$filter_tags => NULL - don't filter on tags
OR int - only display content with matching Tag taxonomy
$filter_search => NULL - don't filter on search
OR string - only display content with string in body or title
$filter_other_terms - NULL - don't filter by other terms
OR array(array('name'=>string,'value'=>int)...)
- only display content with matching taxonomies
$sort_by => int - sort results by column
- mutually exclusive with sortable
$sortable => int - make table sortable by column
- mutually exclusive with sort_by
Return:
array() - per forms API
Description:
Create a form array to display and manage content on management pages.
theme_display_all_table
Parameters:
$form => array() per forms API with the following exceptions
#add_theme_fields => string - this function will be called on the table
to add columns to the table.
#sort_by => int - the table will be sorted by this field
#sortable => int - the table will be draggable and sortable by this field
#disable_tags => bool - remove tags column
#disable_preview => bool - remove preview column
#disable_title => bool - remove title column
#disable_type => bool - remove type column
#disable_author => bool - remove author column
#disable_artists => bool - remove artists column
#disable_order => bool - remove order column
#disable_actions => bool - remove actions column
#other_terms => string - add extra column with that string as header
Return:
string - HTML for display.
Description:
Default themeing function for forms created by display_get_content_form.
The form will be rendered as a sortable or paginated table.
_display_get_title
Parameters:
$page => string - page name per navigation_bar
$prefix => string - affixed to front of result
$suffix => string - affixed to end of result
Returns:
string - HTML title of the page.
Description:
Generate an HTML title based on user's name for this page per navigation_bar
_display_filter_html
Parameters:
$string => string - HTML string
$max_length => int - maximum length of result
Return:
string - filtered HTML
Description:
Shorten and filter HTML very permissively.
If max_length is set; delete img, object, and param tags; then trim the result down to max_length characters long; then remove characters one at a time until tags appear balanced.
Then call _display_balance_tags and filter_xss_bp
_display_balance_tags
Parameters
$text => string - HTML
$ok_open => array('br','img'...) - tags that don't need to be closed
Return:
string - HTML with tags balanced.
Description:
Balance HTML code so no tags are left open.