function workspace_add_form_submit in Workspace 7
Same name and namespace in other branches
- 6 workspace.module \workspace_add_form_submit()
Submit handler for content addition form.
Simply redirects to appropriate node/add/* page.
See also
File
- ./
workspace.module, line 661 - Presents a user-centric view of content.
Code
function workspace_add_form_submit($form, $form_state) {
global $user;
$node_type = $form_state['values']['content_type'];
if ($node_type == t('Select...')) {
drupal_goto('node/add');
}
foreach (node_type_get_types() as $type => $object) {
if (node_access('create', $type, $user)) {
$options[$type] = $object->name;
}
if (isset($options[$node_type])) {
/* Start hack */
if (stristr($node_type, "_") > -1) {
$node_type = str_replace("_", "-", $node_type);
}
/* End hack */
drupal_goto('node/add/' . $node_type);
}
}
}