function views_ui_break_lock_confirm in Views (for Drupal 7) 8.3
Same name and namespace in other branches
- 6.3 includes/admin.inc \views_ui_break_lock_confirm()
- 6.2 includes/admin.inc \views_ui_break_lock_confirm()
- 7.3 includes/admin.inc \views_ui_break_lock_confirm()
Page to delete a view.
1 string reference to 'views_ui_break_lock_confirm'
- views_ui_menu in views_ui/
views_ui.module - Implements hook_menu().
File
- views_ui/
admin.inc, line 433 - Provides the Views' administrative interface.
Code
function views_ui_break_lock_confirm($form, &$form_state, ViewUI $view) {
$form_state['view'] =& $view;
$form = array();
if (empty($view->locked)) {
$form['message']['#markup'] = t('There is no lock on view %name to break.', array(
'%name' => $view->storage->name,
));
return $form;
}
$cancel = drupal_container()
->get('request')->query
->get('cancel');
if (empty($cancel)) {
$cancel = 'admin/structure/views/view/' . $view->storage->name . '/edit';
}
$account = user_load($view->locked->owner);
$form = confirm_form($form, t('Are you sure you want to break the lock on view %name?', array(
'%name' => $view->storage->name,
)), $cancel, t('By breaking this lock, any unsaved changes made by !user will be lost!', array(
'!user' => theme('username', array(
'account' => $account,
)),
)), t('Break lock'), t('Cancel'));
$form['actions']['submit']['#submit'][] = array(
$view,
'submitBreakLock',
);
return $form;
}