sticky_edit_actions.module in Sticky Edit Actions 7
File
sticky_edit_actions.module
View source
<?php
function sticky_edit_actions_form_alter(&$form, &$form_state, $form_id) {
$module_filter_state = module_exists('module_filter');
$admin_path_state = path_is_admin($current_path = current_path());
if ($admin_path_state && !($module_filter_state && $current_path === 'admin/modules')) {
$path = drupal_get_path('module', 'sticky_edit_actions');
$form['#attached']['css'][] = $path . '/css/sticky-edit-actions.css';
$form['#attached']['js'][$path . '/js/waypoints.min.js'] = array(
'type' => 'file',
'weight' => 99,
);
$form['#attached']['js'][$path . '/js/waypoints-sticky.min.js'] = array(
'type' => 'file',
'weight' => 100,
);
$form['#attached']['js'][$path . '/js/sticky-edit-actions.js'] = array(
'type' => 'file',
'weight' => 101,
);
$form['actions']['#attributes']['class'][] = 'my-sticky-element';
}
}
function sticky_edit_actions_media_edit_multiple_form_alter(&$form) {
$form['actions'] = $form['buttons'];
$form['actions']['#type'] = 'actions';
unset($form['buttons']);
$form_state = array();
sticky_edit_actions_form_alter($form, $form_state, 'media_edit_multiple_form');
}