You are here

function filebrowser_install in Filebrowser 8

Same name and namespace in other branches
  1. 8.2 filebrowser.install \filebrowser_install()
  2. 6.2 filebrowser.install \filebrowser_install()
  3. 6 filebrowser.install \filebrowser_install()
  4. 7.4 filebrowser.install \filebrowser_install()
  5. 7.2 filebrowser.install \filebrowser_install()
  6. 7.3 filebrowser.install \filebrowser_install()
  7. 3.x filebrowser.install \filebrowser_install()

Implements hook_install().

Set the filebrowser type to locked. This can't be done in the YAML file, so we have to do it in code, here.

File

./filebrowser.install, line 36
Install, update and uninstall routines for filebrowser module.

Code

function filebrowser_install() {

  // Do not allow the locked content type to be deleted.
  $locked = Drupal::state()
    ->get('node.type.locked');
  $locked['dir_listing'] = 'dir_listing';
  Drupal::state()
    ->set('node.type.locked', $locked);
}