TYPO3 CMS  TYPO3_6-2
ContextMenu.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 = 'ContextMenu';
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;
48 
49  protected $convertToolbarForHtmlAreaArray = array();
50 
51  public function main($parentObject) {
52  $enabled = parent::main($parentObject) && !($this->htmlAreaRTE->client['browser'] == 'opera' || $this->thisConfig['contextMenu.']['disabled']);
53  return $enabled;
54  }
55 
62  public function buildJavascriptConfiguration($editorId) {
63  $registerRTEinJavascriptString = '';
64  if (is_array($this->thisConfig['contextMenu.'])) {
65  $registerRTEinJavascriptString .= '
66  RTEarea[' . $editorId . '].contextMenu = ' . $this->htmlAreaRTE->buildNestedJSArray($this->thisConfig['contextMenu.']) . ';';
67  if ($this->thisConfig['contextMenu.']['showButtons']) {
68  $registerRTEinJavascriptString .= '
69  RTEarea[' . $editorId . '].contextMenu.showButtons = ' . json_encode(\TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->htmlAreaRTE->cleanList(\TYPO3\CMS\Core\Utility\GeneralUtility::strtolower($this->thisConfig['contextMenu.']['showButtons'])), TRUE)) . ';';
70  }
71  if ($this->thisConfig['contextMenu.']['hideButtons']) {
72  $registerRTEinJavascriptString .= '
73  RTEarea[' . $editorId . '].contextMenu.hideButtons = ' . json_encode(\TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->htmlAreaRTE->cleanList(\TYPO3\CMS\Core\Utility\GeneralUtility::strtolower($this->thisConfig['contextMenu.']['hideButtons'])), TRUE)) . ';';
74  }
75  }
76  return $registerRTEinJavascriptString;
77  }
78 
79 }
static trimExplode($delim, $string, $removeEmptyValues=FALSE, $limit=0)