'node/add/family-individual', 'title' => t('Family: Individual'), 'access' => user_access('create family nodes') ); /* $items[] = array( * 'path' => 'node/add/family-group', * 'title' => t('Family: Group'), * 'access' => user_access('create family nodes') * ); * $items[] = array( * 'path' => 'node/add/family-location', * 'title' => t('Family: Location'), * 'access' => user_access('create family nodes') * ); */ $items[] = array( 'path' => 'family', 'title' => t('Family'), 'type' => MENU_ITEM_GROUPING, 'access' => user_access('access family nodes'), ); /* $items[] = array( 'path' => 'admin/content/family_import', 'title' => t('Family Import'), 'description' => 'Import your family tree from a standard GED file.', * 'callback' => 'family_import', * 'access' => user_access('administer family'), * ); * $items[] = array( * 'path' => 'admin/settings/family_privacy', * 'title' => t('Family Privacy Settings'), * 'description' => 'Protect living relatives with auto privacy.', * 'callback' => 'family_auto_privacy', * 'access' => user_access('administer family'), * ); * $items[] = array( * 'path' => 'admin/settings/family_privacy_done', * 'title' => t('Auto Privacy Done'), * 'callback' => 'family_auto_privacy_done', * 'type' => MENU_CALLBACK, * 'access' => user_access('administer family'), * ); * $items[] = array( * 'path' => 'admin/content/family_import_done', * 'title' => t('Import Done'), * 'callback' => 'family_import_done', * 'type' => MENU_CALLBACK, * 'access' => user_access('administer family'), * ); */ $items[] = array( 'path' => 'family/view', 'title' => t('Index'), 'callback' => 'family_view_record', 'access' => user_access('access family nodes'), ); /* $items[] = array( * 'path' => 'family/view/source', * 'title' => t('View Source'), * 'callback' => 'family_view_source', * 'type' => MENU_CALLBACK, * 'access' => user_access('access family') * ); * $items[] = array( * 'path' => 'family/view/citation', * 'title' => t('View Citation'), * 'callback' => 'family_view_citation', * 'type' => MENU_CALLBACK, * 'access' => user_access('access family') * ); */ $items[] = array( 'path' => 'family/tree', 'title' => t('Family Tree Diagrams'), 'callback' => 'family_view_tree', 'access' => user_access('access family'), ); return $items; } } // function family_menu() /** * Implementation of hook_info(). */ function family_node_info() { return array( 'family_individual' => array( 'name' => t('Family: Individual'), 'module' => 'family_individual', 'description' => t('A node representing a person.') ), 'family_group' => array( 'name' => t('Family: Group'), 'module' => 'family_group', 'description' => t('A node representing a single grouping of parents and children.') ), 'family_location' => array( 'name' => t('Family: Location'), 'module' => 'family_location', 'description' => t('A geneological location.') ), ); } /** * Display help and module information * @param section which section of the site we're displaying help * @return help text for section */ function family_help($section='') { $output = ''; switch ($section) { case "admin/modules#description": $output = t("A complete archiving system for socio-historical data."); break; case "admin/modules#description": $output = t("A jolly exciting module for recording and archiving all aspects of your family's history."); break; case "node/add#family_individual": $output = t("A record of a single person. Part of the Family module."); break; case "node/add#family_group": $output = t("A record of a single grouping of parents and their children. Part of the family module"); break; case "node/add#family_location": $output = t("A record of a single location, which may be contained in other locations in a hierarchy. Part of the Family module."); break; } return $output; } // function family_help($section='') /** * Implementation of hook_perm(). */ function family_perm() { return array( 'access family nodes', 'access family private records', 'create family nodes', 'edit family nodes', 'edit own family nodes', 'administer family' ); } // function family_perm() /** * Implementation of hook_access(). */ function family_access($op, $node) { global $user; if ($op == 'create') { return user_access('create family nodes'); } if ($op == 'update' || $op == 'delete') { if (user_access('edit own family nodes') && ($user->uid == $node->uid)) { return TRUE; } if (user_access('edit family nodes')) { return TRUE; } } if ($op == 'view') { return (user_access('access family nodes')); } } // function family_access() /** * Implementation of hook_user(). */ /*function family_user($op, &$edit, &$account, $category = NULL) { * * switch ($op) { * * case ('insert'): * case ('update'): * case ('submit'): * case ('login'): * case ('logout'): * case ('delete'): * break; * * case ('form'): * if ($category == 'account') { * $form['family'] = array( * '#type' => 'fieldset', * '#title' => t('Family association'), * '#collapsible' => TRUE, * '#weight' => 4); * $form['family']['family_link'] = array( * '#type' => 'textfield', * '#title' => t('My family link'), * '#default_value' => $edit['family_link'], * '#description' => t('The node number for the family_individual that represents you.')); * $form['family']['family_tree_root'] = array( * '#type' => 'textfield', * '#title' => t('Tree root individual'), * '#default_value' => $edit['family_tree_root'], * '#description' => t('The node number for the family_individual that your default tree is based on.')); * $form['family']['family_tree_type'] = array( * '#type' => 'select', * '#options' => array( * 'ANS' => 'Ancestry', * 'DESC' => 'Descendency', * 'PED' => 'Pedigree', ), * '#default_value' => $edit['family_tree_type'], * '#description' => t('The type of tree you prefer to see by default.')); * $form['family']['family_tree_depth'] = array( * '#type' => 'textfield', * '#title' => t('Tree depth'), * '#default_value' => $edit['family_tree_depth'], * '#description' => t('The number of degrees to show on your default family tree.')); * } * return $form; * case ('view'): * return array( * t("Family Association") => array( * array('title' => t("My family link"), 'value' => l("Me","node/".$account->family_link)), * # description => t('The node number for the family_individual that represents you.')); * array('title' => t("Tree root individual"), 'value' => l("root","node/".$account->family_tree_root)), * # description => t('The node number for the family_individual that your default tree is based on.')); * array('title' => t("Tree type"), 'value' => $account->family_tree_type), * # description => t('The type of tree you prefer to see by default.')); * array('title' => t("Tree depth"), 'value' => $account->family_tree_depth), * # description => t('The number of degrees to show on your default family tree.')); * )); * } *}*/