You are here

function services_entity_settings_form in Services Entity API 7.2

Admin settings form for picking the class for entity resources.

1 string reference to 'services_entity_settings_form'
services_entity_menu in ./services_entity.module
Implements hook_menu()

File

./services_entity.module, line 23

Code

function services_entity_settings_form($form, $form_state) {
  $resources = services_entity_get_resource_info();
  foreach ($resources as $id => $resource) {
    $options[$resource['class']] = '<strong>' . $resource['title'] . '</strong><div>' . $resource['description'] . '</div>';
  }
  $form['services_entity_resource_class'] = array(
    '#title' => 'Default Entity Resource Class',
    '#description' => 'Select which Resource Controller to use to process the entities where the entity type does not define one.',
    '#type' => 'radios',
    '#options' => $options,
    '#default_value' => variable_get('services_entity_resource_class', 'ServicesEntityResourceController'),
  );
  $form['services_entity_max_pagesize'] = array(
    '#title' => 'Maximum Page Size',
    '#description' => 'Enter the maximum number of items that can be returned per page of an index.',
    '#type' => 'textfield',
    '#default_value' => variable_get('services_entity_max_pagesize', 100),
  );
  return system_settings_form($form);
}