Implements hook_page_build().
Adds the edit library to the page for any user who has the 'access in-place editing' permission.
function edit_page_build(&$page) {
if (!user_access('access in-place editing')) {
return;
}
$page['#attached']['js'][] = array(
'type' => 'setting',
'data' => array(
'edit' => array(
'fieldFormURL' => url('edit/form/!entity_type/!id/!field_name/!langcode/!view_mode'),
'context' => 'body',
),
),
);
$page['#attached']['library'][] = array(
'edit',
'edit',
);
}