function _popup_title in Popup 8
Same name and namespace in other branches
- 7 includes/popup.util.inc \_popup_title()
1 call to _popup_title()
- popup_element in includes/
popup.api.inc - Renders a popup elements' HTML
File
- includes/
popup.util.inc, line 6
Code
function _popup_title($title, $path) {
if ($path) {
global $theme;
$theme_path = drupal_get_path('theme', $theme) . '/' . $path;
$files_path = \Drupal::config('system.file')
->get('default_scheme') . '://' . $path;
$candidates = array_keys(array_filter(array(
$path => file_exists(realpath($path)),
// Relative to drupal install
file_create_url($files_path) => file_exists(\Drupal::service('file_system')
->realpath($files_path)),
// Relative to the files folder
$theme_path => file_exists(realpath($theme_path)),
)));
$url = array_shift($candidates);
$title = '<img src="' . $url . '" alt="' . $title . '" />';
}
return $title;
}