Guest User

Untitled

a guest
Apr 23rd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.41 KB | None | 0 0
  1. $actions = array(
  2.     'cron' => array(
  3.       'title' => t('Index @count queued items', array('@count' => $status['remaining'])),
  4.       'description' => t('Indexes as much as one cron invocation'),
  5.       'disabled' => TRUE,
  6.     ),
  7.     'remaining' => array(
  8.       'title' => t('Index all queued content'),
  9.       'description' => t('Starts a batch job which could take a long time and could put an increased load on your server.'),
  10.       'disabled' => TRUE,
  11.     ),
  12.     'reindex' => array(
  13.       'title' => t('Queue all content for reindexing'),
  14.       'disabled' => FALSE,
  15.     ),
  16.     'delete' => array(
  17.       'title' => t('Delete the Solr index'),
  18.       'description' => t('Useful with a corrupt index or a new schema.xml.'),
  19.       'disabled' => FALSE,
  20.     ),
  21.   );
  22.   foreach ($actions as $key => $action) {
  23.     // Generate the parents as the autogenerator does, so we will have a
  24.     // unique id for each radio button.
  25.     $form['action'][$key] = array(
  26.       '#type' => 'radio',
  27.       '#title' => check_plain($action['title']),
  28.       //'#default_value' => 'cron',
  29.       '#return_value' => $key,
  30.       '#parents' => array('action'),
  31.       '#description' => (!empty($action['description'])) ? check_plain($action['description']) : '',
  32.       '#id' => drupal_clean_css_identifier('edit-' . implode('-', array('action', $key))),
  33.       '#disabled' => isset($action['disabled']) ? $action['disabled'] : FALSE,
  34.     );
  35.   }
Add Comment
Please, Sign In to add comment