117 if (!preg_match(
'/^[a-zA-Z0-9_\\-\\.\\*]*$/', $this->tfID)) {
123 $identifierParts = explode(
'.', $this->tfID);
125 $this->table = array_shift($identifierParts);
128 $this->field = array_shift($identifierParts);
130 if (count($identifierParts) > 0) {
132 $extraIdentifierInformation = array();
133 $extraIdentifierInformation[] = array_shift($identifierParts);
136 if (strpos(
$GLOBALS[
'TCA'][$this->table][
'columns'][$this->field][
'config'][
'ds_pointerField'],
',') !== FALSE) {
137 $extraIdentifierInformation[] = array_shift($identifierParts);
141 $flexFormField = implode(
'.', $identifierParts);
144 foreach ($extraIdentifierInformation as $extraKey) {
145 $this->mainKey .=
'.' . $extraKey;
147 $this->field = $flexFormField;
151 $this->limitAccess = isset(
$GLOBALS[
'TCA'][$this->table]) ? !$showAllToUser : FALSE;
152 $GLOBALS[
'LANG']->includeLLFile(
'EXT:lang/locallang_view_help.xlf', 1);
162 if ($this->field ==
'*') {
166 } elseif ($this->tfID) {
169 $this->content .= $this->
render_Single($this->mainKey, $this->field);
176 $this->doc->backPath =
$GLOBALS[
'BACK_PATH'];
177 $this->doc->setModuleTemplate(
'EXT:cshmanual/Resources/Private/Templates/cshmanual.html');
179 $markers = array(
'CONTENT' => $this->content);
181 $this->content = $this->doc->moduleBody(array(), array(), $markers);
182 $this->content = $this->doc->render(
$GLOBALS[
'LANG']->getLL(
'title'), $this->content);
207 $CSHkeys = array_flip(array_keys(
$GLOBALS[
'TCA_DESCR']));
208 $TCAkeys = array_keys(
$GLOBALS[
'TCA']);
209 $outputSections = array();
212 $GLOBALS[
'LANG']->loadSingleTableDescription(
'xMOD_csh_corebe');
213 $this->
render_TOC_el(
'xMOD_csh_corebe',
'core', $outputSections, $tocArray, $CSHkeys);
216 $loadModules->load(
$GLOBALS[
'TBE_MODULES']);
217 foreach ($loadModules->modules as $mainMod => $info) {
218 $cshKey =
'_MOD_' . $mainMod;
219 if ($CSHkeys[$cshKey]) {
220 $GLOBALS[
'LANG']->loadSingleTableDescription($cshKey);
221 $this->
render_TOC_el($cshKey,
'modules', $outputSections, $tocArray, $CSHkeys);
223 if (is_array($info[
'sub'])) {
224 foreach ($info[
'sub'] as $subMod => $subInfo) {
225 $cshKey =
'_MOD_' . $mainMod .
'_' . $subMod;
226 if ($CSHkeys[$cshKey]) {
227 $GLOBALS[
'LANG']->loadSingleTableDescription($cshKey);
228 $this->
render_TOC_el($cshKey,
'modules', $outputSections, $tocArray, $CSHkeys);
234 foreach ($TCAkeys as
$table) {
236 $GLOBALS[
'LANG']->loadSingleTableDescription($table);
237 if (is_array(
$GLOBALS[
'TCA_DESCR'][$table][
'columns']) &&
$GLOBALS[
'BE_USER']->check(
'tables_select', $table)) {
238 $this->
render_TOC_el($table,
'tables', $outputSections, $tocArray, $CSHkeys);
242 foreach ($CSHkeys as $cshKey => $value) {
244 $GLOBALS[
'LANG']->loadSingleTableDescription($cshKey);
245 $this->
render_TOC_el($cshKey,
'extensions', $outputSections, $tocArray, $CSHkeys);
249 foreach ($CSHkeys as $cshKey => $value) {
251 $GLOBALS[
'LANG']->loadSingleTableDescription($cshKey);
252 $this->
render_TOC_el($cshKey,
'glossary', $outputSections, $tocArray, $CSHkeys);
256 foreach ($CSHkeys as $cshKey => $value) {
258 $GLOBALS[
'LANG']->loadSingleTableDescription($cshKey);
259 $this->
render_TOC_el($cshKey,
'other', $outputSections, $tocArray, $CSHkeys);
265 $output .=
'<h1>' .
$GLOBALS[
'LANG']->getLL(
'manual_title', TRUE) .
'</h1>';
266 $output .=
'<p class="lead">' .
$GLOBALS[
'LANG']->getLL(
'description', TRUE) .
'</p>';
269 if (!$this->renderALL) {
272 <p class="c-nav"><a href="' . htmlspecialchars($this->moduleUrl) .
'&renderALL=1">' .
$GLOBALS[
'LANG']->getLL(
'full_manual', TRUE) .
'</a></p>';
274 if ($this->renderALL) {
277 <h2>' .
$GLOBALS[
'LANG']->getLL(
'full_manual_chapters', TRUE) .
'</h2>' . implode(
' 280 <!-- NEW SECTION: --> 300 if ($this->renderALL) {
302 if ($outputSections[
$table]) {
303 $outputSections[
$table] =
' 305 <!-- New CSHkey/Table: ' . $table .
' --> 306 <p class="c-nav"><a name="ANCHOR_' . $table .
'" href="#">' .
$GLOBALS[
'LANG']->getLL(
'to_top', TRUE) .
'</a></p> 309 ' . $outputSections[
$table];
312 unset($outputSections[$table]);
316 $tocArray[$tocCat][
$table] =
'<p><a href="' . htmlspecialchars($this->moduleUrl) .
'&tfID=' . rawurlencode((
$table .
'.*')) .
'">' . $this->
getTableFieldLabel(
$table) .
'</a></p>';
331 $keys = explode(
',',
'core,modules,tables,extensions,glossary,other');
334 foreach ($keys as $tocKey) {
335 if (is_array($tocArray[$tocKey])) {
337 <li>' .
$GLOBALS[
'LANG']->getLL((
'TOC_' . $tocKey), TRUE) .
' 339 <li>' . implode(
'</li> 340 <li>', $tocArray[$tocKey]) .
'</li> 372 $GLOBALS[
'LANG']->loadSingleTableDescription($key);
373 if (is_array(
$GLOBALS[
'TCA_DESCR'][$key][
'columns']) && (!$this->limitAccess ||
$GLOBALS[
'BE_USER']->check(
'tables_select',
$table))) {
379 foreach (
$GLOBALS[
'TCA_DESCR'][$key][
'columns'] as
$field => $_) {
381 if (is_array($fieldValue) && (!$this->limitAccess || !$fieldValue[
'exclude'] ||
$GLOBALS[
'BE_USER']->check(
'non_exclude_fields',
$table .
':' .
$field))) {
384 $parts[0] = $this->
printItem($key,
'', 1);
387 $parts[] = $this->
printItem($key, $field, 1);
394 $output .= implode(
'<br />', $parts);
399 if (!$this->renderALL) {
400 $tocLink =
'<p class="c-nav"><a href="' . htmlspecialchars($this->moduleUrl) .
'">' .
$GLOBALS[
'LANG']->getLL(
'goToToc', TRUE) .
'</a></p>';
401 $output = $tocLink .
' 419 $GLOBALS[
'LANG']->loadSingleTableDescription($key);
425 $getLLKey = $this->limitAccess ?
'fullDescription' :
'fullDescription_module';
427 <p class="c-nav"><a href="' . htmlspecialchars($this->moduleUrl) .
'&tfID=' . rawurlencode(($key .
'.*')) .
'">' .
$GLOBALS[
'LANG']->getLL($getLLKey, TRUE) .
'</a></p> 428 <p class="c-nav"><a href="' . htmlspecialchars($this->moduleUrl) .
'">' .
$GLOBALS[
'LANG']->getLL(
'goToToc', TRUE) .
'</a></p>';
446 $items = preg_split(
'/[,' . LF .
']/', $value);
448 foreach ($items as $val) {
451 $iP = explode(
':', $val);
454 if (substr($iPUrl[1], 0, 4) ==
'http') {
455 $lines[] =
'<a href="' . htmlspecialchars($iPUrl[1]) .
'" target="_blank"><em>' . htmlspecialchars($iPUrl[0]) .
'</em></a>';
456 } elseif (substr($iPUrl[1], 0, 5) ==
'FILE:') {
458 if ($fileName && @is_file($fileName)) {
460 $lines[] =
'<a href="' . htmlspecialchars($fileName) .
'" target="_blank"><em>' . htmlspecialchars($iPUrl[0]) .
'</em></a>';
464 if (!isset(
$GLOBALS[
'TCA'][$iP[0]]) || (!$iP[1] || is_array(
$GLOBALS[
'TCA'][$iP[0]][
'columns'][$iP[1]])) && (!$this->limitAccess ||
$GLOBALS[
'BE_USER']->check(
'tables_select', $iP[0]) && (!$iP[1] || !
$GLOBALS[
'TCA'][$iP[0]][
'columns'][$iP[1]][
'exclude'] ||
$GLOBALS[
'BE_USER']->check(
'non_exclude_fields', $iP[0] .
':' . $iP[1])))) {
466 if (isset(
$GLOBALS[
'TCA_DESCR'][$iP[0]])) {
468 $href = $this->renderALL || $anchorTable && $iP[0] == $anchorTable ?
'#' . rawurlencode(implode(
'.', $iP)) : $this->moduleUrl .
'&tfID=' . rawurlencode(implode(
'.', $iP)) .
'&back=' .
$this->tfID;
470 $lines[] =
'<a href="' . htmlspecialchars($href) .
'">' . htmlspecialchars($label) .
'</a>';
476 return implode(
'<br />', $lines);
491 if (count($imgArray)) {
492 $descrArray = explode(LF, $descr, count($imgArray));
493 foreach ($imgArray as $k => $image) {
494 $descr = $descrArray[$k];
496 if ($absImagePath && @is_file($absImagePath)) {
498 $imgInfo = @getimagesize($absImagePath);
499 if (is_array($imgInfo)) {
500 $imgFile =
'../' . $imgFile;
501 $code .=
'<br /><img src="' . $imgFile .
'" ' . $imgInfo[3] .
' class="c-inlineimg" alt="" /><br /> 503 $code .=
'<p><em>' . htmlspecialchars($descr) .
'</em></p> 506 $code .=
'<div style="background-color: red; border: 1px solid black; color: white;">NOT AN IMAGE: ' . $imgFile .
'</div>';
509 $code .=
'<div style="background-color: red; border: 1px solid black; color: white;">IMAGE FILE NOT FOUND: ' . $image .
'</div>';
527 $str =
'<h2 class="t3-row-header">' . htmlspecialchars($str) .
'</h2> 531 $str =
'<h3 class="divider">' . htmlspecialchars($str) .
'</h3> 546 return '<p>' . nl2br(trim(strip_tags($str, $this->allowedHTML))) .
'</p> 564 $seeAlsoRes = $this->
make_seeAlso(
$GLOBALS[
'TCA_DESCR'][$key][
'columns'][$field][
'seeAlso'], $anchors ? $key :
'');
566 $out =
'<a name="' . $key .
'.' . $field .
'"></a>' . $this->
headerLine($this->
getTableFieldLabel($key, $field), 1) . $this->
prepareContent(
$GLOBALS[
'TCA_DESCR'][$key][
'columns'][$field][
'description']) . (
$GLOBALS[
'TCA_DESCR'][$key][
'columns'][
$field][
'details'] ? $this->
headerLine((
$GLOBALS[
'LANG']->getLL(
'details') .
':')) . $this->
prepareContent(
$GLOBALS[
'TCA_DESCR'][$key][
'columns'][$field][
'details']) :
'') . (
$GLOBALS[
'TCA_DESCR'][$key][
'columns'][$field][
'syntax'] ? $this->
headerLine((
$GLOBALS[
'LANG']->getLL(
'syntax') .
':')) . $this->
prepareContent(
$GLOBALS[
'TCA_DESCR'][$key][
'columns'][$field][
'syntax']) :
'') . (
$GLOBALS[
'TCA_DESCR'][$key][
'columns'][$field][
'image'] ? $this->
printImage(
$GLOBALS[
'TCA_DESCR'][$key][
'columns'][$field][
'image'],
$GLOBALS[
'TCA_DESCR'][$key][
'columns'][$field][
'image_descr']) :
'') . (
$GLOBALS[
'TCA_DESCR'][$key][
'columns'][$field][
'seeAlso'] && $seeAlsoRes ? $this->
headerLine((
$GLOBALS[
'LANG']->getLL(
'seeAlso') .
':')) .
'<p>' . $seeAlsoRes .
'</p>' :
'') . ($this->back ?
'<br /><p><a href="' . htmlspecialchars($this->moduleUrl .
'&tfID=' . rawurlencode($this->back)) .
'" class="typo3-goBack">' . htmlspecialchars(
$GLOBALS[
'LANG']->getLL(
'goBack')) .
'</a></p>' :
'') .
'<br />';
580 $GLOBALS[
'LANG']->loadSingleTableDescription($key);
583 if (is_array(
$GLOBALS[
'TCA_DESCR'][$key][
'columns'][
'']) && isset(
$GLOBALS[
'TCA_DESCR'][$key][
'columns'][
''][
'alttitle'])) {
585 $keyName =
$GLOBALS[
'TCA_DESCR'][$key][
'columns'][
''][
'alttitle'];
586 } elseif (isset(
$GLOBALS[
'TCA'][$key])) {
588 $keyName =
$GLOBALS[
'TCA'][$key][
'ctrl'][
'title'];
591 $keyName = preg_replace(
'/^_MOD_/',
'', $key);
595 if (is_array(
$GLOBALS[
'TCA_DESCR'][$key][
'columns'][
$field]) && isset(
$GLOBALS[
'TCA_DESCR'][$key][
'columns'][$field][
'alttitle'])) {
597 $fieldName =
$GLOBALS[
'TCA_DESCR'][$key][
'columns'][
$field][
'alttitle'];
598 } elseif (isset(
$GLOBALS[
'TCA'][$key]) && isset(
$GLOBALS[
'TCA'][$key][
'columns'][$field])) {
602 return array($keyName, $fieldName);
619 $labelString =
$GLOBALS[
'LANG']->sL($tableName) . (
$field ? $mergeToken . rtrim(trim(
$GLOBALS[
'LANG']->sL($fieldName)),
':') :
'');
636 $hash = md5(
'help_cshmanual:glossary');
639 if (is_array($cachedData)) {
640 list($this->glossaryWords, $this->substWords) = $cachedData;
643 $this->glossaryWords = array();
644 $this->substWords = array();
645 $CSHkeys = array_flip(array_keys(
$GLOBALS[
'TCA_DESCR']));
647 foreach ($CSHkeys as $cshKey => $value) {
649 $GLOBALS[
'LANG']->loadSingleTableDescription($cshKey);
650 if (is_array(
$GLOBALS[
'TCA_DESCR'][$cshKey][
'columns'])) {
652 foreach (
$GLOBALS[
'TCA_DESCR'][$cshKey][
'columns'] as
$field => $data) {
654 $this->glossaryWords[$cshKey .
'.' .
$field] = array(
655 'title' => trim($data[
'alttitle'] ?: $cshKey),
656 'description' => str_replace(
'%22',
'%23%23%23', rawurlencode($data[
'description']))
664 foreach ($this->glossaryWords as $key => $value) {
666 $word = strtolower($value[
'title']);
668 $this->substWords[$word] = $value;
669 $this->substWords[$word][
'key'] = $key;
672 krsort($this->substWords);
687 $htmlParser->pObj = $this;
688 $code = $htmlParser->HTMLcleaner($code, array(), 1);
702 if (is_array($this->substWords) && count($this->substWords) && strlen(trim($code))) {
704 foreach ($this->substWords as $wordKey => $wordSet) {
706 $parts = preg_split(
'/( |[\\(])(' . quoteMeta($wordSet[
'title']) .
')([\\.\\!\\)\\?\\:\\,]+| )/i',
' ' . $code .
' ', 2, PREG_SPLIT_DELIM_CAPTURE);
707 if (count($parts) == 5) {
708 $parts[2] =
'<a class="glossary-term" href="' . htmlspecialchars($this->moduleUrl .
'&tfID=' . rawurlencode($wordSet[
'key']) .
'&back=' . $this->tfID) .
'" title="' . rawurlencode(htmlspecialchars(
GeneralUtility::fixed_lgd_cs(rawurldecode($wordSet[
'description']), 80))) .
'">' . htmlspecialchars($parts[2]) .
'</a>';
709 $code = substr(implode(
'', $parts), 1, -1);
711 unset($this->substWords[$wordKey]);
714 $code = str_replace(
'###',
'"', rawurldecode($code));
render_Single($key, $field)
static isFirstPartOfStr($str, $partStr)
headerLine($str, $type=0)
getTableFieldNames($key, $field)
substituteGlossaryWords_htmlcleaner_callback($code)
render_TOC_makeTocList($tocArray)
substituteGlossaryWords($code)
static makeInstance($className)
static storeHash($hash, $data, $ident)
static trimExplode($delim, $string, $removeEmptyValues=FALSE, $limit=0)
render_Table($key, $table=NULL)
static getModuleUrl($moduleName, $urlParameters=array(), $backPathOverride=FALSE, $returnAbsoluteUrl=FALSE)
printImage($images, $descr)
static isModuleSetInTBE_MODULES($modName)
make_seeAlso($value, $anchorTable='')
static fixed_lgd_cs($string, $chars, $appendString='...')
static getHash($hash, $expTime=0)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
render_TOC_el($table, $tocCat, &$outputSections, &$tocArray, &$CSHkeys)
static getFileAbsFileName($filename, $onlyRelative=TRUE, $relToTYPO3_mainDir=FALSE)
static stripPathSitePrefix($path)
printItem($key, $field, $anchors=FALSE)
static TYPO3_copyRightNotice($showVersionNumber=TRUE)
getTableFieldLabel($key, $field='', $mergeToken=':')