abstract class DocumentItem

An abstract class for content-first documents Each instance provides content-first functionality one specific DocumentModel

Properties

Controller $mod
protected string $model_name

Methods

bool
can_copy_to_another_instance()

Returns true if this cf type allows copying documents to different instances.

bool
can_create_new()

Returns TRUE if the current user may create new documents

create_copy_document_in_instance(DocumentModel $document, string $instance_id, int $global_group_security_id = 0, $location = false)

Copys a given document to another instance

create_new(string $name)

Creates a new DocumentModel

get_comments_instance(DocumentModel $document)

Returns the comments instance for a given document

string
get_description()

Returns an i18n string describing the document type for which this content first library was created. The description should consist of approximately 30 words.

mixed
get_draft_view(DocumentModel $document)

Returns a view for editing the document before it is finally created.

string
get_icon_class(DocumentModel $document = false)

Returns the FontAwesome Class that can be used for items in the DMS

string
get_location(DocumentModel $document)

Returns the "location" a document is located at in its home instance.

mixed
get_location_form_element(DocumentModel $document = null)

Returns a fdl array containing specification on how to setup a location form element.

get_view(string $view_name, DocumentModel $document, bool $readonly = false)

Returns a specific view for the given document

array
get_views(DocumentModel $document)

Returns an array of name=>title pairs of all views that are available for the current document.

bool
supports_copy_to_another_instance()

Returns true if this cf type has the technical means of being copied to another instance.

Details

at line 164
bool can_copy_to_another_instance()

Returns true if this cf type allows copying documents to different instances.

This does not reflect the technical means, but if the current user is allowed to perform the action

Return Value

bool

at line 80
bool can_create_new()

Returns TRUE if the current user may create new documents

Return Value

bool

at line 185
protected DocumentModel create_copy_document_in_instance(DocumentModel $document, string $instance_id, int $global_group_security_id = 0, $location = false)

Copys a given document to another instance

Parameters

DocumentModel $document

The document which is to be copied

string $instance_id

The instance id of the target instance

int $global_group_security_id

The global group security id in which the new document is to be copied

$location

Return Value

DocumentModel

The newly created document

at line 43
DocumentModel create_new(string $name)

Creates a new DocumentModel

Parameters

string $name

The name of the new document

Return Value

DocumentModel

The newly created document

at line 154
CommentsController get_comments_instance(DocumentModel $document)

Returns the comments instance for a given document

Parameters

DocumentModel $document

The document for which the views are to be created

Return Value

CommentsController

The comments instance, already grouped and initiated

at line 23
string get_description()

Returns an i18n string describing the document type for which this content first library was created. The description should consist of approximately 30 words.

Return Value

string

at line 145
abstract mixed get_draft_view(DocumentModel $document)

Returns a view for editing the document before it is finally created.

Often it is the edit view provided by DocumentItem::get_view()

Parameters

DocumentModel $document

Return Value

mixed

at line 114
string get_icon_class(DocumentModel $document = false)

Returns the FontAwesome Class that can be used for items in the DMS

Parameters

DocumentModel $document

Return Value

string

The icon class

at line 92
string get_location(DocumentModel $document)

Returns the "location" a document is located at in its home instance.

This could be the category, the contact type or something else, depending on the document type in question. It may be implemented as it seams convinient.

Parameters

DocumentModel $document

The document for which the location is to be returned

Return Value

string

The serialized location information in a manner that ca be displayed in strings

at line 105
mixed get_location_form_element(DocumentModel $document = null)

Returns a fdl array containing specification on how to setup a location form element.

If an implementation returns something other than false, the "create_new" form will be equipped with an element created by using the returned fdl specification. The element will ALWAYS be optional

Parameters

DocumentModel $document

The document containing an optional location

Return Value

mixed

The fdl specifications for the optional location form element

at line 135
abstract UIAjaxComponent get_view(string $view_name, DocumentModel $document, bool $readonly = false)

Returns a specific view for the given document

Parameters

string $view_name

the unique name of the view for this cf document

DocumentModel $document

The document for which the views are to be created

bool $readonly

Indicates if the view is currently in readonly mode, even though the user might usually have write access

Return Value

UIAjaxComponent

The view. It should be an instance of the UIAjaxComponent

at line 125
abstract array get_views(DocumentModel $document)

Returns an array of name=>title pairs of all views that are available for the current document.

Use realtime evaluation of the document only if necessary!

Parameters

DocumentModel $document

The document for which the views are to be returned

Return Value

array

An assoc array having the view names as its keys and the title of the view as the value

at line 173
bool supports_copy_to_another_instance()

Returns true if this cf type has the technical means of being copied to another instance.

Return Value

bool