You are here

function workspace_configure_form in Workspace 7

Same name and namespace in other branches
  1. 5 workspace.module \workspace_configure_form()
  2. 6 workspace.module \workspace_configure_form()

Form definition for per-user configuration form.

1 string reference to 'workspace_configure_form'
workspace_configure in ./workspace.module
Menu callback. The configuration page.

File

./workspace.module, line 201
Presents a user-centric view of content.

Code

function workspace_configure_form($form, &$form_state, $account) {
  $defaults = workspace_user_config_get_defaults();
  $workspace = variable_get('workspace_user_config_' . $account->uid, array());
  $form['maxnodes'] = array(
    '#type' => 'textfield',
    '#title' => t('Number of items'),
    '#description' => t('Maximum number of items to display in your workspace.'),
    '#default_value' => isset($workspace['maxnodes']) && $workspace['maxnodes'] ? $workspace['maxnodes'] : $defaults['maxnodes'],
    '#size' => 4,
  );
  $form['maxfilenames'] = array(
    '#type' => 'textfield',
    '#title' => t('Number of files'),
    '#description' => t('Maximum number of filenames to display in your workspace.'),
    '#default_value' => isset($workspace['maxfilenames']) && $workspace['maxfilenames'] ? $workspace['maxfilenames'] : $defaults['maxfilenames'],
    '#size' => 4,
  );
  if (module_exists('comment')) {
    $form['maxcomments'] = array(
      '#type' => 'textfield',
      '#title' => t('Number of comments'),
      '#description' => t('Maximum number of comments to display in your workspace.'),
      '#default_value' => isset($workspace['maxcomments']) && $workspace['maxcomments'] ? $workspace['maxcomments'] : $defaults['maxcomments'],
      '#size' => 4,
    );
  }
  $form['uid'] = array(
    '#type' => 'value',
    '#value' => $account->uid,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save configuration'),
  );
  return $form;
}