class RemoteFileModalExtension extends Extension (View source)

Decorates ModalController with an insert-oembed modal

Properties

protected object $owner

The object this extension is applied to.

from  Extension

Methods

public
__construct()

No description

public static 
add_to_class(string $class, string $extensionClass, mixed $args = null)

Called when this extension is added to a particular class

public
setOwner(object $owner)

Set the owner of this extension.

public
mixed
withOwner(mixed $owner, callable $callback, array $args = [])

Temporarily modify the owner. The original owner is ensured to be restored

public
clearOwner()

Clear the current owner, and restore extension to the state prior to the last setOwner()

public
object
getOwner()

No description

public static 
string
get_classname_without_arguments(string $extensionStr)

Helper method to strip eval'ed arguments from a string that's passed to DataObject::$extensions or Object::add_extension().

protected
getRequest()

No description

protected
getFormSchema()

No description

public
remoteCreateForm()

Form for creating a new OEmbed object in the WYSIWYG, used by the InsertEmbedModal component

public
remoteEditForm()

Form for editing a OEmbed object in the WYSIWYG, used by the InsertEmbedModal component

public
remoteEditFormSchema(HTTPRequest $request)

Capture the schema handling process, as there is validation done to the URL provided before form is generated

protected
getSchemaResponse(string $schemaID, Form $form = null, ValidationResult $errors = null, array $extraData = [])

Generate schema for the given form based on the X-Formschema-Request header value

Details

__construct()

No description

static add_to_class(string $class, string $extensionClass, mixed $args = null)

Called when this extension is added to a particular class

Parameters

string $class
string $extensionClass
mixed $args

setOwner(object $owner)

Set the owner of this extension.

Parameters

object $owner

The owner object

mixed withOwner(mixed $owner, callable $callback, array $args = [])

Temporarily modify the owner. The original owner is ensured to be restored

Parameters

mixed $owner

Owner to set

callable $callback

Callback to invoke

array $args

Args to pass to callback

Return Value

mixed

clearOwner()

Clear the current owner, and restore extension to the state prior to the last setOwner()

object getOwner()

No description

Return Value

object

static string get_classname_without_arguments(string $extensionStr)

Helper method to strip eval'ed arguments from a string that's passed to DataObject::$extensions or Object::add_extension().

Parameters

string $extensionStr

E.g. "Versioned('Stage','Live')"

Return Value

string

Extension classname, e.g. "Versioned"

protected HTTPRequest getRequest()

No description

Return Value

HTTPRequest

protected FormSchema getFormSchema()

No description

Return Value

FormSchema

Form remoteCreateForm()

Form for creating a new OEmbed object in the WYSIWYG, used by the InsertEmbedModal component

Return Value

Form

Form remoteEditForm()

Form for editing a OEmbed object in the WYSIWYG, used by the InsertEmbedModal component

Return Value

Form

HTTPResponse remoteEditFormSchema(HTTPRequest $request)

Capture the schema handling process, as there is validation done to the URL provided before form is generated

Parameters

HTTPRequest $request

Return Value

HTTPResponse

protected HTTPResponse getSchemaResponse(string $schemaID, Form $form = null, ValidationResult $errors = null, array $extraData = [])

Generate schema for the given form based on the X-Formschema-Request header value

de-dupe this logic with LeftAndMain::getSchemaResponse()

Parameters

string $schemaID

ID for this schema. Required.

Form $form

Required for 'state' or 'schema' response

ValidationResult $errors

Required for 'error' response

array $extraData

Any extra data to be merged with the schema response

Return Value

HTTPResponse