Contentserv PHP API

CSGuiRichEditor extends CSGuiComponent
in package

The CSGuiComponent is the root class of all CSGui classes and represents any HTML representable component

The usage of all CSGui classes is the same:

  • Get an object through a call to the corresponding CSGui::create[Component]
  • Configure the object by setter functions
  • Output custom HTML where ever you like
  • Finally call the getHtml method on the object and echo the returned html code

The CSGuiComponent delivers therefore only the makeHtml function as well as popup handler code.

Tags

Table of Contents

_API_PREFIX_CS  = 'CS'
_API_PREFIX_CSGUI  = 'CSGui'
BASE_PATH  = '../admin/modules/gui/rich/'
BUTTON_TRANSLATION_PREFIX  = 'RICHEDITORBUTTON'
BUTTON_TRANSLATION_SCOPE  = 'RICHEDITOR'
EDITORTYPE_CKEDITOR  = 'CKEditor'
EDITORTYPE_DEFAULT  = 'CKEditor'
HEIGHT_100  = '100%'
HEIGHT_DEFAULT  = '250px'
HEIGHT_DEFAULT_SINGLE_LINE  = '18px'
LIB_PATH  = '../admin.local/lib/javascript/rich/'
TOOLBAR_TYPE  = 'RICH'
UNMODIFIED_IGNORE  = 'ignore'
UNMODIFIED_NOSAVE  = 'nosave'
WIDTH_100  = '100%'
$isDisabled  : mixed
$isPortal  : mixed
$popup  : mixed
$popupIDField  : mixed
$popupUrl  : mixed
__construct()  : mixed
addBodyClass()  : void
Adds a class name to the editors content frame body
addContentCssCode()  : void
Adds a CSS snippet to the editors internal CSS code as they are used in the head.
addContentCssLink()  : void
Adds a link to the editors external cascading style sheets.
addCSSCode()  : void
Adds a css snippet to the windows internal css code as they are used in the head Note that links to urls within the file must be relative to the forward.php
addCSSLink()  : void
Adds a link to the windows external cascading style sheets Note that - that the admin.css is included by default - the link to the file is from the browsers point of view relative to the forward.php - that links to urls within the file are relative to the css file location.
addCustomMenuFormatBlock()  : void
Adds a menu entry to the custom format menu which formats the surrounding block element.
addCustomMenuFormatInline()  : void
Adds a menu entry to the custom format menu which inline formats the selected content.
addCustomMenuInsertHtml()  : void
Adds a menu entry to the custom format menu which inserts html content.
addEditorSettings()  : mixed
addEventListener()  : void
Adds an EventListener to the editor.
addJSAPI()  : void
Preloads a js API library instead of using CS.loadAPI in the code
addJSCode()  : void
Adds a js code snippet to the windows internal js scripts as they are used in the head or directly to the component
addJSLink()  : void
Adds a link to the windows external js scripts Note that the link to the file is from the browsers point of view relative to the forward.php
addJSUtils()  : void
Preloads a js util library instead of using CS.loadUtils in the code
addProtectedSource()  : mixed
addStandardButtons()  : mixed
addToolbarButton()  : void
Adds a button to the toolbar of the editor.
addToolbarComponent()  : void
Adds an arbitrary html code to the toolbar of the editor
addToolbarSeparator()  : void
Adds a separator to the toolbar of the editor.
createRichEditor()  : CSGuiRichEditor
Creates a RICH Editor.
enableJQuery()  : void
Enables JQuery by loading all required libraries
enableJQueryEasy()  : void
Enables JQuery easy by loading all required libraries (experimental only)
enableJQueryPlugin()  : bool
Enables jQuery plugin.
enableJQueryUI()  : void
Enables JQuery UI by loading all required libraries (experimental only)
enablePluginCalls()  : mixed
Enables / disables all calls to CSGuiComponent plugins, if it is not wanted
getAdditionalAttributes()  : string
Returns a complete string with all information defined by setField*-methods.
getAutoGrowOnStartup()  : bool
Returns if the autogrow feature is loaded at startup.
getAvailableEditorLanguages()  : mixed
getButtonsDefinition()  : mixed
getContent()  : mixed
getContextMenuItems()  : mixed
getController()  : object
returns the controller of this gui component
getDefaultHeight()  : mixed
getEditorPlugins()  : array<string|int, CSGuiRichEditorPlugin>
Returns all CSGuiRichEditorPlugins.
getEditorSetting()  : mixed
getEditorTypeButtonsDefinition()  : mixed
getEditorTypeStandardButtons()  : mixed
getEncodedEditorSetting()  : mixed
getFieldAlertMessage()  : mixed
getFieldAlertMessageKey()  : mixed
getFieldInterval()  : mixed
getFieldIntervalKey()  : mixed
getFieldPattern()  : mixed
getFieldPatternKey()  : mixed
getFieldRequired()  : mixed
getFieldRequiredKey()  : mixed
getFieldUnmodified()  : string
Returns the current unmodified behavior.
getFieldUnmodifiedKey()  : string
Returns the key for the unmodified html attribute.
getHeight()  : mixed
getHtmlDataFieldType()  : mixed
getInternalId()  : mixed
getName()  : mixed
getNodeAttributeFor()  : mixed
getPluginContext()  : null
Returns the current plugin context.
getRichEditorApi()  : CSRichEditorAbstract
Returns the current RICH Editor api.
getRichEditorType()  : string
Returns the RICH editor type as a string e.g. CKEditor self::EDITORTYPE_*
getStandardButtons()  : mixed
getToolbarCanCollapse()  : bool
Returns whenever the toolbar can be collapsed or not.
getToolbarHtml()  : string
The toolbar of the RICH Editor will be loaded in this html.
getWidth()  : mixed
initLanguage()  : void
Initializes the language for the Editor.
isEditable()  : bool
Whether the content is editable or not.
isLoadOnDemand()  : mixed
isPortal()  : bool
Returns whether the component is used in the portal
isSingleLine()  : bool
Gets value SingleLine, which determines if editor can have multiple lines
isVisible()  : bool
Whether the content is visible or not.
makeForwardUrl()  : mixed
makeHtml()  : string
Makes the editor HTML.
migrateEditorTypeStandardButtons()  : mixed
migrateStandardButtons()  : mixed
popupAddCheckboxItem()  : void
Adds a checkbox popup item to the end of the current component's popup
popupAddItem()  : void
Adds a popup item to the end of the current component's popup
popupAddJavascriptFunction()  : void
Adds a Javascript method to the components Javascript which can be used to display a popup.
popupAddSeparator()  : void
Adds a popup separator item to the end of the current component's popup
popupAddSubMenuDefinition()  : void
Adds a definition (Icon, GroupIdentifier, GroupIndex) for a sub menu entry.
popupEnableDebugMode()  : mixed
popupEvaluateCode()  : mixed
Provides a condition which must be true if the popup item should be available
popupGetJavascript()  : string
Creates a javascript onContext='...' code, which can be inserted in a html component
popupGetMultipleRequestID()  : bool
This function may be used to check whether the request is a popupRequest for multiple elements.
popupGetRequestID()  : string
If a user request a popup the id describing the kind of request is returned here This function may also be used to check whether the request is a popupRequest.
popupInsertItem()  : void
Adds a popup item into a specified location of the current component's popup
popupMakeHtml()  : mixed
Creates the final popup html code
popupRemoveAllItems()  : void
Completely removes all popup items from the component
popupRemoveItem()  : void
Remove one items from the popup for the component
popupRemoveItemsByNamespace()  : void
Remove multiple from the popup specified by the namespace. All items having all the passed namespaces will be removed even if they are having more than the passed.
popupSetCharset()  : string
Sets the encoding for the popup components
popupSetDefaultPopup()  : void
Sets the default popup for the component
popupSetRequestID()  : void
Overwrites the id returned by popupSetRequestID
popupSetUrl()  : void
Changes the url where the popup should be loaded from.
popupSetVisible()  : void
Enables or disables the visiblity of the popup.
popupUseDefaultItem()  : void
Adds a standard popup item to the end of the current component's popup
removeContextMenuItem()  : mixed
removeEventListener()  : bool
Removes an EventListener from the editor.
setAutoGrowOnStartup()  : void
Defines if the autogrow feature is loaded at startup.
setBodyId()  : void
Sets the id of the body tag in the editors content iframe body
setContent()  : void
Sets the content which should be displayed in the RICH Editor.
setController()  : void
sets the controller for the gui component
setDefaultHeight()  : mixed
setDefaultLanguage()  : void
The default language to be used.
setDefinedButtonsGroup()  : mixed
setEditable()  : void
Sets whether the user can edit content in the RICH Editor.
setEntityProcessing()  : void
Default: FALSE
setFieldAlertMessage()  : mixed
setFieldInterval()  : mixed
setFieldPattern()  : mixed
setFieldRequired()  : mixed
setFieldUnmodified()  : void
Sets the unmodified behavior for the editor.
setForcePasteAsPlainText()  : void
Whether to force all pasting operations to insert on plain text into the editor, loosing any formatting information possibly available in the source text.
setHeight()  : void
Sets the height of the editor.
setInternalId()  : mixed
setLanguage()  : void
The user interface language localization to use. If left empty, the editor will automatically be localized to the user language. If the user language is not supported, the language specified in the defaultLanguage configuration setting is used.
setLoadOnDemand()  : mixed
setName()  : void
Sets the name of the editor.
setOnLeaveMessage()  : mixed
setOnLoadFocus()  : mixed
setPluginContext()  : void
Sets a plugin context, can be mixed from type.
setPortalMode()  : void
Sets the component to the browsers portal
setRichEditorApi()  : mixed
setRichEditorType()  : void
Sets the RICH editor type.
setSingleLine()  : mixed
Sets value SingleLine, which determines if editor can have multiple lines
setSpellCheckLang()  : void
Sets the language of the Aspell Spellchecker.
setTableResizeAllowed()  : void
setToolbarCanCollapse()  : void
Defines if the toolbar can collapse or not and if it should expand on load or not.
setToolbarDivId()  : void
Sets the div where in the toolbar should be displayed.
setVisible()  : mixed
setWidth()  : void
Sets the width of the editor.
showOnLeaveMessage()  : mixed
throwError()  : void
Throws a CSException

Constants

BASE_PATH

public mixed BASE_PATH = '../admin/modules/gui/rich/'
Tags

BUTTON_TRANSLATION_PREFIX

public mixed BUTTON_TRANSLATION_PREFIX = 'RICHEDITORBUTTON'
Tags

BUTTON_TRANSLATION_SCOPE

public mixed BUTTON_TRANSLATION_SCOPE = 'RICHEDITOR'
Tags

EDITORTYPE_CKEDITOR

public mixed EDITORTYPE_CKEDITOR = 'CKEditor'
Tags

EDITORTYPE_DEFAULT

public mixed EDITORTYPE_DEFAULT = 'CKEditor'
Tags

HEIGHT_DEFAULT_SINGLE_LINE

public mixed HEIGHT_DEFAULT_SINGLE_LINE = '18px'
Tags

LIB_PATH

public mixed LIB_PATH = '../admin.local/lib/javascript/rich/'
Tags

Properties

$isDisabled

public mixed $isDisabled = \false
Tags
access

private

Methods

__construct()

public __construct([mixed $sName = '' ]) : mixed
Parameters
$sName : mixed = ''
Tags
Return values
mixed

addBodyClass()

Adds a class name to the editors content frame body

public addBodyClass(string $sClass) : void
Parameters
$sClass : string

The class which should be added

Tags
Return values
void

addContentCssCode()

Adds a CSS snippet to the editors internal CSS code as they are used in the head.

public addContentCssCode(string $sCode) : void
Parameters
$sCode : string

The pure CSS code as a string.

Tags
Return values
void

Adds a link to the editors external cascading style sheets.

public addContentCssLink(string $sHref) : void

Relative to admin e.g. '../admin/modules/gui/rich/css/CSRichEditor.css'

Parameters
$sHref : string

The href of the css file.

Tags
Return values
void

addCSSCode()

Adds a css snippet to the windows internal css code as they are used in the head Note that links to urls within the file must be relative to the forward.php

public addCSSCode(string $sCode) : void
Parameters
$sCode : string

the code of the css without any <style> elements

Tags
access

public

Return values
void

Adds a link to the windows external cascading style sheets Note that - that the admin.css is included by default - the link to the file is from the browsers point of view relative to the forward.php - that links to urls within the file are relative to the css file location.

public addCSSLink(string $sCsslink) : void
Parameters
$sCsslink : string

the href of the css file

Tags
access

public

Return values
void

addCustomMenuFormatBlock()

Adds a menu entry to the custom format menu which formats the surrounding block element.

public addCustomMenuFormatBlock(string $sDisplayName[, string $sTagName = '' ][, string $sCssClass = '' ][, string $sCssStyle = '' ][, array<string|int, mixed> $aAdditionalAttributes = array() ][, string $sIconPath = '' ]) : void
Parameters
$sDisplayName : string

The Name of the entry.

$sTagName : string = ''

The optional new tag of the block element, e.g. h1, div. Default tag is 'p'.

$sCssClass : string = ''

The class of the new block element.

$sCssStyle : string = ''

The style of the new block element.

$aAdditionalAttributes : array<string|int, mixed> = array()

Further attributes which should be added to the block element.

$sIconPath : string = ''

An optional icon relative to the admin folder e.g. '../admin/images/preview.png' PNG images should be used.

Tags
Return values
void

addCustomMenuFormatInline()

Adds a menu entry to the custom format menu which inline formats the selected content.

public addCustomMenuFormatInline(string $sDisplayName, string $sTagName[, string $sCssClass = '' ][, string $sCssStyle = '' ][, array<string|int, mixed> $aAdditionalAttributes = array() ][, string $sIconPath = '' ]) : void
Parameters
$sDisplayName : string

The Name of the entry.

$sTagName : string

The tag of the inline element, e.g. span

$sCssClass : string = ''

the class of the inline element

$sCssStyle : string = ''

the style of the inline element

$aAdditionalAttributes : array<string|int, mixed> = array()

Further attributes which should be added to the block element.

$sIconPath : string = ''

An optional icon relative to the admin folder e.g. '../admin/images/preview.png' PNG images should be used.

Tags
Return values
void

addCustomMenuInsertHtml()

Adds a menu entry to the custom format menu which inserts html content.

public addCustomMenuInsertHtml(string $sDisplayName, string $sContentHtml[, string $sIconPath = '' ]) : void
Parameters
$sDisplayName : string

The name of the entry.

$sContentHtml : string

The HTML which should be inserted at the current position.

$sIconPath : string = ''

An optional icon relative to the admin folder. e.g. '../admin/images/preview.png' PNG images should be used.

Tags
Return values
void

addEditorSettings()

public addEditorSettings(mixed $sName, mixed $settings) : mixed
Parameters
$sName : mixed
$settings : mixed
Tags
Return values
mixed

addEventListener()

Adds an EventListener to the editor.

public addEventListener(mixed $sEventName, string $sEventCodeJs) : void
Parameters
$sEventName : mixed
$sEventCodeJs : string

The this scope of the code is current editor. Following parameter a available: Parameter "event" is the current event see JS CSGuiRichEditorEvent Parameter "editor" is the current editor.

Tags
Return values
void

addJSAPI()

Preloads a js API library instead of using CS.loadAPI in the code

public addJSAPI(string $api) : void
Parameters
$api : string

the name of the CS API library in the ../admin/modules/[MODULE]/CS[MODULE].js directory

Tags
access

public

Return values
void

addJSCode()

Adds a js code snippet to the windows internal js scripts as they are used in the head or directly to the component

public addJSCode(string $sCode) : void
Parameters
$sCode : string

the code of the js without any <javasctipt> elements

Tags
access

public

Return values
void

Adds a link to the windows external js scripts Note that the link to the file is from the browsers point of view relative to the forward.php

public addJSLink(string $sHref) : void
Parameters
$sHref : string

the href of the js

Tags
access

public

Return values
void

addJSUtils()

Preloads a js util library instead of using CS.loadUtils in the code

public addJSUtils(string $util) : void
Parameters
$util : string

the name of the CS Util library in the ../admin/core/utils/js/ directory

Tags
access

public

Return values
void

addProtectedSource()

public addProtectedSource(mixed $source) : mixed
Parameters
$source : mixed
Tags
Return values
mixed

addStandardButtons()

public abstract addStandardButtons([mixed $bMixed = NULL ]) : mixed
Parameters
$bMixed : mixed = NULL
Tags
Return values
mixed

addToolbarButton()

Adds a button to the toolbar of the editor.

public addToolbarButton(string $sName[, string $sTitle = '' ][, string $sOnClickJsCode = '' ][, string $sImage = '' ]) : void
Parameters
$sName : string

A unique name

$sTitle : string = ''
$sOnClickJsCode : string = ''

The "this" scope is the current editor implementation Also the "editor" variable is available and reference to current CSGuiRichEditor.

$sImage : string = ''

Relative to admin folder e.g. '../admin/images/check.png'

Tags
Return values
void

addToolbarComponent()

Adds an arbitrary html code to the toolbar of the editor

public addToolbarComponent(string $sHtml[, string $sTitle = '' ]) : void
Parameters
$sHtml : string
$sTitle : string = ''
Tags
Return values
void

addToolbarSeparator()

Adds a separator to the toolbar of the editor.

public addToolbarSeparator() : void
Tags
access

public

Return values
void

createRichEditor()

Creates a RICH Editor.

public static createRichEditor([string $sName = '' ][, string $sType = '' ]) : CSGuiRichEditor
Parameters
$sName : string = ''

The unique name of the editor.

$sType : string = ''

A editor type one of the const self::EDITORTYPE_* e.g. self::EDITORTYPE_CKEDITOR for CKEditor

Tags
Return values
CSGuiRichEditor

enableJQuery()

Enables JQuery by loading all required libraries

public enableJQuery() : void
Tags
Return values
void

enableJQueryEasy()

Enables JQuery easy by loading all required libraries (experimental only)

public enableJQueryEasy() : void
Tags
Return values
void

enableJQueryPlugin()

Enables jQuery plugin.

public enableJQueryPlugin(string $sPluginName) : bool

For possible plugins see ADMIN_LOCAL/lib/javascript/jquery/plugins subfolder.

Parameters
$sPluginName : string

The name of the jquery plugin (case sensitive) and without the "jquery." prefix. To load the jquery.cookie.js plugin give only "cookie" as param.

Tags
Return values
bool

Whenever the plugin path was found or not.

enableJQueryUI()

Enables JQuery UI by loading all required libraries (experimental only)

public enableJQueryUI() : void
Tags
Return values
void

enablePluginCalls()

Enables / disables all calls to CSGuiComponent plugins, if it is not wanted

public static enablePluginCalls([bool $enabled = false ]) : mixed
Parameters
$enabled : bool = false

whether plugin calls may be used

Tags
Return values
mixed

getAdditionalAttributes()

Returns a complete string with all information defined by setField*-methods.

public getAdditionalAttributes() : string
Tags
Return values
string

getAutoGrowOnStartup()

Returns if the autogrow feature is loaded at startup.

public getAutoGrowOnStartup() : bool

.

Tags
Return values
bool

getAvailableEditorLanguages()

public abstract getAvailableEditorLanguages() : mixed
Tags
Return values
mixed

getButtonsDefinition()

public abstract getButtonsDefinition() : mixed
Tags
Return values
mixed

getContent()

public getContent() : mixed
Tags
Return values
mixed

getContextMenuItems()

public abstract getContextMenuItems() : mixed
Tags
Return values
mixed

getController()

returns the controller of this gui component

public getController() : object
Tags
access

public

Return values
object

the controller of the gui component

getDefaultHeight()

public getDefaultHeight() : mixed
Tags
Return values
mixed

getEditorPlugins()

Returns all CSGuiRichEditorPlugins.

public getEditorPlugins() : array<string|int, CSGuiRichEditorPlugin>
Tags
Return values
array<string|int, CSGuiRichEditorPlugin>

getEditorSetting()

public getEditorSetting() : mixed
Tags
Return values
mixed

getEditorTypeButtonsDefinition()

public static getEditorTypeButtonsDefinition([mixed $sEditorType = '' ]) : mixed
Parameters
$sEditorType : mixed = ''
Tags
Return values
mixed

getEditorTypeStandardButtons()

public static getEditorTypeStandardButtons([mixed $sEditorType = '' ][, mixed $bSingleLine = false ]) : mixed
Parameters
$sEditorType : mixed = ''
$bSingleLine : mixed = false
Tags
Return values
mixed

getEncodedEditorSetting()

public getEncodedEditorSetting([mixed $bFormatWithHtmlEntities = TRUE ]) : mixed
Parameters
$bFormatWithHtmlEntities : mixed = TRUE
Tags
Return values
mixed

getFieldAlertMessage()

public getFieldAlertMessage() : mixed
Tags
Return values
mixed

getFieldAlertMessageKey()

public getFieldAlertMessageKey() : mixed
Tags
Return values
mixed

getFieldInterval()

public getFieldInterval() : mixed
Tags
Return values
mixed

getFieldIntervalKey()

public getFieldIntervalKey() : mixed
Tags
Return values
mixed

getFieldPattern()

public getFieldPattern() : mixed
Tags
Return values
mixed

getFieldPatternKey()

public getFieldPatternKey() : mixed
Tags
Return values
mixed

getFieldRequired()

public getFieldRequired() : mixed
Tags
Return values
mixed

getFieldRequiredKey()

public getFieldRequiredKey() : mixed
Tags
Return values
mixed

getFieldUnmodified()

Returns the current unmodified behavior.

public getFieldUnmodified() : string
Tags
access

public

Return values
string

The unmodified behavior as one of the UNMODIFIED_...-constants.

getFieldUnmodifiedKey()

Returns the key for the unmodified html attribute.

public getFieldUnmodifiedKey() : string
Tags
access

public

Return values
string

The key for the unmodified html attribute.

getHeight()

public getHeight() : mixed
Tags
Return values
mixed

getHtmlDataFieldType()

public getHtmlDataFieldType() : mixed
Tags
Return values
mixed

getInternalId()

public getInternalId() : mixed
Tags
Return values
mixed

getNodeAttributeFor()

public getNodeAttributeFor(mixed $sKey) : mixed
Parameters
$sKey : mixed
Tags
Return values
mixed

getPluginContext()

Returns the current plugin context.

public getPluginContext() : null
Tags
Return values
null

getRichEditorApi()

Returns the current RICH Editor api.

public getRichEditorApi() : CSRichEditorAbstract
Tags
Return values
CSRichEditorAbstract

getRichEditorType()

Returns the RICH editor type as a string e.g. CKEditor self::EDITORTYPE_*

public getRichEditorType() : string
Tags
Return values
string

getStandardButtons()

public abstract getStandardButtons() : mixed
Tags
Return values
mixed

getToolbarCanCollapse()

Returns whenever the toolbar can be collapsed or not.

public getToolbarCanCollapse() : bool
Tags
Return values
bool

getToolbarHtml()

The toolbar of the RICH Editor will be loaded in this html.

public static getToolbarHtml([string $sId = '' ]) : string
Parameters
$sId : string = ''

The toolbar ID.

Tags
Return values
string

initLanguage()

Initializes the language for the Editor.

public initLanguage([null $mShortNameOrId = NULL ][, bool $bUseRichEditorLanguage = TRUE ]) : void
Parameters
$mShortNameOrId : null = NULL

The ShortName or ID of the CONTENTSERV language which should be used

$bUseRichEditorLanguage : bool = TRUE

If the RichEditorLanguage option of the given Language should be used.

Tags
Return values
void

isEditable()

Whether the content is editable or not.

public isEditable() : bool
Tags
Return values
bool

isLoadOnDemand()

public isLoadOnDemand() : mixed
Tags
Return values
mixed

isPortal()

Returns whether the component is used in the portal

public static isPortal() : bool
Tags
access

protected

Return values
bool

whether the portal mode is activated

isSingleLine()

Gets value SingleLine, which determines if editor can have multiple lines

public isSingleLine() : bool
Tags
Return values
bool

isVisible()

Whether the content is visible or not.

public isVisible() : bool
Tags
Return values
bool

makeForwardUrl()

public static makeForwardUrl(mixed $url[, mixed $useRequestParams = array() ]) : mixed
Parameters
$url : mixed
$useRequestParams : mixed = array()
Tags
access

protected

Return values
mixed

makeHtml()

Makes the editor HTML.

public makeHtml() : string
Tags
Return values
string

migrateEditorTypeStandardButtons()

public static migrateEditorTypeStandardButtons(mixed $aStoredButtons[, mixed $aNewButtons = array() ][, mixed $sEditorType = '' ]) : mixed
Parameters
$aStoredButtons : mixed
$aNewButtons : mixed = array()
$sEditorType : mixed = ''
Tags
Return values
mixed

migrateStandardButtons()

public abstract migrateStandardButtons(mixed $aStoredButtons[, mixed $aNewButtons = array() ]) : mixed
Parameters
$aStoredButtons : mixed
$aNewButtons : mixed = array()
Tags
Return values
mixed

popupAddCheckboxItem()

Adds a checkbox popup item to the end of the current component's popup

public popupAddCheckboxItem(mixed $sLabel, mixed $sJavascript[, mixed $bIsEnabled = true ][, mixed $bIsSelected = false ][, mixed $sAccessKey = '' ][, mixed $bEvalCondition = true ][, mixed $mNamespaces = array() ][, mixed $sGroupIdentifier = '' ], mixed $iGroupIndex) : void
Parameters
$sLabel : mixed
$sJavascript : mixed
$bIsEnabled : mixed = true
$bIsSelected : mixed = false
$sAccessKey : mixed = ''
$bEvalCondition : mixed = true
$mNamespaces : mixed = array()
$sGroupIdentifier : mixed = ''
$iGroupIndex : mixed
Tags
access

public

Return values
void

popupAddItem()

Adds a popup item to the end of the current component's popup

public popupAddItem(string $sLabel[, string $sJavascript = '' ][, int $bIsEnabled = true ][, string $sIconPath = '' ][, string $sAccessKey = '' ][, bool $bEvalCondition = true ][, array<string|int, mixed>|string $mNamespaces = array() ][, string $sGroupIdentifier = '' ], int $iGroupIndex) : void
Parameters
$sLabel : string

label of the popup item. It can use '//' to create a submenu, e.g. 'submenu_label//sub_submenu_label//label'

$sJavascript : string = ''

Javascript code to call with the popup item

$bIsEnabled : int = true

can be false if the popup item should be visible but disabled

$sIconPath : string = ''

Image of the item relative to the admin/images/popup/ directory

$sAccessKey : string = ''

Keyboard access key of the popup item

$bEvalCondition : bool = true

If the condition should be evaluated.

$mNamespaces : array<string|int, mixed>|string = array()

The namespace for the button like "workflow"

$sGroupIdentifier : string = ''

The identifier to add the popup item to a group, which has separator at the beginning and at the end.

$iGroupIndex : int

The index of the group. The index will be used to order the groups. The lowest index will be taken of all popup items inside of a group.

Tags
access

public

Return values
void

popupAddJavascriptFunction()

Adds a Javascript method to the components Javascript which can be used to display a popup.

public popupAddJavascriptFunction([string $jsName = 'displayComponentPopup' ]) : void

It can be called with the given name and the requested POPUPID and event (event object) as argument, e.g. displayComponentPopup(ID, event)

Parameters
$jsName : string = 'displayComponentPopup'

the name of the Javascript method, if it should be different from the standard 'displayComponentPopup'

Tags
Return values
void

popupAddSeparator()

Adds a popup separator item to the end of the current component's popup

public popupAddSeparator([string $evalCondition = true ][, string $subMenu = '' ]) : void
Parameters
$evalCondition : string = true

optional php condition to be evaluated as true to let the popup item be available

$subMenu : string = ''

optional sub menu the separator should be placed within. It can use '//' to add the seperator within a submenu, e.g. 'submenu_label//subsubmenu_label'

Tags
access

public

Return values
void

popupAddSubMenuDefinition()

Adds a definition (Icon, GroupIdentifier, GroupIndex) for a sub menu entry.

public popupAddSubMenuDefinition(string $sSubMenuLabel, string $sIcon[, string $sGroupIdentifier = '' ], int $iGroupIndex) : void
Parameters
$sSubMenuLabel : string

The target sub menu label

$sIcon : string

THe icon of the sub menu.

$sGroupIdentifier : string = ''

The group identifier

$iGroupIndex : int

The index of the group.

Tags
Return values
void

popupEnableDebugMode()

public popupEnableDebugMode() : mixed
Tags
access

private

Return values
mixed

popupEvaluateCode()

Provides a condition which must be true if the popup item should be available

public popupEvaluateCode(mixed $evalCode) : mixed

Sometimes it is necessary to evaluate further code to define a $evalCondition. As the condition only returns one value, this can not be done there. Therefore any phpCode can be evaluated using the popupEvaluateCode method. Here e.g. conditions can be stored in variables which can be used in the $evalCondition later. {RecordID} can be used to get the id of the current selected item

Parameters
$evalCode : mixed
Tags
access

public

Return values
mixed

popupGetJavascript()

Creates a javascript onContext='...' code, which can be inserted in a html component

public popupGetJavascript(string $id[, string $innerHtml = "" ][, string $elementName = 'span' ][, string $embedAttribute = 'oncontextmenu' ][, string $additionalAttributes = "" ][, string $popupUrl = '' ][, string $popupIDField = '' ][, string $jsCode = '' ]) : string
Parameters
$id : string

The value which will can be received using the popupGetRequestID() method

$innerHtml : string = ""

The content of the optional html element is not empty. If this value is not set the $id is used instead

$elementName : string = 'span'

An optional html element name which will contain the attribute

$embedAttribute : string = 'oncontextmenu'

The attribute which should contain the JavaScript code

$additionalAttributes : string = ""

Additional attributes which should be additionally added to the oncontext command

$popupUrl : string = ''

Overwrites the standard url where the popup is defined

$popupIDField : string = ''

Overwrites the standard IDField for the popup which will be added to the request and is necessary to get the results using the popupGetRequestID method if it has been modified

$jsCode : string = ''

The JavaScript code which should be evaluated before the contextmenu is shown

Tags
Return values
string

The JavaScript code or a complete html element which will create the popup request

popupGetMultipleRequestID()

This function may be used to check whether the request is a popupRequest for multiple elements.

public popupGetMultipleRequestID() : bool
Tags
Return values
bool

whether a popup request for multiple items have been sent

popupGetRequestID()

If a user request a popup the id describing the kind of request is returned here This function may also be used to check whether the request is a popupRequest.

public popupGetRequestID() : string
Tags
Return values
string

the ID for which a popup is requested

popupInsertItem()

Adds a popup item into a specified location of the current component's popup

public popupInsertItem(mixed $mIndex, mixed $sLabel[, mixed $sJavascript = '' ][, mixed $bIsEnabled = true ][, mixed $sIconPath = '' ][, mixed $sAccessKey = '' ][, mixed $bEvalCondition = true ][, mixed $mNamespaces = array() ][, mixed $sGroupIdentifier = '' ], mixed $iGroupIndex) : void
Parameters
$mIndex : mixed
$sLabel : mixed
$sJavascript : mixed = ''
$bIsEnabled : mixed = true
$sIconPath : mixed = ''
$sAccessKey : mixed = ''
$bEvalCondition : mixed = true
$mNamespaces : mixed = array()
$sGroupIdentifier : mixed = ''
$iGroupIndex : mixed
Tags
access

public

Return values
void

popupMakeHtml()

Creates the final popup html code

public popupMakeHtml(mixed $PopupID) : mixed
Parameters
$PopupID : mixed
Tags
access

protected

Return values
mixed

popupRemoveAllItems()

Completely removes all popup items from the component

public popupRemoveAllItems([array<string|int, mixed> $keep = array() ][, bool $recursive = false ]) : void
Parameters
$keep : array<string|int, mixed> = array()

the labels of the items which may be kept

$recursive : bool = false

whether this action should be applied to all subcomponents as subtrees in CSGuiMixedTrees

Tags
access

public

Return values
void

popupRemoveItem()

Remove one items from the popup for the component

public popupRemoveItem(string $label[, string|bool $evalCondition = true ][, array<string|int, mixed>|string $aNamespaces = array() ]) : void
Parameters
$label : string

label of the popup item

$evalCondition : string|bool = true

optional php condition to be evaluated as true to let the popup item be available {RecordID} can be used to get the id of the current selected item

$aNamespaces : array<string|int, mixed>|string = array()

Either a simple string for a namespace like "workflow" or an array for further specification like array("Workflow", "123"). All items having the same label and all namespaces passed set (even if they are having more) will be removed.

Tags
access

public

Return values
void

popupRemoveItemsByNamespace()

Remove multiple from the popup specified by the namespace. All items having all the passed namespaces will be removed even if they are having more than the passed.

public popupRemoveItemsByNamespace([array<string|int, mixed> $aNamespaces = array() ]) : void
Parameters
$aNamespaces : array<string|int, mixed> = array()

An array containing all the defined namespaces for the popup items to be removed

Tags
Return values
void

popupSetCharset()

Sets the encoding for the popup components

public popupSetCharset(mixed $charset) : string
Parameters
$charset : mixed
Tags
Return values
string

$charset the new characterset

popupSetDefaultPopup()

Sets the default popup for the component

public popupSetDefaultPopup(CSGuiPopup $popup) : void
Parameters
$popup : CSGuiPopup

Popup object to use as popup for the component

Tags
access

protected

Return values
void

popupSetRequestID()

Overwrites the id returned by popupSetRequestID

public popupSetRequestID(string $id) : void
Parameters
$id : string

the value of the id to overwrite

Tags
Return values
void

popupSetUrl()

Changes the url where the popup should be loaded from.

public popupSetUrl([string $popupUrl = '' ][, string $idField = 'POPUP_ID' ][, bool $recursive = false ]) : void

It can be set if the pure forward name is not sufficient or another file should be used for a popup request This is an important option to add additional GET parameters, which should be available again for popups You can add additionalParameters to the forward url using the & seperator, e.g 'destination.php&param1=true'

Parameters
$popupUrl : string = ''

the url where the popup is defined

$idField : string = 'POPUP_ID'

the IDField for the popup which will be added to the request and is necessary to get the results using the popupGetRequestID method if it has been modified

$recursive : bool = false

whether this action should be applied to all subcomponents as subtrees in CSGuiMixedTrees

Tags
access

public

Return values
void

popupSetVisible()

Enables or disables the visiblity of the popup.

public popupSetVisible([bool $visibility = null ]) : void

If a popupAddItem is called before, the popup is automatically set to visible . If you only create the popup menu when recieving the popupGetRequestID parameter you have to enable the popup menu manually. You can even hide the popup completly be setting the $visibility to false

Parameters
$visibility : bool = null

whether the component has a visible popup menu

Tags
access

public

Return values
void

popupUseDefaultItem()

Adds a standard popup item to the end of the current component's popup

public popupUseDefaultItem(string $label[, string|bool $evalCondition = true ]) : void

The popupitems defined using the popupSetDefaultPopup can be reused after popupRemoveAllItems has been called. This offers the possibility to reuse working popupitems in a userdefined popupmenu The type of popup item which should be used is defined by the $label parameter. This label represents the label of the original item

Parameters
$label : string

label of the popup item

$evalCondition : string|bool = true

php condition to be evaluated as true to let the popup item be available

Tags
access

public

Return values
void

removeContextMenuItem()

public removeContextMenuItem(mixed $sName) : mixed
Parameters
$sName : mixed
Tags
Return values
mixed

removeEventListener()

Removes an EventListener from the editor.

public removeEventListener(string $sEventName) : bool
Parameters
$sEventName : string
Tags
Return values
bool

setAutoGrowOnStartup()

Defines if the autogrow feature is loaded at startup.

public setAutoGrowOnStartup(bool $bLoadAtStartup) : void
Parameters
$bLoadAtStartup : bool
Tags
Return values
void

setBodyId()

Sets the id of the body tag in the editors content iframe body

public setBodyId(string $sId) : void
Parameters
$sId : string

The id which should be added

Tags
Return values
void

setContent()

Sets the content which should be displayed in the RICH Editor.

public setContent(string $sContent) : void
Parameters
$sContent : string

The html content which should be displayed

Tags
Return values
void

setController()

sets the controller for the gui component

public setController(object $oController) : void
Parameters
$oController : object

the controller for the gui component

Tags
access

public

Return values
void

setDefaultHeight()

public setDefaultHeight(mixed $sHeight) : mixed
Parameters
$sHeight : mixed
Tags
Return values
mixed

setDefaultLanguage()

The default language to be used.

public setDefaultLanguage(string $sDefaultLanguageShortName) : void

This language will be used if the setted language with {$this->setLanguage()} can not be loaded for various reasons.

Parameters
$sDefaultLanguageShortName : string

A short name e.g. "en", "ru"

Tags
Return values
void

setDefinedButtonsGroup()

public setDefinedButtonsGroup(mixed $settings) : mixed
Parameters
$settings : mixed
Tags
Return values
mixed

setEditable()

Sets whether the user can edit content in the RICH Editor.

public setEditable(bool $bEditable[, bool $bVisible = FALSE ]) : void
Parameters
$bEditable : bool

Whether the content can be edited.

$bVisible : bool = FALSE

If the editor should be disabled This parameter defines whether the whole editor is shown or only the content without the editor itself.

