Fixed bug #14771: Updates for taskcenter, sys_action, impexp (Thanks to Georg Ringer)
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_tsstyleconfig.php
old mode 100755 (executable)
new mode 100644 (file)
index 866f177..e812d74
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2006 Kasper Skaarhoj (kasperYYYY@typo3.com)
+*  (c) 1999-2010 Kasper Skaarhoj (kasperYYYY@typo3.com)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -57,7 +57,6 @@
  *
  */
 
-require_once(PATH_t3lib.'class.t3lib_tsparser_ext.php');
 
 
 
@@ -124,8 +123,7 @@ class t3lib_tsStyleConfig extends t3lib_tsparser_ext        {
                $this->flatSetup = $temp;
 
 
-               reset($theConstants);
-               while(list($k,$p)=each($theConstants))  {
+               foreach ($theConstants as $k => $p) {
                        if (isset($this->objReg[$k]))   {
                                $theConstants[$k]["value"] = $this->ext_realValues[$k];
                        }
@@ -170,21 +168,18 @@ class t3lib_tsStyleConfig extends t3lib_tsparser_ext      {
                $printFields = trim($this->ext_printFields($theConstants,$cat));
 
                $content='';
-               $content.='
-               <script language="javascript" type="text/javascript">
-                       function uFormUrl(aname)        {
-                               document.'.$this->ext_CEformName.'.action = "'.t3lib_div::linkThisScript().'#"+aname;
+               $content .= t3lib_div::wrapJS('
+                       function uFormUrl(aname) {
+                               document.' . $this->ext_CEformName . '.action = "' . t3lib_div::linkThisScript() . '#"+aname;
                        }
-               </script>
-               ';
-               $content.= '<form action="'.($script?$script:t3lib_div::linkThisScript()).'" name="'.$this->ext_CEformName.'" method="POST" enctype="'.$GLOBALS["TYPO3_CONF_VARS"]["SYS"]["form_enctype"].'">';
+               ');
+               $content .= '<form action="' . htmlspecialchars($script ? $script : t3lib_div::linkThisScript()) . '" name="' . $this->ext_CEformName . '" method="post" enctype="' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'] . '">';
                $content.= $addFields;
-#              $content.= '<input type="Submit" name="submit" value="Update"><BR>';
                $content.= $printFields;
-               $content.= '<input type="Submit" name="submit" value="Update">';
+               $content.= '<input type="Submit" name="submit" value="Update" />';
 
                $example = $this->ext_displayExample();
-               $content.= $example?'<HR>'.$example:"";
+               $content.= $example?'<hr/>'.$example:"";
 
                return $content;
        }
@@ -212,7 +207,7 @@ class t3lib_tsStyleConfig extends t3lib_tsparser_ext        {
         */
        function ext_mergeIncomingWithExisting($arr)    {
                $parseObj = t3lib_div::makeInstance("t3lib_TSparser");
-               $parseObj->parse(implode(chr(10),$this->ext_incomingValues));
+               $parseObj->parse(implode(LF,$this->ext_incomingValues));
                $arr2 = $parseObj->setup;
                return t3lib_div::array_merge_recursive_overrule($arr,$arr2);
        }
@@ -249,7 +244,7 @@ class t3lib_tsStyleConfig extends t3lib_tsparser_ext        {
                        $fV="";
                }
                $fV=htmlspecialchars($fV);
-#debug(array($params,$fN,$fV,isset($this->ext_realValues[$params["name"]])));
+
                return array($fN,$fV,$params);
        }
 
@@ -262,7 +257,7 @@ class t3lib_tsStyleConfig extends t3lib_tsparser_ext        {
        function ext_loadResources($absPath)    {
                $this->ext_readDirResources($GLOBALS["TYPO3_CONF_VARS"]["MODS"]["web_ts"]["onlineResourceDir"]);
                if (is_dir($absPath))   {
-                       $absPath = ereg_replace("\/$","",$absPath);
+                       $absPath = rtrim($absPath, '/');
                        $this->readDirectory($absPath);
                }
                $this->ext_resourceDims();