* Added some file icons from Ben and Emile
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_syntaxhl.php
index d5b0176..1955605 100644 (file)
  *
  *
  *
- *   76: class t3lib_syntaxhl 
- *  109:     function highLight_DS($str)       
- *  133:     function getAllTags($str) 
- *  164:     function splitXMLbyTags($tagList,$str)    
- *  192:     function markUpRecursively($struct,$parent='',$app='')    
+ *   84: class t3lib_syntaxhl 
  *
- * TOTAL FUNCTIONS: 4
+ *              SECTION: Markup of Data Structure, <T3DataStructure>
+ *  152:     function highLight_DS($str)       
+ *  179:     function highLight_DS_markUpRecursively($struct,$parent='',$app='')       
+ *
+ *              SECTION: Markup of Data Structure, <T3FlexForms>
+ *  264:     function highLight_FF($str)       
+ *  291:     function highLight_FF_markUpRecursively($struct,$parent='',$app='')       
+ *
+ *              SECTION: Various
+ *  362:     function getAllTags($str) 
+ *  393:     function splitXMLbyTags($tagList,$str)    
+ *
+ * TOTAL FUNCTIONS: 6
  * (This index is automatically created/updated by the extension "extdeveval")
  *
  */
@@ -68,7 +76,7 @@ require_once(PATH_t3lib.'class.t3lib_parsehtml.php');
 
 /**
  * Syntax Highlighting class.
- * 
+ *
  * @author     Kasper Skaarhoj <kasper@typo3.com>
  * @package TYPO3
  * @subpackage t3lib
@@ -104,8 +112,10 @@ class t3lib_syntaxhl {
                'T3FlexForms' => array('<span style="font-weight: bold;">','</span>'),
                'meta' => array('<span style="font-weight: bold; color: #800080;">','</span>'),
                'data' => array('<span style="font-weight: bold; color: #800080;">','</span>'),
+               'el' => array('<span style="font-weight: bold; color: #80a000;">','</span>'),
+               'numIndex' => array('<span style="color: #333333;">','</span>'),
                '_unknown' => array('<span style="font-style: italic; color: #666666;">','</span>'),
-               
+
 
                'sDEF'  => array('<span style="font-weight: bold; color: #008000;">','</span>'),
                'level:sheet' => array('<span style="font-weight: bold; color: #008000;">','</span>'),
@@ -115,8 +125,8 @@ class t3lib_syntaxhl {
 
                'level:fieldname' => array('<span style="font-weight: bold; color: #666666;">','</span>'),
 
-               'vDEF'  => array('<span style="font-weight: bold; color: #800000;">','</span>'),
-               'level:value' => array('<span style="font-weight: bold; color: #800000;">','</span>'),
+               'vDEF'  => array('<span style="font-weight: bold; color: #008080;">','</span>'),
+               'level:value' => array('<span style="font-weight: bold; color: #008080;">','</span>'),
 
                'currentSheetId' => array('<span style="color: #000080;">','</span>'),
                'currentLangId' => array('<span style="color: #000080;">','</span>'),
@@ -137,7 +147,7 @@ class t3lib_syntaxhl {
 
        /**
         * Makes syntax highlighting of a Data Structure, <T3DataStructure>
-        * 
+        *
         * @param       string          Data Structure XML, must be valid since it's parsed.
         * @return      string          HTML code with highlighted content. Must be wrapped in <PRE> tags
         */
@@ -162,7 +172,7 @@ class t3lib_syntaxhl {
        /**
         * Making syntax highlighting of the parsed Data Structure XML.
         * Called recursively.
-        * 
+        *
         * @param       array           The structure, see splitXMLbyTags()
         * @param       string          Parent tag.
         * @param       string          "Application" - used to denote if we are 'inside' a section
@@ -249,7 +259,7 @@ class t3lib_syntaxhl {
 
        /**
         * Makes syntax highlighting of a FlexForm Data, <T3FlexForms>
-        * 
+        *
         * @param       string          Data Structure XML, must be valid since it's parsed.
         * @return      string          HTML code with highlighted content. Must be wrapped in <PRE> tags
         */
@@ -274,7 +284,7 @@ class t3lib_syntaxhl {
        /**
         * Making syntax highlighting of the parsed FlexForm XML.
         * Called recursively.
-        * 
+        *
         * @param       array           The structure, see splitXMLbyTags()
         * @param       string          Parent tag.
         * @param       string          "Application" - used to denote if we are 'inside' a section
@@ -292,16 +302,22 @@ class t3lib_syntaxhl {
                        $app='fieldname';
                } elseif($app=='fieldname')     {
                        $app='value';
+               } elseif($app=='el' || $app=='numIndex')        {
+                       $app='fieldname';
                }
-               
-                       // Traverse structure:          
+
+                       // Traverse structure:
                foreach($struct as $k => $v)    {
                        if ($k%2)       {
                                $wrap = array('','');
 
-                                       // Default wrap:                                
+                               if ($v['tagName'] == 'numIndex')        {
+                                       $app = 'numIndex';
+                               }
+
+                                       // Default wrap:
                                $wrap = $this->FF_wrapTags[$v['tagName']];
-                               
+
                                        // If no wrap defined, us "unknown" definition
                                if (!is_array($wrap))   {
                                        switch($app)    {
@@ -317,6 +333,10 @@ class t3lib_syntaxhl {
                                        }
                                }
 
+                               if ($v['tagName']=='el')        {
+                                       $app='el';
+                               }
+
                                $output.=$wrap[0].htmlspecialchars($v['tag']).$wrap[1];
                                $output.=$this->highLight_FF_markUpRecursively($v['sub'],$v['tagName'],$app);
                                $output.=$wrap[0].htmlspecialchars('</'.$v['tagName'].'>').$wrap[1];
@@ -347,7 +367,7 @@ class t3lib_syntaxhl {
        
        /**
         * Returning all tag names found in XML/HTML input string
-        * 
+        *
         * @param       string          HTML/XML input
         * @return      array           Array with all found tags (starttags only)
         */
@@ -377,7 +397,7 @@ class t3lib_syntaxhl {
        /**
         * Splitting the input source by the tags listing in $tagList.
         * Called recursively.
-        * 
+        *
         * @param       string          Commalist of tags to split source by (into blocks, ALL being block-tags!)
         * @param       string          Input string.
         * @return      array           Array with the content arranged hierarchically.
@@ -406,4 +426,4 @@ class t3lib_syntaxhl {
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_syntaxhl.php']) {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_syntaxhl.php']);
 }
-?>
\ No newline at end of file
+?>