keepItemsInArray() was not declared static
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_parsehtml_proc.php
index b2020eb..0d8d5a0 100755 (executable)
@@ -110,6 +110,7 @@ class t3lib_parsehtml_proc extends t3lib_parsehtml {
        var $elRef = '';                                // Element reference [table]:[field], eg. "tt_content:bodytext"
        var $relPath='';                                // Relative path
        var $relBackPath='';                    // Relative back-path
+       public $tsConfig = array();             // Current Page TSConfig
        var $procOptions = '';                  // Set to the TSconfig options coming from Page TSconfig
 
                // Internal, dynamic
@@ -232,14 +233,15 @@ class t3lib_parsehtml_proc extends t3lib_parsehtml {
        function RTE_transform($value,$specConf,$direction='rte',$thisConfig=array())   {
 
                        // Init:
+               $this->tsConfig = $thisConfig;
                $this->procOptions = $thisConfig['proc.'];
                $this->preserveTags = strtoupper(implode(',',t3lib_div::trimExplode(',',$this->procOptions['preserveTags'])));
-               
+
                        // dynamic configuration of blockElementList
                if ($this->procOptions['blockElementList']) {
                        $this->blockElementList = $this->procOptions['blockElementList'];
                }
-               
+
                        // Get parameters for rte_transformation:
                $p = $this->rte_p = t3lib_BEfunc::getSpecConfParametersFromArray($specConf['rte_transform']['parameters']);
 
@@ -648,7 +650,7 @@ class t3lib_parsehtml_proc extends t3lib_parsehtml {
                                }
                                if (!count($attribArray_copy))  {       // Only if href, target and class are the only attributes, we can alter the link!
                                                // Creating the TYPO3 pseudo-tag "<LINK>" for the link (includes href/url, target and class attributes):
-                                       $bTag='<link '.$info['url'].($attribArray['target']?' '.$attribArray['target']:(($attribArray['class'] || $attribArray['title'])?' -':'')).($attribArray['class']?' '.$attribArray['class']:($attribArray['title']?' -':'')).($attribArray['title']?' "'.$attribArray['title'].'"':'').'>';
+                                       $bTag='<link '.$info['url'].($info['query']?',0,'.$info['query']:'').($attribArray['target']?' '.$attribArray['target']:(($attribArray['class'] || $attribArray['title'])?' -':'')).($attribArray['class']?' '.$attribArray['class']:($attribArray['title']?' -':'')).($attribArray['title']?' "'.$attribArray['title'].'"':'').'>';
                                        $eTag='</link>';
                                        $blockSplit[$k] = $bTag.$this->TS_links_db($this->removeFirstAndLastTag($blockSplit[$k])).$eTag;
                                } else {        // ... otherwise store the link as a-tag.
@@ -730,7 +732,8 @@ class t3lib_parsehtml_proc extends t3lib_parsehtml {
                                                }
                                                $page = t3lib_BEfunc::getRecord('pages', $idPart);
                                                if (is_array($page))    {       // Page must exist...
-                                                       $href = $siteUrl.'?id='.$link_param;
+                                                       $pairParts = t3lib_div::trimExplode(',',$link_param);
+                                                       $href = $siteUrl.'?id='.$pairParts[0].($pairParts[2]?$pairParts[2]:'');
                                                } else if(strtolower(substr($link_param, 0, 7)) == 'record:') {
                                                                // linkHandler - allowing links to start with "record:"
                                                        $href = $link_param;
@@ -1146,12 +1149,12 @@ class t3lib_parsehtml_proc extends t3lib_parsehtml {
                                        if (isset($keepTags['span']))           {
                                                $classes=array_merge(array(''),$this->allowedClasses);
                                                $keepTags['span']=array(
-                                                       'allowedAttribs' => 'class,style,xml:lang',
+                                                       'allowedAttribs' => 'id,class,style,title,lang,xml:lang,dir',
                                                        'fixAttrib' => Array(
                                                                'class' => Array (
                                                                        'list' => $classes,
                                                                        'removeIfFalse' => 1
-                                                               )
+                                                               ),
                                                        ),
                                                        'rmTagIfNoAttrib' => 1
                                                );
@@ -1540,12 +1543,14 @@ class t3lib_parsehtml_proc extends t3lib_parsehtml {
                                        $info['type']='anchor';
                                } elseif (!trim($uP['path']) || !strcmp($uP['path'],'index.php'))       {
                                        $pp = explode('id=',$uP['query']);
-                                       $id = trim($pp[1]);
+                                       $parameters = explode('&', $pp[1]);
+                                       $id = array_shift($parameters);
                                        if ($id)        {
                                                $info['pageid']=$id;
                                                $info['cElement']=$uP['fragment'];
                                                $info['url']=$id.($info['cElement']?'#'.$info['cElement']:'');
                                                $info['type']='page';
+                                               $info['query'] = $parameters[0]?'&'.implode('&', $parameters):'';
                                        }
                                } else {
                                        $info['url']=$info['relUrl'];
@@ -1597,4 +1602,5 @@ class t3lib_parsehtml_proc extends t3lib_parsehtml {
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_parsehtml_proc.php'])   {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_parsehtml_proc.php']);
 }
-?>
+
+?>
\ No newline at end of file