public static function open($form_name, $action_url = "", $method = "POST", $default_azione = "") { fg_ex_param_defined_not_empty($form_name, "Il nome della form deve essere specificato."); if (self::$current_form == null) { self::$current_form = $form_name; } else { throw new Exception("Una form risulta gia aperta."); } if (!isset($action_url) || $action_url == "") { $action_url = $_SERVER['PHP_SELF']; } ?> <form name="<?php echo $form_name; ?> " method="<?php echo $method; ?> " action="<?php echo $action_url; ?> "> <input id="<?php echo Form::$current_form; ?> _id_azione_form" type="hidden" name="azione" value="<?php echo $default_azione; ?> " > <?php }
function fg_session_get_session_type_from_tipo_profilo($tipo_profilo) { fg_ex_param_defined_not_empty($tipo_profilo, "Il tipo del profilo deve essere specificato."); switch ($tipo_profilo) { case FG_TIPO_PROFILO_ADMIN: return FG_SESSION_TYPE_ADMIN; case FG_TIPO_PROFILO_ESHOP: return FG_SESSION_TYPE_CUSTOMER; default: throw new Exception("Tipo di profilo non previsto per la sessione : " . $tipo_profilo); } }
function fg_is_form_post($form_command) { fg_ex_param_defined_not_empty($form_command, "Il comando del POST deve essere specificato."); if (isset($_POST['azione'])) { if ($_POST['azione'] == $form_command) { return true; } } return false; }