TYPO3 CMS  TYPO3_6-2
Typo3Image.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 = 'TYPO3Image';
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 = 'extensions/TYPO3Image/skin/htmlarea.css';
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 = 'image';
48 
50  'image' => 'InsertImage'
51  );
52 
53  public function main($parentObject) {
54  $enabled = parent::main($parentObject);
55  // Check if this should be enabled based on extension configuration and Page TSConfig
56  // The 'Minimal' and 'Typical' default configurations include Page TSConfig that removes images on the way to the database
57  $enabled = $enabled && !($this->thisConfig['proc.']['entryHTMLparser_db.']['tags.']['img.']['allowedAttribs'] == '0' && $this->thisConfig['proc.']['entryHTMLparser_db.']['tags.']['img.']['rmTagIfNoAttrib'] == '1') && !$this->thisConfig['buttons.']['image.']['TYPO3Browser.']['disabled'];
58  return $enabled;
59  }
60 
67  public function buildJavascriptConfiguration($RTEcounter) {
68  $registerRTEinJavascriptString = '';
69  $button = 'image';
70  if (in_array($button, $this->toolbar)) {
71  if (!is_array($this->thisConfig['buttons.']) || !is_array($this->thisConfig['buttons.'][($button . '.')])) {
72  $registerRTEinJavascriptString .= '
73  RTEarea[' . $RTEcounter . ']["buttons"]["' . $button . '"] = new Object();';
74  }
75  $registerRTEinJavascriptString .= '
76  RTEarea[' . $RTEcounter . '].buttons.' . $button . '.pathImageModule = "' .
77  \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('rtehtmlarea_wizard_select_image') . '";';
78  }
79  return $registerRTEinJavascriptString;
80  }
81 
82 }
static getModuleUrl($moduleName, $urlParameters=array(), $backPathOverride=FALSE, $returnAbsoluteUrl=FALSE)