get('node.type.locked'); $locked['dir_listing'] = 'dir_listing'; Drupal::state()->set('node.type.locked', $locked); } /** * Implements hook_uninstall(). */ function filebrowser_uninstall() { // Clear filebrowser data out of the cache. \Drupal::cache('data')->deleteAll(); } function filebrowser_schema() { $schema['filebrowser_nodes'] = [ 'description' => 'Stores filebrowser specific data for each node', 'fields' => [ 'nid' => [ 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'description' => 'nid of the node holding this filebrowser', ], 'folder_path' => [ 'type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'description' => 'uri to the exposed directory', ], 'properties' => [ 'type' => 'text', 'not null' => TRUE, 'size' => 'big', 'description' => 'serialised data containing the filebrowser settings for this node', ] ], 'primary key' => ['nid'] ]; $schema['filebrowser_content'] = [ 'description' => 'contains information about the file. one row per file', 'fields' => [ 'nid' => [ 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'description' => 'nid of the node holding this file', ], 'fid' => [ 'type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE, 'description' => 'id of this file', ], 'root' => [ 'type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'description' => 'relative root of this file', ], 'path' => [ 'type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'description' => 'path to the file', ], 'file_data' => [ 'type' => 'text', 'not null' => TRUE, 'size' => 'big', 'description' => 'serialised field containing file data', ], ], 'primary key' => ['fid'], 'unique keys' => [ 'nid_fid' => ['nid', 'fid'], 'fid' => ['fid'] ] ]; return $schema; }