Commit d733eb83d2418538f2a609d3115bd79587ff646d

Authored by Benjamin Renard
2 parents 00881ee3 1e653e6f

Merge branch 'master' into expression-parser-bre

src/InputOutput/IHMImpl/Params/IHMInputOutputParamsAbstractClass.php
... ... @@ -61,8 +61,9 @@ abstract class IHMInputOutputParamsAbstractClass implements InputOutputInterface
61 61 {
62 62 case "TimeTable" :
63 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 67 $crtIndex = 0;
67 68 foreach ($input->timeTables as $tt)
68 69 {
... ...
src/InputOutput/IHMImpl/Tools/IHMParamTemplateClass.php
... ... @@ -18,6 +18,7 @@ class IHMParamTemplateClass
18 18 protected static $paramTemplateArgumentKeyAtt = 'key';
19 19 protected static $paramTemplateArgumentNameAtt = 'name';
20 20 protected static $paramTemplateArgumentTypeAtt = 'type';
  21 + protected static $paramTemplateArgumentSubTypeAtt = 'subtype';
21 22 protected static $paramTemplateArgumentMinKeyAtt = 'minkey';
22 23 protected static $paramTemplateArgumentMaxKeyAtt = 'maxkey';
23 24 protected static $paramTemplateArgumentNameTplAtt = 'nametpl';
... ... @@ -93,12 +94,27 @@ class IHMParamTemplateClass
93 94 case 'bool' :
94 95 $args_format .= "%d";
95 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 111 default:
97 112 $args_format .= "%s";
98 113 }
99 114 }
100 115  
101 116 $exploded_args = sscanf($template_args_str , $args_format);
  117 + error_log($exploded_args);
102 118  
103 119 if ($exploded_args === -1)
104 120 return FALSE;
... ... @@ -329,6 +345,7 @@ class IHMParamTemplateClass
329 345 $argumentKey = $argumentNode->getAttribute(self::$paramTemplateArgumentKeyAtt);
330 346 $argumentName = $argumentNode->getAttribute(self::$paramTemplateArgumentNameAtt);
331 347 $argumentType = $argumentNode->getAttribute(self::$paramTemplateArgumentTypeAtt);
  348 + $argumentSubType = $argumentNode->getAttribute(self::$paramTemplateArgumentSubTypeAtt);
332 349 $argumentDefault = $argumentNode->getAttribute(self::$paramTemplateArgumentDefaultAtt);
333 350 $argumentMinKey = $argumentNode->getAttribute(self::$paramTemplateArgumentMinKeyAtt);
334 351 $argumentMaxKey = $argumentNode->getAttribute(self::$paramTemplateArgumentMaxKeyAtt);
... ... @@ -340,6 +357,7 @@ class IHMParamTemplateClass
340 357 $arguments[$argumentKey] = array(
341 358 "name" => (empty($argumentName) ? $argumentKey : $argumentName),
342 359 "type" => $argumentType,
  360 + "subtype" => $argumentSubType,
343 361 "default" => $argumentDefault
344 362 );
345 363  
... ...