function edit_page_build

Implements hook_page_build().

Adds the edit library to the page for any user who has the 'access in-place editing' permission.

File

drupal/core/modules/edit/edit.module, line 54
Provides in-place content editing functionality for fields.

Code

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',
  );
}