popup_ui.api.inc in Popup 8
File
modules/popup_ui/includes/popup_ui.api.inc
View source
<?php
function popup_ui_confirm($title, $message, $confirm_path, $attributes = array()) {
module_load_include('inc', 'popup', 'includes/popup.api');
drupal_add_css(drupal_get_path('module', 'popup_ui') . '/style/popup-confirm.css');
$confirm_title = isset($attributes['confirm label']) ? $attributes['confirm label'] : t('Yes');
$cancel_title = isset($attributes['cancel label']) ? $attributes['cancel label'] : t('No');
$body = '<div class="popup-message">' . $message . '</div>' . '<div class="popup-buttons">' . l('<span>' . $confirm_title . '</title>', $confirm_path, array(
'attributes' => array(
'class' => array(
'popup-confirm button',
),
),
'html' => TRUE,
)) . ' ' . ($cancel_title ? '<a href="#" class="popup-close button"><span>' . $cancel_title . '</span></a>' : '') . '</div>';
$attributes += array(
'activate' => 'click',
'class' => 'popup-confirm',
);
return popup_element($title, $body, $attributes);
}