Hello - I am pretty new to the Drupal scene (2 weeks), but I felt like I was learning pretty quickly; however, I've hit a pretty big problem that I'm not sure how to approach. I created a custom module that is supposed to display a business name, its location, and a
wry comment" about it. It is as follows:
/
/**
* Implementation of hook_node_info().
*/
function biz_node_info() {
return array('biz' => array('name' => t('Suburban Business'), 'base' => 'biz'));
}
/**
* Implementation of hook_perm().
*/
function biz_perm() {
return array('create suburban business', 'edit own suburban business');
}
/**
* Implementation of hook_access().
*/
function biz_access($op, $node) {
global $user;
if ($op == 'create') {
return user_access('create suburban business');
}
if ($op == 'update' || $op == 'delete') {
if (user_access('edit own suburban business') && ($user->uid == $node->uid)) {
return TRUE;
}
}
}
/**
* Implementation of hook_menu().
*/
function biz_menu($may_cache) {
$items = array();
if ($may_cache) {
$items[] = array('path' => 'node/add/biz', 'title' => t('Suburban Business'),
'access' => user_access('create suburban business'));
}
return $items;
}
/**
* Implementation of hook_form().
*/
function biz_form(&$node) {
//$form['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#required' => TRUE, '#default_value' => $node->title, '#rows' => 1, '#required' => TRUE);