Пример #1
0
 /**
  *
  * Check the allowed using of input elements in a function  
  * @param 		array		$inputArray	Input Array with search elements
  * @param 		string		$function Currently function 
  * @return ErrorException
  */
 public static function isPossibleInputElementOfFunction($inputArray, $function)
 {
     $possibleElements = GR4PHP_Template::possibleInputValuesByFunction($function);
     try {
         foreach ((array) $inputArray as $element => $value) {
             if (!in_array($element, $possibleElements)) {
                 throw new GR4PHP_Exception("The element -" . $element . "- is not allowed in function: " . $function . ". Please check the manual!");
             }
         }
     } catch (GR4PHP_Exception $e) {
         echo "<b>Error: " . $e->getMessage() . "</b>";
         exit;
     }
 }
Пример #2
0
echo $str;
echo "<br /><br />";
?>
Keys of array:&nbsp;
<input  name="array1" size="50" type="text" value="<?php 
echo $array1;
?>
"/>
Values of array:&nbsp;
<input  name="array2" size="50" type="text" value="<?php 
echo $array2;
?>
"/>
<br />
<i>Possible keys:&nbsp; <?php 
echo getArray2String(GR4PHP_Template::possibleInputValuesByFunction($function));
?>
</i>
<br />
<br />
Which elements would you like to see?:&nbsp;
<input  name="array3" size="50" type="text" value="<?php 
echo $array3;
?>
"/>
<br />
<i>Possible SELECT-elements are:&nbsp; <?php 
echo str_replace("?", "", getArray2String(array_merge((array) GR4PHP_Template::getSelectPartsByFunction("general"), (array) GR4PHP_Template::getSelectPartsByFunction($function))));
?>
</i>
<br />