[BUGFIX] Reduce spacing CGL violations in /t3lib/
authorRoland Waldner <most.wanted@gmx.at>
Sat, 19 May 2012 21:13:29 +0000 (23:13 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 19 May 2012 21:24:55 +0000 (23:24 +0200)
There were a lot spacing CGL violations in /t3lib/.
These will be reduced by this commit.

Change-Id: I66981be01ecb4f289de2ccbc0363d2f02bd98f6a
Resolves: #37309
Releases: 6.0
Reviewed-on: http://review.typo3.org/11310
Reviewed-by: Philipp Gampe
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
12 files changed:
t3lib/class.t3lib_ajax.php
t3lib/class.t3lib_div.php
t3lib/class.t3lib_extobjbase.php
t3lib/class.t3lib_positionmap.php
t3lib/class.t3lib_scbase.php
t3lib/class.t3lib_tceforms.php
t3lib/class.t3lib_tcemain.php
t3lib/class.t3lib_userauth.php
t3lib/config_default.php
t3lib/jsfunc.evalfield.js
t3lib/jsfunc.updateform.js
t3lib/jsfunc.validateform.js

index 140da1b..f30f3ef 100644 (file)
@@ -64,14 +64,14 @@ class t3lib_ajax {
                        var A;
                        try     {
                                A=new ActiveXObject("Msxml2.XMLHTTP");
-                       } catch (e)     {
+                       } catch (e) {
                                try     {
                                        A=new ActiveXObject("Microsoft.XMLHTTP");
-                               } catch (oc)    {
+                               } catch (oc) {
                                        A=null;
                                }
                        }
-                       if(!A && typeof XMLHttpRequest != "undefined")  {
+                       if(!A && typeof XMLHttpRequest != "undefined") {
                                A = new XMLHttpRequest();
                        }
                        return A;
@@ -83,17 +83,17 @@ class t3lib_ajax {
                        $fallback = 'return';
                }
                $code .= '
-               function ajax_doRequest(url)    {
+               function ajax_doRequest(url) {
                        var x;
 
                        x = ajax_initObject();
-                       if(!x)  {
+                       if(!x) {
                                ' . $fallback . ';
                        }
                        x.open("GET", url, true);
 
-                       x.onreadystatechange = function()       {
-                               if (x.readyState != 4)  {
+                       x.onreadystatechange = function() {
+                               if (x.readyState != 4) {
                                        return;
                                }
                                ' . ($debug ? 'alert(x.responseText)' : '') . '
index 569c700..9c85983 100644 (file)
@@ -3436,7 +3436,7 @@ final class t3lib_div {
                                        // $_SERVER['PATH_INFO']!=$_SERVER['SCRIPT_NAME'] is necessary because some servers (Windows/CGI) are seen to set PATH_INFO equal to script_name
                                        // Further, there must be at least one '/' in the path - else the PATH_INFO value does not make sense.
                                        // IF 'PATH_INFO' never works for our purpose in TYPO3 with CGI-servers, then 'PHP_SAPI=='cgi'' might be a better check. Right now strcmp($_SERVER['PATH_INFO'],t3lib_div::getIndpEnv('SCRIPT_NAME')) will always return FALSE for CGI-versions, but that is only as long as SCRIPT_NAME is set equal to PATH_INFO because of PHP_SAPI=='cgi' (see above)
-                                       //                              if (strcmp($_SERVER['PATH_INFO'],self::getIndpEnv('SCRIPT_NAME')) && count(explode('/',$_SERVER['PATH_INFO']))>1)       {
+                                       //                              if (strcmp($_SERVER['PATH_INFO'],self::getIndpEnv('SCRIPT_NAME')) && count(explode('/',$_SERVER['PATH_INFO']))>1) {
                                if (PHP_SAPI != 'cgi' && PHP_SAPI != 'cgi-fcgi' && PHP_SAPI != 'fpm-fcgi') {
                                        $retVal = $_SERVER['PATH_INFO'];
                                }
index 91af902..046e91c 100644 (file)
@@ -85,7 +85,7 @@
  *      class tx_funcwizards_webfunc extends t3lib_extobjbase {
  *              var $localLangFile = "locallang.php";
  *              var $function_key = "wiz";
- *              function init(&$pObj,$conf)    {
+ *              function init(&$pObj,$conf) {
  *                              // OK, handles ordinary init. This includes setting up the menu array with ->modMenu
  *                      parent::init($pObj,$conf);
  *                              // Making sure that any further external classes are added to the include_once array. Notice that inclusion happens twice in the main script because of this!!!
index 07ab3b1..5514319 100644 (file)
@@ -223,7 +223,7 @@ class t3lib_positionMap {
 
                        function changeImg(name,d)      {       //
                                if (document[name]) {
-                                       if (d)  {
+                                       if (d) {
                                                document[name].src = img_newrecord_marker_d.src;
                                        } else {
                                                document[name].src = img_newrecord_marker.src;
index 480bacd..5fe4e9c 100644 (file)
@@ -59,7 +59,7 @@
  *                              $this->content='';
  *                      }
  *                              // PRINT CONTENT - DONE AS THE LAST THING
- *                      function printContent()        {
+ *                      function printContent() {
  *                              echo $this->content;
  *                      }
  *              }
index bc3e9c9..019163e 100644 (file)
@@ -2478,7 +2478,7 @@ class t3lib_TCEforms {
 
                                // Create sheet menu:
                                //TODO; Why is this commented out?
-                       //                      if (is_array($dataStructArray['sheets']))       {
+                       //                      if (is_array($dataStructArray['sheets'])) {
                        //                              #$item.=$this->getSingleField_typeFlex_sheetMenu($dataStructArray['sheets'], $PA['itemFormElName'].'[meta][currentSheetId]', $sheet).'<br />';
                        //                      }
 
@@ -2517,7 +2517,7 @@ class t3lib_TCEforms {
                        $editData['meta']['currentLangId'] = array_unique($editData['meta']['currentLangId']);
 
                                //TODO: Why is this commented out?
-                       //                      if (!$langDisabled && count($languages) > 1)    {
+                       //                      if (!$langDisabled && count($languages) > 1) {
                        //                              $item.=$this->getSingleField_typeFlex_langMenu($languages, $PA['itemFormElName'].'[meta][currentLangId]', $editData['meta']['currentLangId']).'<br />';
                        //                      }
 
@@ -5538,7 +5538,7 @@ class t3lib_TCEforms {
                                for (var i = 0, length = children.length; i < length; i++) {
                                        if (children[i].type=="text" && children[i].value)      previewContent+= (previewContent?" / ":"")+children[i].value;
                                }
-                               if (previewContent.length>80)   {
+                               if (previewContent.length>80) {
                                        previewContent = previewContent.substring(0,67)+"...";
                                }
                                $(id+"-preview").update(previewContent);
@@ -5549,15 +5549,15 @@ class t3lib_TCEforms {
                                var isClosed=0;
                                        // Traverse and find how many are open or closed:
                                for (var i = 0, length = descendants.length; i < length; i++) {
-                                       if (descendants[i].id)  {
+                                       if (descendants[i].id) {
                                                if (Element.visible(descendants[i].id+"-content"))      {isOpen++;} else {isClosed++;}
                                        }
                                }
 
                                        // Traverse and toggle
                                for (var i = 0, length = descendants.length; i < length; i++) {
-                                       if (descendants[i].id)  {
-                                               if (isOpen!=0 && isClosed!=0)   {
+                                       if (descendants[i].id) {
+                                               if (isOpen!=0 && isClosed!=0) {
                                                        if (Element.visible(descendants[i].id+"-content"))      {flexFormToggle(descendants[i].id);}
                                                } else {
                                                        flexFormToggle(descendants[i].id);
@@ -5576,7 +5576,7 @@ class t3lib_TCEforms {
 
                                        // Traverse and find how many are open or closed:
                                for (var i = 0, length = descendants.length; i < length; i++) {
-                                       if (descendants[i].id)  {
+                                       if (descendants[i].id) {
                                                $(descendants[i].id+"-action").value = descendants[i].visible() ? i : "DELETE";
                                        }
                                }
@@ -5709,13 +5709,13 @@ class t3lib_TCEforms {
                                                        // Clear elements if exclusive values are found
                                                if (exclusiveValues) {
                                                        var m = new RegExp("(^|,)" + value + "($|,)");
-                                                       if (exclusiveValues.match(m))   {
+                                                       if (exclusiveValues.match(m)) {
                                                                        // the new value is exclusive
                                                                for (a = len - 1; a >= 0; a--) {
                                                                        fObj[a] = null; // This is dangerous because it works on the object\'s numeric properties directly instead of using a custom attribute!
                                                                }
                                                                len = 0;
-                                                       } else if (len == 1)    {
+                                                       } else if (len == 1) {
                                                                m = new RegExp("(^|,)" + fObj.options[0].value + "($|,)");
                                                                if (exclusiveValues.match(m)) {
                                                                                // the old value is exclusive
@@ -5760,13 +5760,13 @@ class t3lib_TCEforms {
                        function setHiddenFromList(fObjSel,fObjHid)     {       //
                                l=fObjSel.length;
                                fObjHid.value="";
-                               for (a=0;a<l;a++)       {
+                               for (a=0;a<l;a++) {
                                        fObjHid.value+=fObjSel.options[a].value+",";
                                }
                        }
                        function setFormValueManipulate(fName, type, maxLength) {
                                var formObj = setFormValue_getFObj(fName);
-                               if (formObj)    {
+                               if (formObj) {
                                        var localArray_V = new Array();
                                        var localArray_L = new Array();
                                        var localArray_S = new Array();
@@ -5791,10 +5791,10 @@ class t3lib_TCEforms {
                                                }
                                        }
 
-                                       if ((type=="Remove" && fObjSel.size > 1) || type=="Top" || type=="Bottom")      {
-                                               if (type=="Top")        {
-                                                       for (a=0;a<l;a++)       {
-                                                               if (fObjSel.options[a].selected==1)     {
+                                       if ((type=="Remove" && fObjSel.size > 1) || type=="Top" || type=="Bottom") {
+                                               if (type=="Top") {
+                                                       for (a=0;a<l;a++) {
+                                                               if (fObjSel.options[a].selected==1) {
                                                                        localArray_V[c]=fObjSel.options[a].value;
                                                                        localArray_L[c]=fObjSel.options[a].text;
                                                                        localArray_S[c]=1;
@@ -5803,8 +5803,8 @@ class t3lib_TCEforms {
                                                                }
                                                        }
                                                }
-                                               for (a=0;a<l;a++)       {
-                                                       if (fObjSel.options[a].selected!=1)     {
+                                               for (a=0;a<l;a++) {
+                                                       if (fObjSel.options[a].selected!=1) {
                                                                localArray_V[c]=fObjSel.options[a].value;
                                                                localArray_L[c]=fObjSel.options[a].text;
                                                                localArray_S[c]=0;
@@ -5812,9 +5812,9 @@ class t3lib_TCEforms {
                                                                c++;
                                                        }
                                                }
-                                               if (type=="Bottom")     {
-                                                       for (a=0;a<l;a++)       {
-                                                               if (fObjSel.options[a].selected==1)     {
+                                               if (type=="Bottom") {
+                                                       for (a=0;a<l;a++) {
+                                                               if (fObjSel.options[a].selected==1) {
                                                                        localArray_V[c]=fObjSel.options[a].value;
                                                                        localArray_L[c]=fObjSel.options[a].text;
                                                                        localArray_S[c]=1;
@@ -5824,12 +5824,12 @@ class t3lib_TCEforms {
                                                        }
                                                }
                                        }
-                                       if (type=="Down")       {
+                                       if (type=="Down") {
                                                var tC = 0;
                                                var tA = new Array();
 
-                                               for (a=0;a<l;a++)       {
-                                                       if (fObjSel.options[a].selected!=1)     {
+                                               for (a=0;a<l;a++) {
+                                                       if (fObjSel.options[a].selected!=1) {
                                                                        // Add non-selected element:
                                                                localArray_V[c]=fObjSel.options[a].value;
                                                                localArray_L[c]=fObjSel.options[a].text;
@@ -5838,8 +5838,8 @@ class t3lib_TCEforms {
                                                                c++;
 
                                                                        // Transfer any accumulated and reset:
-                                                               if (tA.length > 0)      {
-                                                                       for (aa=0;aa<tA.length;aa++)    {
+                                                               if (tA.length > 0) {
+                                                                       for (aa=0;aa<tA.length;aa++) {
                                                                                localArray_V[c]=fObjSel.options[tA[aa]].value;
                                                                                localArray_L[c]=fObjSel.options[tA[aa]].text;
                                                                                localArray_S[c]=1;
@@ -5856,8 +5856,8 @@ class t3lib_TCEforms {
                                                        }
                                                }
                                                        // Transfer any remaining:
-                                               if (tA.length > 0)      {
-                                                       for (aa=0;aa<tA.length;aa++)    {
+                                               if (tA.length > 0) {
+                                                       for (aa=0;aa<tA.length;aa++) {
                                                                localArray_V[c]=fObjSel.options[tA[aa]].value;
                                                                localArray_L[c]=fObjSel.options[tA[aa]].text;
                                                                localArray_S[c]=1;
@@ -5866,13 +5866,13 @@ class t3lib_TCEforms {
                                                        }
                                                }
                                        }
-                                       if (type=="Up") {
+                                       if (type=="Up") {
                                                var tC = 0;
                                                var tA = new Array();
                                                var c = l-1;
 
-                                               for (a=l-1;a>=0;a--)    {
-                                                       if (fObjSel.options[a].selected!=1)     {
+                                               for (a=l-1;a>=0;a--) {
+                                                       if (fObjSel.options[a].selected!=1) {
 
                                                                        // Add non-selected element:
                                                                localArray_V[c]=fObjSel.options[a].value;
@@ -5882,8 +5882,8 @@ class t3lib_TCEforms {
                                                                c--;
 
                                                                        // Transfer any accumulated and reset:
-                                                               if (tA.length > 0)      {
-                                                                       for (aa=0;aa<tA.length;aa++)    {
+                                                               if (tA.length > 0) {
+                                                                       for (aa=0;aa<tA.length;aa++) {
                                                                                localArray_V[c]=fObjSel.options[tA[aa]].value;
                                                                                localArray_L[c]=fObjSel.options[tA[aa]].text;
                                                                                localArray_S[c]=1;
@@ -5900,8 +5900,8 @@ class t3lib_TCEforms {
                                                        }
                                                }
                                                        // Transfer any remaining:
-                                               if (tA.length > 0)      {
-                                                       for (aa=0;aa<tA.length;aa++)    {
+                                               if (tA.length > 0) {
+                                                       for (aa=0;aa<tA.length;aa++) {
                                                                localArray_V[c]=fObjSel.options[tA[aa]].value;
                                                                localArray_L[c]=fObjSel.options[tA[aa]].text;
                                                                localArray_S[c]=1;
@@ -5914,7 +5914,7 @@ class t3lib_TCEforms {
 
                                                // Transfer items in temporary storage to list object:
                                        fObjSel.length = c;
-                                       for (a=0;a<c;a++)       {
+                                       for (a=0;a<c;a++) {
                                                fObjSel.options[a].value = localArray_V[a];
                                                fObjSel.options[a].text = localArray_L[a];
                                                fObjSel.options[a].selected = localArray_S[a];
index efc0020..cf1119e 100644 (file)
@@ -750,8 +750,8 @@ class t3lib_TCEmain {
                                                                                                                         *               but you can easily translate it to the real uid of the inserted record using the $this->substNEWwithIDs array.
                                                                                                                         */
                                                        $this->hook_processDatamap_afterDatabaseOperations($hookObjectsArr, $status, $table, $id, $fieldArray);
-                                               } // if ($recordAccess) {
-                                       } // if (is_array($incomingFieldArray)) {
+                                               } // if ($recordAccess) {
+                                       } // if (is_array($incomingFieldArray)) {
                                }
                        }
                }
index 344df69..fdafb89 100644 (file)
@@ -1212,7 +1212,7 @@ abstract class t3lib_userAuth {
                                $isLoginDataProcessed = TRUE;
 
                                        // if the service returns >=200 then no more processing is needed
-                               if (intval($serviceResult) >= 200)      {
+                               if (intval($serviceResult) >= 200) {
                                        unset($serviceObject);
                                        break;
                                }
index c39fd99..f8a200e 100644 (file)
@@ -918,48 +918,48 @@ unset($typo_db_tables_script);
 unset($typo_db_extTableDef_script);
 
        // Based on the configuration of the image processing some options may be forced:
-if (!$GLOBALS['TYPO3_CONF_VARS']['GFX']['image_processing'])   {
+if (!$GLOBALS['TYPO3_CONF_VARS']['GFX']['image_processing']) {
        $GLOBALS['TYPO3_CONF_VARS']['GFX']['im']=0;
        $GLOBALS['TYPO3_CONF_VARS']['GFX']['gdlib']=0;
 }
-if (!$GLOBALS['TYPO3_CONF_VARS']['GFX']['im']) {
+if (!$GLOBALS['TYPO3_CONF_VARS']['GFX']['im']) {
        $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path']='';
        $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path_lzw']='';
        $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']='gif,jpg,jpeg,png';
        $GLOBALS['TYPO3_CONF_VARS']['GFX']['thumbnails'] = 0;
 }
-if ($GLOBALS['TYPO3_CONF_VARS']['GFX']['im_version_5'])        {
+if ($GLOBALS['TYPO3_CONF_VARS']['GFX']['im_version_5']) {
        $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_negate_mask'] = 1;
        $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_no_effects'] = 1;
        $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_mask_temp_ext_gif'] = 1;
 
-       if ($GLOBALS['TYPO3_CONF_VARS']['GFX']['im_version_5']==='gm')  {
+       if ($GLOBALS['TYPO3_CONF_VARS']['GFX']['im_version_5']==='gm') {
                $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_negate_mask'] = 0;
                $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_imvMaskState'] = 0;
                $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_no_effects'] = 1;
                $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_v5effects'] = -1;
        }
 }
-if ($GLOBALS['TYPO3_CONF_VARS']['GFX']['im_imvMaskState'])     {
+if ($GLOBALS['TYPO3_CONF_VARS']['GFX']['im_imvMaskState']) {
        $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_negate_mask']=$GLOBALS['TYPO3_CONF_VARS']['GFX']['im_negate_mask']?0:1;
 }
 
 
        // Convert type of "pageNotFound_handling" setting in case it was written as a string (e.g. if edited in Install Tool)
        // TODO: Once the Install Tool handles such data types correctly, this workaround should be removed again...
-if (!strcasecmp($TYPO3_CONF_VARS['FE']['pageNotFound_handling'],'TRUE'))       {
+if (!strcasecmp($TYPO3_CONF_VARS['FE']['pageNotFound_handling'],'TRUE')) {
        $TYPO3_CONF_VARS['FE']['pageNotFound_handling'] = TRUE;
 }
 
 
        // simple debug function which prints output immediately
-function xdebug($var = '', $debugTitle = 'xdebug')     {
+function xdebug($var = '', $debugTitle = 'xdebug') {
                // If you wish to use the debug()-function, and it does not output something, please edit the IP mask in TYPO3_CONF_VARS
        if (!t3lib_div::cmpIP(t3lib_div::getIndpEnv('REMOTE_ADDR'), $GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask']))   return;
        t3lib_utility_Debug::debug($var, $debugTitle);
 }
        // Debug function which calls $GLOBALS['error'] error handler if available
-function debug($variable='', $name='*variable*', $line='*line*', $file='*file*', $recursiveDepth=3, $debugLevel=E_DEBUG)       {
+function debug($variable='', $name='*variable*', $line='*line*', $file='*file*', $recursiveDepth=3, $debugLevel=E_DEBUG) {
                // If you wish to use the debug()-function, and it does not output something, please edit the IP mask in TYPO3_CONF_VARS
        if (!t3lib_div::cmpIP(t3lib_div::getIndpEnv('REMOTE_ADDR'), $GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask']))   return;
 
@@ -994,15 +994,15 @@ $TYPO3_CONF_VARS['SC_OPTIONS']['errors']['exceptionalErrors'] = $TYPO3_CONF_VARS
 $TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/utility/class.t3lib_utility_mail.php']['substituteMailDelivery'][] = 't3lib_mail_SwiftMailerAdapter';
 
        // Turn error logging on/off.
-if (($displayErrors = intval($TYPO3_CONF_VARS['SYS']['displayErrors'])) != '-1')       {
+if (($displayErrors = intval($TYPO3_CONF_VARS['SYS']['displayErrors'])) != '-1') {
        if ($displayErrors == 2)        {       // Special value "2" enables this feature only if $TYPO3_CONF_VARS[SYS][devIPmask] matches
-               if (t3lib_div::cmpIP(t3lib_div::getIndpEnv('REMOTE_ADDR'), $GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask']))    {
+               if (t3lib_div::cmpIP(t3lib_div::getIndpEnv('REMOTE_ADDR'), $GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask'])) {
                        $displayErrors = 1;
                } else {
                        $displayErrors = 0;
                }
        }
-       if ($displayErrors == 0)        {
+       if ($displayErrors == 0) {
                $TYPO3_CONF_VARS['SC_OPTIONS']['errors']['exceptionalErrors'] = 0;
        }
        if ($displayErrors == 1) {
@@ -1011,7 +1011,7 @@ if (($displayErrors = intval($TYPO3_CONF_VARS['SYS']['displayErrors'])) != '-1')
        }
 
        @ini_set('display_errors', $displayErrors);
-} elseif (t3lib_div::cmpIP(t3lib_div::getIndpEnv('REMOTE_ADDR'), $GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask']))     {
+} elseif (t3lib_div::cmpIP(t3lib_div::getIndpEnv('REMOTE_ADDR'), $GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask'])) {
                // with displayErrors = -1 (default), turn on debugging if devIPmask matches:
        $TYPO3_CONF_VARS['SC_OPTIONS']['errors']['exceptionHandler'] = $TYPO3_CONF_VARS['SYS']['debugExceptionHandler'];
 }
@@ -1041,12 +1041,12 @@ define('TYPO3_REQUESTTYPE',
 
 // Load extensions:
 $TYPO3_LOADED_EXT = t3lib_extMgm::typo3_loadExtensions();
-if ($TYPO3_LOADED_EXT['_CACHEFILE'])   {
+if ($TYPO3_LOADED_EXT['_CACHEFILE']) {
        require(PATH_typo3conf.$TYPO3_LOADED_EXT['_CACHEFILE'].'_ext_localconf.php');
 } else {
        $temp_TYPO3_LOADED_EXT = $TYPO3_LOADED_EXT;
        foreach ($temp_TYPO3_LOADED_EXT as $_EXTKEY => $temp_lEDat) {
-               if (is_array($temp_lEDat) && $temp_lEDat['ext_localconf.php'])  {
+               if (is_array($temp_lEDat) && $temp_lEDat['ext_localconf.php']) {
                        $_EXTCONF = $TYPO3_CONF_VARS['EXT']['extConf'][$_EXTKEY];
                        require($temp_lEDat['ext_localconf.php']);
                }
index f43b158..aa1b1c0 100644 (file)
@@ -22,7 +22,7 @@
 ***************************************************************/
 
 
-function evalFunc()    {
+function evalFunc() {
        this.input = evalFunc_input;
        this.output = evalFunc_output;
        this.parseInt = evalFunc_parseInt;
@@ -52,10 +52,10 @@ function evalFunc() {
        this.isInString = '';
        this.USmode = 0;
 }
-function evalFunc_pol(fortegn, value)  {
+function evalFunc_pol(fortegn, value) {
        return eval (((fortegn=="-")?'-':'')+value);
 }
-function evalFunc_evalObjValue(FObj,value)     {
+function evalFunc_evalObjValue(FObj,value) {
        var evallist = FObj.evallist;
        this.isInString = (FObj.is_in) ? ''+FObj.is_in : '';
        var index=1;
@@ -74,7 +74,7 @@ function evalFunc_evalObjValue(FObj,value)    {
        }
        return newValue;
 }
-function evalFunc_outputObjValue(FObj,value)   {
+function evalFunc_outputObjValue(FObj,value) {
        var evallist = FObj.evallist;
        var index=1;
        var theEvalType = this.split(evallist, ",", index);
@@ -88,34 +88,34 @@ function evalFunc_outputObjValue(FObj,value)        {
        }
        return newValue;
 }
-function evalFunc_caseSwitch(type,inVal)       {
+function evalFunc_caseSwitch(type,inVal) {
        var theVal = ''+inVal;
        var newString = '';
-       switch (type)   {
+       switch (type) {
                case "alpha":
                case "num":
                case "alphanum":
                case "alphanum_x":
-                       for (var a=0;a<theVal.length;a++)       {
+                       for (var a=0;a<theVal.length;a++) {
                                var theChar = theVal.substr(a,1);
                                var special = (theChar=='_'||theChar=='-');
                                var alpha = (theChar>='a'&&theChar<='z') || (theChar>='A'&&theChar<='Z');
                                var num = (theChar>='0' && theChar<='9');
-                               switch(type)    {
+                               switch(type) {
                                        case "alphanum":        special=0;              break;
                                        case "alpha":   num=0; special=0;               break;
                                        case "num":     alpha=0; special=0;             break;
                                }
-                               if (alpha || num || theChar==' ' || special)    {
+                               if (alpha || num || theChar==' ' || special) {
                                        newString+=theChar;
                                }
                        }
                break;
                case "is_in":
-                       if (this.isInString)    {
-                               for (var a=0;a<theVal.length;a++)       {
+                       if (this.isInString) {
+                               for (var a=0;a<theVal.length;a++) {
                                        var theChar = theVal.substr(a,1);
-                                       if (this.isInString.indexOf(theChar)!=-1)       {
+                                       if (this.isInString.indexOf(theChar)!=-1) {
                                                newString+=theChar;
                                        }
                                }
@@ -135,28 +135,28 @@ function evalFunc_caseSwitch(type,inVal)  {
        }
        return newString;
 }
-function evalFunc_parseInt(value)      {
+function evalFunc_parseInt(value) {
        var theVal = ''+value;
        if (!value)     return 0;
-       for (var a=0;a<theVal.length;a++)       {
-               if (theVal.substr(a,1)!='0')    {
+       for (var a=0;a<theVal.length;a++) {
+               if (theVal.substr(a,1)!='0') {
                        return parseInt(theVal.substr(a,theVal.length)) || 0;
                }
        }
        return 0;
 }
-function evalFunc_getNumChars(value)   {
+function evalFunc_getNumChars(value) {
        var theVal = ''+value;
        if (!value)     return 0;
        var outVal="";
-       for (var a=0;a<theVal.length;a++)       {
-               if (theVal.substr(a,1)==parseInt(theVal.substr(a,1)))   {
+       for (var a=0;a<theVal.length;a++) {
+               if (theVal.substr(a,1)==parseInt(theVal.substr(a,1))) {
                        outVal+=theVal.substr(a,1);
                }
        }
        return outVal;
 }
-function evalFunc_parseDouble(value)   {
+function evalFunc_parseDouble(value) {
        var theVal = "" + value;
        theVal = theVal.replace(/[^0-9,\.-]/g, "");
        var negative = theVal.substring(0, 1) === '-';
@@ -175,38 +175,38 @@ function evalFunc_parseDouble(value)      {
 
        return theVal;
 }
-function evalFunc_noSpace(value)       {
+function evalFunc_noSpace(value) {
        var theVal = ''+value;
        var newString="";
-       for (var a=0;a<theVal.length;a++)       {
+       for (var a=0;a<theVal.length;a++) {
                var theChar = theVal.substr(a,1);
-               if (theChar!=' ')       {
+               if (theChar!=' ') {
                        newString+=theChar;
                }
        }
        return newString;
 }
-function evalFunc_ltrim(value) {
+function evalFunc_ltrim(value) {
        var theVal = ''+value;
        if (!value)     return '';
-       for (var a=0;a<theVal.length;a++)       {
-               if (theVal.substr(a,1)!=' ')    {
+       for (var a=0;a<theVal.length;a++) {
+               if (theVal.substr(a,1)!=' ') {
                        return theVal.substr(a,theVal.length);
                }
        }
        return '';
 }
-function evalFunc_btrim(value) {
+function evalFunc_btrim(value) {
        var theVal = ''+value;
        if (!value)     return '';
-       for (var a=theVal.length;a>0;a--)       {
-               if (theVal.substr(a-1,1)!=' ')  {
+       for (var a=theVal.length;a>0;a--) {
+               if (theVal.substr(a-1,1)!=' ') {
                        return theVal.substr(0,a);
                }
        }
        return '';
 }
-function evalFunc_splitSingle(value)   {
+function evalFunc_splitSingle(value) {
        var theVal = ''+value;
        this.values = new Array();
        this.pointer = 3;
@@ -214,23 +214,23 @@ function evalFunc_splitSingle(value)      {
        this.values[2]=theVal.substr(2,2);
        this.values[3]=theVal.substr(4,10);
 }
-function evalFunc_split(value) {
+function evalFunc_split(value) {
        this.values = new Array();
        this.valPol = new Array();
        this.pointer = 0;
        var numberMode = 0;
        var theVal = "";
        value+=" ";
-       for (var a=0;a<value.length;a++)        {
+       for (var a=0;a<value.length;a++) {
                var theChar = value.substr(a,1);
-               if (theChar<"0" || theChar>"9") {
-                       if (numberMode) {
+               if (theChar<"0" || theChar>"9") {
+                       if (numberMode) {
                                this.pointer++;
                                this.values[this.pointer]=theVal;
                                theVal = "";
                                numberMode=0;
                        }
-                       if (theChar=="+" || theChar=="-")       {
+                       if (theChar=="+" || theChar=="-") {
                                this.valPol[this.pointer+1] = theChar;
                        }
                } else {
@@ -239,7 +239,7 @@ function evalFunc_split(value)      {
                }
        }
 }
-function evalFunc_input(type,inVal)    {
+function evalFunc_input(type,inVal) {
        if (type=="md5") {
                return MD5(inVal);
        }
@@ -263,29 +263,29 @@ function evalFunc_input(type,inVal)       {
                return "";
                return 0;       // Why would I ever return a zero??? (20/12/01)
        }
-       switch (type)   {
+       switch (type) {
                case "datetime":
-                       switch (theCmd) {
+                       switch (theCmd) {
                                case "d":
                                case "t":
                                case "n":
                                        this.lastTime = this.convertClientTimestampToUTC(this.getTimestamp(today), 0);
-                                       if (values.valPol[1])   {
+                                       if (values.valPol[1]) {
                                                add = this.pol(values.valPol[1],this.parseInt(values.values[1]));
                                        }
                                break;
                                case "+":
                                case "-":
-                                       if (this.lastTime == 0) {
+                                       if (this.lastTime == 0) {
                                                this.lastTime = this.convertClientTimestampToUTC(this.getTimestamp(today), 0);
                                        }
-                                       if (values.valPol[1])   {
+                                       if (values.valPol[1]) {
                                                add = this.pol(values.valPol[1],this.parseInt(values.values[1]));
                                        }
                                break;
                                default:
                                        var index = value.indexOf(' ');
-                                       if (index!=-1)  {
+                                       if (index!=-1) {
                                                var dateVal = this.input("date",value.substr(index,value.length));
                                                        // set refDate so that evalFunc_input on time will work with correct DST information
                                                this.refDate = new Date(dateVal*1000);
@@ -299,28 +299,28 @@ function evalFunc_input(type,inVal)       {
                        return this.lastTime;
                break;
                case "year":
-                       switch (theCmd) {
+                       switch (theCmd) {
                                case "d":
                                case "t":
                                case "n":
                                        this.lastYear = this.getYear(today);
-                                       if (values.valPol[1])   {
+                                       if (values.valPol[1]) {
                                                add = this.pol(values.valPol[1],this.parseInt(values.values[1]));
                                        }
                                break;
                                case "+":
                                case "-":
-                                       if (values.valPol[1])   {
+                                       if (values.valPol[1]) {
                                                add = this.pol(values.valPol[1],this.parseInt(values.values[1]));
                                        }
                                break;
                                default:
-                                       if (values.valPol[2])   {
+                                       if (values.valPol[2]) {
                                                add = this.pol(values.valPol[2],this.parseInt(values.values[2]));
                                        }
                                        var year = (values.values[1])?this.parseInt(values.values[1]):this.getYear(today);
-                                       if (  (year>=0&&year<38) || (year>=70&&year<100) || (year>=1902&&year<2038)     )       {
-                                               if (year<100)   {
+                                       if (  (year>=0&&year<38) || (year>=70&&year<100) || (year>=1902&&year<2038)     ) {
+                                               if (year<100) {
                                                        year = (year<38) ? year+=2000 : year+=1900;
                                                }
                                        } else {
@@ -332,28 +332,28 @@ function evalFunc_input(type,inVal)       {
                        return this.lastYear;
                break;
                case "date":
-                       switch (theCmd) {
+                       switch (theCmd) {
                                case "d":
                                case "t":
                                case "n":
                                        this.lastDate = this.getTimestamp(today);
-                                       if (values.valPol[1])   {
+                                       if (values.valPol[1]) {
                                                add = this.pol(values.valPol[1],this.parseInt(values.values[1]));
                                        }
                                break;
                                case "+":
                                case "-":
-                                       if (values.valPol[1])   {
+                                       if (values.valPol[1]) {
                                                add = this.pol(values.valPol[1],this.parseInt(values.values[1]));
                                        }
                                break;
                                default:
                                        var index = 4;
-                                       if (values.valPol[index])       {
+                                       if (values.valPol[index]) {
                                                add = this.pol(values.valPol[index],this.parseInt(values.values[index]));
                                        }
-                                       if (values.values[1] && values.values[1].length>2)      {
-                                               if (values.valPol[2])   {
+                                       if (values.values[1] && values.values[1].length>2) {
+                                               if (values.valPol[2]) {
                                                        add = this.pol(values.valPol[2],this.parseInt(values.values[2]));
                                                }
                                                var temp = values.values[1];
@@ -361,8 +361,8 @@ function evalFunc_input(type,inVal) {
                                        }
 
                                        var year = (values.values[3])?this.parseInt(values.values[3]):this.getYear(today);
-                                       if ( (year>=0&&year<38) || (year>=70&&year<100) || (year>=1902&&year<2038) )    {
-                                               if (year<100)   {
+                                       if ( (year>=0&&year<38) || (year>=70&&year<100) || (year>=1902&&year<2038) ) {
+                                               if (year<100) {
                                                        year = (year<38) ? year+=2000 : year+=1900;
                                                }
                                        } else {
@@ -381,31 +381,31 @@ function evalFunc_input(type,inVal)       {
                break;
                case "time":
                case "timesec":
-                       switch (theCmd) {
+                       switch (theCmd) {
                                case "d":
                                case "t":
                                case "n":
                                        this.lastTime = this.getTimeSecs(today);
-                                       if (values.valPol[1])   {
+                                       if (values.valPol[1]) {
                                                add = this.pol(values.valPol[1],this.parseInt(values.values[1]));
                                        }
                                break;
                                case "+":
                                case "-":
-                                       if (this.lastTime == 0) {
+                                       if (this.lastTime == 0) {
                                                this.lastTime = this.getTimeSecs(today);
                                        }
-                                       if (values.valPol[1])   {
+                                       if (values.valPol[1]) {
                                                add = this.pol(values.valPol[1],this.parseInt(values.values[1]));
                                        }
                                break;
                                default:
                                        var index = (type=="timesec")?4:3;
-                                       if (values.valPol[index])       {
+                                       if (values.valPol[index]) {
                                                add = this.pol(values.valPol[index],this.parseInt(values.values[index]));
                                        }
-                                       if (values.values[1] && values.values[1].length>2)      {
-                                               if (values.valPol[2])   {
+                                       if (values.values[1] && values.values[1].length>2) {
+                                               if (values.valPol[2]) {
                                                        add = this.pol(values.valPol[2],this.parseInt(values.values[2]));
                                                }
                                                var temp = values.values[1];
@@ -431,13 +431,13 @@ function evalFunc_input(type,inVal)       {
                        return value;
        }
 }
-function evalFunc_output(type,value,FObj)      {
+function evalFunc_output(type,value,FObj) {
        var theString = "";
-       switch (type)   {
+       switch (type) {
                case "date":
                        if (!parseInt(value))   {return '';}
                        var theTime = new Date(parseInt(value) * 1000);
-                       if (this.USmode)        {
+                       if (this.USmode) {
                                theString = (theTime.getUTCMonth()+1)+'-'+theTime.getUTCDate()+'-'+this.getYear(theTime);
                        } else {
                                theString = theTime.getUTCDate()+'-'+(theTime.getUTCMonth()+1)+'-'+this.getYear(theTime);
@@ -467,21 +467,21 @@ function evalFunc_output(type,value,FObj) {
        }
        return theString;
 }
-function evalFunc_getSecs(timeObj)     {
+function evalFunc_getSecs(timeObj) {
        return timeObj.getUTCSeconds();
 }
 // Seconds since midnight:
-function evalFunc_getTime(timeObj)     {
+function evalFunc_getTime(timeObj) {
        return timeObj.getUTCHours() * 60 * 60 + timeObj.getUTCMinutes() * 60 + this.getSecs(timeObj);
 }
-function evalFunc_getYear(timeObj)     {
+function evalFunc_getYear(timeObj) {
        return timeObj.getUTCFullYear();
 }
 // Seconds since midnight with client timezone offset:
-function evalFunc_getTimeSecs(timeObj) {
+function evalFunc_getTimeSecs(timeObj) {
        return timeObj.getHours()*60*60+timeObj.getMinutes()*60+timeObj.getSeconds();
 }
-function evalFunc_getDate(timeObj)     {
+function evalFunc_getDate(timeObj) {
        var theTime = new Date(this.getYear(timeObj), timeObj.getUTCMonth(), timeObj.getUTCDate());
        return this.getTimestamp(theTime);
 }
@@ -496,7 +496,7 @@ function evalFunc_splitStr(theStr1, delim, index) {
        var lengthOfDelim = delim.length;
        sPos = -lengthOfDelim;
        if (index<1) {index=1;}
-       for (a=1; a<index; a++) {
+       for (a=1; a<index; a++) {
                sPos = theStr.indexOf(delim, sPos+lengthOfDelim);
                if (sPos==-1)   {return null;}
        }
@@ -504,15 +504,15 @@ function evalFunc_splitStr(theStr1, delim, index) {
        if(ePos == -1)  {ePos = theStr.length;}
        return (theStr.substring(sPos+lengthOfDelim,ePos));
 }
-function evalFunc_getTimestamp(timeObj)        {
+function evalFunc_getTimestamp(timeObj) {
        return Date.parse(timeObj)/1000;
 }
 
 // Substract timezone offset from client to a timestamp to get UTC-timestamp to be send to server
-function evalFunc_convertClientTimestampToUTC(timestamp, timeonly)     {
+function evalFunc_convertClientTimestampToUTC(timestamp, timeonly) {
        var timeObj = new Date(timestamp*1000);
        timeObj.setTime((timestamp - timeObj.getTimezoneOffset()*60)*1000);
-       if (timeonly)   {
+       if (timeonly) {
                        // only seconds since midnight
                return this.getTime(timeObj);
        } else  {
index cb7cd1e..4f56270 100644 (file)
 ***************************************************************/
 
 
-function updateForm(formname,fieldname,value)  {
-       if (document[formname] && document[formname][fieldname])        {
+function updateForm(formname,fieldname,value) {
+       if (document[formname] && document[formname][fieldname]) {
                var fObj = document[formname][fieldname];
                var type=fObj.type;
-               if (!fObj.type) {
+               if (!fObj.type) {
                        type="radio";
                }
-               switch(type)    {
+               switch(type) {
                        case "text":
                        case "textarea":
                        case "hidden":
@@ -41,24 +41,24 @@ function updateForm(formname,fieldname,value)       {
                        break;
                        case "select-one":
                                var l=fObj.length;
-                               for (a=0;a<l;a++)       {
-                                       if (fObj.options[a].value == value)     {
+                               for (a=0;a<l;a++) {
+                                       if (fObj.options[a].value == value) {
                                                fObj.selectedIndex = a;
                                        }
                                }
                        break;
                        case "select-multiple":
                                var l=fObj.length;
-                               for (a=0;a<l;a++)       {
-                                       if (fObj.options[a].value == value)     {
+                               for (a=0;a<l;a++) {
+                                       if (fObj.options[a].value == value) {
                                                fObj.options[a].selected = 1;
                                        }
                                }
                        break;
                        case "radio":
                                var l=fObj.length;
-                               for (a=0; a<l;a++)      {
-                                       if (fObj[a].value==value)       {
+                               for (a=0; a<l;a++) {
+                                       if (fObj[a].value==value) {
                                                fObj[a].checked = 1;
                                        }
                                }
index b1d3286..6f46da4 100644 (file)
 ***************************************************************/
 
 
-function validateForm(theFormname,theFieldlist,goodMess,badMess,emailMess)     {
+function validateForm(theFormname,theFieldlist,goodMess,badMess,emailMess) {
        var formObject = document[theFormname];
-       if (!formObject)        {
+       if (!formObject) {
                formObject = document.getElementById(theFormname);
        }
-       if (formObject && theFieldlist) {
+       if (formObject && theFieldlist) {
                var index=1;
                var theField = split(theFieldlist, ",", index);
                var msg="";
@@ -46,12 +46,12 @@ function validateForm(theFormname,theFieldlist,goodMess,badMess,emailMess)  {
                                theEregMsg = split(theFieldlist, ",", index);
                                index++;
                                theEreg = split(theFieldlist, ",", index);
-                       } else if (theField == '_EMAIL')        {
+                       } else if (theField == '_EMAIL') {
                                specialMode = theField;
                        }
 
                                // Get real field name if special mode has been set:
-                       if (specialMode)        {
+                       if (specialMode) {
                                index++;
                                theField = split(theFieldlist, ",", index);
                        }
@@ -59,14 +59,14 @@ function validateForm(theFormname,theFieldlist,goodMess,badMess,emailMess)  {
                        index++;
                        theLabel = split(theFieldlist, ",", index);
                        theField = theField;
-                       if (formObject[theField])       {
+                       if (formObject[theField]) {
                                var fObj = formObject[theField];
                                var type=fObj.type;
-                               if (!fObj.type) {
+                               if (!fObj.type) {
                                        type="radio";
                                }
                                var value="";
-                               switch(type)    {
+                               switch(type) {
                                        case "text":
                                        case "textarea":
                                        case "password":
@@ -74,14 +74,14 @@ function validateForm(theFormname,theFieldlist,goodMess,badMess,emailMess)  {
                                                value = fObj.value;
                                        break;
                                        case "select-one":
-                                               if (fObj.selectedIndex>=0)      {
+                                               if (fObj.selectedIndex>=0) {
                                                        value = fObj.options[fObj.selectedIndex].value;
                                                }
                                        break;
                                        case "select-multiple":
                                                var l=fObj.length;
-                                               for (a=0;a<l;a++)       {
-                                                       if (fObj.options[a].selected)   {
+                                               for (a=0;a<l;a++) {
+                                                       if (fObj.options[a].selected) {
                                                                 value+= fObj.options[a].value;
                                                        }
                                                }
@@ -89,14 +89,14 @@ function validateForm(theFormname,theFieldlist,goodMess,badMess,emailMess)  {
                                        case "radio":
                                        case "checkbox":
                                                var len=fObj.length;
-                                               if (len)        {
-                                                       for (a=0;a<len;a++)     {
-                                                               if (fObj[a].checked)    {
+                                               if (len) {
+                                                       for (a=0;a<len;a++) {
+                                                               if (fObj[a].checked) {
                                                                        value = fObj[a].value;
                                                                }
                                                        }
                                                } else {
-                                                       if (fObj.checked)       {
+                                                       if (fObj.checked) {
                                                                value = fObj.value;
                                                        }
                                                }
@@ -105,7 +105,7 @@ function validateForm(theFormname,theFieldlist,goodMess,badMess,emailMess)  {
                                                value = 1;
                                }
 
-                               switch(specialMode)     {
+                               switch(specialMode) {
                                        case "_EMAIL":
                                                var theRegEx_notValid = new RegExp("(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)", "gi");
                                                var theRegEx_isValid = new RegExp("^.+\@[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})$","");
@@ -115,12 +115,12 @@ function validateForm(theFormname,theFieldlist,goodMess,badMess,emailMess)        {
                                        break;
                                        case "_EREG":
                                                var theRegEx_isValid = new RegExp(theEreg,"");
-                                               if (!theRegEx_isValid.test(value))      {
+                                               if (!theRegEx_isValid.test(value)) {
                                                        msg+="\n"+theLabel+' ('+theEregMsg+')';
                                                }
                                        break;
                                        default:
-                                               if (!value)     {
+                                               if (!value) {
                                                        msg+="\n"+theLabel;
                                                }
                                }
@@ -128,9 +128,9 @@ function validateForm(theFormname,theFieldlist,goodMess,badMess,emailMess)  {
                        index++;
                        theField = split(theFieldlist, ",", index);
                }
-               if (msg)        {
+               if (msg) {
                        var theBadMess = badMess;
-                       if (!theBadMess)        {
+                       if (!theBadMess) {
                                theBadMess = "You must fill in these fields:";
                        }
                        theBadMess+="\n";
@@ -138,7 +138,7 @@ function validateForm(theFormname,theFieldlist,goodMess,badMess,emailMess)  {
                        return false;
                } else {
                        var theGoodMess = goodMess;
-                       if (theGoodMess)        {
+                       if (theGoodMess) {
                                alert(theGoodMess);
                        }
                        return true;
@@ -151,7 +151,7 @@ function split(theStr1, delim, index) {
        var sPos = -lengthOfDelim;
        var a, ePos;
        if (index<1) {index=1;}
-       for (a=1; a<index; a++) {
+       for (a=1; a<index; a++) {
                sPos = theStr.indexOf(delim, sPos+lengthOfDelim);
                if (sPos==-1)   {return null;}
        }