TYPO3 CMS  TYPO3_6-2
Typo3HtmlParser.php
Go to the documentation of this file.
1 <?php
3 
22 
23  protected $extensionKey = 'rtehtmlarea';
24 
25  // The key of the extension that is extending htmlArea RTE
26  protected $pluginName = 'TYPO3HtmlParser';
27 
28  // The name of the plugin registered by the extension
30 
31  // Path to this main locallang file of the extension relative to the extension dir.
32  protected $relativePathToSkin = '';
33 
34  // Path to the skin (css) file relative to the extension dir
35  protected $htmlAreaRTE;
36 
37  // Reference to the invoking object
38  protected $thisConfig;
39 
40  // Reference to RTE PageTSConfig
41  protected $toolbar;
42 
43  // Reference to RTE toolbar array
44  protected $LOCAL_LANG;
45 
46  // Frontend language array
47  protected $pluginButtons = 'cleanword';
48 
50  'cleanword' => 'CleanWord'
51  );
52 
53  public function main($parentObject) {
54  return parent::main($parentObject) && $this->thisConfig['enableWordClean'] && is_array($this->thisConfig['enableWordClean.']['HTMLparser.']);
55  }
56 
63  public function buildJavascriptConfiguration($RTEcounter) {
64  $registerRTEinJavascriptString = '';
65  $button = 'cleanword';
66  if (in_array($button, $this->toolbar)) {
67  if (!is_array($this->thisConfig['buttons.']) || !is_array($this->thisConfig['buttons.'][($button . '.')])) {
68  $registerRTEinJavascriptString .= '
69  RTEarea[' . $RTEcounter . '].buttons.' . $button . ' = new Object();';
70  }
71  $registerRTEinJavascriptString .= '
72  RTEarea[' . $RTEcounter . '].buttons.' . $button . '.pathParseHtmlModule = "' .
73  \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('rtehtmlarea_wizard_parse_html') . '";
74  RTEarea[' . $RTEcounter . '].buttons.' . $button . '.hotKey = "' . ($this->thisConfig['enableWordClean.']['hotKey'] ?: '0') . '";';
75  }
76  return $registerRTEinJavascriptString;
77  }
78 
86  public function applyToolbarConstraints($show) {
87  return array_unique(array_merge($show, \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->pluginButtons)));
88  }
89 
90 }
static trimExplode($delim, $string, $removeEmptyValues=FALSE, $limit=0)
static getModuleUrl($moduleName, $urlParameters=array(), $backPathOverride=FALSE, $returnAbsoluteUrl=FALSE)