View source
<?php
function popup_ui_enable() {
module_load_include('inc', 'popup_ui', 'includes/popup_ui.util');
$weight = @array_pop(db_select('system', 's')
->fields('s', array(
'weight',
))
->condition('name', 'popup', '=')
->execute()
->fetchAssoc());
db_update('system')
->fields(array(
'weight' => $weight - 1,
))
->condition('name', 'popup_ui', '=')
->execute();
_popup_ui_flush_all();
}
function popup_ui_menu() {
return array(
'admin/config/user-interface/popup/settings' => array(
'title' => 'Global settings',
'type' => MENU_DEFAULT_LOCAL_TASK,
),
'admin/config/user-interface/popup/formats' => array(
'access arguments' => array(
'administer popup elements',
),
'description' => 'Manage popup formats available to Views and CCK',
'file' => 'includes/popup_ui.admin.inc',
'page arguments' => array(
'popup_ui_form_formatters',
),
'page callback' => 'drupal_get_form',
'title' => 'Formats',
'type' => MENU_LOCAL_TASK,
'weight' => 1,
),
'admin/config/user-interface/popup/formats/delete' => array(
'access arguments' => array(
'administer popup elements',
),
'file' => 'includes/popup_ui.admin.inc',
'page callback' => 'popup_ui_delete_format',
'type' => MENU_CALLBACK,
),
'admin/config/user-interface/popup/formats/whipe' => array(
'access arguments' => array(
'administer popup elements',
),
'file' => 'includes/popup_ui.admin.inc',
'page callback' => 'popup_ui_whipe_formats',
'type' => MENU_CALLBACK,
),
'admin/config/user-interface/popup/formats/reset' => array(
'access arguments' => array(
'administer popup elements',
),
'file' => 'includes/popup_ui.admin.inc',
'page callback' => 'popup_ui_reset',
'type' => MENU_CALLBACK,
),
);
}
function popup_ui_features_api() {
return array(
'popupformat' => array(
'name' => t('Popup formats'),
'default_hook' => 'popupformat_defaults',
'default_file' => FEATURES_DEFAULTS_INCLUDED_COMMON,
'file' => drupal_get_path('module', 'popup_ui') . '/includes/popup_ui.features.inc',
),
);
}
function popup_ui_popup_attributes_alter(&$attributes) {
if (isset($attributes['format'])) {
module_load_include('inc', 'popup_ui', 'includes/popup_ui.admin');
$format_attributes = FALSE;
$formats = _popup_ui_formatter_settings();
if (isset($formats[$attributes['format']]) && is_array($formats[$attributes['format']])) {
$attributes = array_merge($formats[$attributes['format']], $attributes);
}
unset($attributes['format']);
}
}