Only changes to function indexes, comments and stripping of trailing whitespace in...
[Packages/TYPO3.CMS.git] / typo3 / view_help.php
index 90d8f35..769763d 100755 (executable)
@@ -1,22 +1,22 @@
 <?php
 /***************************************************************
 *  Copyright notice
-*  
+*
 *  (c) 1999-2004 Kasper Skaarhoj (kasper@typo3.com)
 *  All rights reserved
 *
-*  This script is part of the TYPO3 project. The TYPO3 project is 
+*  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 
+*  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
@@ -24,7 +24,7 @@
 *
 *  This copyright notice MUST APPEAR in all copies of the script!
 ***************************************************************/
-/** 
+/**
  * Document for viewing the online help texts, also known as TCA_DESCR.
  * See Inside TYPO3 for details.
  *
  *
  *
  *
- *   78: class SC_view_help 
- *   97:     function init()   
- *  119:     function main()   
- *  173:     function printContent()   
- *  184:     function make_seeAlso($value,$anchorTable='')     
- *  222:     function printImage($image,$descr)        
- *  244:     function headerLine($str,$type=0) 
- *  265:     function prepareContent($str)     
- *  280:     function printItem($table,$field,$anchors=0)      
- *  316:     function getTableFieldNames($table,$field)        
+ *   78: class SC_view_help
+ *   97:     function init()
+ *  119:     function main()
+ *  173:     function printContent()
+ *  184:     function make_seeAlso($value,$anchorTable='')
+ *  222:     function printImage($image,$descr)
+ *  244:     function headerLine($str,$type=0)
+ *  265:     function prepareContent($str)
+ *  280:     function printItem($table,$field,$anchors=0)
+ *  316:     function getTableFieldNames($table,$field)
  *
  * TOTAL FUNCTIONS: 9
  * (This index is automatically created/updated by the extension "extdeveval")
@@ -70,7 +70,7 @@ include ('sysext/lang/locallang_view_help.php');
 
 /**
  * Script Class for rendering the Context Sensitive Help documents, either the single display in the small pop-up window or the full-table view in the larger window.
- * 
+ *
  * @author     Kasper Skaarhoj <kasper@typo3.com>
  * @package TYPO3
  * @subpackage core
@@ -84,19 +84,19 @@ class SC_view_help {
        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
-       
+
                // Internal, static: GPvar:
        var $tfID;                      // Table/FIeld id.
        var $back;                      // Back (previous tfID)
-       
+
        /**
         * Initialize the class for various input etc.
-        * 
-        * @return      void            
+        *
+        * @return      void
         */
        function init() {
                global $LANG;
-               
+
                        // Setting GPvars:
                $this->tfID = t3lib_div::_GP('tfID');
                $this->back = t3lib_div::_GP('back');
@@ -106,25 +106,25 @@ class SC_view_help {
 
                        // Load descriptions for table $this->table
                $LANG->loadSingleTableDescription($this->table);
-               
+
                        // limitAccess is checked if the $this->table really IS a table.
                $this->limitAccess = !isset($TCA[$this->table]) ? 0 : 1;
        }
-       
+
        /**
         * Main function, rendering the display
-        * 
-        * @return      void            
+        *
+        * @return      void
         */
        function main() {
                global $BE_USER,$LANG,$TCA_DESCR,$TCA,$TBE_TEMPLATE;
-               
+
                        // Start HTML output accumulation:
                $TBE_TEMPLATE->docType='xhtml_trans';
                $TBE_TEMPLATE->divClass='typo3-view-help';
                $this->content.=$TBE_TEMPLATE->startPage($LANG->getLL('title'));
 
-                       // If ALL fields is supposed to be shown:               
+                       // If ALL fields is supposed to be shown:
                if ($this->field=='*')  {
                                // Load table TCA
                        t3lib_div::loadTCA($this->table);
@@ -145,11 +145,11 @@ class SC_view_help {
                                                }
                                        }
                                }
-                               
+
                                if (!strcmp($parts,"")) unset($parts[0]);
                                $this->content.= implode('<br />',$parts);
                        }
