You are here

function cer_update_form in Corresponding Entity References 7

Same name and namespace in other branches
  1. 7.2 cer.admin.inc \cer_update_form()

The update form. Allows updating of current entitys.

1 string reference to 'cer_update_form'
cer_menu in ./cer.module
Implements hook_menu().

File

./cer.admin.inc, line 134
Admin functionality, separated for performance purposes.

Code

function cer_update_form() {
  $form = array();
  $form['intro'] = array(
    '#value' => t('This will update all the existing entitys for the selected content types so that their entity reference fields are in sync.') . '<br />' . t('This process may take a long time depending on the number of entitys you are updating.') . '<br />' . t('When the process is finished you will see a count of the number of entitys that were updated.'),
  );
  $options = entity_get_info();
  foreach ($options as $type => $class) {
    $options[$type] = $class['label'];
  }
  $form['type'] = array(
    '#type' => 'select',
    '#title' => t('Entity types'),
    '#options' => $options,
    '#description' => t('Select the entity type that you want to update.'),
  );
  $form['limit'] = array(
    '#type' => 'select',
    '#title' => t('Number of entities to process at once'),
    '#options' => array(
      10 => t('10'),
      20 => t('20'),
      30 => t('30'),
      50 => t('50'),
      75 => t('75'),
      100 => t('100'),
      125 => t('125'),
      150 => t('150'),
      200 => t('200'),
      250 => t('250'),
      300 => t('300'),
      350 => t('350'),
      400 => t('400'),
      450 => t('450'),
      500 => t('500'),
    ),
    '#default_value' => 50,
    '#description' => t('This process is done in batches. This is the number of entitys processed in each batch. If necessary, reduce the number of entitys to prevent timeouts and memory errors while processing.'),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => 'submit',
  );
  return $form;
}