'description'=>t('A blog is a regularly updated journal or diary made up of individual posts shown in reversed chronological order. Each member of the site may create and maintain a blog.'),
)
);
}
/**
...
...
@@ -72,8 +78,6 @@ function blog_help($section) {
return$output;
case'admin/settings/modules#description':
returnt('Enables keeping an easily and regularly updated web page or a blog.');
case'node/add#blog':
returnt("A blog is a regularly updated journal or diary made up of individual posts shown in reversed chronological order. Each member of the site may create and maintain a blog.");
'description'=>t("A book is a collaborative writing effort: users can collaborate writing the pages of the book, positioning the pages in the right order, and reviewing or modifying pages previously written. So when you have some information to share or when you read a page of the book and you didn't like it, or if you think a certain page could have been written better, you can do something about it."),
)
);
}
/**
...
...
@@ -83,10 +89,6 @@ function book_menu($may_cache) {
$items=array();
if($may_cache){
$items[]=array(
'path'=>'node/add/book',
'title'=>t('book page'),
'access'=>user_access('create book pages'));
$items[]=array(
'path'=>'admin/content/book',
'title'=>t('books'),
...
...
@@ -224,6 +226,7 @@ function book_submit(&$node) {
* Implementation of hook_form().
*/
functionbook_form(&$node){
$type=node_get_types('type',$node);
if($node->nid&&!$node->parent&&!user_access('create new books')){
@@ -1014,8 +1017,6 @@ function book_help($section) {
returnt('<p>The book module offers a means to organize content, authored by many users, in an online manual, outline or FAQ.</p>');
case'admin/content/book/orphan':
returnt('<p>Pages in a book are like a tree. As pages are edited, reorganized and removed, child pages might be left with no link to the rest of the book. Such pages are referred to as "orphan pages". On this page, administrators can review their books for orphans and reattach those pages as desired.</p>');
case'node/add#book':
returnt("A book is a collaborative writing effort: users can collaborate writing the pages of the book, positioning the pages in the right order, and reviewing or modifying pages previously written. So when you have some information to share or when you read a page of the book and you didn't like it, or if you think a certain page could have been written better, you can do something about it.");
$form['workflow']['comment_'.$form['type']['#value']]=array('#type'=>'radios','#title'=>t('Default comment setting'),'#default_value'=>variable_get('comment_'.$form['type']['#value'],COMMENT_NODE_READ_WRITE),'#options'=>array(t('Disabled'),t('Read only'),t('Read/Write')),'#description'=>t('Users with the <em>administer comments</em> permission will be able to override this setting.'));
returnt('<p>Containers help you organize your forums. The job of a container is to hold, or contain, other forums that are related. For example, a container named "Food" might hold two forums named "Fruit" and "Vegetables".</p>');
case'admin/content/forum/add/forum':
returnt('<p>A forum holds discussion topics that are related. For example, a forum named "Fruit" might contain topics titled "Apples" and "Bananas".</p>');
case'node/add#forum':
returnt('Create a new topic for discussion in the forums.');
}
}
...
...
@@ -107,7 +105,14 @@ function forum_menu($may_cache) {
$form['shadow']=array('#type'=>'checkbox','#title'=>t('Leave shadow copy'),'#default_value'=>$shadow,'#description'=>t('If you move this topic, you can leave a link in the old forum to the new forum.'));
$form['choice']['morechoices']=array('#type'=>'checkbox','#title'=>t('Need more choices'),'#default_value'=>0,'#description'=>t("If the amount of boxes above isn't enough, check this box and click the Preview button below to add some more."),'#weight'=>1);
db_query("INSERT INTO {node_access} VALUES (0, 0, 'all', 1, 0, 0)");
db_query("INSERT INTO {node_type} (type, name, module, description, help, has_title, title_label, has_body, body_label, min_word_count, custom, modified, locked, orig_type) VALUES ('page', 'page', 'node', 'If you want to add a static page, like a contact page or an about page, use a page.', '', 1, 'Title', 1, 'Body', 0, 1, 1, 0, 'page')");
db_query("INSERT INTO {node_type} (type, name, module, description, help, has_title, title_label, has_body, body_label, min_word_count, custom, modified, locked, orig_type) VALUES ('story', 'story', 'node', '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.', '', 1, 'Title', 1, 'Body', 0, 1, 1, 0, 'story')");
db_query("INSERT INTO {filter_formats} (name, roles, cache) VALUES ('Filtered HTML',',1,2,',1)");
db_query("INSERT INTO {filter_formats} (name, roles, cache) VALUES ('PHP code','',0)");
db_query("INSERT INTO {filter_formats} (name, roles, cache) VALUES ('Full HTML','',1)");
...
...
@@ -2908,3 +2929,99 @@ function system_update_187() {
}
return$ret;
}
functionsystem_update_188(){
// Add ability to create dynamic node types like the CCK module
$ret=array();
switch($GLOBALS['db_type']){
case'mysqli':
case'mysql':
// Create node_type table
$ret[]=update_sql("CREATE TABLE {node_type} (
type varchar(32) NOT NULL,
name varchar(255) NOT NULL,
module varchar(255) NOT NULL,
description mediumtext NOT NULL,
help mediumtext NOT NULL,
has_title tinyint(3) unsigned NOT NULL,
title_label varchar(255) NOT NULL default '',
has_body tinyint(3) unsigned NOT NULL,
body_label varchar(255) NOT NULL default '',
min_word_count smallint(4) unsigned NOT NULL,
custom tinyint(1) NOT NULL DEFAULT '0',
modified tinyint(1) NOT NULL DEFAULT '0',
locked tinyint(1) NOT NULL DEFAULT '0',
orig_type varchar(255) NOT NULL default '',
PRIMARY KEY (type)
) /*!40100 DEFAULT CHARACTER SET utf8 */;");
break;
case'pgsql':
$ret[]=update_sql("CREATE TABLE {node_type} (
type varchar(32) NOT NULL,
name varchar(255) NOT NULL,
module varchar(255) NOT NULL,
description text NOT NULL,
help text NOT NULL,
has_title integer unsigned NOT NULL,
title_label varchar(255) NOT NULL default '',
has_body integer unsigned NOT NULL,
body_label varchar(255) NOT NULL default '',
min_word_count integer unsigned NOT NULL,
custom smallint NOT NULL DEFAULT '0',
modified smallint NOT NULL DEFAULT '0',
locked smallint NOT NULL DEFAULT '0',
orig_type varchar(255) NOT NULL default '',
PRIMARY KEY (type)
);");
break;
}
// Insert default user-defined node types into the database.
$types=array(
array(
'type'=>'page',
'name'=>t('page'),
'module'=>'node',
'description'=>t('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,
),
array(
'type'=>'story',
'name'=>t('story'),
'module'=>'node',
'description'=>t('Stories are articles in their simplest form: they have a title, a teaser and a body, but can be extendd 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,
)
);
foreach($typesas$type){
$type=(object)_node_type_set_defaults($type);
node_type_save($type);
}
cache_clear_all();
system_modules();
menu_rebuild();
node_types_rebuild();
// Migrate old values for 'minimum_x_size' variables to the node_type table.
$query=db_query('SELECT type FROM {node_type}');
while($result=db_fetch_object($query)){
$variable_name='minimum_'.$result->type.'_size';
if($value=db_fetch_object(db_query("SELECT value FROM {variable} WHERE name = '%s'",$variable_name))){
$value=(int)unserialize($value->value);
db_query("UPDATE {node_type} SET min_word_count = %d, modified = %d WHERE type = '%s'",$value,1,$result->type);