@@ -107,7 +107,7 @@ public function doDefault($msg = '')
107107 'function ' => [
108108 'title ' => $ this ->lang ['strfunction ' ],
109109 'field ' => Decorator::field ('proproto ' ),
110- 'url ' => \SUBFOLDER . "/redirect/function?action=properties& {$ this ->misc ->href }& " ,
110+ 'url ' => \SUBFOLDER . "/redirect/function?action=properties& {$ this ->misc ->href }& " ,
111111 'vars ' => ['function ' => 'proproto ' , 'function_oid ' => 'prooid ' ],
112112 ],
113113 'returns ' => [
@@ -413,10 +413,11 @@ private function _getNamedParamsArgs($data, $fndata)
413413 }
414414 if (isset ($ names_arr [$ i ]) && '' != $ names_arr [$ i ]) {
415415 $ data ->fieldClean ($ names_arr [$ i ]);
416- $ args .= '" ' . $ names_arr [$ i ] . '" ' ;
416+ $ args .= '" ' . $ names_arr [$ i ]. '" ' ;
417417 }
418418 $ args .= $ args_arr [$ i ];
419419 }
420+
420421 return $ args ;
421422 }
422423
@@ -437,6 +438,7 @@ public function doEdit($msg = '')
437438
438439 if ($ fndata ->recordCount () <= 0 ) {
439440 echo "<p> {$ this ->lang ['strnodata ' ]}</p> \n" ;
441+
440442 return ;
441443 }
442444 $ fndata ->fields ['proretset ' ] = $ data ->phpBool ($ fndata ->fields ['proretset ' ]);
@@ -471,7 +473,7 @@ public function doEdit($msg = '')
471473 $ args = $ fndata ->fields ['proarguments ' ];
472474 }
473475
474- echo '<form action=" ' . \SUBFOLDER . "/src/views/functions \" method= \"post \"> \n" ;
476+ echo '<form action=" ' . \SUBFOLDER . "/src/views/functions \" method= \"post \"> \n" ;
475477 echo "<table style= \"width: 90% \"> \n" ;
476478 echo "<tr> \n" ;
477479 echo "<th class= \"data required \"> {$ this ->lang ['strschema ' ]}</th> \n" ;
@@ -542,7 +544,7 @@ public function doEdit($msg = '')
542544 echo "<tr><th class= \"data required \" colspan= \"5 \"> {$ this ->lang ['strdefinition ' ]}</th></tr> \n" ;
543545 echo '<tr><td class="data1" colspan="5"> ' ;
544546 $ textarea_id = ($ fnlang === 'sql ' || $ fnlang === 'plpgsql ' ) ? 'query ' : 'formDefinition ' ;
545- echo '<textarea style="width:100%;" rows="20" cols="50" id=" ' . $ textarea_id . '" name="formDefinition"> ' ;
547+ echo '<textarea style="width:100%;" rows="20" cols="50" id=" ' . $ textarea_id. '" name="formDefinition"> ' ;
546548 echo htmlspecialchars ($ _POST ['formDefinition ' ]);
547549 echo "</textarea></td></tr> \n" ;
548550 }
@@ -557,8 +559,8 @@ public function doEdit($msg = '')
557559 // Display function cost options
558560 if ($ data ->hasFunctionCosting ()) {
559561 echo "<tr><th class= \"data required \" colspan= \"5 \"> {$ this ->lang ['strfunctioncosting ' ]}</th></tr> \n" ;
560- echo "<td class= \"data1 \" colspan= \"2 \"> {$ this ->lang ['strexecutioncost ' ]}: <input name= \"formCost \" size= \"16 \" value= \"" .
561- htmlspecialchars ($ _POST ['formCost ' ]) . '" /></td> ' ;
562+ echo "<td class= \"data1 \" colspan= \"2 \"> {$ this ->lang ['strexecutioncost ' ]}: <input name= \"formCost \" size= \"16 \" value= \"" .
563+ htmlspecialchars ($ _POST ['formCost ' ]). '" /></td> ' ;
562564 echo "<td class= \"data1 \" colspan= \"2 \"> {$ this ->lang ['strresultrows ' ]}: <input name= \"formRows \" size= \"16 \" value= \"" ,
563565 htmlspecialchars ($ _POST ['formRows ' ]), '" ' , (!$ fndata ->fields ['proretset ' ]) ? 'disabled ' : '' , '/></td> ' ;
564566 }
@@ -630,7 +632,7 @@ public function doProperties($msg = '')
630632 }
631633
632634 $ funcdata ->fields ['proretset ' ] = $ data ->phpBool ($ funcdata ->fields ['proretset ' ]);
633- $ func_full = $ funcdata ->fields ['proname ' ] . '( ' . $ funcdata ->fields ['proarguments ' ] . ') ' ;
635+ $ func_full = $ funcdata ->fields ['proname ' ]. '( ' . $ funcdata ->fields ['proarguments ' ]. ') ' ;
634636 echo "<table style= \"width: 90% \"> \n" ;
635637 echo sprintf ('<tr><th class="data">%s</th>%s ' , $ this ->lang ['strfunction ' ], "\n" );
636638 echo sprintf ('<th class="data">%s</th>%s ' , $ this ->lang ['strarguments ' ], "\n" );
@@ -707,7 +709,7 @@ public function doDrop($confirm)
707709 $ this ->printTrail ('schema ' );
708710 $ this ->printTitle ($ this ->lang ['strdrop ' ], 'pg.function.drop ' );
709711
710- echo '<form action=" ' . \SUBFOLDER . "/src/views/functions \" method= \"post \"> \n" ;
712+ echo '<form action=" ' . \SUBFOLDER . "/src/views/functions \" method= \"post \"> \n" ;
711713
712714 //If multi drop
713715 if (isset ($ _REQUEST ['ma ' ])) {
@@ -831,16 +833,16 @@ public function doCreate($msg = '', $szJS = '')
831833 $ szSelected = ' selected="selected" ' ;
832834 }
833835 // this variable is include in the JS code bellow, so we need to ENT_QUOTES
834- $ szTypes .= '<option value=" ' . htmlspecialchars ($ types ->fields ['typname ' ], ENT_QUOTES ) . "\"{$ szSelected }> " ;
835- $ szTypes .= htmlspecialchars ($ types ->fields ['typname ' ], ENT_QUOTES ) . '</option> ' ;
836+ $ szTypes .= '<option value=" ' . htmlspecialchars ($ types ->fields ['typname ' ], ENT_QUOTES ). "\"{$ szSelected }> " ;
837+ $ szTypes .= htmlspecialchars ($ types ->fields ['typname ' ], ENT_QUOTES ). '</option> ' ;
836838 $ types ->moveNext ();
837839 }
838840
839- $ szFunctionName = "<td class= \"data1 \"><input name= \"formFunction \" size= \"16 \" maxlength= \"{$ data ->_maxNameLen }\" value= \"" .
840- htmlspecialchars ($ _POST ['formFunction ' ]) . '" /></td> ' ;
841+ $ szFunctionName = "<td class= \"data1 \"><input name= \"formFunction \" size= \"16 \" maxlength= \"{$ data ->_maxNameLen }\" value= \"" .
842+ htmlspecialchars ($ _POST ['formFunction ' ]). '" /></td> ' ;
841843
842- $ szArguments = '<td class="data1"><input name="formArguments" style="width:100%;" size="16" value=" ' .
843- htmlspecialchars ($ _POST ['formArguments ' ]) . '" /></td> ' ;
844+ $ szArguments = '<td class="data1"><input name="formArguments" style="width:100%;" size="16" value=" ' .
845+ htmlspecialchars ($ _POST ['formArguments ' ]). '" /></td> ' ;
844846
845847 $ szSetOfSelected = '' ;
846848 $ szNotSetOfSelected = '' ;
@@ -855,7 +857,7 @@ public function doCreate($msg = '', $szJS = '')
855857 $ szReturns .= "<option value= \"SETOF \"{$ szSetOfSelected }>SETOF</option> " ;
856858 $ szReturns .= '</select> ' ;
857859
858- $ szReturns .= '<select class="select2" name="formReturns"> ' . $ szTypes . '</select> ' ;
860+ $ szReturns .= '<select class="select2" name="formReturns"> ' . $ szTypes. '</select> ' ;
859861
860862 // Create string array type selector
861863
@@ -875,7 +877,7 @@ public function doCreate($msg = '', $szJS = '')
875877 // Create string for language
876878 $ szLanguage = '<td class="data1"> ' ;
877879 if ('c ' == $ fnlang || 'internal ' == $ fnlang ) {
878- $ szLanguage .= $ _POST ['formLanguage ' ] . "\n" ;
880+ $ szLanguage .= $ _POST ['formLanguage ' ]. "\n" ;
879881 $ szLanguage .= "<input type= \"hidden \" name= \"formLanguage \" value= \"{$ _POST ['formLanguage ' ]}\" /> \n" ;
880882 } else {
881883 $ szLanguage .= "<select name= \"formLanguage \"> \n" ;
@@ -885,8 +887,8 @@ public function doCreate($msg = '', $szJS = '')
885887 $ szSelected = ' selected="selected" ' ;
886888 }
887889 if ('c ' != strtolower ($ langs ->fields ['lanname ' ]) && 'internal ' != strtolower ($ langs ->fields ['lanname ' ])) {
888- $ szLanguage .= '<option value=" ' . htmlspecialchars ($ langs ->fields ['lanname ' ]) . "\"{$ szSelected }> \n" .
889- $ this ->misc ->printVal ($ langs ->fields ['lanname ' ]) . '</option> ' ;
890+ $ szLanguage .= '<option value=" ' . htmlspecialchars ($ langs ->fields ['lanname ' ]). "\"{$ szSelected }> \n" .
891+ $ this ->misc ->printVal ($ langs ->fields ['lanname ' ]). '</option> ' ;
890892 }
891893
892894 $ langs ->moveNext ();
@@ -908,9 +910,9 @@ public function doCreate($msg = '', $szJS = '')
908910 $ szArgReturns .= '</select> ' ;
909911 $ subfolder = \SUBFOLDER ;
910912 if (!empty ($ this ->conf ['theme ' ])) {
911- $ szImgPath = \SUBFOLDER . "/assets/images/themes/ {$ this ->conf ['theme ' ]}" ;
913+ $ szImgPath = \SUBFOLDER . "/assets/images/themes/ {$ this ->conf ['theme ' ]}" ;
912914 } else {
913- $ szImgPath = \SUBFOLDER . '/assets/images/themes/default ' ;
915+ $ szImgPath = \SUBFOLDER . '/assets/images/themes/default ' ;
914916 }
915917 if (empty ($ msg )) {
916918 // $this->prtrace($subfolder);
@@ -923,7 +925,7 @@ public function doCreate($msg = '', $szJS = '')
923925 $ szJSAddTR .= "<img src= \"{$ szImgPath }/AddArguments.png \" alt= \"Add Argument \" /></td> " ;
924926 $ szJSAddTR .= "<td class= \"data3 \"><span style= \"font-size: 8pt \"> {$ this ->lang ['strargadd ' ]}</span></td></tr></table></td> \n</tr> \n" ;
925927
926- echo '<script src=" ' . \SUBFOLDER . "/assets/js/functions.js \" type= \"text/javascript \"></script>
928+ echo '<script src=" ' . \SUBFOLDER . "/assets/js/functions.js \" type= \"text/javascript \"></script>
927929 <script type= \"text/javascript \">
928930 //<![CDATA[
929931 var g_types_select = '<select class= \"select2 \" name= \"formArgType[] \"> {$ szTypes }</select> {$ szArgReturns }';
@@ -940,7 +942,7 @@ public function doCreate($msg = '', $szJS = '')
940942 //]]>
941943 </script>
942944 " ;
943- echo '<form action=" ' . \SUBFOLDER . "/src/views/functions \" method= \"post \"> \n" ;
945+ echo '<form action=" ' . \SUBFOLDER . "/src/views/functions \" method= \"post \"> \n" ;
944946 echo "<table><tbody id= \"args_table \"> \n" ;
945947 echo "<tr><th class= \"data required \"> {$ this ->lang ['strname ' ]}</th> \n" ;
946948 echo "<th class= \"data required \" colspan= \"2 \"> {$ this ->lang ['strreturns ' ]}</th> \n" ;
@@ -985,10 +987,10 @@ public function doCreate($msg = '', $szJS = '')
985987 // Display function cost options
986988 if ($ data ->hasFunctionCosting ()) {
987989 echo "<tr><th class= \"data required \" colspan= \"4 \"> {$ this ->lang ['strfunctioncosting ' ]}</th></tr> \n" ;
988- echo "<td class= \"data1 \" colspan= \"2 \"> {$ this ->lang ['strexecutioncost ' ]}: <input name= \"formCost \" size= \"16 \" value= \"" .
989- htmlspecialchars ($ _POST ['formCost ' ]) . '" /></td> ' ;
990- echo "<td class= \"data1 \" colspan= \"2 \"> {$ this ->lang ['strresultrows ' ]}: <input name= \"formRows \" size= \"16 \" value= \"" .
991- htmlspecialchars ($ _POST ['formRows ' ]) . '" /></td> ' ;
990+ echo "<td class= \"data1 \" colspan= \"2 \"> {$ this ->lang ['strexecutioncost ' ]}: <input name= \"formCost \" size= \"16 \" value= \"" .
991+ htmlspecialchars ($ _POST ['formCost ' ]). '" /></td> ' ;
992+ echo "<td class= \"data1 \" colspan= \"2 \"> {$ this ->lang ['strresultrows ' ]}: <input name= \"formRows \" size= \"16 \" value= \"" .
993+ htmlspecialchars ($ _POST ['formRows ' ]). '" /></td> ' ;
992994 }
993995
994996 // Display function properties
@@ -1037,14 +1039,14 @@ public function doSaveCreate()
10371039
10381040 $ szJS = '' ;
10391041
1040- echo '<script src=" ' . \SUBFOLDER . '/assets/js/functions.js" type="text/javascript"></script> ' ;
1041- echo '<script type="text/javascript"> ' . $ this ->_buildJSData () . '</script> ' ;
1042+ echo '<script src=" ' . \SUBFOLDER . '/assets/js/functions.js" type="text/javascript"></script> ' ;
1043+ echo '<script type="text/javascript"> ' . $ this ->_buildJSData (). '</script> ' ;
10421044 if (!empty ($ _POST ['formArgName ' ])) {
10431045 $ szJS = $ this ->_buildJSRows ($ this ->_buildFunctionArguments ($ _POST ));
10441046 } else {
10451047 $ subfolder = \SUBFOLDER ;
10461048 // $this->prtrace($subfolder);
1047- $ szJS = '<script type="text/javascript" src=" ' . \SUBFOLDER . '/assets/js/functions.js">noArgsRebuild(addArg(" ' . $ subfolder . '"));</script> ' ;
1049+ $ szJS = '<script type="text/javascript" src=" ' . \SUBFOLDER . '/assets/js/functions.js">noArgsRebuild(addArg(" ' . $ subfolder. '"));</script> ' ;
10481050 }
10491051
10501052 $ cost = (isset ($ _POST ['formCost ' ])) ? $ _POST ['formCost ' ] : null ;
@@ -1067,7 +1069,7 @@ public function doSaveCreate()
10671069 $ status = $ data ->createFunction (
10681070 $ _POST ['formFunction ' ],
10691071 empty ($ _POST ['nojs ' ]) ? $ this ->_buildFunctionArguments ($ _POST ) : $ _POST ['formArguments ' ],
1070- $ _POST ['formReturns ' ] . $ _POST ['formArray ' ],
1072+ $ _POST ['formReturns ' ]. $ _POST ['formArray ' ],
10711073 $ def ,
10721074 $ _POST ['formLanguage ' ],
10731075 $ _POST ['formProperties ' ],
@@ -1097,7 +1099,7 @@ private function _buildFunctionArguments($arrayVars)
10971099 if (isset ($ _POST ['formArgName ' ])) {
10981100 $ arrayArgs = [];
10991101 foreach ($ arrayVars ['formArgName ' ] as $ pK => $ pV ) {
1100- $ arrayArgs [] = $ arrayVars ['formArgModes ' ][$ pK ] . ' ' . trim ($ pV ) . ' ' . trim ($ arrayVars ['formArgType ' ][$ pK ]) . $ arrayVars ['formArgArray ' ][$ pK ];
1102+ $ arrayArgs [] = $ arrayVars ['formArgModes ' ][$ pK ]. ' ' . trim ($ pV ). ' ' . trim ($ arrayVars ['formArgType ' ][$ pK ]). $ arrayVars ['formArgArray ' ][$ pK ];
11011103 }
11021104
11031105 return implode (', ' , $ arrayArgs );
@@ -1155,18 +1157,18 @@ private function _buildJSData()
11551157 $ arrayPModes = [];
11561158
11571159 while (!$ arrayTypes ->EOF ) {
1158- $ arrayPTypes [] = "' " . $ arrayTypes ->fields ['typname ' ] . "' " ;
1160+ $ arrayPTypes [] = "' " . $ arrayTypes ->fields ['typname ' ]. "' " ;
11591161 $ arrayTypes ->moveNext ();
11601162 }
11611163
11621164 foreach ($ arrayModes as $ pV ) {
11631165 $ arrayPModes [] = "' {$ pV }' " ;
11641166 }
11651167
1166- $ szTypes = 'g_main_types = new Array( ' . implode (', ' , $ arrayPTypes ) . '); ' ;
1167- $ szModes = 'g_main_modes = new Array( ' . implode (', ' , $ arrayPModes ) . '); ' ;
1168+ $ szTypes = 'g_main_types = new Array( ' . implode (', ' , $ arrayPTypes ). '); ' ;
1169+ $ szModes = 'g_main_modes = new Array( ' . implode (', ' , $ arrayPModes ). '); ' ;
11681170
1169- return $ szTypes . $ szModes ;
1171+ return $ szTypes. $ szModes ;
11701172 }
11711173
11721174 /**
@@ -1221,7 +1223,7 @@ private function _getPropertiesArgs($funcdata)
12211223 }
12221224 if (isset ($ names_arr [$ i ]) && '' != $ names_arr [$ i ]) {
12231225 $ data ->fieldClean ($ names_arr [$ i ]);
1224- $ args .= '" ' . $ names_arr [$ i ] . '" ' ;
1226+ $ args .= '" ' . $ names_arr [$ i ]. '" ' ;
12251227 }
12261228 $ args .= $ args_arr [$ i ];
12271229 }
0 commit comments