I'm trying to create a module which should create a new content-type. I've managed to actually add a node-type, but there are no fields but the default ones, and I figured out why: my hook_form never gets executed.
My test-code:
<?php
// hook_disable() implementation
function contenttypetest_disable(){
error_log('hook_disable called!');
node_type_delete('contenttypetest_node');
}
// hook_uninstall() implementation
function contenttypetest_uninstall(){
error_log('hook_uninstall called!');
node_type_delete('contenttypetest_node');
}
// hook_form implementation
function contenttypetest_form(&$node, $form_state){
error_log('hook_form called!');
$type = node_type_get_type($node);
$form = array();
$form['title'] = array(
'#type' => 'textfield',
'#title' => check_plain($type->title_label),
'#default_value' => !empty($node->title) ? $node->title : '',
'#weight' => -5,
);
$form['contenttypetest_pass'] = array(
'#type' => 'password',
'#title' => t('Type a password'),
'#description' => t('You can type anything you like.'),
);
$form['contenttypetest_veld'] = array(
'#type' => 'file',