node_example.module
Version
1.11.2.2 (checked in on 2005/08/25 at 04:27:13 by webchick)
Description
This is an example outlining how a module can be used to define a new node type.
Our example node type will allow users to specify a "color" and a "quantity" for their nodes; some kind of rudimentary inventory-tracking system, perhaps? To store this extra information, we need an auxiliary database table.
Database definition:
<?php
CREATE TABLE node_example (
nid int(10) unsigned NOT NULL default '0',
color varchar(255) NOT NULL default '',
quantity int(10) unsigned NOT NULL default '0',
PRIMARY KEY (nid)
)
?>
Functions
| Name | Description |
|---|---|
| node_example_access | Implementation of hook_access(). |
| node_example_delete | Implementation of hook_delete(). |
| node_example_form | Implementation of hook_form(). |
| node_example_help | Implementation of hook_help(). |
| node_example_insert | Implementation of hook_insert(). |
| node_example_link | Implementation of hook_link(). |
| node_example_load | Implementation of hook_load(). |
| node_example_menu | Implementation of hook_menu(). |
| node_example_node_name | Implementation of hook_node_name(). |
| node_example_perm | Implementation of hook_perm(). |
| node_example_update | Implementation of hook_update(). |
| node_example_validate | Implementation of hook_validate(). |
| node_example_view | Implementation of hook_view(). |
| theme_node_example_order_info | A custom theme function. |
