-<?php\r
-/***************************************************************\r
- * Copyright notice\r
- *\r
- * (c) 2010 Steffen Kamper <steffen@typo3.org>\r
- * All rights reserved\r
- *\r
- * This script is part of the TYPO3 project. The TYPO3 project is\r
- * free software; you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * The GNU General Public License can be found at\r
- * http://www.gnu.org/copyleft/gpl.html.\r
- * A copy is found in the textfile GPL.txt and important notices to the license\r
- * from the author is found in LICENSE.txt distributed with these scripts.\r
- *\r
- *\r
- * This script is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- * GNU General Public License for more details.\r
- *\r
- * This copyright notice MUST APPEAR in all copies of the script!\r
- ***************************************************************/\r
-\r
-/**\r
- * ExtDirect DataProvider for ContextHelp\r
- */\r
-class extDirect_DataProvider_ContextHelp {\r
-\r
- /**\r
- * Fetch the context help for the given table/field parameters\r
- *\r
- * @param string $table table identifier\r
- * @param string $field field identifier\r
- * @return array complete help information\r
- */\r
- public function getContextHelp($table, $field) {\r
-\r
- if (!isset($GLOBALS['TCA_DESCR'][$table]['columns'])) {\r
- $GLOBALS['LANG']->loadSingleTableDescription($table);\r
- }\r
- $data = $GLOBALS['TCA_DESCR'][$table]['columns'][$field];\r
-\r
-\r
- // add description text\r
- if ($data['description']) {\r
- $description = '<p class="t3-help-short">' . nl2br(strip_tags($data['description'])) . '</p>';\r
- }\r
-\r
- $title = $data['alttitle'] ? $data['alttitle'] : $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_view_help.xml:title');\r
-\r
- return array(\r
- 'title' => $title,\r
- 'description' => $description,\r
- 'id' => $table . '.' . $field,\r
- );\r
- }\r
-}\r
+<?php
+/***************************************************************
+ * Copyright notice
+ *
+ * (c) 2010 Steffen Kamper <steffen@typo3.org>
+ * All rights reserved
+ *
+ * This script is part of the TYPO3 project. The TYPO3 project is
+ * free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * The GNU General Public License can be found at
+ * http://www.gnu.org/copyleft/gpl.html.
+ * A copy is found in the textfile GPL.txt and important notices to the license
+ * from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ * This script is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * ExtDirect DataProvider for ContextHelp
+ */
+class extDirect_DataProvider_ContextHelp {
+
+ /**
+ * Fetch the context help for the given table/field parameters
+ *
+ * @param string $table table identifier
+ * @param string $field field identifier
+ * @return array complete help information
+ */
+ public function getContextHelp($table, $field) {
+
+ if (!isset($GLOBALS['TCA_DESCR'][$table]['columns'])) {
+ $GLOBALS['LANG']->loadSingleTableDescription($table);
+ }
+ $data = $GLOBALS['TCA_DESCR'][$table]['columns'][$field];
+
+
+ // add description text
+ if ($data['description']) {
+ $description = '<p class="t3-help-short">' . nl2br(strip_tags($data['description'])) . '</p>';
+ }
+
+ $title = $data['alttitle'] ? $data['alttitle'] : $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_view_help.xml:title');
+
+ return array(
+ 'title' => $title,
+ 'description' => $description,
+ 'id' => $table . '.' . $field,
+ );
+ }
+}
+
+?>
-/***************************************************************\r
- * Copyright notice\r
- *\r
- * (c) 2010 Steffen Kamper <steffen@typo3.org>\r
- * All rights reserved\r
- *\r
- * This script is part of the TYPO3 project. The TYPO3 project is\r
- * free software; you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * The GNU General Public License can be found at\r
- * http://www.gnu.org/copyleft/gpl.html.\r
- * A copy is found in the textfile GPL.txt and important notices to the license\r
- * from the author is found in LICENSE.txt distributed with these scripts.\r
- *\r
- *\r
- * This script is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- * GNU General Public License for more details.\r
- *\r
- * This copyright notice MUST APPEAR in all copies of the script!\r
- ***************************************************************/\r
-\r
-Ext.ns('TYPO3', 'TYPO3.CSH.ExtDirect');\r
-\r
-/**\r
- * Class to show tooltips for links that have the css t3-help-link\r
- * need the tags data-table and data-field (HTML5)\r
- */\r
-TYPO3.ContextHelp = function() {\r
- /**\r
- * Tooltip\r
- * @type {Ext.ToolTip}\r
- */\r
- var tip;\r
- /**\r
- * Cache for CSH\r
- * @type {Ext.util.MixedCollection}\r
- */\r
- var cshHelp = new Ext.util.MixedCollection(true);\r
-\r
- return {\r
- /**\r
- * Constructor\r
- */\r
- init: function() {\r
- tip = new Ext.ToolTip({\r
- title: 'TYPO3 CSH',\r
- html: '',\r
- anchorToTarget: true,\r
- width: 160,\r
- renderTo: Ext.getBody(),\r
- cls: 'typo3-csh-tooltip',\r
- dismissDelay: 3000, // auto hide after 3 seconds\r
- showsDelay: 2000, // show after 2 seconds\r
- listeners: {\r
- 'render': function(){\r
- this.body.on('click', function(e){\r
- e.stopEvent();\r
- top.TYPO3.ContextHelpWindow.open(this.cshLink);\r
- }, this);\r
- }\r
- }\r
-\r
- });\r
- Ext.select('div').on('mouseover', TYPO3.ContextHelp.showToolTipHelp, TYPO3.ContextHelp, {delegate: 'a.t3-help-link'});\r
- Ext.select('div').on('click', TYPO3.ContextHelp.openHelpWindow, TYPO3.ContextHelp, {delegate: 'a.t3-help-link'});\r
- },\r
-\r
- /**\r
- * Shows the tooltip, triggered from mouseover event handler\r
- *\r
- * @param {Event} event\r
- * @param {Node} link\r
- */\r
- showToolTipHelp: function(event, link) {\r
- event.stopEvent();\r
- var table = link.getAttribute('data-table');\r
- var field = link.getAttribute('data-field');\r
- var key = table + '.' + field;\r
- var element = Ext.fly(link);\r
- var response;\r
-\r
- tip.target = element;\r
-\r
- if (response = cshHelp.key(key)) {\r
- tip.body.dom.innerHTML = response.description;\r
- tip.cshLink = response.id;\r
- tip.setTitle(response.title);\r
- tip.showBy(element, 'tl-tr');\r
- } else {\r
- TYPO3.CSH.ExtDirect.getContextHelp(table, field, function(response, options) {\r
- cshHelp[table + '.' + field] = response;\r
- tip.body.dom.innerHTML = response.description;\r
- tip.cshLink = response.id;\r
- tip.setTitle(response.title);\r
- cshHelp.add(response);\r
- tip.showAt(event.getXY());\r
- }, this);\r
- }\r
- },\r
- /**\r
- * Opens the help window, triggered from click event handler\r
- *\r
- * @param {Event} event\r
- * @param {Node} link\r
- */\r
- openHelpWindow: function(event, link) {\r
- var id = link.getAttribute('data-table') + '.' + link.getAttribute('data-field');\r
- event.stopEvent();\r
- top.TYPO3.ContextHelpWindow.open(id);\r
- }\r
- }\r
-\r
-}();\r
-/**\r
- * Calls the init on Ext.onReady\r
- */\r
-Ext.onReady(TYPO3.ContextHelp.init, TYPO3.ContextHelp);
\ No newline at end of file
+/***************************************************************
+ * Copyright notice
+ *
+ * (c) 2010 Steffen Kamper <steffen@typo3.org>
+ * All rights reserved
+ *
+ * This script is part of the TYPO3 project. The TYPO3 project is
+ * free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * The GNU General Public License can be found at
+ * http://www.gnu.org/copyleft/gpl.html.
+ * A copy is found in the textfile GPL.txt and important notices to the license
+ * from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ * This script is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+Ext.ns('TYPO3', 'TYPO3.CSH.ExtDirect');
+
+/**
+ * Class to show tooltips for links that have the css t3-help-link
+ * need the tags data-table and data-field (HTML5)
+ */
+TYPO3.ContextHelp = function() {
+
+ /**
+ * Tooltip
+ * @type {Ext.ToolTip}
+ */
+ var tip;
+
+ /**
+ * Cache for CSH
+ * @type {Ext.util.MixedCollection}
+ */
+ var cshHelp = new Ext.util.MixedCollection(true);
+
+ return {
+ /**
+ * Constructor
+ */
+ init: function() {
+ tip = new Ext.ToolTip({
+ title: 'TYPO3 CSH',
+ html: '',
+ anchorToTarget: true,
+ width: 160,
+ renderTo: Ext.getBody(),
+ cls: 'typo3-csh-tooltip',
+ dismissDelay: 3000, // auto hide after 3 seconds
+ showsDelay: 2000, // show after 2 seconds
+ listeners: {
+ 'render': function(){
+ this.body.on('click', function(e){
+ e.stopEvent();
+ top.TYPO3.ContextHelpWindow.open(this.cshLink);
+ }, this);
+ }
+ }
+
+ });
+ Ext.select('div').on('mouseover', TYPO3.ContextHelp.showToolTipHelp, TYPO3.ContextHelp, {delegate: 'a.t3-help-link'});
+ Ext.select('div').on('click', TYPO3.ContextHelp.openHelpWindow, TYPO3.ContextHelp, {delegate: 'a.t3-help-link'});
+ },
+
+ /**
+ * Shows the tooltip, triggered from mouseover event handler
+ *
+ * @param {Event} event
+ * @param {Node} link
+ */
+ showToolTipHelp: function(event, link) {
+ event.stopEvent();
+ var table = link.getAttribute('data-table');
+ var field = link.getAttribute('data-field');
+ var key = table + '.' + field;
+ var element = Ext.fly(link);
+ var response;
+
+ tip.target = element;
+
+ if (response = cshHelp.key(key)) {
+ tip.body.dom.innerHTML = response.description;
+ tip.cshLink = response.id;
+ tip.setTitle(response.title);
+ tip.showBy(element, 'tl-tr');
+ } else {
+ TYPO3.CSH.ExtDirect.getContextHelp(table, field, function(response, options) {
+ cshHelp[table + '.' + field] = response;
+ tip.body.dom.innerHTML = response.description;
+ tip.cshLink = response.id;
+ tip.setTitle(response.title);
+ cshHelp.add(response);
+ tip.showAt(event.getXY());
+ }, this);
+ }
+ },
+
+ /**
+ * Opens the help window, triggered from click event handler
+ *
+ * @param {Event} event
+ * @param {Node} link
+ */
+ openHelpWindow: function(event, link) {
+ var id = link.getAttribute('data-table') + '.' + link.getAttribute('data-field');
+ event.stopEvent();
+ top.TYPO3.ContextHelpWindow.open(id);
+ }
+ }
+
+}();
+
+/**
+ * Calls the init on Ext.onReady
+ */
+Ext.onReady(TYPO3.ContextHelp.init, TYPO3.ContextHelp);