Skip to content

Feature/breadcrumbs #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/docs/getting-started/document-manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,10 @@ One of the most important methods on the Document Manager, responsible for const

```

## Breadcrumbs

For providing breadcrumbs, which might be supported by the WOPI client, implement the `HasBreadcrumbs` interface.

### Actions

Todo from the docs
7 changes: 7 additions & 0 deletions src/Contracts/AbstractDocumentManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ abstract class AbstractDocumentManager
'SupportsRename' => 'supportRename',
'SupportsExtendedLockLength' => 'supportExtendedLockLength',

// Breadcrumbs
'BreadcrumbBrandName' => 'breadcrumbBrandName',
'BreadcrumbBrandUrl' => 'breadcrumbBrandUrl',
'BreadcrumbDocName' => 'breadcrumbDocName',
'BreadcrumbFolderName' => 'breadcrumbFolderName',
'BreadcrumbFolderUrl' => 'breadcrumbFolderUrl',

];

/**
Expand Down
36 changes: 36 additions & 0 deletions src/Contracts/Concerns/HasBreadcrumbs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

namespace Nagi\LaravelWopi\Contracts\Concerns;

/**
* Provides information to allow showing breadcrumbs in the editor. Not necessarily supported by all WOPI clients.
*/
interface HasBreadcrumbs
{
/**
* The name of the brand URL.
*/
public function breadcrumbBrandName(): string;

/**
* A user accessible URI that allows the user to
* go back to the root page.
*/
public function breadcrumbBrandUrl(): string;

/**
* The name of the document, optional.
*/
public function breadcrumbDocName(): string;

/**
* The name of the folder URL
*/
public function breadcrumbFolderName(): string;

/**
* A user accessible URI that allows the user to
* * go back to the parent of the document.
*/
public function breadcrumbFolderUrl(): string;
}