/** * generating hidden items of request form * * Function generates hidden items of request form * * @param array $newparam data for hidden items, * where keys of array are names of variables * and values of arry are values of variables * @param bool $pass_all defines unsetting of value of request data named 'action' */ public static function form($newparam = array(), $pass_all = false) { if ($pass_all) { $arr = $_REQUEST; unset($arr['action']); } else { $arr = SJB_HelperFunctions::unset_unnecessary($_REQUEST); } foreach ($newparam as $name => $value) { $arr[$name] = $value; } foreach ($arr as $k => $v) { if (is_array($v)) { continue; } $arr[$k] = htmlspecialchars($v); } return SJB_HelperFunctions::array_to_string($arr, '<input type="hidden" name="', '" value="', '" />' . "\n"); }