Backdrop 1.20.0 consolidated the design of many admin interfaces by introducing the new theme function theme_label_machine_name()
that will output the label and machine name of anything.
The new function will output the Label and machine name together, with the Label prominently displayed, and the machine name more subtly displayed. It will most commonly appear in the first column of an administrative table.
The following functions have been deprecated, and will be removed in Backdrop 2.x:
- theme_file_type_overview()
- theme_menu_admin_overview()
- theme_node_admin_overview()
- theme_views_ui_view_name()
This first example shows how to remove the column for Machine name from an administrative table.
Instead of:$row = array();
$row[] = array('data' => check_plain($format_info['label']));
$row[] = array('data' => $date_format_name);
$row = array();
$row[] = theme('label_machine_name__date_format', array(
'label' => $format_info['label'],
'machine_name' => $date_format_name,
));
This second example shows how to replace a specialized display of Label and Machine name.
Instead of:$row[] = array(
'data' => theme('views_ui_view_name', array('view' => $view)),
);
$row[] = array(
'data' => theme('label_machine_name__view', array(
'label' => $view->get_human_name(),
'machine_name' => $view->name,
)),
);
Introduced in branch:
1.20.x
Introduced in version:
1.20.0
Impacts:
Module developers
Theme developers
Related Github Issues: