Contentserv PHP API

CSGuiDynamicTree extends CSGuiStaticTree
in package

The CSGuiDynamicTree implements a reloading expanding tree

This class has no public constructor, use the factory method instead.

A CSGuiDynamicTree works like a static tree except that all nodes are not loaded at once but step by step. Therefore there are two request types: Popups and getChildren request:

Children: The id from the getChildren request can be recieved using the getRequestedID() method If the return value is not null you have to create all children for the request id (see. getRequestedID()) using the addNode(...) method

Popups: If the popupGetRequestID() method doesn't return null the request is a popup request and some popup items can be added using the popup... methods

The following example illustrates the usage of the CSGuiDynamicTree:

$tree = CSGui::createDynamicTree(); $requestId = $tree->getRequestedID(); if ($requestId !== null) { for ($i = 1; $i < rand(2, 9); $i++) { $tree->addNode($requestId.'-'.$i, true, 'Test '.$requestId.'-'.$i, '', '#', '', 'alert("Clicked on child "+'.$i.'); return false;'); } } if ($tree->popupGetRequestID()) { $tree->popupAddItem( "Show Id", "parent.alert('{$requestId} or POPUPID')"); }

Tags
abstract
since
4.3

Table of Contents

$isDisabled  : mixed
$isPortal  : mixed
$popup  : mixed
$popupIDField  : mixed
$popupUrl  : mixed
$selectedId  : mixed
$subTrees  : mixed
$tree  : CSTreeManager
__construct()  : mixed
CSGuiDynamicTree constructor.
addAdditionalJSCode()  : mixed
Adds some javascript to the tree to be able to manipulate the default tree behaviour
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.
addIdPrefix()  : mixed
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
addNode()  : void
Adds another node to the tree model
addOnSelect()  : void
Add's javascript code to be evaluated at selection. Beside the setOnClick method this code is called even if the click is overwritten on a node.
appendParametersToUrl()  : void
Adds one or more parameters to the tree loading and popup urls This is an important option to add further parameters, which should be available again for popups and loading of new nodes
enableDebugMode()  : mixed
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
getController()  : object
returns the controller of this gui component
getCookieName()  : mixed
getIdPrefix()  : string
Returns the id prefix of the current tree
getPath()  : array<string|int, mixed>
Returns the id path for a given id in the current tree
getRequestedID()  : string
Returns the id for the currently requested node If the user clicks on any folder the children are requested from the server by using this parent ID.
getSelectedNode()  : string
Returns the selected node in the tree
getSubTrees()  : array<string|int, CSGuiTree>
Returns all subtrees of the current tree
getTreeUrl()  : string
Gets the url of the tree
hasIdPrefix()  : bool
Checks if the given id prefix matches with the current prefix of the tree.
isPopupRequest()  : bool
Checks if it is a popup request or if it matches a given id tree prefix.
isPortal()  : bool
Returns whether the component is used in the portal
isTreeRequest()  : bool
Checks if it is a tree request for a node.
isVisible()  : bool
Returns whether a given id is visible in the current tree
makeBody()  : mixed
makeForwardUrl()  : mixed
makeHtml()  : string
Returns the complete HTML representation of the component
makeHTML()  : 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.
popupAddUpdate()  : mixed
Adds a refresh entry to the current popup menu
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|null
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
setAllowAll()  : void
Creates the tree nodes as editable, movable, creatable, deletable and renamable in one call
setClonable()  : void
Creates the tree nodes as clonable
setCloneable()  : void
Creates the tree nodes as clonable
setController()  : void
sets the controller for the gui component
setCookieName()  : mixed
Sets the name of the cookie where the last selected node should be stored
setCreatable()  : void
Creates the tree nodes as creatable
setCreateable()  : void
Creates the tree nodes as creatable
setDefaultIcon()  : void
Sets the default icon for all added nodes relative to the ../admin/images/tree/ directory
setDeletable()  : void
Creates the tree nodes as deletable
setDeleteable()  : void
Creates the tree nodes as deletable
setDragable()  : void
Creates the tree nodes as dragable
setDropType()  : void
Sets the drop type of the staticnodes
setDropTypesAllowed()  : void
Sets the drop types that are allowed to be dropped on this tree
setEditable()  : void
Creates the tree nodes as editable
setIdPrefix()  : void
Sets the id prefix to the current tree.
setMovable()  : void
Creates the tree nodes as movable
setMoveable()  : void
Creates the tree nodes as movable
setOnClick()  : void
Set's the javascript code to be evaluated at onClick Note that the JavaScript code may contain also the reserved word "{RecordID}" where ever it should use the clicked nodes ID
setOnDblClick()  : void
Set's the javascript code to be evaluated at onDblClick Note that the JavaScript code may contain also the reserved word "{RecordID}" where ever it should use the clicked nodes ID
setPortalMode()  : void
Sets the component to the browsers portal
setRenamable()  : void
Creates the tree nodes as renamable
setRenameable()  : void
Creates the tree nodes as renamable
setRootItems()  : void
Set's an array of root item IDs the tree should be limited to
setRootLabel()  : void
Changes the label of the root node of the tree
setSelectable()  : void
Sets whether the selected node can be changed or not
setSelectedNode()  : void
Sets the default selected node in the tree
setSkin()  : mixed
Overwrite the default skin folder
setTreeUrl()  : void
Sets the url of the tree, if the pure forward name is not sufficient This is an important option to add additional GET parameters, which should be available again for popups and loading of new nodes
throwError()  : void
Throws a CSException

Properties

$isDisabled

public mixed $isDisabled = \false
Tags
access

private

$selectedId

public mixed $selectedId = \null
Tags
access

private

$subTrees

public mixed $subTrees = array()
Tags

$tree

public CSTreeManager $tree
Tags
access

protected

Methods

__construct()

CSGuiDynamicTree constructor.

public __construct([string $href = "" ][, string $target = "" ]) : mixed
Parameters
$href : string = ""
$target : string = ""
Tags
Return values
mixed

addAdditionalJSCode()

Adds some javascript to the tree to be able to manipulate the default tree behaviour

public addAdditionalJSCode(string $jsCode) : mixed
Parameters
$jsCode : string

JSCode which should be added

Tags
Return values
mixed

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

addIdPrefix()

public addIdPrefix(mixed $id) : mixed
Parameters
$id : mixed
Tags
access

protected

Return values
mixed

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

addNode()

Adds another node to the tree model

public addNode(string $id, bool $hasChildren, string $label[, string $icon = "" ][, string $href = "" ][, string $target = "" ][, string $onClick = "" ][, string $onDblClick = "" ][, string $title = "" ][, string $popupUrl = "" ][, array<string|int, mixed> $additionalOptions = array() ]) : void

If the javascript code onClick is provided, the href argument is ignored. Note that the JavaScript codes for onClick and onDblClick may contain also the reserved word "{RecordID}" where ever it should use the clicked node's ID. For the icons the tree looks automatically for matching folder and open folder icons if available. E.g. if you define an icon "workflow.gif" the tree tries to use

  • ../admin/images/tree/workflow.gif for nodes
  • ../admin/images/tree/workflowFolder.gif for closed folders
  • ../admin/images/tree/workflowFolderOpen.gif for open folders
Parameters
$id : string

the id of the node as it can be refered to as the argument $parentid from other nodes

$hasChildren : bool

false if the node has no children or true if the node has children

$label : string

the visible label of the node

$icon : string = ""

the icon of the node relative to the ../admin/images/tree/ directory

$href : string = ""

the url to open on mouse click

$target : string = ""

the target of the to open on mouse click

$onClick : string = ""

javascript code to evaluate onClick, see comment above for more infos

$onDblClick : string = ""

javascript code to evaluate onDblClick, see comment above for more infos

$title : string = ""

the tooltip of the node

$popupUrl : string = ""

the url where the popup should be retrieved from if it is different to the standard url

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

additional options for the added node. At the moment the following keys are available: 'dropType' => the drop type of this node, normally set by the $tree->setDropType-method for the whole tree (string) 'dropTypesAllowed' => the drop types that are allowed to drop on this node, normally set by the $tree->setDropTypesAllowed (array)

Tags
access

public

Return values
void

addOnSelect()

Add's javascript code to be evaluated at selection. Beside the setOnClick method this code is called even if the click is overwritten on a node.

public addOnSelect(string $onSelect) : void

This method can only be used for the outer tree and not be for trees embedded in CSGuiMixedTrees. They inherit the onSelect code from the CSGuiMixedTree Note that the JavaScript code may contain also the reserved word "{RecordID}" where ever it should use the clicked nodes ID

Parameters
$onSelect : string

javascript code to evaluate

Tags
access

public

Return values
void

appendParametersToUrl()

Adds one or more parameters to the tree loading and popup urls This is an important option to add further parameters, which should be available again for popups and loading of new nodes

public appendParametersToUrl(string $urlParameters) : void
Parameters
$urlParameters : string

the urlparameters which should be added to the tree

Tags
access

public

Return values
void

enableDebugMode()

public enableDebugMode() : mixed
Tags
access

private

Return values
mixed

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

getController()

returns the controller of this gui component

public getController() : object
Tags
access

public

Return values
object

the controller of the gui component

getCookieName()

public getCookieName() : mixed
Tags
access

private

Return values
mixed

getIdPrefix()

Returns the id prefix of the current tree

public getIdPrefix() : string
Tags
access

public

Return values
string

the prefix of the current tree

getPath()

Returns the id path for a given id in the current tree

public getPath(string $id) : array<string|int, mixed>
Parameters
$id : string

the id of the requested node

Tags
access

public

Return values
array<string|int, mixed>

of ids representing the path in the tree

getRequestedID()

Returns the id for the currently requested node If the user clicks on any folder the children are requested from the server by using this parent ID.

public getRequestedID() : string
Tags
Return values
string

The ID which is requested beginning with 0 as RootID or null if it is a popup request

getSelectedNode()

Returns the selected node in the tree

public getSelectedNode() : string
Tags
access

public

Return values
string

$id the id of the node which should is selected at start

getSubTrees()

Returns all subtrees of the current tree

public getSubTrees() : array<string|int, CSGuiTree>
Tags
Return values
array<string|int, CSGuiTree>

of CSGuiTree objects

getTreeUrl()

Gets the url of the tree

public getTreeUrl() : string
Tags
access

public

Return values
string

the url of the tree

hasIdPrefix()

Checks if the given id prefix matches with the current prefix of the tree.

public hasIdPrefix(string|null $sFirstLevelIdPrefix, string ...$aAdditionalLevelIdPrefixes) : bool
Parameters
$sFirstLevelIdPrefix : string|null

The first level id prefix of the tree

$aAdditionalLevelIdPrefixes : string

Additional id prefixes of different levels of the tree.

Tags
Return values
bool

if the given id prefix parts match the current id prefix of the tree.

isPopupRequest()

Checks if it is a popup request or if it matches a given id tree prefix.

public isPopupRequest([string|null $sIdPrefix = '' ]) : bool
Parameters
$sIdPrefix : string|null = ''

The id tree prefix which should be checked.

Tags
Return values
bool

if it is a popup request or if it matches a given id tree prefix.

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

isTreeRequest()

Checks if it is a tree request for a node.

public isTreeRequest([string $sIdPrefix = '' ]) : bool

If an id prefix is given it checks if the tree request matches the id prefix.

A popup request returns false. Please use the method "isPopupRequest" to check if it is a popup request.

Parameters
$sIdPrefix : string = ''

The id tree prefix which should be checked.

Tags
Return values
bool

if it is a tree request.

isVisible()

Returns whether a given id is visible in the current tree

public isVisible(string $id) : bool
Parameters
$id : string

the id of the requested node

Tags
access

public

Return values
bool

whether the id is visible in the tree

makeBody()

public makeBody([mixed $openNodeID = null ]) : mixed
Parameters
$openNodeID : mixed = null
Tags
Return values
mixed

makeForwardUrl()

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

protected

Return values
mixed

makeHtml()

Returns the complete HTML representation of the component

public makeHtml() : string

May be called only once for each object in most cases.

Tags
access

public

Return values
string

some html code for JS, CSS tags

makeHTML()

public makeHTML([mixed $openNodeID = null ]) : mixed
Parameters
$openNodeID : mixed = null
Tags
access

private

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

popupAddUpdate()

Adds a refresh entry to the current popup menu

public popupAddUpdate() : mixed
Tags
Return values
mixed

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|null
Tags
Return values
string|null

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

setAllowAll()

Creates the tree nodes as editable, movable, creatable, deletable and renamable in one call

public setAllowAll(bool $boolean) : void
Parameters
$boolean : bool

whether the tree should be editable

Tags
access

public

Return values
void

setClonable()

Creates the tree nodes as clonable

public setClonable(bool $boolean) : void
Parameters
$boolean : bool

whether the tree should be clonable

Tags
access

public

Return values
void

setCloneable()

Creates the tree nodes as clonable

public setCloneable(bool $boolean) : void
Parameters
$boolean : bool

whether the tree should be clonable

Tags
access

public

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

setCookieName()

Sets the name of the cookie where the last selected node should be stored

public setCookieName(string $name) : mixed
Parameters
$name : string

the name of the cookie

Tags
Return values
mixed

setCreatable()

Creates the tree nodes as creatable

public setCreatable(bool $boolean) : void
Parameters
$boolean : bool

whether the tree should be creatable

Tags
access

public

Return values
void

setCreateable()

Creates the tree nodes as creatable

public setCreateable(bool $boolean) : void
Parameters
$boolean : bool

whether the tree should be creatable

Tags
access

public

Return values
void

setDefaultIcon()

Sets the default icon for all added nodes relative to the ../admin/images/tree/ directory

public setDefaultIcon(string $icon) : void

See the documentation of to learn more about the icon matching rules for open and closed folders

Parameters
$icon : string

is the path to the icon relative to the admin/images/tree directory. use false to hide all icons

Tags
access

