2 namespace TYPO3\CMS\Rtehtmlarea\Extension;
46 'link' =>
'CreateLink',
59 return parent::main($configuration)
60 && !$this->configuration[
'thisConfig'][
'buttons.'][
'link.'][
'TYPO3Browser.'][
'disabled'];
72 if (in_array($button, $this->toolbar)) {
73 if (!is_array($this->configuration[
'thisConfig'][
'buttons.']) || !is_array($this->configuration[
'thisConfig'][
'buttons.'][($button .
'.')])) {
74 $jsArray[] =
'RTEarea[editornumber].buttons.' . $button .
' = new Object();';
76 $jsArray[] =
'RTEarea[editornumber].buttons.' . $button .
'.pathLinkModule = ' .
GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl(
'rtehtmlarea_wizard_browse_links')) .
';';
77 if (is_array($this->configuration[
'RTEsetup'][
'properties'][
'classesAnchor.'])) {
78 $jsArray[] =
'RTEarea[editornumber].buttons.' . $button .
'.classesAnchorUrl = "' . $this->
writeTemporaryFile(
'classesAnchor_' . $this->configuration[
'contentLanguageUid'],
'js', $this->
buildJSClassesAnchorArray()) .
'";';
82 return implode(LF, $jsArray);
92 $JSClassesAnchorArray =
'HTMLArea.classesAnchorSetup = [ ' . LF;
93 $classesAnchorIndex = 0;
94 foreach ($this->configuration[
'RTEsetup'][
'properties'][
'classesAnchor.'] as $label => $conf) {
95 if (is_array($conf) && $conf[
'class']) {
96 $JSClassesAnchorArray .= ($classesAnchorIndex++ ?
',' :
'') .
' { ' . LF;
98 $JSClassesAnchorArray .= ($index++ ?
',' :
'') .
'name : "' . str_replace(
'"',
'', str_replace(
'\'',
'', $conf[
'class'])) .
'"' . LF;
100 $JSClassesAnchorArray .= ($index++ ?
',' :
'') .
'type : "' . str_replace(
'"',
'', str_replace(
'\'',
'', $conf[
'type'])) .
'"' . LF;
102 if (trim(str_replace(
'\'',
'', str_replace(
'"',
'', $conf[
'image'])))) {
105 $JSClassesAnchorArray .= ($index++ ?
',' :
'') .
'addIconAfterLink : ' . ($conf[
'addIconAfterLink'] ?
'true' :
'false') . LF;
106 if (trim($conf[
'altText'])) {
108 $JSClassesAnchorArray .= ($index++ ?
',' :
'') .
'altText : ' . str_replace(
'"',
'\\"', str_replace(
'\\\'',
'\'', $string)) . LF;
110 if (trim($conf[
'titleText'])) {
112 $JSClassesAnchorArray .= ($index++ ?
',' :
'') .
'titleText : ' . str_replace(
'"',
'\\"', str_replace(
'\\\'',
'\'', $string)) . LF;
114 if (trim($conf[
'target'])) {
115 $JSClassesAnchorArray .= ($index++ ?
',' :
'') .
'target : "' . trim($conf[
'target']) .
'"' . LF;
117 $JSClassesAnchorArray .=
'}' . LF;
120 $JSClassesAnchorArray .=
'];' . LF;
121 return $JSClassesAnchorArray;
133 if (!in_array(
'link', $show)) {