You are here

function workspace_add_form in Workspace 7

Same name and namespace in other branches
  1. 6 workspace.module \workspace_add_form()

Form definition for content addition form.

1 string reference to 'workspace_add_form'
workspace_list_content in ./workspace.module
Menu callback. Display list of content.

File

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

Code

function workspace_add_form($form, &$form_state) {
  $description = t('Choose what kind of content you would like to add.') . ' ' . l(t('Help?'), 'node/add');
  $options = workspace_get_types();
  if (!$options) {
    return array();
  }
  $form['add'] = array(
    '#type' => 'fieldset',
    '#prefix' => '<div class="container-inline">',
    '#suffix' => '</div>',
  );
  $form['add']['content_type'] = array(
    '#type' => 'select',
    '#options' => $options,
  );
  $form['add']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Add new item'),
    '#suffix' => $description,
  );
  return $form;
}