Exemplo n.º 1
0
    private function get_form_method_parameters_fields($post_arr, $form_arr)
    {
        if (empty($this->_method) or empty($form_arr) or !is_array($form_arr) or empty($form_arr['form_name']) or empty($post_arr['func']) or !($func_details = $this->_method->valid_functionality($post_arr['func'])) or empty($func_details['request_structure'])) {
            return '';
        }
        $post_arr = self::validate_post_data($post_arr);
        /** @var S2P_SDK_Scope_Structure $structure_obj */
        $structure_obj = $func_details['request_structure'];
        if ($method_definition = $structure_obj->get_validated_definition()) {
            if (empty($func_details['mandatory_in_request']) or !($mandatory_arr = $structure_obj->transfrom_keys_to_internal_names($func_details['mandatory_in_request']))) {
                $mandatory_arr = array();
            }
            if (empty($func_details['hide_in_request']) or !($hide_keys_arr = $structure_obj->transfrom_keys_to_internal_names($func_details['hide_in_request']))) {
                $hide_keys_arr = array();
            }
            ob_start();
            ?>
            <fieldset id="method_parameters">
            <label for="method_parameters"><a href="javascript:void(0);" onclick="toggle_container( 'method_parameters_container' )"><strong><?php 
            echo self::s2p_t('Method parameters');
            ?>
</strong></a></label>
            <div id="method_parameters_container" style="display: block;">

            <?php 
            echo $this->get_form_method_parameters_fields_detailed($method_definition, $mandatory_arr, $hide_keys_arr, $post_arr, $form_arr);
            ?>

            </div>
            </fieldset>
            <?php 
            $buf = ob_get_clean();
            return $buf;
        }
        return '';
    }