DrupalBin
Submit Code
About
Recent Posts
How do i make this work in D6 (I have to clear the cache everytime to see the tabs)
2 hours 47 min
ago
Code
3 hours 42 min
ago
Code
7 hours 41 min
ago
oopsie in modules/taxonomy/taxonomy.test
9 hours 39 min
ago
more
Tags
CCK
drupal
fapi
jquery
menu
module
Panels
php
simpletest
test
theme
views
more tags
User login
Log in using OpenID:
What is OpenID?
Username:
*
Password:
*
Create new account
Request new password
Log in using OpenID
Cancel OpenID login
Home
Fix for Drupal Execute progrmatically
View
Download
Fix
This fix will not be saved to the database until you submit.
Summary:
Tags:
Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Source code:
*
// Insert default user-defined node types into the database. // For a complete list of available node type attributes, refer to the node // type API documentation at: // http://api.drupal.org/api/HEAD/function/hook_node_info $types = array( array( 'type' => 'page', 'name' => st('Page'), 'module' => 'node', 'description' => st('If you want to add a static page, like a contact page or an about page, use a page.'), 'custom' => TRUE, 'modified' => TRUE, 'locked' => FALSE, 'og_content_type_usage' => 'omitted', ), array( 'type' => 'story', 'name' => st('Story'), 'module' => 'node', 'description' => st('Stories are articles in their simplest form: they have a title, a teaser and a body, but can be extended by other modules. The teaser is part of the body too. Stories may be used as a personal blog or for news articles.'), 'custom' => TRUE, 'modified' => TRUE, 'locked' => FALSE, 'og_content_type_usage' => 'group_post_standard_mail', ), array( 'type' => 'school_community', 'name' => st('School Community'), 'module' => 'node', 'description' => st('This is a system community that is created for a specific school.'), 'custom' => TRUE, 'modified' => TRUE, 'locked' => TRUE, 'og_content_type_usage' => 'group', ), array( 'type' => 'user_community', 'name' => st('User Community'), 'module' => 'node', 'description' => st('A community that anyone can create.'), 'custom' => TRUE, 'modified' => TRUE, 'locked' => TRUE, 'og_content_type_usage' => 'group', ), array( 'type' => 'wiki_page_public', 'name' => st('Public Wiki Page'), 'module' => 'node', 'description' => st('A Public Wiki page that anyone can edit.'), 'custom' => TRUE, 'modified' => TRUE, 'locked' => TRUE, 'og_content_type_usage' => 'omitted', ), array( 'type' => 'wiki_page_private', 'name' => st('Private Wiki Page'), 'module' => 'node', 'description' => st('A Private Wiki page that only the group members in the group the page is posted to can view and/or edit it.'), 'custom' => TRUE, 'modified' => TRUE, 'locked' => TRUE, 'og_content_type_usage' => 'group_post_wiki_mail', ), ); foreach ($types as $type) { $type = (object) _node_type_set_defaults($type); node_type_save($type); if(isset($type->og_content_type_usage)) { variable_set('og_content_type_usage_' . $type->type, $type->og_content_type_usage); } } // Default page to not be promoted and have comments disabled. variable_set('node_options_page', array('status')); variable_set('comment_page', COMMENT_NODE_DISABLED);
Syntax highlighting mode:
ActionScript
ColdFusion
Diff
Drupal
Drupal 5
Drupal 6
HTML
Javascript
MySQL
PHP
Python
robots.txt
SQL
Text
Select the syntax highlighting mode to use.