Tags
Return values
void

setEntityProcessing()

Default: FALSE

public setEntityProcessing(mixed $bProcess) : void
Parameters
$bProcess : mixed
Tags
Return values
void

setFieldAlertMessage()

public setFieldAlertMessage(mixed $sMessage) : mixed
Parameters
$sMessage : mixed
Tags
Return values
mixed

setFieldInterval()

public setFieldInterval(mixed $sInterval) : mixed
Parameters
$sInterval : mixed
Tags
Return values
mixed

setFieldPattern()

public setFieldPattern(mixed $sPattern) : mixed
Parameters
$sPattern : mixed
Tags
Return values
mixed

setFieldRequired()

public setFieldRequired(mixed $bRequired) : mixed
Parameters
$bRequired : mixed
Tags
Return values
mixed

setFieldUnmodified()

Sets the unmodified behavior for the editor.

public setFieldUnmodified([string $sUnmodified = self::UNMODIFIED_NOSAVE ]) : void
Parameters
$sUnmodified : string = self::UNMODIFIED_NOSAVE

The unmodified behavior. Supported values are: UNMODIFIED_NOSAVE: Unmodified values should not be saved. UNMODIFIED_IGNORE: Unmodified values should be completely ignored.

Tags
access

public

Return values
void

setForcePasteAsPlainText()

Whether to force all pasting operations to insert on plain text into the editor, loosing any formatting information possibly available in the source text.

public setForcePasteAsPlainText(bool $bForce) : void
Parameters
$bForce : bool
Tags
Return values
void

setHeight()

Sets the height of the editor.

public setHeight(string $sHeight) : void
Parameters
$sHeight : string
Tags
Return values
void

setInternalId()

public setInternalId(mixed $sId) : mixed
Parameters
$sId : mixed
Tags
Return values
mixed

setLanguage()

The user interface language localization to use. If left empty, the editor will automatically be localized to the user language. If the user language is not supported, the language specified in the defaultLanguage configuration setting is used.

public setLanguage(mixed $mShortNameOrId) : void
Parameters
$mShortNameOrId : mixed
Tags
Return values
void

setLoadOnDemand()

public setLoadOnDemand(mixed $bool) : mixed
Parameters
$bool : mixed
Tags
Return values
mixed

setName()

Sets the name of the editor.

public setName(string $sName) : void

A unique identifier for the editor.

Parameters
$sName : string
Tags
Return values
void

setOnLeaveMessage()

public setOnLeaveMessage(mixed $sTranslatedMessage[, mixed $bShow = FALSE ]) : mixed
Parameters
$sTranslatedMessage : mixed
$bShow : mixed = FALSE
Tags
Return values
mixed

setOnLoadFocus()

public setOnLoadFocus(mixed $bool) : mixed
Parameters
$bool : mixed
Tags
Return values
mixed

setPluginContext()

Sets a plugin context, can be mixed from type.

public setPluginContext(mixed $mPluginContext) : void

This given plugin context will be available in the isAvailable method in CSGuiRichEditorPlugin as second parameter (first parameter is the EditorType).

By default it is a class name e.g. CSGuiCKEditor.

Parameters
$mPluginContext : mixed
Tags
Return values
void

setPortalMode()

Sets the component to the browsers portal

public static setPortalMode([mixed $isPortal = true ]) : void
Parameters
$isPortal : mixed = true
Tags
access

protected

Return values
void

setRichEditorApi()

public setRichEditorApi(mixed $oApi) : mixed
Parameters
$oApi : mixed
Tags
Return values
mixed

setRichEditorType()

Sets the RICH editor type.

public setRichEditorType(string $sType) : void
Parameters
$sType : string

An editor type. One of the const self::EDITORTYPE_*

Tags
Return values
void

setSingleLine()

Sets value SingleLine, which determines if editor can have multiple lines

public setSingleLine(bool $bSingleLine) : mixed
Parameters
$bSingleLine : bool
Tags
Return values
mixed

setSpellCheckLang()

Sets the language of the Aspell Spellchecker.

public setSpellCheckLang(string $sLang) : void
Parameters
$sLang : string
Tags
Return values
void

setTableResizeAllowed()

public setTableResizeAllowed(bool $bAllowed) : void
Parameters
$bAllowed : bool

Whether table resizing via drag&drop is allowed or not

Tags
Return values
void

setToolbarCanCollapse()

Defines if the toolbar can collapse or not and if it should expand on load or not.

public setToolbarCanCollapse(bool $bCanCollapse[, bool $bOnLoadExpanded = FALSE ]) : void
Parameters
$bCanCollapse : bool
$bOnLoadExpanded : bool = FALSE

Default value false. If set to true the editor toolbar will be expanded on load.

Tags
Return values
void

setToolbarDivId()

Sets the div where in the toolbar should be displayed.

public setToolbarDivId(string $sId) : void
Parameters
$sId : string

The document element id.

Tags
Return values
void

setVisible()

public setVisible(mixed $bVisible) : mixed
Parameters
$bVisible : mixed
Tags
Return values
mixed

setWidth()

Sets the width of the editor.

public setWidth(string $sWidth) : void
Parameters
$sWidth : string
Tags
Return values
void

showOnLeaveMessage()

public showOnLeaveMessage(mixed $bool) : mixed
Parameters
$bool : mixed
Tags
Return values
mixed

throwError()

Throws a CSException

public static throwError(string $sMessage, int $iCode) : void
Parameters
$sMessage : string
$iCode : int
Tags
Return values
void

        

Search results