PHP Class Airship\Cabin\Bridge\Blueprint\CustomPages

Create and manage custom web pages.
Inheritance: extends Airship\Cabin\Hull\Blueprint\CustomPages, use trait Airship\Engine\Bolt\Cache
Afficher le fichier Open project: paragonie/airship Class Usage Examples

Méthodes publiques

Méthode Description
createDifferentCabinRedirect ( string $oldURL, string $newURL, string $cabin ) : boolean Create a redirect
createDir ( string $cabin, string $path, array $post = [] ) : boolean Create a new page (and initial page version)
createDirRedirect ( array $old, array $new ) : boolean Redirect a directory, and all of its pages.
createPage ( string $cabin, string $path, array $post = [], boolean $publish = false, boolean $raw = true ) : boolean Create a new page (and initial page version)
createPageRedirect ( array $old, array $new, boolean $allowCrossCabin = false ) : boolean Create a page redirect
createRedirectsForMove ( array $old, array $new ) : boolean Create the redirects necessary for a directory being moved.
createSameCabinRedirect ( string $oldURL, string $newURL, string $cabin ) : boolean Create a redirect
deleteDir ( integer $directoryID ) : boolean
deletePage ( integer $pageId ) : boolean Delete a page from the database, along with its revision history.
deleteRedirect ( integer $redirectID ) : boolean Delete a redirect.
getCabinForDirectory ( integer $directoryId ) : string Get the cabin assigned to a particular directory
getCustomDirChildren ( string $cabin, integer $directoryId, integer $selected, integer $skip, integer $depth ) : array Recursively grab the children of the custom directory tree
getCustomDirTree ( array $cabins, integer $selected, integer $skip ) : array Get a custom directory tree
getDirInfo ( string $cabin, string $parent = '', string $name = '' ) : array Get information about only this directory
getDirectoryPieces ( integer $directoryID ) : array Get all of the parents for a given directory, as an array
getHistory ( integer $pageId ) : array Get all of a page's revision history
getLatestDraft ( integer $pageId ) : array Get the latest version of a custom page
getLatestVersionId ( integer $pageId ) : integer Get the latest published version ID of a custom page
getNextVersionUniqueId ( integer $pageId, integer $currentVersionId ) : string Get the next version's unique ID
getPageInfo ( string $cabin, string $path = '', string $page ) : array Get information about only the page
getPageVersionByUniqueId ( string $uniqueId ) : array Get the information about a particular page version, given a unique ID
getPathByPageId ( integer $pageId, string $cabin = '' ) : array Get path information by a page ID
getPrevVersionUniqueId ( integer $pageId, integer $currentVersionId ) : string Get the next version's unique ID
getRedirect ( string $cabin, integer $redirectID ) : array Get the redirects for this particular cabin.
getRedirectsForCabin ( string $cabin ) : array Get the redirects for this particular cabin.
listCustomPages ( string $dir = '', string $cabin = CABIN_NAME ) : array List all of the custom pages contained within a given cabin and directory
listCustomPagesByDirectoryID ( integer $dir ) : array List all of the custom pages contained within a given directory ID
listSubDirectories ( string $dir = '', string $cabin = CABIN_NAME ) : array List all of the subdirectories for a given cabin and directory
listSubDirectoriesByDirectoryID ( integer $dir ) : array List all of the subdirectories contained within a given directory ID
moveDir ( integer $dirID, string $url = '', integer $parent, string $cabin = '' ) : boolean Move/rename a directory
movePage ( integer $pageId, string $url = '', integer $destinationDir ) : boolean Move a page to a new directory
movePagesToDir ( integer $parent, integer $destinationDir, boolean $createRedirect = false, string $oldCabin = '', string $newCabin = '', array $pieces = [] ) : boolean
numCustomPages ( null $published = null ) : integer Get the number of custom pages.
recursiveDelete ( integer $directoryID ) : boolean Delete everything within a given directory
updatePage ( integer $pageId, array $post = [], boolean $publish = false, boolean | null $raw = null, boolean $cache = false ) : boolean Create a new page (and initial page version)
updateRedirect ( integer $redirectID, array $post ) : boolean Save changes to a custom redirect

