Index: t3lib/class.t3lib_tceforms.php
===================================================================
--- t3lib/class.t3lib_tceforms.php (revision 10068)
+++ t3lib/class.t3lib_tceforms.php (working copy)
@@ -2589,7 +2589,12 @@
$lang = 'l' . $lKey; // Default language, other options are "lUK" or whatever country code (independant of system!!!)
$PA['_valLang'] = $langChildren && !$langDisabled ? $editData['meta']['currentLangId'] : 'DEF'; // Default language, other options are "lUK" or whatever country code (independant of system!!!)
$PA['_lang'] = $lang;
- $PA['_cshFile'] = ((isset($dataStruct['ROOT']['TCEforms']) && isset($dataStruct['ROOT']['TCEforms']['cshFile'])) ? $dataStruct['ROOT']['TCEforms']['cshFile'] : '');
+ // Assemble key for loading the correct CSH file
+ $dsPointerFields = t3lib_div::trimExplode(',', $GLOBALS['TCA'][$table]['columns'][$field]['config']['ds_pointerField'], TRUE);
+ $PA['_cshKey'] = $table . '.' . $field;
+ foreach ($dsPointerFields as $key) {
+ $PA['_cshKey'] .= '.' . $row[$key];
+ }
// Push the sheet level tab to DynNestedStack
if (is_array($dataStructArray['sheets'])) {
@@ -2977,9 +2982,8 @@
$processedTitle = str_replace('\n', '
', $theTitle);
$tRows[] = '
-tag with
+ * @deprecated since TYPO3 4.5, this function will be removed in TYPO3 4.7. Use t3lib_BEfunc::wrapInHelp() instead.
*/
function helpTextIcon_typeFlex($field, $fieldTitle, $cshFile) {
+ t3lib_div::logDeprecatedFunction();
if ($this->globalShowHelp && $cshFile) {
$value = $GLOBALS['LANG']->sL($cshFile . ':' . $field . '.description');
if (trim($value)) {
@@ -5273,8 +5279,10 @@
* @param string Field name
* @param string CSH file name
* @return string Description for the field with cion or empty string
+ * @deprecated since TYPO3 4.5, this function will be removed in TYPO3 4.7. Use t3lib_BEfunc::wrapInHelp() instead.
*/
function helpText_typeFlex($field, $fieldTitle, $cshFile) {
+ t3lib_div::logDeprecatedFunction();
if ($this->globalShowHelp && $cshFile && $this->edit_showFieldHelp == 'text') {
$value = $GLOBALS['LANG']->sL($cshFile . ':' . $field . '.description');
if (trim($value)) {
Index: typo3/view_help.php
===================================================================
--- typo3/view_help.php (revision 10068)
+++ typo3/view_help.php (working copy)
@@ -124,6 +124,13 @@
var $limitAccess; // If set access to fields and tables is checked. Should be done for true database tables.
var $table; // The "table" key
var $field; // The "field" key
+ /**
+ * Key used to point to the right CSH resource
+ * In simple cases, is equal to $table
+ *
+ * @var string
+ */
+ protected $mainKey;
// Internal, static: GPvar:
var $tfID; // Table/FIeld id.
@@ -160,7 +167,23 @@
$this->renderALL = t3lib_div::_GP('renderALL');
// Set internal table/field to the parts of "tfID" incoming var.
- list($this->table,$this->field) = explode('.',$this->tfID);
+ $identifierParts = explode('.', $this->tfID);
+ // The table is the first item
+ $this->table = array_shift($identifierParts);
+ $this->mainKey = $this->table;
+ // The field is the second one
+ $this->field = array_shift($identifierParts);
+ // There may be extra parts for FlexForms
+ if (count($identifierParts) > 0) {
+ $flexFormField = array_pop($identifierParts);
+ $extraIdentifierInformation = $identifierParts;
+ // Assemble a different main key and switch field to use flexform field name
+ $this->mainKey .= '.' . $this->field;
+ foreach ($extraIdentifierInformation as $extraKey) {
+ $this->mainKey .= '.' . $extraKey;
+ }
+ $this->field = $flexFormField;
+ }
// limitAccess is checked if the $this->table really IS a table (and if the user is NOT a translator who should see all!)
$showAllToUser = t3lib_BEfunc::isModuleSetInTBE_MODULES('txllxmltranslateM1') && $GLOBALS['BE_USER']->check('modules','txllxmltranslateM1');
@@ -177,18 +200,23 @@
// Start HTML output accumulation:
$TBE_TEMPLATE->divClass = 'typo3-view-help';
- $this->content.= $TBE_TEMPLATE->startPage($LANG->getLL('title'));
+ $this->content .= $TBE_TEMPLATE->startPage($LANG->getLL('title'));
- if ($this->field=='*') { // If ALL fields is supposed to be shown:
+ if ($this->field == '*') {
+ // If ALL fields is supposed to be shown:
$this->createGlossaryIndex();
- $this->content.= $this->render_Table($this->table);
- } elseif ($this->tfID) { // ... otherwise show only single field:
+ $this->content .= $this->render_Table($this->mainKey);
+
+ } elseif ($this->tfID) {
+ // ... otherwise show only single field:
$this->createGlossaryIndex();
- $this->content.= $this->render_Single($this->table,$this->field);
- }
- elseif (is_array($this->ffID)) {
- $this->content.= $this->render_SingleFlex();
- } else { // Render Table Of Contents if nothing else:
+ $this->content .= $this->render_Single($this->mainKey, $this->field);
+
+ } elseif (is_array($this->ffID)) {
+ $this->content .= $this->render_SingleFlex();
+
+ } else {
+ // Render Table Of Contents if nothing else:
$this->content.= $this->render_TOC();
}
@@ -414,35 +442,36 @@
/**
* Render CSH for a full cshKey/table
*
- * @param string CSH key / table name
- * @return string HTML output
+ * @param string $key Full CSH key (may be different from table name)
+ * @param string $table CSH key / table name
+ * @return string HTML output
*/
- function render_Table($table) {
+ function render_Table($key, $table) {
global $BE_USER,$TCA_DESCR,$TCA,$LANG;
$output = '';
// Load table TCA
- t3lib_div::loadTCA($table);
+ t3lib_div::loadTCA($key);
// Load descriptions for table $table
- $LANG->loadSingleTableDescription($table);
+ $LANG->loadSingleTableDescription($key);
- if (is_array($TCA_DESCR[$table]['columns']) && (!$this->limitAccess || $BE_USER->check('tables_select',$table))) {
+ if (is_array($TCA_DESCR[$key]['columns']) && (!$this->limitAccess || $BE_USER->check('tables_select', $table))) {
// Initialize variables:
$parts = array();
$parts[0] = ''; // Reserved for header of table
// Traverse table columns as listed in TCA_DESCR
- foreach ($TCA_DESCR[$table]['columns'] as $field => $value) {
+ foreach ($TCA_DESCR[$key]['columns'] as $field => $_) {
- $fieldValue = isset($TCA[$table]) && strcmp($field,'') ? $TCA[$table]['columns'][$field] : array();
+ $fieldValue = isset($TCA[$key]) && strcmp($field, '') ? $TCA[$key]['columns'][$field] : array();
- if (is_array($fieldValue) && (!$this->limitAccess || !$fieldValue['exclude'] || $BE_USER->check('non_exclude_fields',$table.':'.$field))) {
+ if (is_array($fieldValue) && (!$this->limitAccess || !$fieldValue['exclude'] || $BE_USER->check('non_exclude_fields', $table . ':' . $field))) {
if (!$field) {
- $parts[0] = $this->printItem($table,'',1); // Header
+ $parts[0] = $this->printItem($key, '', 1); // Header
} else {
- $parts[] = $this->printItem($table,$field,1); // Field
+ $parts[] = $this->printItem($key, $field, 1); // Field
}
}
}
@@ -450,15 +479,15 @@
if (!$parts[0]) {
unset($parts[0]);
}
- $output.= implode('
',$parts);
+ $output .= implode('
', $parts);
}
// Substitute glossary words:
$output = $this->substituteGlossaryWords($output);
// TOC link:
- if (!$this->renderALL) {
- $tocLink = ''.$LANG->getLL('goToToc',1).'
';
+ if (!$this->renderALL) {
+ $tocLink = '' . $LANG->getLL('goToToc', 1) . '
';
$output =
$tocLink.'
@@ -474,20 +503,20 @@
/**
* Renders CSH for a single field.
*
- * @param string CSH key / table name
- * @param string Sub key / field name
- * @return string HTML output
+ * @param string $key CSH key / table name
+ * @param string $field Sub key / field name
+ * @return string HTML output
*/
- function render_Single($table,$field) {
+ function render_Single($key, $field) {
global $LANG, $TCA;
$output = '';
- // Load descriptions for table $table
- $LANG->loadSingleTableDescription($table);
+ // Load the description field
+ $LANG->loadSingleTableDescription($key);
- // Render single item:
- $output.= $this->printItem($table,$field);
+ // Render single item
+ $output.= $this->printItem($key, $field);
// Substitute glossary words:
$output = $this->substituteGlossaryWords($output);
@@ -495,8 +524,8 @@
// Link to Full table description and TOC:
$getLLKey = $this->limitAccess ? 'fullDescription' : 'fullDescription_module';
$output.= '
- '.$LANG->getLL($getLLKey,1).'
- '.$LANG->getLL('goToToc',1).'
';
+ ' . $LANG->getLL($getLLKey, 1) . '
+ ' . $LANG->getLL('goToToc', 1) . '
';
return $output;
}
@@ -508,8 +537,10 @@
* @param string CSH key / table name
* @param string Sub key / field name
* @return string HTML output
+ * @deprecated since TYPO3 4.5, this function will be removed in TYPO3 4.7. Use render_Single() instead.
*/
function render_SingleFlex() {
+ t3lib_div::logDeprecatedFunction();
$output = '';
// Render
@@ -648,32 +679,32 @@
* Prints a single $table/$field information piece
* If $anchors is set, then seeAlso references to the same table will be page-anchors, not links.
*
- * @param string Table name
- * @param string Field name
- * @param boolean If anchors is to be shown.
- * @return string HTML content
+ * @param string $key CSH key / table name
+ * @param string $field Sub key / field name
+ * @param boolean $anchors If anchors is to be shown.
+ * @return string HTML content
*/
- function printItem($table,$field,$anchors=0) {
+ function printItem($key, $field, $anchors = FALSE) {
global $TCA_DESCR, $LANG, $TCA, $BE_USER;
+ $out = '';
// Load full table definition in $TCA
- t3lib_div::loadTCA($table);
+ t3lib_div::loadTCA($key);
- if ($table && (!$field || is_array($TCA_DESCR[$table]['columns'][$field]))) {
+ if ($key && (!$field || is_array($TCA_DESCR[$key]['columns'][$field]))) {
// Make seeAlso references.
- $seeAlsoRes = $this->make_seeAlso($TCA_DESCR[$table]['columns'][$field]['seeAlso'],$anchors?$table:'');
+ $seeAlsoRes = $this->make_seeAlso($TCA_DESCR[$key]['columns'][$field]['seeAlso'], $anchors ? $key : '');
// Making item:
- $out= '