function page_manager_node_add

Callback to handle the process of adding a node.

This creates a basic $node and passes that off to page_manager_node_edit(). It is modelled after Drupal's node_add() function.

Unlike node_add() we do not need to check node_access because that was already checked by the menu system.

1 string reference to 'page_manager_node_add'
page_manager_node_edit_menu_alter in page_manager/plugins/tasks/node_edit.inc
Callback defined by page_manager_node_edit_page_manager_tasks().

File

page_manager/plugins/tasks/node_edit.inc, line 135

Code

function page_manager_node_add($type) {
    global $user;
    $types = node_type_get_types();
    // Initialize settings:
    $node = (object) array(
        'uid' => $user->uid,
        'name' => isset($user->name) ? $user->name : '',
        'type' => $type,
        'language' => LANGUAGE_NONE,
    );
    drupal_set_title(t('Create @name', array(
        '@name' => $types[$type]->name,
    )), PASS_THROUGH);
    return page_manager_node_edit($node);
}