PageController

Extends \OCP\AppFramework\Controller

Generates templates for the landing page from within ownCloud, the public gallery and error pages

package

OCA\Gallery\Controller

Methods

Constructor

__construct(string $appName, \OCP\IRequest $request, \OCA\Gallery\Environment\Environment $environment, \OCP\IURLGenerator $urlGenerator, \OCP\IConfig $appConfig) 

Arguments

$appName

string

$request

\OCP\IRequest

$urlGenerator

\OCP\IURLGenerator

$appConfig

\OCP\IConfig

Adds the domain "data:" to the allowed image domains this function is called by reference

addContentSecurityToResponse(\OCP\AppFramework\Http\TemplateResponse $response) 

Arguments

$response

\OCP\AppFramework\Http\TemplateResponse

errorPage

errorPage(integer $code) : \OCP\AppFramework\Http\TemplateResponse
PublicPage
NoCSRFRequired
Guest

Generates an error page based on the error code

Arguments

$code

integer

Response

\OCP\AppFramework\Http\TemplateResponse

Returns the parameters to be used in the index function

getIndexParameters( $appName) : \OCA\Gallery\Controller\array<string,string>

Arguments

$appName

Response

\OCA\Gallery\Controller\array

Determines if we can add external shared to this instance

getServer2ServerProperties() : \OCA\Gallery\Controller\array<bool,string>

Response

\OCA\Gallery\Controller\array

index

index() : \OCP\AppFramework\Http\TemplateResponse
NoAdminRequired
NoCSRFRequired

Shows the albums and pictures at the root folder or a message if there are no pictures.

This is the entry page for logged-in users accessing the app from within ownCloud. A TemplateResponse response uses a template from the templates folder and parameters provided here to build the page users will see

Response

\OCP\AppFramework\Http\TemplateResponse

publicIndex

publicIndex(string $token, null|string $filename) : \OCP\AppFramework\Http\TemplateResponse|\OCA\Gallery\Http\ImageResponse|\OCP\AppFramework\Http\RedirectResponse
PublicPage
NoCSRFRequired

Shows the albums and pictures or redirects to the download location the token gives access to

Arguments

$token

string

$filename

null|string

Response

\OCP\AppFramework\Http\TemplateResponse|\OCA\Gallery\Http\ImageResponse|\OCP\AppFramework\Http\RedirectResponse

Shows the albums and pictures the token gives access to

showPublicPage( $token) : \OCP\AppFramework\Http\TemplateResponse

Arguments

$token

Response

\OCP\AppFramework\Http\TemplateResponse

slideshow

slideshow() : \OCP\AppFramework\Http\TemplateResponse
PublicPage
NoCSRFRequired
Guest

Returns the slideshow template

Response

\OCP\AppFramework\Http\TemplateResponse

Properties

environment

environment : \OCA\Gallery\Environment\Environment

urlGenerator

urlGenerator : \OCP\IURLGenerator
var

Type(s)

\OCP\IURLGenerator

appConfig

appConfig : \OCP\IConfig
var

Type(s)

\OCP\IConfig