-               } else {        
+               } else {
                                // ... otherwise show only single field:
                        $this->content.=$this->printItem($this->table,$this->field);
 
@@ -164,19 +164,19 @@ class SC_view_help {
                        // End page:
                $this->content.=$TBE_TEMPLATE->endPage();
        }
-       
+
        /**
         * Outputting the accumulated content to screen
-        * 
-        * @return      void            
+        *
+        * @return      void
         */
        function printContent() {
                echo $this->content;
        }
-       
+
        /**
         * Make seeAlso links from $value
-        * 
+        *
         * @param       string          See-also input codes
         * @param       string          If $anchorTable is set to a tablename, then references to this table will be made as anchors, not URLs.
         * @return      string          See-also links HTML
@@ -196,7 +196,7 @@ class SC_view_help {
                                if (substr($iPUrl[1],0,4)=='http')      {
                                        $lines[]='<a href="'.htmlspecialchars($iPUrl[1]).'" target="_blank"><em>'.htmlspecialchars($iPUrl[0]).'</em></a>';
                                } else {
-                                       // "table" reference    
+                                       // "table" reference
                                        t3lib_div::loadTCA($iP[0]);
                                        if (!isset($TCA[$iP[0]]) || (is_array($TCA[$iP[0]]['columns'][$iP[1]]) && (!$this->limitAccess || ($BE_USER->check('tables_select',$iP[0]) && (!$TCA[$iP[0]]['columns'][$iP[1]]['exclude'] || $BE_USER->check('non_exclude_fields',$iP[0].':'.$iP[1]))))))      {       // Checking read access:
                                                list($tableName,$fieldName) = $this->getTableFieldNames($iP[0],$iP[1]);
@@ -211,10 +211,10 @@ class SC_view_help {
                }
                return implode('<br />',$lines);
        }
-       
+
        /**
         * Will return an image tag with description in italics.
-        * 
+        *
         * @param       string          Image file reference
         * @param       string          Description string
         * @return      string          Image HTML codes
@@ -236,7 +236,7 @@ class SC_view_help {
 
        /**
         * Returns header HTML content
-        * 
+        *
         * @param       string          Header text
         * @param       string          Header type (1, 0)
         * @return      string          The HTML for the header.
@@ -252,13 +252,13 @@ class SC_view_help {
                                ';
                        break;
                }
-               
+
                return $str;
        }
-       
+
        /**
         * Returns prepared content
-        * 
+        *
         * @param       string          Content to format.
         * @return      string          Formatted content.
         */
@@ -267,11 +267,11 @@ class SC_view_help {
                return '<p>'.nl2br(trim(strip_tags($str,$this->allowedHTML))).'</p>
                ';
        }
-       
+
        /**
         * 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.
@@ -286,7 +286,7 @@ class SC_view_help {
                if ($table && (!$field || is_array($TCA_DESCR[$table]['columns'][$field])))     {
                                // Make seeAlso references.
                        $seeAlsoRes = $this->make_seeAlso($TCA_DESCR[$table]['columns'][$field]['seeAlso'],$anchors?$table:'');
-                       
+
                                // Get Human Readable table and field labels
                        list($tableName,$fieldName) = $this->getTableFieldNames($table,$field);
 
@@ -304,22 +304,22 @@ class SC_view_help {
                }
                return $out;
        }
-       
+
        /**
         * Returns labels for $table and $field.
         * If $table is "_MOD_" prefixed, the part after "_MOD_" is returned (non-tables, fx. modules)
-        * 
+        *
         * @param       string          Table name
         * @param       string          Field name
         * @return      array           Table and field labels in a numeric array
         */
        function getTableFieldNames($table,$field)      {
                global $TCA, $TCA_DESCR;
-                       $tableName = is_array($TCA_DESCR[$table]['columns']['']) && $TCA_DESCR[$table]['columns']['']['alttitle'] ? 
-                                                       $TCA_DESCR[$table]['columns']['']['alttitle'] : 
+                       $tableName = is_array($TCA_DESCR[$table]['columns']['']) && $TCA_DESCR[$table]['columns']['']['alttitle'] ?
+                                                       $TCA_DESCR[$table]['columns']['']['alttitle'] :
                                                        (isset($TCA[$table]) ? $TCA[$table]['ctrl']['title'] : ereg_replace('^_MOD_','',$table));
-                       $fieldName = is_array($TCA_DESCR[$table]['columns'][$field]) && $TCA_DESCR[$table]['columns'][$field]['alttitle'] ? 
-                                                       $TCA_DESCR[$table]['columns'][$field]['alttitle'] : 
+                       $fieldName = is_array($TCA_DESCR[$table]['columns'][$field]) && $TCA_DESCR[$table]['columns'][$field]['alttitle'] ?
+                                                       $TCA_DESCR[$table]['columns'][$field]['alttitle'] :
                                                        (isset($TCA[$table])&&isset($TCA[$table]['columns'][$field]) ? $TCA[$table]['columns'][$field]['label'] : $field);
                return array($tableName,$fieldName);
        }