Commit d733eb83d2418538f2a609d3115bd79587ff646d
Exists in
master
and in
54 other branches
Merge branch 'master' into expression-parser-bre
Showing
2 changed files
with
21 additions
and
2 deletions
Show diff stats
src/InputOutput/IHMImpl/Params/IHMInputOutputParamsAbstractClass.php
@@ -61,8 +61,9 @@ abstract class IHMInputOutputParamsAbstractClass implements InputOutputInterface | @@ -61,8 +61,9 @@ abstract class IHMInputOutputParamsAbstractClass implements InputOutputInterface | ||
61 | { | 61 | { |
62 | case "TimeTable" : | 62 | case "TimeTable" : |
63 | if (($ttFileIndex >= 0) && ($ttFileIndex >= count($input->timeTables))) | 63 | if (($ttFileIndex >= 0) && ($ttFileIndex >= count($input->timeTables))) |
64 | - throw new Exception('Try to use a non-existing Time table index in the request.'); | ||
65 | - | 64 | + $ttFileIndex = 0; |
65 | + if($ttFileIndex < 0) | ||
66 | + $ttFileIndex = count($input->timeTables) -1; | ||
66 | $crtIndex = 0; | 67 | $crtIndex = 0; |
67 | foreach ($input->timeTables as $tt) | 68 | foreach ($input->timeTables as $tt) |
68 | { | 69 | { |
src/InputOutput/IHMImpl/Tools/IHMParamTemplateClass.php
@@ -18,6 +18,7 @@ class IHMParamTemplateClass | @@ -18,6 +18,7 @@ class IHMParamTemplateClass | ||
18 | protected static $paramTemplateArgumentKeyAtt = 'key'; | 18 | protected static $paramTemplateArgumentKeyAtt = 'key'; |
19 | protected static $paramTemplateArgumentNameAtt = 'name'; | 19 | protected static $paramTemplateArgumentNameAtt = 'name'; |
20 | protected static $paramTemplateArgumentTypeAtt = 'type'; | 20 | protected static $paramTemplateArgumentTypeAtt = 'type'; |
21 | + protected static $paramTemplateArgumentSubTypeAtt = 'subtype'; | ||
21 | protected static $paramTemplateArgumentMinKeyAtt = 'minkey'; | 22 | protected static $paramTemplateArgumentMinKeyAtt = 'minkey'; |
22 | protected static $paramTemplateArgumentMaxKeyAtt = 'maxkey'; | 23 | protected static $paramTemplateArgumentMaxKeyAtt = 'maxkey'; |
23 | protected static $paramTemplateArgumentNameTplAtt = 'nametpl'; | 24 | protected static $paramTemplateArgumentNameTplAtt = 'nametpl'; |
@@ -93,12 +94,27 @@ class IHMParamTemplateClass | @@ -93,12 +94,27 @@ class IHMParamTemplateClass | ||
93 | case 'bool' : | 94 | case 'bool' : |
94 | $args_format .= "%d"; | 95 | $args_format .= "%d"; |
95 | break; | 96 | break; |
97 | + case 'list' : | ||
98 | + switch($arg["subtype"]) { | ||
99 | + case 'float' : | ||
100 | + case 'double' : | ||
101 | + $args_format .= "%f"; | ||
102 | + break; | ||
103 | + case 'int' : | ||
104 | + case 'bool' : | ||
105 | + $args_format .= "%d"; | ||
106 | + break; | ||
107 | + default: | ||
108 | + $args_format .= "%s"; | ||
109 | + } | ||
110 | + break; | ||
96 | default: | 111 | default: |
97 | $args_format .= "%s"; | 112 | $args_format .= "%s"; |
98 | } | 113 | } |
99 | } | 114 | } |
100 | 115 | ||
101 | $exploded_args = sscanf($template_args_str , $args_format); | 116 | $exploded_args = sscanf($template_args_str , $args_format); |
117 | + error_log($exploded_args); | ||
102 | 118 | ||
103 | if ($exploded_args === -1) | 119 | if ($exploded_args === -1) |
104 | return FALSE; | 120 | return FALSE; |
@@ -329,6 +345,7 @@ class IHMParamTemplateClass | @@ -329,6 +345,7 @@ class IHMParamTemplateClass | ||
329 | $argumentKey = $argumentNode->getAttribute(self::$paramTemplateArgumentKeyAtt); | 345 | $argumentKey = $argumentNode->getAttribute(self::$paramTemplateArgumentKeyAtt); |
330 | $argumentName = $argumentNode->getAttribute(self::$paramTemplateArgumentNameAtt); | 346 | $argumentName = $argumentNode->getAttribute(self::$paramTemplateArgumentNameAtt); |
331 | $argumentType = $argumentNode->getAttribute(self::$paramTemplateArgumentTypeAtt); | 347 | $argumentType = $argumentNode->getAttribute(self::$paramTemplateArgumentTypeAtt); |
348 | + $argumentSubType = $argumentNode->getAttribute(self::$paramTemplateArgumentSubTypeAtt); | ||
332 | $argumentDefault = $argumentNode->getAttribute(self::$paramTemplateArgumentDefaultAtt); | 349 | $argumentDefault = $argumentNode->getAttribute(self::$paramTemplateArgumentDefaultAtt); |
333 | $argumentMinKey = $argumentNode->getAttribute(self::$paramTemplateArgumentMinKeyAtt); | 350 | $argumentMinKey = $argumentNode->getAttribute(self::$paramTemplateArgumentMinKeyAtt); |
334 | $argumentMaxKey = $argumentNode->getAttribute(self::$paramTemplateArgumentMaxKeyAtt); | 351 | $argumentMaxKey = $argumentNode->getAttribute(self::$paramTemplateArgumentMaxKeyAtt); |
@@ -340,6 +357,7 @@ class IHMParamTemplateClass | @@ -340,6 +357,7 @@ class IHMParamTemplateClass | ||
340 | $arguments[$argumentKey] = array( | 357 | $arguments[$argumentKey] = array( |
341 | "name" => (empty($argumentName) ? $argumentKey : $argumentName), | 358 | "name" => (empty($argumentName) ? $argumentKey : $argumentName), |
342 | "type" => $argumentType, | 359 | "type" => $argumentType, |
360 | + "subtype" => $argumentSubType, | ||
343 | "default" => $argumentDefault | 361 | "default" => $argumentDefault |
344 | ); | 362 | ); |
345 | 363 |