function xmlrpc_example_client_form

Same name in other branches
  1. 7.x-1.x xmlrpc_example/xmlrpc_example.module \xmlrpc_example_client_form()

Present a form that makes use of xmlrpc services to add or subtract.

Related topics

1 string reference to 'xmlrpc_example_client_form'
xmlrpc_example_menu in xmlrpc_example/xmlrpc_example.module
Implementation of hook_menu(). Register all the demonstration forms.

File

xmlrpc_example/xmlrpc_example.module, line 222

Code

function xmlrpc_example_client_form() {
    $form = array();
    $form['explanation'] = array(
        '#markup' => "<div>" . t("The XMLRPC example demonstrates the use of the XMLRPC client in Drupal. <br/>It uses the xmlrpc() function to act as a client, calling itself for some defined methods.<br />An xmlrpc error will result if the result is out of bounds defined by the server.<br />") . "</div>",
    );
    $form['num1'] = array(
        '#type' => 'textfield',
        '#title' => t("Enter an integer"),
        '#default_value' => 2,
        '#size' => 5,
        '#required' => TRUE,
    );
    $form['num2'] = array(
        '#type' => 'textfield',
        '#title' => t("Enter a second integer"),
        '#default_value' => 2,
        '#size' => 5,
        '#required' => TRUE,
    );
    $form['add'] = array(
        '#type' => 'submit',
        '#value' => t("Add the integers"),
        '#submit' => array(
            'xmlrpc_example_client_add_submit',
        ),
    );
    $form['subtract'] = array(
        '#type' => 'submit',
        '#value' => t("Subtract the integers"),
        '#submit' => array(
            'xmlrpc_example_client_subtract_submit',
        ),
    );
    return $form;
}