PHP Класс Airship\Cabin\Bridge\Blueprint\CustomPages

Create and manage custom web pages.
Наследование: extends Airship\Cabin\Hull\Blueprint\CustomPages, use trait Airship\Engine\Bolt\Cache
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
uniqueId ( string $table, string $column = 'uniqueid' ) : string Get a unique ID (and make sure it doesn't exist)

Описание методов

createDifferentCabinRedirect() публичный Метод

Create a redirect
public createDifferentCabinRedirect ( string $oldURL, string $newURL, string $cabin ) : boolean
$oldURL string
$newURL string
$cabin string
Результат boolean

createDir() публичный Метод

Create a new page (and initial page version)
public createDir ( string $cabin, string $path, array $post = [] ) : boolean
$cabin string
$path string
$post array
Результат boolean

createDirRedirect() публичный Метод

Redirect a directory, and all of its pages.
public createDirRedirect ( array $old, array $new ) : boolean
$old array
$new array
Результат boolean

createPage() публичный Метод

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
Результат boolean

createPageRedirect() публичный Метод

Create a page redirect
public createPageRedirect ( array $old, array $new, boolean $allowCrossCabin = false ) : boolean
$old array
$new array
$allowCrossCabin boolean
Результат boolean

createRedirectsForMove() публичный Метод

Create the redirects necessary for a directory being moved.
public createRedirectsForMove ( array $old, array $new ) : boolean
$old array
$new array
Результат boolean

createSameCabinRedirect() публичный Метод

Create a redirect
public createSameCabinRedirect ( string $oldURL, string $newURL, string $cabin ) : boolean
$oldURL string
$newURL string
$cabin string
Результат boolean

deleteDir() публичный Метод

public deleteDir ( integer $directoryID ) : boolean
$directoryID integer
Результат boolean

deletePage() публичный Метод

Delete a page from the database, along with its revision history.
public deletePage ( integer $pageId ) : boolean
$pageId integer
Результат boolean

deleteRedirect() публичный Метод

Delete a redirect.
public deleteRedirect ( integer $redirectID ) : boolean
$redirectID integer
Результат boolean

getCabinForDirectory() публичный Метод

Get the cabin assigned to a particular directory
public getCabinForDirectory ( integer $directoryId ) : string
$directoryId integer
Результат string

getCustomDirChildren() публичный Метод

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
Результат array

getCustomDirTree() публичный Метод

Get a custom directory tree
public getCustomDirTree ( array $cabins, integer $selected, integer $skip ) : array
$cabins array
$selected integer
$skip integer
Результат array

getDirInfo() публичный Метод

Get information about only this directory
public getDirInfo ( string $cabin, string $parent = '', string $name = '' ) : array
$cabin string
$parent string
$name string
Результат array

getDirectoryPieces() публичный Метод

Get all of the parents for a given directory, as an array
public getDirectoryPieces ( integer $directoryID ) : array
$directoryID integer
Результат array

getHistory() публичный Метод

Get all of a page's revision history
public getHistory ( integer $pageId ) : array
$pageId integer
Результат array

getLatestDraft() публичный Метод

Get the latest version of a custom page
public getLatestDraft ( integer $pageId ) : array
$pageId integer
Результат array

getLatestVersionId() публичный Метод

Get the latest published version ID of a custom page
public getLatestVersionId ( integer $pageId ) : integer
$pageId integer
Результат integer

getNextVersionUniqueId() публичный Метод

Get the next version's unique ID
public getNextVersionUniqueId ( integer $pageId, integer $currentVersionId ) : string
$pageId integer
$currentVersionId integer
Результат string

getPageInfo() публичный Метод

Get information about only the page
public getPageInfo ( string $cabin, string $path = '', string $page ) : array
$cabin string
$path string
$page string
Результат array

getPageVersionByUniqueId() публичный Метод

Get the information about a particular page version, given a unique ID
public getPageVersionByUniqueId ( string $uniqueId ) : array
$uniqueId string
Результат array

getPathByPageId() публичный Метод

Get path information by a page ID
public getPathByPageId ( integer $pageId, string $cabin = '' ) : array
$pageId integer
$cabin string
Результат array string[3] (cabin, directory, page)

getPrevVersionUniqueId() публичный Метод

Get the next version's unique ID
public getPrevVersionUniqueId ( integer $pageId, integer $currentVersionId ) : string
$pageId integer
$currentVersionId integer
Результат string

getRedirect() публичный Метод

Get the redirects for this particular cabin.
public getRedirect ( string $cabin, integer $redirectID ) : array
$cabin string
$redirectID integer
Результат array

getRedirectsForCabin() публичный Метод

Get the redirects for this particular cabin.
public getRedirectsForCabin ( string $cabin ) : array
$cabin string
Результат array

listCustomPages() публичный Метод

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
Результат array

listCustomPagesByDirectoryID() публичный Метод

List all of the custom pages contained within a given directory ID
public listCustomPagesByDirectoryID ( integer $dir ) : array
$dir integer
Результат array

listSubDirectories() публичный Метод

List all of the subdirectories for a given cabin and directory
public listSubDirectories ( string $dir = '', string $cabin = CABIN_NAME ) : array
$dir string
$cabin string
Результат array

listSubDirectoriesByDirectoryID() публичный Метод

List all of the subdirectories contained within a given directory ID
public listSubDirectoriesByDirectoryID ( integer $dir ) : array
$dir integer
Результат array

moveDir() публичный Метод

Move/rename a directory
public moveDir ( integer $dirID, string $url = '', integer $parent, string $cabin = '' ) : boolean
$dirID integer
$url string
$parent integer
$cabin string
Результат boolean

movePage() публичный Метод

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
Результат boolean

movePagesToDir() публичный Метод

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
Результат boolean

numCustomPages() публичный Метод

Get the number of custom pages.
public numCustomPages ( null $published = null ) : integer
$published null
Результат integer

recursiveDelete() публичный Метод

Delete everything within a given directory
public recursiveDelete ( integer $directoryID ) : boolean
$directoryID integer
Результат boolean

uniqueId() защищенный Метод

Get a unique ID (and make sure it doesn't exist)
protected uniqueId ( string $table, string $column = 'uniqueid' ) : string
$table string
$column string
Результат string

updatePage() публичный Метод

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
Результат boolean

updateRedirect() публичный Метод

Save changes to a custom redirect
public updateRedirect ( integer $redirectID, array $post ) : boolean
$redirectID integer
$post array
Результат boolean