function xmlrpc_example_alter_form in Examples for Developers 7
Present a form to enable/disable the code implemented in hook_xmlrpc_alter.
Related topics
1 string reference to 'xmlrpc_example_alter_form'
- xmlrpc_example_menu in xmlrpc_example/
xmlrpc_example.module - Implements hook_menu().
File
- xmlrpc_example/
xmlrpc_example.module, line 689 - Module file for xmlrpc_example module.
Code
function xmlrpc_example_alter_form() {
$form = array();
$form['explanation'] = array(
'#markup' => '<div>' . t('This is a configuration form to enable the alteration of XML-RPC methods using hook_xmlrpc_alter.<br />hook_xmlrpc_alter() can be used to alter the current defined methods by other modules. In this case as demonstration, we will overide current add and subtraction methods with others not being limited. Remember that this hook is optional and is not required to create XMLRPC services.<br />') . '</div>',
);
$form['xmlrpc_example_alter_enabled'] = array(
'#type' => 'checkbox',
'#title' => t('Overide current xmlrpc_example.add and xmlrpc_example.subtraction methods'),
'#description' => t('If this checkbox is enabled, the default methods will be replaced with custom methods that ignore the XML-RPC server maximum and minimum restrictions.'),
'#default_value' => variable_get('xmlrpc_example_alter_enabled', 0),
);
$form['info'] = array(
'#markup' => '<div>' . t('Use the <a href="!link">client submission form</a> to see the results of checking this checkbox', array(
'!link' => url('examples/xmlrpc/client'),
)) . '</div>',
);
return system_settings_form($form);
}