'#description'=>t('The human-readable name of this content type. This text will be displayed as part of the list on the <em>create content</em> page. It is recommended that this name consists only of lowercase letters, numbers, and <strong>spaces</strong>. The name must be unique to this content type.'),
'#required'=>TRUE,
);
if(!$type->locked){
$form['identity']['type']=array(
'#title'=>t('Type'),
'#type'=>'textfield',
'#default_value'=>$type->type,
'#maxlength'=>32,
'#required'=>TRUE,
'#description'=>t('The machine-readable name of this content type. This text will be used for constructing the URL of the <em>create content</em> page for this content type. It is recommended that this name consists only of lowercase letters, numbers, and <strong>underscores</strong>. Dashes are not allowed. Underscores will be converted into dashes when constructing the URL of the <em>create content</em> page. The name must be unique to this content type.'),
);
}
else{
$form['identity']['type']=array(
'#type'=>'value',
'#value'=>$type->type,
);
$form['identity']['type_display']=array(
'#title'=>t('Type'),
'#type'=>'item',
'#value'=>theme('placeholder',$type->type),
'#description'=>t('The machine-readable name of this content type. This field cannot be modified for system-defined content types.'),
);
}
$form['submission']=array(
'#type'=>'fieldset',
'#title'=>t('Submission form'),
'#collapsible'=>TRUE,
'#collapsed'=>FALSE,
);
if($type->has_title){
$form['submission']['title_label']=array(
'#title'=>t('Title field label'),
'#type'=>'textfield',
'#default_value'=>$type->title_label,
'#description'=>t('The label for the title field of this content type.'),
'#required'=>TRUE,
);
}
if($type->has_body){
$form['submission']['body_label']=array(
'#title'=>t('Body field label'),
'#type'=>'textfield',
'#default_value'=>$type->body_label,
'#description'=>t('The label for the body field of this content type.'),
'#required'=>TRUE,
);
}
$form['submission']['description']=array(
'#title'=>t('Description'),
'#type'=>'textarea',
'#default_value'=>$type->description,
'#description'=>t('A brief description of this content type. This text will be displayed as part of the list on the <em>create content</em> page.'),
);
$form['submission']['help']=array(
'#type'=>'textarea',
'#title'=>t('Explanation or submission guidelines'),
'#default_value'=>$type->help,
'#description'=>t('This text will be displayed at the top of the submission form for this content type. It is useful for helping or instructing your users.')
'#description'=>t('The minimum number of words for the body field to be considered valid for this content type. This can be useful to rule out submissions that do not meet the site\'s standards, such as short test posts.')
drupal_set_message(t('Changed the content type of %update_count %posts from %old_type to %type.',array('%update_count'=>$update_count,'%posts'=>format_plural($update_count,'post','posts'),'%old_type'=>theme('placeholder',$type->old_type),'%type'=>theme('placeholder',$type->type))));
cache_clear_all('filter:',TRUE);
}
}
}
$status=node_type_save($type);
// Remove everything that's been saved already - whatever's left is assumed
$message=t('Are you sure you want to delete the content type %type?',array('%type'=>theme('placeholder',$type->name)));
$caption='';
$num_nodes=db_num_rows(db_query("SELECT * FROM {node} WHERE type = '%s'",$type->type));
if($num_nodes){
$caption.='<p>'.t('<strong>Warning:</strong> there %are currently %num_nodes %type %nodes on your site. %they may not be able to be displayed or edited correctly, once you have removed this content type.',array('%are'=>format_plural($num_nodes,'is','are'),'%num_nodes'=>$num_nodes,'%type'=>theme('placeholder',$type->name),'%nodes'=>format_plural($num_nodes,'node','nodes'),'%they'=>format_plural($num_nodes,'It','They'))).'</p>';
}
$caption.='<p>'.t('This action cannot be undone.').'</p>';
* Enables the creation of pages that can be added to the navigation system.
*/
/**
* Implementation of hook_help().
*/
functionpage_help($section){
switch($section){
case'admin/help#page':
$output='<p>'.t('The page module allows users to create static pages, which are the most basic type of content. Pages are commonly collected in books via the book module. Users should create a page if the information on the page is static. An example would be an "about" page. ').'</p>';
$output.='<p>'.t('When a page is created, a user can set authoring information, configure publishing options, whether readers will be able to post comments. They can also select the content type of the page (e.g., full HTML, filtered HTML). ').'</p>';
$output.='<p>'.t('As an administrator, you can set the publishing default for a page (in its workflow): you can specify whether a page is by default published, sent to moderation, promoted to the front page, sticky at the top of lists, and whether revisions are enabled by default. You can set the permissions that different user roles have to view, create, and edit pages.').'</p>';
$output.='<p>'.t('If the location module is enabled, then location specific information can be added. If the trackback module is enabled trackbacks can be configured.').'</p>';
$output.=t('<p>You can</p>
<ul>
<li>read the node administration help at <a href="%admin-help-node">administer >> help >> node</a>.</li>
<li>read the page administration help at <a href="%admin-help-page">administer >> help >> page</a>.</li>
<li>read the story administration help at <a href="%admin-help-story">administer >> help >> story</a>.</li>
<li>create a page at <a href="%node-add-page">create content >> page</a>.</li>
<li>administer page content type at <a href="%admin-settings-content-types-page">administer >> settings >> content types >> configure page</a>.</li>
$output.='<p>'.t('For more information please read the configuration and customization handbook <a href="%page">Page page</a>.',array('%page'=>'http://drupal.org/handbook/modules/page/')).'</p>';
return$output;
case'admin/settings/modules#description':
returnt('Enables the creation of pages that can be added to the navigation system.');
case'node/add#page':
returnt('If you want to add a static page, like a contact page or an about page, use a page.');