array('name' => t('page'), 'base' => 'page')); } /** * Implementation of hook_access(). */ function page_access($op, $node) { global $user; if ($op == 'create') { return user_access('create pages'); } if ($op == 'update' || $op == 'delete') { if (user_access('edit own pages') && ($user->uid == $node->uid)) { return TRUE; } } } /** * Implementation of hook_menu(). */ function page_menu($may_cache) { $items = array(); if ($may_cache) { $items[] = array('path' => 'node/add/page', 'title' => t('page'), 'access' => page_access('create', NULL)); } return $items; } /** * Implementation of hook_validate(). */ function page_validate(&$node) { node_validate_title($node); } /** * Implementation of hook_form(). */ function page_form(&$node) { $form['title'] = array(type => 'textfield', title => t('Title'), size => 60, maxlength => 128, required => TRUE, default_value => $node->title); if (function_exists('taxonomy_node_form')) { $form['taxonomy'] = taxonomy_node_form('page', $node); } $form['body'] = array( type => 'textarea', title => t('Body'), default_value => $node->body, required => TRUE ); $form = array_merge($form, filter_form($node->format)); $form['log'] = array( type => 'textarea', title => t('Log message'), default_value => $node->log, rows => 5, description => t('An explanation of the additions or updates being made to help other authors understand your motivations.') ); return $form; }