PHP Class BookStack\Http\Controllers\PageController

Inheritance: extends Controller
Show file Open project: ssddanbrown/bookstack

Protected Properties

Property Type Description
$bookRepo
$chapterRepo
$exportService
$pageRepo
$userRepo

Public Methods

Method Description
__construct ( PageRepo $pageRepo, BookRepo $bookRepo, ChapterRepo $chapterRepo, ExportService $exportService, UserRepo $userRepo ) PageController constructor.
create ( string $bookSlug, string $chapterSlug = null ) : Response Show the form for creating a new page.
createAsGuest ( Illuminate\Http\Request $request, string $bookSlug, string | null $chapterSlug = null ) : mixed Create a new page as a guest user.
destroy ( string $bookSlug, string $pageSlug ) : Response Remove the specified page from storage.
destroyDraft ( string $bookSlug, integer $pageId ) : Response Remove the specified draft page from storage.
edit ( string $bookSlug, string $pageSlug ) : Response Show the form for editing the specified page.
editDraft ( string $bookSlug, integer $pageId ) : Illuminate\Contracts\View\Factory | Illuminate\View\View Show form to continue editing a draft page.
exportHtml ( string $bookSlug, string $pageSlug ) : Illuminate\Http\Response Export a page to a self-contained HTML file.
exportPdf ( string $bookSlug, string $pageSlug ) : Illuminate\Http\Response Exports a page to pdf format using barryvdh/laravel-dompdf wrapper.
exportPlainText ( string $bookSlug, string $pageSlug ) : Illuminate\Http\Response Export a page to a simple plaintext .txt file.
getPageAjax ( integer $pageId ) : Illuminate\Http\JsonResponse Get page from an ajax request.
move ( string $bookSlug, string $pageSlug, Illuminate\Http\Request $request ) : mixed Does the action of moving the location of a page
redirectFromLink ( integer $pageId ) : Illuminate\Http\RedirectResponse | Redirector Redirect from a special link url which uses the page id rather than the name.
restoreRevision ( string $bookSlug, string $pageSlug, integer $revisionId ) : Illuminate\Http\RedirectResponse | Redirector Restores a page using the content of the specified revision.
restrict ( string $bookSlug, string $pageSlug, Illuminate\Http\Request $request ) : Illuminate\Http\RedirectResponse | Redirector Set the permissions for this page.
saveDraft ( Illuminate\Http\Request $request, integer $pageId ) : Illuminate\Http\JsonResponse Save a draft update as a revision.
show ( string $bookSlug, string $pageSlug ) : Response Display the specified page.
showDelete ( string $bookSlug, string $pageSlug ) : Illuminate\View\View Show the deletion page for the specified page.
showDeleteDraft ( string $bookSlug, integer $pageId ) : Illuminate\View\View Show the deletion page for the specified page.
showMove ( string $bookSlug, string $pageSlug ) : mixed Show the view to choose a new parent to move a page into.
showRecentlyCreated ( ) : Illuminate\Contracts\View\Factory | Illuminate\View\View Show a listing of recently created pages
showRecentlyUpdated ( ) : Illuminate\Contracts\View\Factory | Illuminate\View\View Show a listing of recently created pages
showRestrict ( string $bookSlug, string $pageSlug ) : Illuminate\Contracts\View\Factory | Illuminate\View\View Show the Restrictions view.
showRevision ( string $bookSlug, string $pageSlug, integer $revisionId ) : Illuminate\View\View Shows a preview of a single revision
showRevisionChanges ( string $bookSlug, string $pageSlug, integer $revisionId ) : Illuminate\View\View Shows the changes of a single revision
showRevisions ( string $bookSlug, string $pageSlug ) : Illuminate\View\View Shows the last revisions for this page.
store ( Illuminate\Http\Request $request, string $bookSlug, $pageId ) : Response Store a new page by changing a draft into a page.
update ( Illuminate\Http\Request $request, string $bookSlug, string $pageSlug ) : Response Update the specified page in storage.

Method Details

__construct() public method

PageController constructor.
public __construct ( PageRepo $pageRepo, BookRepo $bookRepo, ChapterRepo $chapterRepo, ExportService $exportService, UserRepo $userRepo )
$pageRepo BookStack\Repos\PageRepo
$bookRepo BookStack\Repos\BookRepo
$chapterRepo BookStack\Repos\ChapterRepo
$exportService BookStack\Services\ExportService
$userRepo BookStack\Repos\UserRepo

create() public method

Show the form for creating a new page.
public create ( string $bookSlug, string $chapterSlug = null ) : Response
$bookSlug string
$chapterSlug string
return Response

createAsGuest() public method

Create a new page as a guest user.
public createAsGuest ( Illuminate\Http\Request $request, string $bookSlug, string | null $chapterSlug = null ) : mixed
$request Illuminate\Http\Request
$bookSlug string
$chapterSlug string | null
return mixed

destroy() public method

Remove the specified page from storage.
public destroy ( string $bookSlug, string $pageSlug ) : Response
$bookSlug string
$pageSlug string
return Response

destroyDraft() public method

Remove the specified draft page from storage.
public destroyDraft ( string $bookSlug, integer $pageId ) : Response
$bookSlug string
$pageId integer
return Response

edit() public method

Show the form for editing the specified page.
public edit ( string $bookSlug, string $pageSlug ) : Response
$bookSlug string
$pageSlug string
return Response

