53 'acronym' =>
'Acronym' 60 public function main($parentObject) {
72 if ($this->htmlAreaRTE->client[
'browser'] ==
'msie' && $this->htmlAreaRTE->client[
'version'] < 7) {
74 $content = preg_replace(
'/<(\\/?)abbr/i',
'<$1acronym', $content);
86 $registerRTEinJavascriptString =
'';
88 if (in_array($button, $this->toolbar)) {
89 if (!is_array($this->thisConfig[
'buttons.']) || !is_array($this->thisConfig[
'buttons.'][($button .
'.')])) {
90 $registerRTEinJavascriptString .=
' 91 RTEarea[' . $RTEcounter .
']["buttons"]["' . $button .
'"] = new Object();';
93 $registerRTEinJavascriptString .=
' 94 RTEarea[' . $RTEcounter .
'].buttons.' . $button .
'.acronymUrl = "' . $this->htmlAreaRTE->writeTemporaryFile(
'', (
'acronym_' . $this->htmlAreaRTE->contentLanguageUid),
'js', $this->buildJSAcronymArray($this->htmlAreaRTE->contentLanguageUid)) .
'";';
96 if ($this->htmlAreaRTE->client[
'browser'] ==
'msie' && $this->htmlAreaRTE->client[
'version'] < 7) {
97 $this->abbreviationIndex = 0;
99 $registerRTEinJavascriptString .=
' 100 RTEarea[' . $RTEcounter .
'].buttons.' . $button .
'.noAcronym = ' . ($this->acronymIndex ?
'false' :
'true') .
'; 101 RTEarea[' . $RTEcounter .
'].buttons.' . $button .
'.noAbbr = ' . ($this->abbreviationIndex ?
'false' :
'true') .
';';
103 return $registerRTEinJavascriptString;
114 $acronymArray = array();
115 $abbrArray = array();
116 $tableA =
'tx_rtehtmlarea_acronym';
117 $tableB =
'static_languages';
118 $fields = $tableA .
'.type,' . $tableA .
'.term,' . $tableA .
'.acronym,' . $tableB .
'.lg_iso_2,' . $tableB .
'.lg_country_iso_2';
119 $tableAB = $tableA .
' LEFT JOIN ' . $tableB .
' ON ' . $tableA .
'.static_lang_isocode=' . $tableB .
'.uid';
120 $whereClause =
'1=1';
121 $loadRecordsFromDatabase = TRUE;
123 $lockBeUserToDBmounts = isset($this->thisConfig[
'buttons.'][$button .
'.'][
'lockBeUserToDBmounts']) ? $this->thisConfig[
'buttons.'][$button .
'.'][
'lockBeUserToDBmounts'] :
$GLOBALS[
'TYPO3_CONF_VARS'][
'BE'][
'lockBeUserToDBmounts'];
124 if (!
$GLOBALS[
'BE_USER']->isAdmin() &&
$GLOBALS[
'TYPO3_CONF_VARS'][
'BE'][
'lockBeUserToDBmounts'] && $lockBeUserToDBmounts) {
126 $altMountPoints = trim(
$GLOBALS[
'BE_USER']->getTSConfigVal(
'options.pageTree.altElementBrowserMountPoints'));
127 if ($altMountPoints) {
128 $savedGroupDataWebmounts =
$GLOBALS[
'BE_USER']->groupData[
'webmounts'];
132 $webMounts =
$GLOBALS[
'BE_USER']->returnWebmounts();
133 $perms_clause =
$GLOBALS[
'BE_USER']->getPagePermsClause(1);
134 $recursive = isset($this->thisConfig[
'buttons.'][$button .
'.'][
'recursive']) ? (int)$this->thisConfig[
'buttons.'][$button .
'.'][
'recursive'] : 0;
135 if (trim($this->thisConfig[
'buttons.'][$button .
'.'][
'pages'])) {
137 foreach ($pids as $key => $val) {
138 if (!
$GLOBALS[
'BE_USER']->isInWebMount($val, $perms_clause)) {
146 if ($altMountPoints) {
147 $GLOBALS[
'BE_USER']->groupData[
'webmounts'] = $savedGroupDataWebmounts;
152 $pageTreePrefix =
'';
153 foreach ($pids as $key => $val) {
155 $pageTreePrefix =
',';
157 $pageTree .= $pageTreePrefix . $queryGenerator->getTreeList($val, $recursive, ($begin = 0), $perms_clause);
160 if ($pageTree !==
'') {
161 $whereClause .=
' AND ' . $tableA .
'.pid IN (' . $pageTree .
')';
165 $loadRecordsFromDatabase = FALSE;
169 if ($loadRecordsFromDatabase) {
171 if ($this->htmlAreaRTE->contentLanguageUid > -1) {
172 $whereClause .=
' AND (' . $tableA .
'.sys_language_uid=' . $this->htmlAreaRTE->contentLanguageUid .
' OR ' . $tableA .
'.sys_language_uid=-1) ';
175 if (is_array($this->thisConfig[
'buttons.']) && is_array($this->thisConfig[
'buttons.'][
'language.']) && isset($this->thisConfig[
'buttons.'][
'language.'][
'restrictToItems'])) {
176 $languageList = implode(
'\',\
'', \
TYPO3\CMS\Core\Utility\
GeneralUtility::trimExplode(
',',
$GLOBALS[
'TYPO3_DB']->fullQuoteStr(strtoupper($this->thisConfig[
'buttons.'][
'language.'][
'restrictToItems']), $tableB)));
177 $whereClause .=
' AND ' . $tableB .
'.lg_iso_2 IN (' . $languageList .
') ';
183 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery($fields, $tableAB, $whereClause);
184 while ($abbreviationRow =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res)) {
185 $item = array(
'term' => $abbreviationRow[
'term'],
'abbr' => $abbreviationRow[
'acronym'],
'language' => strtolower($abbreviationRow[
'lg_iso_2']) . ($abbreviationRow[
'lg_country_iso_2'] ?
'-' . $abbreviationRow[
'lg_country_iso_2'] :
''));
186 if ($abbreviationRow[
'type'] == 1) {
187 $acronymArray[] = $item;
188 } elseif ($abbreviationRow[
'type'] == 2) {
189 $abbrArray[] = $item;
194 $this->acronymIndex = count($acronymArray);
195 $this->abbreviationIndex = count($abbrArray);
196 return json_encode(array(
'abbr' => $abbrArray,
'acronym' => $acronymArray));
$relativePathToLocallangFile
static intExplode($delimiter, $string, $removeEmptyValues=FALSE, $limit=0)
static makeInstance($className)
static trimExplode($delim, $string, $removeEmptyValues=FALSE, $limit=0)
buildJSAcronymArray($languageUid)
buildJavascriptConfiguration($RTEcounter)
static isLoaded($key, $exitOnError=FALSE)
$convertToolbarForHtmlAreaArray
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
transformContent($content)
static BEenableFields($table, $inv=0)
static deleteClause($table, $tableAlias='')