Méthodes protégées

Méthode Description
uniqueId ( string $table, string $column = 'uniqueid' ) : string Get a unique ID (and make sure it doesn't exist)

Method Details

createDifferentCabinRedirect() public méthode

Create a redirect
public createDifferentCabinRedirect ( string $oldURL, string $newURL, string $cabin ) : boolean
$oldURL string
$newURL string
$cabin string
Résultat boolean

createDir() public méthode

Create a new page (and initial page version)
public createDir ( string $cabin, string $path, array $post = [] ) : boolean
$cabin string
$path string
$post array
Résultat boolean

createDirRedirect() public méthode

Redirect a directory, and all of its pages.
public createDirRedirect ( array $old, array $new ) : boolean
$old array
$new array
Résultat boolean

createPage() public méthode

Create a new page (and initial page version)
public createPage ( string $cabin, string $path, array $post = [], boolean $publish = false, boolean $raw = true ) : boolean
$cabin string
$path string
$post array
$publish boolean
$raw boolean
Résultat boolean

createPageRedirect() public méthode

Create a page redirect
public createPageRedirect ( array $old, array $new, boolean $allowCrossCabin = false ) : boolean
$old array
$new array
$allowCrossCabin boolean
Résultat boolean

createRedirectsForMove() public méthode

Create the redirects necessary for a directory being moved.
public createRedirectsForMove ( array $old, array $new ) : boolean
$old array
$new array
Résultat boolean

createSameCabinRedirect() public méthode

Create a redirect
public createSameCabinRedirect ( string $oldURL, string $newURL, string $cabin ) : boolean
$oldURL string
$newURL string
$cabin string
Résultat boolean

deleteDir() public méthode

public deleteDir ( integer $directoryID ) : boolean
$directoryID integer
Résultat boolean

deletePage() public méthode

Delete a page from the database, along with its revision history.
public deletePage ( integer $pageId ) : boolean
$pageId integer
Résultat boolean

deleteRedirect() public méthode

Delete a redirect.
public deleteRedirect ( integer $redirectID ) : boolean
$redirectID integer
Résultat boolean

getCabinForDirectory() public méthode

Get the cabin assigned to a particular directory
public getCabinForDirectory ( integer $directoryId ) : string
$directoryId integer
Résultat string

getCustomDirChildren() public méthode

Recursively grab the children of the custom directory tree
public getCustomDirChildren ( string $cabin, integer $directoryId, integer $selected, integer $skip, integer $depth ) : array
$cabin string Cabin
$directoryId integer Parent directory for which to list directories
$selected integer Which directory is selected by default?
$skip integer Which directory to skip when recusring (for moving and deleting)
$depth integer
Résultat array

getCustomDirTree() public méthode

Get a custom directory tree
public getCustomDirTree ( array $cabins, integer $selected, integer $skip ) : array
$cabins array
$selected integer
$skip integer
Résultat array

getDirInfo() public méthode

Get information about only this directory
public getDirInfo ( string $cabin, string $parent = '', string $name = '' ) : array
$cabin string
$parent string
$name string
Résultat array

getDirectoryPieces() public méthode

Get all of the parents for a given directory, as an array
public getDirectoryPieces ( integer $directoryID ) : array
$directoryID integer
Résultat array

getHistory() public méthode

Get all of a page's revision history
public getHistory ( integer $pageId ) : array
$pageId integer
Résultat array

getLatestDraft() public méthode

Get the latest version of a custom page
public getLatestDraft ( integer $pageId ) : array
$pageId integer
Résultat array

getLatestVersionId() public méthode

Get the latest published version ID of a custom page
public getLatestVersionId ( integer $pageId ) : integer
$pageId integer
Résultat integer

getNextVersionUniqueId() public méthode

Get the next version's unique ID
public getNextVersionUniqueId ( integer $pageId, integer $currentVersionId ) : string
$pageId integer
$currentVersionId integer
Résultat string

getPageInfo() public méthode

Get information about only the page
public getPageInfo ( string $cabin, string $path = '', string $page ) : array
$cabin string
$path string
$page string
Résultat array

getPageVersionByUniqueId() public méthode

Get the information about a particular page version, given a unique ID
public getPageVersionByUniqueId ( string $uniqueId ) : array
$uniqueId string
Résultat array

getPathByPageId() public méthode

Get path information by a page ID
public getPathByPageId ( integer $pageId, string $cabin = '' ) : array
$pageId integer
$cabin string
Résultat array string[3] (cabin, directory, page)

getPrevVersionUniqueId() public méthode

Get the next version's unique ID
public getPrevVersionUniqueId ( integer $pageId, integer $currentVersionId ) : string
$pageId integer
$currentVersionId integer
Résultat string

getRedirect() public méthode

Get the redirects for this particular cabin.
public getRedirect ( string $cabin, integer $redirectID ) : array
$cabin string
$redirectID integer
Résultat array

getRedirectsForCabin() public méthode

Get the redirects for this particular cabin.
public getRedirectsForCabin ( string $cabin ) : array
$cabin string
Résultat array

listCustomPages() public méthode

List all of the custom pages contained within a given cabin and directory
public listCustomPages ( string $dir = '', string $cabin = CABIN_NAME ) : array
$dir string
$cabin string
Résultat array

listCustomPagesByDirectoryID() public méthode

List all of the custom pages contained within a given directory ID
public listCustomPagesByDirectoryID ( integer $dir ) : array
$dir integer
Résultat array

listSubDirectories() public méthode

List all of the subdirectories for a given cabin and directory
public listSubDirectories ( string $dir = '', string $cabin = CABIN_NAME ) : array
$dir string
$cabin string
Résultat array

listSubDirectoriesByDirectoryID() public méthode

List all of the subdirectories contained within a given directory ID
public listSubDirectoriesByDirectoryID ( integer $dir ) : array
$dir integer
Résultat array

moveDir() public méthode

Move/rename a directory
public moveDir ( integer $dirID, string $url = '', integer $parent, string $cabin = '' ) : boolean
$dirID integer
$url string
$parent integer
$cabin string
Résultat boolean

movePage() public méthode

Move a page to a new directory
public movePage ( integer $pageId, string $url = '', integer $destinationDir ) : boolean
$pageId integer the page we're changing
$url string the new URL
$destinationDir integer the new directory
Résultat boolean

movePagesToDir() public méthode

public movePagesToDir ( integer $parent, integer $destinationDir, boolean $createRedirect = false, string $oldCabin = '', string $newCabin = '', array $pieces = [] ) : boolean
$parent integer
$destinationDir integer
$createRedirect boolean
$oldCabin string
$newCabin string
$pieces array
Résultat boolean

numCustomPages() public méthode

Get the number of custom pages.
public numCustomPages ( null $published = null ) : integer
$published null
Résultat integer

recursiveDelete() public méthode

Delete everything within a given directory
public recursiveDelete ( integer $directoryID ) : boolean
$directoryID integer
Résultat boolean

uniqueId() protected méthode

Get a unique ID (and make sure it doesn't exist)
protected uniqueId ( string $table, string $column = 'uniqueid' ) : string
$table string
$column string
Résultat string

updatePage() public méthode

Create a new page (and initial page version)
public updatePage ( integer $pageId, array $post = [], boolean $publish = false, boolean | null $raw = null, boolean $cache = false ) : boolean
$pageId integer
$post array
$publish boolean (This is set to FALSE by the Landing if the permission check fails)
$raw boolean | null
$cache boolean
Résultat boolean

updateRedirect() public méthode

Save changes to a custom redirect
public updateRedirect ( integer $redirectID, array $post ) : boolean
$redirectID integer
$post array
Résultat boolean