TYPO3  7.6
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
SelectImage Class Reference
Inheritance diagram for SelectImage:

Public Member Functions

 init ()
 
 initVariables ()
 
 insertPlainImage (File $fileObject, $altText= '', $titleText= '', $additionalParams= '')
 
 getJSCode ($act, $editorNo, $sys_language_content)
 
 processSessionData ($data)
 
 getAllowedItems ($items)
 
 orderMenuDefinition ($menuDefinition)
 
 getHelpMessage ($act)
 

Public Attributes

const PLAIN_MODE_IMAGE_FILE_EXTENSIONS = 'jpg,jpeg,gif,png'
 
 $extKey = 'rtehtmlarea'
 
 $content
 
 $allowedItems
 
 $allowedFileTypes = array()
 
 $editorNo
 
 $sys_language_content
 
 $buttonConfig
 
 $addModifyTab
 

Protected Member Functions

 initDocumentTemplate ()
 
 imageInsertJsStatement ($url, $width, $height, $altText= '', $titleText= '', $additionalParams= '')
 
 insertImages ($insertJsStatements)
 
 main_rte ($wiz=false)
 
 buildMenuArray ($wiz, $allowedItems)
 
 getImgPath ()
 
 getButtonConfig ()
 
 getDefaultClass ()
 
 setMaximumPlainImageDimensions ()
 
 fileIsSelectableInFileList (FileInterface $file, array $imgInfo)
 
 getLanguageService ()
 
 getBackendUser ()
 

Protected Attributes

 $defaultClass
 
 $plainMaxWidth
 
 $plainMaxHeight
 
 $imgPath
 
 $hookName = 'ext/rtehtmlarea/mod4/class.tx_rtehtmlarea_select_image.php'
 

Detailed Description

Script Class

Definition at line 33 of file SelectImage.php.

Member Function Documentation

buildMenuArray (   $wiz,
  $allowedItems 
)
protected

Returns an array definition of the top menu

Parameters
bool$wiz
array$allowedItems
Returns
array

Definition at line 592 of file SelectImage.php.

References $lang, SelectImage\getLanguageService(), SelectImage\orderMenuDefinition(), and GeneralUtility\quoteJSvalue().

Referenced by SelectImage\main_rte().

fileIsSelectableInFileList ( FileInterface  $file,
array  $imgInfo 
)
protected

Checks if the given file is selectable in the filelist.

In "plain" RTE mode only image files with a maximum width and height are selectable.

Parameters
FileInterface$file
array$imgInfoImage dimensions from ::getImageDimensions()
Returns
bool TRUE if file is selectable.

Definition at line 780 of file SelectImage.php.

References SelectImage\$plainMaxHeight, FileInterface\getExtension(), and GeneralUtility\inList().

getAllowedItems (   $items)

Get the allowed items or tabs

Parameters
string$items,:initial list of possible items
Returns
array the allowed items

Definition at line 664 of file SelectImage.php.

References SelectImage\$allowedItems, GeneralUtility\clientInfo(), and GeneralUtility\trimExplode().

Referenced by SelectImage\init().

getBackendUser ( )
protected
Returns
BackendUserAuthentication

Definition at line 803 of file SelectImage.php.

References $GLOBALS.

Referenced by SelectImage\main_rte().

getButtonConfig ( )
protected

Get the configuration of the image button

Returns
array the configuration array of the image button

Definition at line 651 of file SelectImage.php.

Referenced by SelectImage\initVariables().

getDefaultClass ( )
protected

Get the default image class

Returns
string the default class, if any

Definition at line 717 of file SelectImage.php.

References SelectImage\$defaultClass.

Referenced by SelectImage\initVariables().

getHelpMessage (   $act)

Get the help message to be displayed on a given tab

Parameters
string$act,:the identifier of the tab
Returns
string the text of the message

Definition at line 757 of file SelectImage.php.

References SelectImage\getLanguageService().

Referenced by SelectImage\main_rte().

getImgPath ( )
protected

Get the path of the image to be inserted or modified

Returns
string path to the image

Definition at line 640 of file SelectImage.php.

Referenced by SelectImage\initVariables().

getJSCode (   $act,
  $editorNo,
  $sys_language_content 
)

Generate JS code to be used on the image insert/modify dialogue

Parameters
string$act,:the action to be performed
string$editorNo,:the number of the RTE instance on the page
string$sys_language_content,:the language of the content element
Returns
string the generated JS code

Definition at line 346 of file SelectImage.php.

References GeneralUtility\quoteJSvalue().

Referenced by SelectImage\main_rte().

getLanguageService ( )
protected
Returns
LanguageService

Definition at line 795 of file SelectImage.php.

References $GLOBALS.

Referenced by SelectImage\buildMenuArray(), SelectImage\getHelpMessage(), and SelectImage\main_rte().

