function views_ui_truncate
3.x views_ui.module | views_ui_truncate($string, $length) |
Truncate strings to a set length and provide a ... if they truncated.
This is often used in the UI to ensure long strings fit.
3 calls to views_ui_truncate()
- views_plugin_display_block::options_summary in plugins/
views_plugin_display_block.inc - Provide the summary for page options in the views UI.
- views_plugin_display_page::options_summary in plugins/
views_plugin_display_page.inc - Provide the summary for page options in the views UI.
- views_ui_get_display_label in includes/
admin.inc - Placeholder function for overriding $display->display_title.
File
- ./
views_ui.module, line 860 - Provide structure for the administrative interface to Views.
Code
function views_ui_truncate($string, $length) {
if (drupal_strlen($string) > $length) {
$string = drupal_substr($string, 0, $length);
$string .= '...';
}
return $string;
}