Class that module defined content types must extend.
This is the base level content class. It is an abstract object and cannot be instantiated directly. All content pages in the database are required to be drived from this class.
since | 0.9 |
---|---|
package |
CMS |
ModuleName() : string
string
Lang(string $name, array $params = array())
string
$nameThe key for the language string
array
$paramsOptional parameters for use in vsprintf
GetModuleInstance()
__construct()
SetProperties()
Id()
FriendlyName() : string
Normally the content type returns a string representing the name of the content type translated into the users current language
string
Name() : string
string
SetName(string $name)
string
$nameThe name.
Alias() : string
string
Type() : string
string
Owner() : integer
integer
SetOwner(integer $owner)
No validation is performed.
integer
$ownerOwner's user id
Metadata() : string
string
HandlesAlias() : boolean
boolean
default is false.
SetMetadata(string $metadata)
string
$metadataThe metadata
TabIndex() : integer
integer
SetTabIndex(integer $tabindex)
integer
$tabindextabindex
TitleAttribute() : string
string
GetCreationDate() : integer
integer
Unix Timestamp of the creation date
GetModifiedDate() : integer
integer
Unix Timestamp of the modification date.
SetTitleAttribute(string $titleattribute)
The title attribue can be used in navigations to set the "title=" attribute of a link some menu templates may ignore this.
string
$titleattributeThe title attribute
AccessKey() : string
string
SetAccessKey(string $accesskey)
string
$accesskeyParentId() : integer
The parent id may be -2 to indicate a new page. A parent id value of -1 indicates that the page has no parent. oterwise a positive integer is returned.
integer
SetParentId(integer $parentid)
integer
$parentidThe numeric page parent id. Use -1 for no parent.
TemplateId() : \int.
\int.
SetTemplateId(integer $templateid)
integer
$templateidItemOrder() : integer
integer
OldItemOrder() : integer
The OldItemOrder is used to specify the item order before changes were done
integer
Hierarchy() : string
A string like #.##.## indicating the path to this page and it's order this value uses the item order when calculating the output i.e: 3.3.3 to indicate the third grandghild of the third child of the third root page.
string
IdHierarchy() : string
A string like #.##.## indicating the path to the page and it's order this property uses the id's of pages when calculating the output i.e: 21.5.17 to indicate that page id 17 is the child of page with id 5 which is inturn the child of the page with id 21
string
HierarchyPath() : string
Similar to the Hierarchy and IdHierarchy this string uses page aliases and outputs a string like root_alias/parent_alias/page_alias
string
Active() : boolean
boolean
SetActive(boolean $active)
boolean
$activeHasPreview() : boolean
boolean
ShowInMenu() : boolean
boolean
SetShowInMenu(boolean $showinmenu)
boolean
$showinmenuDefaultContent() : boolean
The default page is the one that is displayed when no alias or pageid is specified in the route Only one content page can be the default.
boolean
SetDefaultContent(boolean $defaultcontent)
Note: does not modify the flags for any other content page.
boolean
$defaultcontentCachable() : boolean
Cachable pages (when enabled in global settings) are cached by the browser (also server side caching of HTML output may be enabled)
boolean
SetCachable(boolean $cachable)
boolean
$cachableSecure() : boolean
The secure flag effects whether the ssl protocol and appropriate config entries are used when generating urls to this page.
boolean
SetSecure(boolean $secure)
The secure flag effectsw whether the ssl protocol and appropriate config entries are used when generating urls to this page.
boolean
$secureURL() : string
The page url is not the complete URL to the content page, but merely the 'stub' or 'slug' appended after the root url when accessing the site If the page is specified as the default page then the "page url" will be ignored. Some content types do not support page urls.
string
SetURL(string $url)
Note: some content types do not support page urls. The url should be relative to the root url. i.e: /some/path/to/the/page
string
$urlLastModifiedBy() : integer
integer
SetLastModifiedBy(integer $lastmodifiedby)
integer
$lastmodifiedbyRequiresAlias() : boolean
Some content types that are not directly navigable do not require page aliases.
boolean
IsViewable() : boolean
some content types (like redirection links) are not viewable.
boolean
Default is True
IsPermitted() : boolean
boolean
IsSearchable() : boolean
Searchable pages can be indexed by the search module.
This function by default uses a combination of other abstract methods to determine if the page is searchable but extended content types can override this.
boolean
HasSearchableContent() : boolean
Content types should override this method if they are special purpose content types and they cannot support searchable content in any way. Content types such as ErrorPage, Section Header, and Separator are examples.
boolean
IsDefaultPossible()
The content editor module may adjust it's user interface to not allow setting pages that return false for this method as the default page.
SetAlias(string $alias = null, boolean $doAutoAliasIfEnabled = true)
If an empty alias is supplied, and depending upon the doAutoAliasIfEnabled flag, and config entries a suitable alias may be calculated from other data in the page object This method relies on the menutext and the name of the content page already being set.
string
$aliasThe alias
boolean
$doAutoAliasIfEnabledWhether an alias should be calculated or not.
MenuText() : string
The MenuText is by default used as the text portion of a navigation link.
string
SetMenuText(string $menutext)
string
$menutextChildCount() : integer
integer
Properties() : array
This method will return all of the other parts of the content object.
Note: this method does not directly load properties.
array
HasProperty(string $name) : boolean
Properties will be loaded from the database if necessary.
string
$name boolean
GetPropertyValue(string $name) : mixed
Properties will be loaded from the database if necessary.
string
$name mixed
String value, or null if the property does not exist.
SetPropertyValue(string $name, string $value)
This method will load properties for this content page if necessary.
string
$nameThe property name
string
$valueThe property value.
SetPropertyValueNoLoad(string $name, string $value)
This method will not load properties
string
$nameThe property name
string
$valueThe property value.
WantsChildren() : boolean
Some content types, such as a separator do not want to have any children.
boolean
Default TRUE
HasUsableLink() : boolean
boolean
Default TRUE
IsCopyable() : boolean
boolean
default FALSE
IsSystemPage() : boolean
System pages are used to handle things like 404 errors etc.
boolean
default FALSE
HasTemplate() : boolean
i.e: some content types like sectionheader and separator do not.
boolean
default FALSE
LoadFromData(array &$data, boolean $loadProperties = false)
This method modifies the current object.
There is no check on the data provided, because this is the job of ValidateData
Upon failure the object comes back to initial values and returns FALSE
array
$dataData as loaded from the database
boolean
$loadPropertiesOptionally load content properties at the same time.
ToData() : array
This can be considered a simple DTO (Data Transfer Object)
array
Load()
This is called right after the content is loaded from the database.
Save()
Update()
This method will calculate a new item order for the object if necessary and then save the content record, the additional editors, and the properties. Additionally, if a page url is specified a static route will be created
Because multiple content objects may be modified in one batch the calling function is responsible for ensuring that page hierarchies are updated.
Insert()
Like the Update method this method will determine a new item order save the record, save properties and additional editors, but will not update the hierarchy positions.
ValidateData()
This function is used to check that no compulsory argument has been forgotten by the user
We do not check the Id because there can be no Id (new content) That's up to Save to check this.
Delete()
FillParams(array $params, boolean $editing = false)
This method is typically called from an editor form to allow modifying the content object from form input fields (usually $_POST)
array
$paramsThe input array (usually from $_POST)
boolean
$editingIndicates wether this is an edit or add operation.
GetURL(boolean $rewrite = true) : string
This method may be overridden by content types.
boolean
$rewriteif true, and mod_rewrite is enabled, build a URL suitable for mod_rewrite.
string
ChangeItemOrder(integer $direction)
Note: This method modifies two content objects.
integer
$directiondirection. negative value indicates up, positive value indicates down.
Show(string $propname = 'content_en') : string
If no proeprty name is specified 'content_en' is assumed
string
$propnameAn optional property name to display. If none specified, the system should assume content_en.
string
GetEditableProperties() : array
Other content types may override this method, but should call the base method at the start.
array
Array of stdclass objects containing name (string), tab (string), priority (integer), required (bool) members
GetTabNames() : Array
This method provides a list of distinct sections that devides up the various logical sections that this content type supports for editing.
Array
associative array list of tab keys and labels.
GetTabMessage(string $key) : string
string
$keythe tab key (as returned with GetTabNames)
string
html text to display at the top of the tab.
GetTabElements(string $key, boolean $adding = FALSE) : array
string
$keytab key
boolean
$addingWhether this is an add or edit operation.
array
An array of arrays. Index 0 of each element should be a prompt field, and index 1 should be the input field for the prompt.
HasChildren(boolean $activeonly = false) : boolean
boolean
$activeonlyShould we test only for active children.
boolean
GetAdditionalEditors() : mixed
Note: in the returned array, group id's are specified as negative integers.
mixed
Array of uids and group ids, or null
SetAdditionalEditors(mixed $editorarray)
Note: in the provided array, group id's are specified as negative integers.
mixed
$editorarrayArray of uids and group ids, or null
GetAdditionalEditorOptions() : array
Note: group ids are expressed as negative integers in the keys.
array
GetAdditionalEditorInput(array $addteditors, integer $owner_id = -1) : string
If a positive owner id is specified that user will be excluded from output select element.
array
$addteditorsArray of additional editors
integer
$owner_idThe current owner of the page.
string
HTML output
ShowAdditionalEditors(array $addteditors = '') : string
This method is usually called from within this object.
array
$addteditorsAn optional array of additional editor id's (group ids specified with negative values)
string
The input element.
RemoveProperty(string $name, string $dflt)
Specify a default value to use if the property is called.
string
$nameThe property name
string
$dfltThe default value.
AddProperty(string $name, integer $priority, string $tab = self::TAB_MAIN, boolean $required = FALSE, boolean $basic = FALSE)
string
$nameThe property name
integer
$priorityThe property priority, for sorting.
string
$tabThe tab for the property (see tab constants)
boolean
$required(whether the property is required)
boolean
$basicWhether or not the property is a basic property (editable by even restricted editors)
GetProperties() : array
array
of stdclass objects
AddBaseProperty(string $name, integer $priority, boolean $is_required)
string
$nameThe property name
integer
$priorityThe priority
boolean
$is_requiredWhether this field is required for this content type
AddContentProperty(string $name, integer $priority, boolean $is_required)
string
$nameinteger
$priorityboolean
$is_requireddisplay_single_element(string $one, boolean $adding) : array
string
$oneThe property name
boolean
$addingWhether or not we are in add or edit mode.
array
consisting of two elements. A label, and the input element.
mParentId :
mItemOrder :