ToolbarController
extends Controller
in package
Specific ToolbarContoller for this Component.
Use this to easily create a toolbar configurator
Tags
Table of Contents
Properties
- $cx : Cx
- Main class instance
- $dbCon : ADONewConnection
- Contains the connection to the database to change it fast and simple
- $defaultBbcode : array<string|int, mixed>
- This is the default toolbar for Bbcode
- $defaultFrontendEditingContent : array<string|int, mixed>
- This is the default toolbar for frontend editing contend
- $defaultFrontendEditingTitle : array<string|int, mixed>
- This is the default toolbar for frontend editing title
- $defaultFull : array<string|int, mixed>
- This is the default toolbar for either full or small
- $defaultRemovedButtons : string
- These are the buttons that are removed by default and are not accessible
- $types : array<string|int, mixed>
- Contains all available types of toolbars
Methods
- __call() : mixed
- Route methods like getName(), getType(), getDirectory(), etc.
- __construct() : mixed
- ToolbarController constructor.
- getAsOldSyntax() : string
- Compile the removed buttons into available functions
- getRemovedButtons() : string
- Get the buttons that shall be removed
- getRemovedButtonsByToolbarId() : string
- getSystemComponentController() : SystemComponentController
- Returns the main controller
- getToolbar() : string
- Wrapper for any getTYPEToolbar calls
- getToolbarByGroupId() : string
- getToolbarConfiguratorTemplate() : Sigma
- Get the template for the toolbar configurator
- store() : int
- Store a toolbar configuration
- getToolbarIdsOfUserGroup() : array<string|int, mixed>
- Get all toolbar ids of the assigned user groups or by the given user groups
- getToolbarTranslations() : void
- Get the translations for the toolbar and store it as a variable
- loadRemovedButtons() : array<string|int, mixed>
- Load the removed button of the given toolbar ids
- loadSystemRemovedButtons() : array<string|int, mixed>
- Load system-wide removed buttons
- mergeRemovedButtons() : string
- Merge the given removed buttons in $removedButtons together
Properties
$cx
Main class instance
protected
Cx
$cx
= null
$dbCon
Contains the connection to the database to change it fast and simple
protected
ADONewConnection
$dbCon
Connection with the Database
Tags
$defaultBbcode
This is the default toolbar for Bbcode
protected
array<string|int, mixed>
$defaultBbcode
= array(array('Source'), array('NewPage'), array('Undo', 'Redo'), array('Find', 'Replace'), array('SelectAll'), array('Bold', 'Italic', 'Underline'), array('CopyFormatting', 'RemoveFormat'), array('Link', 'Unlink'), array('SpecialChar'))
Tags
$defaultFrontendEditingContent
This is the default toolbar for frontend editing contend
protected
array<string|int, mixed>
$defaultFrontendEditingContent
= array(array('Templates'), array('Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord'), array('Undo', 'Redo'), array('Find', 'Replace'), array('SelectAll'), array('Scayt'), array('Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript'), array('CopyFormatting', 'RemoveFormat'), array('NumberedList', 'BulletedList'), array('Outdent', 'Indent'), array('Blockquote'), '/', array('JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'), array('BidiLtr', 'BidiRtl'), array('Link', 'Unlink', 'Anchor'), array('Image', 'Flash', 'Table', 'HorizontalRule', 'SpecialChar'), array('Styles', 'Format', 'Font', 'FontSize'), array('TextColor', 'BGColor'), array('ShowBlocks'))
Tags
$defaultFrontendEditingTitle
This is the default toolbar for frontend editing title
protected
array<string|int, mixed>
$defaultFrontendEditingTitle
= array(array('Cut', 'Copy', 'Paste'), array('Undo', 'Redo'), array('SelectAll'), array('Scayt'))
Tags
$defaultFull
This is the default toolbar for either full or small
protected
array<string|int, mixed>
$defaultFull
= array(array('Source'), array('searchCode'), array('NewPage'), array('Templates'), array('Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord'), array('Undo', 'Redo'), array('Find', 'Replace'), array('SelectAll'), array('Scayt'), array('Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript'), array('CopyFormatting', 'RemoveFormat'), array('NumberedList', 'BulletedList'), array('Outdent', 'Indent'), array('Blockquote', 'CreateDiv'), array('JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'), array('BidiLtr', 'BidiRtl'), array('Link', 'Unlink', 'Anchor'), array('Image', 'Flash', 'Table', 'HorizontalRule', 'SpecialChar'), array('Styles', 'Format', 'Font', 'FontSize'), array('TextColor', 'BGColor'), array('Maximize'), array('ShowBlocks'))
Tags
$defaultRemovedButtons
These are the buttons that are removed by default and are not accessible
protected
string
$defaultRemovedButtons
= 'autoFormat,CommentSelectedRange,UncommentSelectedRange,AutoComplete'
Functions that shall never be available in Cloudrexx
Tags
$types
Contains all available types of toolbars
protected
array<string|int, mixed>
$types
= array('small', 'full', 'frontendEditingContent', 'frontendEditingTitle', 'bbcode')
Contains all the type of toolbars available in Cloudrexx
Tags
Methods
__call()
Route methods like getName(), getType(), getDirectory(), etc.
public
__call(string $methodName, array<string|int, mixed> $arguments) : mixed
Parameters
- $methodName : string
-
Name of method to call
- $arguments : array<string|int, mixed>
-
List of arguments for the method to call
Attributes
- #[ReturnTypeWillChange]
Return values
mixed —Return value of the method to call
__construct()
ToolbarController constructor.
public
__construct(SystemComponentController $systemComponentController, Cx $cx) : mixed
Parameters
- $systemComponentController : SystemComponentController
-
Main controller for this system component
- $cx : Cx
getAsOldSyntax()
Compile the removed buttons into available functions
public
getAsOldSyntax(string $removedButtons, string $type) : string
Compiles the removed buttons into available function based on the given type of toolbar (either small, full, bbcode, frontendEditingContent or frontendEditingTitle) and returns these available functions as a json- array
Parameters
- $removedButtons : string
-
List of functinos which shall be removed
- $type : string
-
Type of toolbar (either small, full, bbcode, frontendEditingContent or frontendEditingTitle)
Return values
string —$oldSyntax json-array of the available functions
getRemovedButtons()
Get the buttons that shall be removed
public
getRemovedButtons([bool $buttonsOnly = false ][, bool $isAccess = false ]) : string
Parameters
- $buttonsOnly : bool = false
-
Only buttons no config.removeButtons prefix
- $isAccess : bool = false
-
If set remove buttons that are disabled by the default configuration
Return values
string —Either the list of removed buttons or the proper config string
getRemovedButtonsByToolbarId()
public
getRemovedButtonsByToolbarId(mixed $toolbarId) : string
Parameters
- $toolbarId : mixed
Return values
stringgetSystemComponentController()
Returns the main controller
public
getSystemComponentController() : SystemComponentController
Return values
SystemComponentController —Main controller for this system component
getToolbar()
Wrapper for any getTYPEToolbar calls
public
getToolbar(mixed $type) : string
Type must be one of the following: Small, Full, FrontendEditingContent, FrontendEditingTitle or Bbcode
Parameters
- $type : mixed
-
string Type of toolbar (Small, Full, FrontendEditingContent, FrontendEditingTitle or Bbcode)
Return values
string —string The toolbar with the restricted scope of functions
getToolbarByGroupId()
public
getToolbarByGroupId(mixed $groupId) : string
Parameters
- $groupId : mixed
Return values
stringgetToolbarConfiguratorTemplate()
Get the template for the toolbar configurator
public
getToolbarConfiguratorTemplate([string $componentRoot = '/' ][, bool $isDefaultConfiguration = false ]) : Sigma
Also registers the necessary css and js files
Parameters
- $componentRoot : string = '/'
-
The Path to the template
- $isDefaultConfiguration : bool = false
-
Wraps the template in a form tag defaults to false
Return values
Sigma —$template The toolbar configurator template
store()
Store a toolbar configuration
public
store(string $toolbar[, int $toolbarId = 0 ][, bool $isDefault = false ]) : int
Store a toolbar configuration and return the id in case of a new toolbar or 0 in case an existing one has been updated
Parameters
- $toolbar : string
-
Toolbar configuration that shall be stored
- $toolbarId : int = 0
-
Id of the toolbar if an existing one is updated
- $isDefault : bool = false
-
Store config as default configuration
Tags
Return values
intgetToolbarIdsOfUserGroup()
Get all toolbar ids of the assigned user groups or by the given user groups
protected
getToolbarIdsOfUserGroup([array<string|int, mixed> $userGroups = array() ]) : array<string|int, mixed>
If the parameter $userGroup is empty the assigned user groups of the current user are used
Parameters
- $userGroups : array<string|int, mixed> = array()
-
Array containing the user group ids
Return values
array<string|int, mixed> —$toolbarIds All the available toolbar ids. Be wary though, as this array might be empty
getToolbarTranslations()
Get the translations for the toolbar and store it as a variable
protected
getToolbarTranslations() : void
This variable is available through the cx javascript framework.
loadRemovedButtons()
Load the removed button of the given toolbar ids
protected
loadRemovedButtons(array<string|int, mixed> $toolbarIds) : array<string|int, mixed>
Parameters
- $toolbarIds : array<string|int, mixed>
-
Array containing all ids of the toolbars that shall be loaded
Return values
array<string|int, mixed> —Array containing the removed buttons of the given toolbar ids
loadSystemRemovedButtons()
Load system-wide removed buttons
protected
loadSystemRemovedButtons() : array<string|int, mixed>
Return values
array<string|int, mixed> —Array containing the system-wide removed buttons
mergeRemovedButtons()
Merge the given removed buttons in $removedButtons together
protected
mergeRemovedButtons(array<string|int, mixed> $removedButtons) : string
Parameters
- $removedButtons : array<string|int, mixed>
-
The removed buttons which shall be merged together
Return values
string —The merged buttons. Be wary that this string might be empty