public

Return values
void

setDeletable()

Creates the tree nodes as deletable

public setDeletable(bool $boolean) : void
Parameters
$boolean : bool

whether the tree should be deletable

Tags
access

public

Return values
void

setDeleteable()

Creates the tree nodes as deletable

public setDeleteable(bool $boolean) : void
Parameters
$boolean : bool

whether the tree should be deletable

Tags
access

public

Return values
void

setDragable()

Creates the tree nodes as dragable

public setDragable(bool $boolean) : void
Parameters
$boolean : bool

whether the tree should be dragable

Tags
access

public

Return values
void

setDropType()

Sets the drop type of the staticnodes

public setDropType(string $dropType) : void
Parameters
$dropType : string

the drop type the tree should have

Tags
access

public

Return values
void

setDropTypesAllowed()

Sets the drop types that are allowed to be dropped on this tree

public setDropTypesAllowed(array<string|int, mixed> $dropTypesAllowed) : void
Parameters
$dropTypesAllowed : array<string|int, mixed>

the drop types which are allowed for drop events

Tags
access

public

Return values
void

setEditable()

Creates the tree nodes as editable

public setEditable(bool $boolean) : void
Parameters
$boolean : bool

whether the tree should be editable

Tags
access

public

Return values
void

setIdPrefix()

Sets the id prefix to the current tree.

public setIdPrefix(string $sIdPrefix) : void
Parameters
$sIdPrefix : string

The id prefix for the current tree.

Tags
Return values
void

setMovable()

Creates the tree nodes as movable

public setMovable(bool $boolean) : void
Parameters
$boolean : bool

whether the tree should be movable

Tags
access

public

Return values
void

setMoveable()

Creates the tree nodes as movable

public setMoveable(bool $boolean) : void
Parameters
$boolean : bool

whether the tree should be movable

Tags
access

public

Return values
void

setOnClick()

Set's the javascript code to be evaluated at onClick Note that the JavaScript code may contain also the reserved word "{RecordID}" where ever it should use the clicked nodes ID

public setOnClick(string $onClick) : void
Parameters
$onClick : string

javascript code to evaluate

Tags
access

public

Return values
void

setOnDblClick()

Set's the javascript code to be evaluated at onDblClick Note that the JavaScript code may contain also the reserved word "{RecordID}" where ever it should use the clicked nodes ID

public setOnDblClick(string $onDblClick) : void
Parameters
$onDblClick : string

javascript code to evaluate

Tags
access

public

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

setRenamable()

Creates the tree nodes as renamable

public setRenamable(bool $boolean) : void
Parameters
$boolean : bool

whether the tree should be renamable

Tags
access

public

Return values
void

setRenameable()

Creates the tree nodes as renamable

public setRenameable(bool $boolean) : void
Parameters
$boolean : bool

whether the tree should be renamable

Tags
access

public

Return values
void

setRootItems()

Set's an array of root item IDs the tree should be limited to

public setRootItems([array<string|int, mixed> $array = array() ][, string $rootID = null ]) : void
Parameters
$array : array<string|int, mixed> = array()

array of root item IDs

$rootID : string = null

the new rootID of the tree

Tags
access

public

Return values
void

setRootLabel()

Changes the label of the root node of the tree

public setRootLabel([string $icon = "TreeLine.svg" ][, string $html = "" ]) : void
Parameters
$icon : string = "TreeLine.svg"

the icon representing the root node relative to the admin/images directory

$html : string = ""

the label added to the icon

Tags
access

public

Return values
void

setSelectable()

Sets whether the selected node can be changed or not

public setSelectable(bool $selectable[, bool $markOpenNode = false ]) : void
Parameters
$selectable : bool

whether the selection could be changed

$markOpenNode : bool = false

whether the open node should be marked if no selection is allowed

Tags
access

public

Return values
void

setSelectedNode()

Sets the default selected node in the tree

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

the id of the node which should be selected

Tags
access

public

Return values
void

setSkin()

Overwrite the default skin folder

public setSkin(string $skinPath) : mixed
Parameters
$skinPath : string

is the path to the skin folder relative to admin/images/tree/skins

Tags
Return values
mixed

setTreeUrl()

Sets the url of the tree, if the pure forward name is not sufficient This is an important option to add additional GET parameters, which should be available again for popups and loading of new nodes

public setTreeUrl([string $url = '' ][, array<string|int, mixed> $useRequestParams = array() ][, bool $recursive = true ]) : void
Parameters
$url : string = ''

the url of the tree

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

an array of params which should be reused to complete the url

$recursive : bool = true

whether the operation should be executed recursivly e.g. on CSGuiMixedTrees

Tags
access

public

Return values
void

throwError()

Throws a CSException

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

        

Search results