You are here

function workspace_form in Workspace 5

1 call to workspace_form()
_workspace_addform in ./workspace.module
1 string reference to 'workspace_form'
_workspace_addform in ./workspace.module

File

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

Code

function workspace_form() {
  global $user;
  $description = t('Choose what kind of content you would like to add.') . ' [' . l(t('help'), 'node/add') . ']';
  $select = t('Select...');
  $options = array(
    $select => $select,
  );
  foreach (node_get_types() as $type => $typeobject) {
    if (module_invoke(node_get_types('module', $type), 'access', 'create', $type)) {
      $options[$type] = $typeobject->name;
    }
  }
  $form = array();
  $form['content_type'] = array(
    '#type' => 'select',
    '#title' => t('Add content'),
    '#options' => $options,
    '#description' => $description,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Add new item'),
  );
  return $form;
}