imageInsertJsStatement (   $url,
  $width,
  $height,
  $altText = '',
  $titleText = '',
  $additionalParams = '' 
)
protected

Assemble the image insertion JS statement

Parameters
string$url,:the url of the image
int$width,:the width of the image
int$height,:the height of the image
string$altText,:text for the alt attribute of the image
string$titleText,:text for the title attribute of the image
string$additionalParams,:text representing more html attributes to be added on the img tag
Returns
string the image insertion JS statement

Definition at line 300 of file SelectImage.php.

References $url, and GeneralUtility\quoteJSvalue().

Referenced by SelectImage\insertPlainImage().

init ( )

Initialisation

Returns
void

Definition at line 116 of file SelectImage.php.

References SelectImage\getAllowedItems(), SelectImage\initDocumentTemplate(), and SelectImage\initVariables().

initDocumentTemplate ( )
protected

Initialize document template object

Returns
void

Definition at line 173 of file SelectImage.php.

References ExtensionManagementUtility\extRelPath(), and GeneralUtility\quoteJSvalue().

Referenced by SelectImage\init().

initVariables ( )
insertImages (   $insertJsStatements)
protected

Echo the HTML page and JS that will insert the images

Parameters
array$insertJsStatements,:array of image insertion JS statements
Returns
void

Definition at line 312 of file SelectImage.php.

References GeneralUtility\quoteJSvalue().

insertPlainImage ( File  $fileObject,
  $altText = '',
  $titleText = '',
  $additionalParams = '' 
)

Insert a plain image

Parameters
\TYPO3\CMS\Core\Resource\File$fileObject,:the image file
string$altText,:text for the alt attribute of the image
string$titleText,:text for the title attribute of the image
string$additionalParams,:text representing more HTML attributes to be added on the img tag
Returns
string the plain image JS insertion statement

Definition at line 271 of file SelectImage.php.

References AbstractFile\getForLocalProcessing(), File\getProperty(), File\getPublicUrl(), and SelectImage\imageInsertJsStatement().

main_rte (   $wiz = false)
protected

Rich Text Editor (RTE) image selector

Parameters
bool$wizNot used here, kept for method signature compatibility with parent class
Returns
string Modified content variable.
string

Definition at line 395 of file SelectImage.php.

References SelectImage\$content, $GLOBALS, $lang, SelectImage\buildMenuArray(), elseif, SelectImage\getBackendUser(), SelectImage\getHelpMessage(), ResourceFactory\getInstance(), SelectImage\getJSCode(), SelectImage\getLanguageService(), AbstractMessage\INFO, GeneralUtility\makeInstance(), GeneralUtility\quoteJSvalue(), and GeneralUtility\trimExplode().

orderMenuDefinition (   $menuDefinition)

Order the definition of menu items according to configured order

Parameters
array$menuDefinition,:definition of menu items
Returns
array ordered menu definition

Definition at line 697 of file SelectImage.php.

References GeneralUtility\trimExplode().

Referenced by SelectImage\buildMenuArray().

processSessionData (   $data)

Session data for this class can be set from outside with this method. Call after init()

Parameters
array$dataSession data array
Returns
array Session data and boolean which indicates that data needs to be stored in session because it's changed

Definition at line 368 of file SelectImage.php.

setMaximumPlainImageDimensions ( )
protected

Set variables for maximum plain image dimensions

Returns
void

Definition at line 733 of file SelectImage.php.

Referenced by SelectImage\initVariables().

Member Data Documentation

$addModifyTab

Definition at line 104 of file SelectImage.php.

$allowedFileTypes = array()

Definition at line 60 of file SelectImage.php.

$allowedItems

Definition at line 55 of file SelectImage.php.

Referenced by SelectImage\getAllowedItems().

$buttonConfig

Definition at line 99 of file SelectImage.php.

$content

Definition at line 50 of file SelectImage.php.

Referenced by SelectImage\main_rte().

$defaultClass
protected

Definition at line 65 of file SelectImage.php.

Referenced by SelectImage\getDefaultClass().

$editorNo

Definition at line 89 of file SelectImage.php.

$extKey = 'rtehtmlarea'

Definition at line 45 of file SelectImage.php.

$hookName = 'ext/rtehtmlarea/mod4/class.tx_rtehtmlarea_select_image.php'
protected

Definition at line 109 of file SelectImage.php.

$imgPath
protected

Definition at line 84 of file SelectImage.php.

$plainMaxHeight
protected

Definition at line 79 of file SelectImage.php.

Referenced by SelectImage\fileIsSelectableInFileList().

$plainMaxWidth
protected

Definition at line 72 of file SelectImage.php.

$sys_language_content

Definition at line 94 of file SelectImage.php.

const PLAIN_MODE_IMAGE_FILE_EXTENSIONS = 'jpg,jpeg,gif,png'

These file extensions are allowed in the "plain" image selection mode.

Definition at line 40 of file SelectImage.php.