foldershare-8.x-1.2/foldershare.routing.yml
foldershare.routing.yml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | # # Defines routes to module pages. # # Module pages include pages that show specific entities (e.g. files # and folders), module configuration, and administrator forms. # #----------------------------------------------------------------------- # # Reports pages. # #----------------------------------------------------------------------- # # Show module usage. # ------------------ # The module usage page for content administrators shows a table of site # users and their current usage of the FolderShare module. The usage # information includes the number of files, folders, and root folders # owned by the user, and the total storage space used. # foldershare.reports.usage: path: '/admin/reports/foldershare' defaults: _form: '\Drupal\foldershare\Form\AdminUsageReport' _title: 'FolderShare usage' requirements: _permission: 'administer foldershare' #----------------------------------------------------------------------- # # Module configuration. # #----------------------------------------------------------------------- # # Show module configuration. # -------------------------- # The module configuration page for site administrators shows multiple tabs of # configuration that may be adjusted for the module. These include whether the # module uses a public or private file system for file storage, whether it # restricts filename extensions, and so on. The configuration page also links # to many other relevant configuration pages from other modules. # entity.foldershare.settings: path: '/admin/structure/foldershare' defaults: _form: '\Drupal\foldershare\Form\AdminSettings' _title: 'FolderShare' requirements: _permission: 'admin+administer site configuration' options: _admin_route: TRUE #----------------------------------------------------------------------- # # Folder lists. # #----------------------------------------------------------------------- # # Show personal root items. # ------------------------- # This route presents a page listing root files and folders owned by the # current user, or shared with the current user. # entity.foldershare.rootitems: path: '/foldershare' defaults: _controller: '\Drupal\foldershare\Controller\RootListController::listPersonalAndSharedRootItems' _title: 'Personal files' requirements: _permission: 'view foldershare' # # Show public root items. # ----------------------- # This route presents a page listing root files and folders that are owned # either (1) owned by "anonymous" , or (2) shared with "anonymous" . # entity.foldershare.rootitems. public : path: '/foldershare/public' defaults: _controller: '\Drupal\foldershare\Controller\RootListController::listPublicRootItems' _title: 'Public files' requirements: _permission: 'view foldershare' # # Show all root folders. # ---------------------- # This route presents a page listing root folders that are owned by anyone. # The page is used by administrators to provide access to everything. # entity.foldershare.rootitems.all: path: '/foldershare/all' defaults: _controller: '\Drupal\foldershare\Controller\RootListController::listAllRootItems' _title: 'All files' requirements: _permission: 'administer foldershare' _user_is_logged_in: 'TRUE' #----------------------------------------------------------------------- # # User interface forms. # #----------------------------------------------------------------------- # # Edit entity. # ------------ # The entity edit page uses the {foldershare} argument containing the # FolderShare object entity ID of a file or folder to edit. The form # presented for the entity supports changing the entity's description, # comment configuration, and any fields added by the site administrator or # other modules. The page does not support editing the entity's title, # its location in the folder tree, the entity's ownership, or the # entity's root folder sharing configuration. # entity.foldershare.edit: path: '/foldershare/{foldershare}/edit' defaults: _entity_form: foldershare.edit _title: 'Edit Description' requirements: _entity_access: 'foldershare.update' foldershare: \d+ options: parameters: foldershare: type: entity:foldershare # # Prompt for command. # ------------------- # A FolderShare "command" is an operation invoked from the GUI. Some # commands execute immediately (e.g. New folder), while others prompt the # user for confirmation (e.g. delete ) or additional information (e.g. # Share). Commands that prompt forward to this route, which provides a # form shell to wrap a command-specific prompt. # # The {encoded} argument contains a base-64 encoded JSON associative array # of command arguments, including the current selection, parent, destination, # etc. # entity.foldersharecommand.plugin: path: '/foldershare/command/{encoded}' defaults: _form: '\Drupal\foldershare\Form\CommandFormWrapper' requirements: _permission: 'admin+administer site configuration+administer foldershare+share foldershare+share public foldershare+author foldershare+view foldershare' options: parameters: encoded: type: string #----------------------------------------------------------------------- # # Autocomplete services. # #----------------------------------------------------------------------- # # User name autocomplete. # ----------------------- # The service returns a short list of closest matches to a partial user name. # The service is primarily used by the 'Share' form to find and select users # with which to share content. However, the service can be used elsewhere. # For that reason, permission requirements are for access to the FolderShare # module, and not necessary sharing. # # Required URL arguments: # - q=NAMEFRAGMENT # # Optional URL arguments: # - excludeUids=UIDLIST # - excludeBlocked=0|1 # # NAMEFRAGMENT is a string to match against the user account name, email # address, and possibly display name. If it is empty , an empty list is returned. # # UIDLIST is a list of user IDs to ignore during the match. During processing, # the current user's ID, anonymous, and the primary site admin are automatically # excluded. # # The 0 or 1 argument to 'excludeBlocked' indicates if blocked accounts should # be include or not. entity.foldershare.userautocomplete: path: '/foldershare/userautocomplete' defaults: _controller: '\Drupal\foldershare\Controller\UserAutocompleteController::autocomplete' _format: json requirements: _permission: 'administer foldershare+share foldershare' #----------------------------------------------------------------------- # # Entity pages. # # These pages present entities, including their fields and folder contents. # #----------------------------------------------------------------------- # # View entity. # ------------ # The entity view route usaes the {foldershare} argument containing the # FolderShare object entity ID of a file or folder to show. The page # presented for the entity includes the entity's name as the page title, # the entity 's displayed fields, and an embedded view table of a folder' s # contents ( for entities that are folders). # # The view page is available to users with the view permission and with # folder-base view access granted. # entity.foldershare.canonical: path: '/foldershare/{foldershare}' defaults: _controller: '\Drupal\foldershare\Entity\Controller\FolderShareViewController::view' _title_callback: '\Drupal\foldershare\Entity\Controller\FolderShareViewController::title' requirements: foldershare: \d+ _entity_access: 'foldershare.view' options: parameters: foldershare: type: entity:foldershare #----------------------------------------------------------------------- # # File downloads. # # These pages assist in downloading files. # #----------------------------------------------------------------------- # # Download file. # -------------- # The file download route uses a {file} argument containing the File object # entity ID of a file to download. The file must be under management by # this module. The route requires module access permission (view, author, or # admin) along with folder-based access grants. # # The downloaded file has HTTP headers set to provide the user-visible # file name, the MIME type, the file size, and disabled web cache controls. # entity.foldershare.file: path: '/foldershare/file/{file}' defaults: _controller: '\Drupal\foldershare\Controller\FileDownload::download' options: parameters: file: type: entity:file requirements: file: \d+ _permission: 'admin+administer foldershare+author foldershare+view foldershare' # Download entity or entities. # ---------------------------- # The entity download route uses a special {encoded} argument that contains a # base-64 JSON array that lists FolderShare object entity IDs to download. # The route requires module access permission (view, author, or admin) along # with folder-based access grants. # # If the download requests a single file, that file is downloaded with HTTP # headers set to provide the user-visible file name, the MIME type, the file # size, and disabled web cache controls. # # If the download requests a folder or multiple files, those items are # ZIP-ed together and the ZIP file downloaded with HTTP headers set to provide # the ZIP file name, the MIME type, the ZIP file size, and disabled web # cache controls. # entity.foldershare.download: path: '/foldershare/download/{encoded}' defaults: _controller: '\Drupal\foldershare\Controller\FolderShareDownload::download' options: parameters: encoded: type: string requirements: _permission: 'admin+administer foldershare+author foldershare+view foldershare' |