editDraft() public method

Show form to continue editing a draft page.
public editDraft ( string $bookSlug, integer $pageId ) : Illuminate\Contracts\View\Factory | Illuminate\View\View
$bookSlug string
$pageId integer
return Illuminate\Contracts\View\Factory | Illuminate\View\View

exportHtml() public method

Export a page to a self-contained HTML file.
public exportHtml ( string $bookSlug, string $pageSlug ) : Illuminate\Http\Response
$bookSlug string
$pageSlug string
return Illuminate\Http\Response

exportPdf() public method

https://github.com/barryvdh/laravel-dompdf
public exportPdf ( string $bookSlug, string $pageSlug ) : Illuminate\Http\Response
$bookSlug string
$pageSlug string
return Illuminate\Http\Response

exportPlainText() public method

Export a page to a simple plaintext .txt file.
public exportPlainText ( string $bookSlug, string $pageSlug ) : Illuminate\Http\Response
$bookSlug string
$pageSlug string
return Illuminate\Http\Response

getPageAjax() public method

Get page from an ajax request.
public getPageAjax ( integer $pageId ) : Illuminate\Http\JsonResponse
$pageId integer
return Illuminate\Http\JsonResponse

move() public method

Does the action of moving the location of a page
public move ( string $bookSlug, string $pageSlug, Illuminate\Http\Request $request ) : mixed
$bookSlug string
$pageSlug string
$request Illuminate\Http\Request
return mixed

restoreRevision() public method

Restores a page using the content of the specified revision.
public restoreRevision ( string $bookSlug, string $pageSlug, integer $revisionId ) : Illuminate\Http\RedirectResponse | Redirector
$bookSlug string
$pageSlug string
$revisionId integer
return Illuminate\Http\RedirectResponse | Illuminate\Routing\Redirector

restrict() public method

Set the permissions for this page.
public restrict ( string $bookSlug, string $pageSlug, Illuminate\Http\Request $request ) : Illuminate\Http\RedirectResponse | Redirector
$bookSlug string
$pageSlug string
$request Illuminate\Http\Request
return Illuminate\Http\RedirectResponse | Illuminate\Routing\Redirector

saveDraft() public method

Save a draft update as a revision.
public saveDraft ( Illuminate\Http\Request $request, integer $pageId ) : Illuminate\Http\JsonResponse
$request Illuminate\Http\Request
$pageId integer
return Illuminate\Http\JsonResponse

show() public method

If the page is not found via the slug the revisions are searched for a match.
public show ( string $bookSlug, string $pageSlug ) : Response
$bookSlug string
$pageSlug string
return Response

showDelete() public method

Show the deletion page for the specified page.
public showDelete ( string $bookSlug, string $pageSlug ) : Illuminate\View\View
$bookSlug string
$pageSlug string
return Illuminate\View\View

showDeleteDraft() public method

Show the deletion page for the specified page.
public showDeleteDraft ( string $bookSlug, integer $pageId ) : Illuminate\View\View
$bookSlug string
$pageId integer
return Illuminate\View\View

showMove() public method

Show the view to choose a new parent to move a page into.
public showMove ( string $bookSlug, string $pageSlug ) : mixed
$bookSlug string
$pageSlug string
return mixed

showRecentlyCreated() public method

Show a listing of recently created pages
public showRecentlyCreated ( ) : Illuminate\Contracts\View\Factory | Illuminate\View\View
return Illuminate\Contracts\View\Factory | Illuminate\View\View

showRecentlyUpdated() public method

Show a listing of recently created pages
public showRecentlyUpdated ( ) : Illuminate\Contracts\View\Factory | Illuminate\View\View
return Illuminate\Contracts\View\Factory | Illuminate\View\View

showRestrict() public method

Show the Restrictions view.
public showRestrict ( string $bookSlug, string $pageSlug ) : Illuminate\Contracts\View\Factory | Illuminate\View\View
$bookSlug string
$pageSlug string
return Illuminate\Contracts\View\Factory | Illuminate\View\View

showRevision() public method

Shows a preview of a single revision
public showRevision ( string $bookSlug, string $pageSlug, integer $revisionId ) : Illuminate\View\View
$bookSlug string
$pageSlug string
$revisionId integer
return Illuminate\View\View

showRevisionChanges() public method

Shows the changes of a single revision
public showRevisionChanges ( string $bookSlug, string $pageSlug, integer $revisionId ) : Illuminate\View\View
$bookSlug string
$pageSlug string
$revisionId integer
return Illuminate\View\View

showRevisions() public method

Shows the last revisions for this page.
public showRevisions ( string $bookSlug, string $pageSlug ) : Illuminate\View\View
$bookSlug string
$pageSlug string
return Illuminate\View\View

store() public method

Store a new page by changing a draft into a page.
public store ( Illuminate\Http\Request $request, string $bookSlug, $pageId ) : Response
$request Illuminate\Http\Request
$bookSlug string
return Response

update() public method

Update the specified page in storage.
public update ( Illuminate\Http\Request $request, string $bookSlug, string $pageSlug ) : Response
$request Illuminate\Http\Request
$bookSlug string
$pageSlug string
return Response

Property Details

$bookRepo protected property

protected $bookRepo

$chapterRepo protected property

protected $chapterRepo

$exportService protected property

protected $exportService

$pageRepo protected property

protected $pageRepo

$userRepo protected property

protected $userRepo