2006-07-13 13:14:25 +00:00
<?php
2006-07-14 01:05:10 +00:00
// $Id$
2006-07-13 13:14:25 +00:00
/**
* Return an array of the modules to be enabled when this profile is installed.
*
* @return
* An array of modules to be enabled.
*/
function default_profile_modules() {
2007-07-11 15:15:40 +00:00
return array('color', 'comment', 'help', 'menu', 'taxonomy', 'dblog', 'update');
2006-07-13 13:14:25 +00:00
}
/**
2007-01-03 11:10:58 +00:00
* Return a description of the profile for the initial installation screen.
*
* @return
* An array with keys 'name' and 'description' describing this profile.
2006-07-13 13:14:25 +00:00
*/
function default_profile_details() {
return array(
'name' => 'Drupal',
'description' => 'Select this profile to enable some basic Drupal functionality and the default theme.'
);
}
2007-01-03 11:10:58 +00:00
2007-05-10 19:55:24 +00:00
/**
* Return a list of tasks that this profile supports.
*
* @return
2007-05-15 15:29:49 +00:00
* A keyed array of tasks the profile will perform during
* the final stage. The keys of the array will be used internally,
* while the values will be displayed to the user in the installer
* task list.
2007-05-10 19:55:24 +00:00
*/
function default_profile_task_list() {
}
2007-01-03 11:10:58 +00:00
/**
* Perform any final installation tasks for this profile.
*
2007-05-15 15:29:49 +00:00
* The installer goes through the configure -> locale-import ->
* locale-batch -> finished -> done tasks in this order, if you
* don't implement this function in your profile.
*
* If this function is implemented, you can have any number of
* custom tasks to perform, implementing a state machine here to
* walk the user through those tasks, by setting $task to something
* other then the reserved tasks listed in install_reserved_tasks()
* and the 'profile' task this function gets called with for first
* time. If you implement your custom tasks, this function will get called
* in every HTTP request (for form processing, printing your
* information screens and so on) until you advance to the
* 'locale-import' task, with which you hand control back to the
* installer.
*
* You should define the list of custom tasks you implement by
* returning an array of them in hook_profile_task_list().
2007-05-10 19:55:24 +00:00
*
* Should a profile want to display a form here, it can; it should set
* the task using variable_set('install_task', 'new_task') and use
* the form technique used in install_tasks() rather than using
* drupal_get_form().
*
* @param $task
2007-05-15 15:29:49 +00:00
* The current $task of the install system. When hook_profile_tasks()
* is first called, this is 'profile'.
2007-05-10 19:55:24 +00:00
*
2007-01-03 11:10:58 +00:00
* @return
2007-05-15 15:29:49 +00:00
* An optional HTML string to display to the user. Only used if you
* modify the $task, otherwise discarded.
2007-01-03 11:10:58 +00:00
*/
2007-05-15 15:29:49 +00:00
function default_profile_tasks(&$task) {
2007-05-10 19:55:24 +00:00
2007-03-25 20:49:06 +00:00
// 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.
2007-01-03 11:10:58 +00:00
$types = array(
array(
'type' => 'page',
2007-01-13 10:21:32 +00:00
'name' => st('Page'),
2007-01-03 11:10:58 +00:00
'module' => 'node',
2007-10-25 20:51:41 +00:00
'description' => st("A <em>page</em>, similar in form to a <em>story</em>, is a simple method for creating and displaying information that rarely changes, such as an \"About us\" section of a website. By default, a <em>page</em> entry does not allow visitor comments and is not featured on the site's initial home page."),
2007-01-03 11:10:58 +00:00
'custom' => TRUE,
'modified' => TRUE,
'locked' => FALSE,
2007-03-27 05:13:55 +00:00
'help' => '',
'min_word_count' => '',
2007-01-03 11:10:58 +00:00
),
array(
'type' => 'story',
2007-01-13 10:21:32 +00:00
'name' => st('Story'),
2007-01-03 11:10:58 +00:00
'module' => 'node',
2007-10-25 15:32:56 +00:00
'description' => st("A <em>story</em>, similar in form to a <em>page</em>, is ideal for creating and displaying content that informs or engages website visitors. Press releases, site announcements, and informal blog-like entries may all be created with a <em>story</em> entry. By default, a <em>story</em> entry is automatically featured on the site's initial home page, and provides the ability to post comments."),
2007-01-03 11:10:58 +00:00
'custom' => TRUE,
'modified' => TRUE,
'locked' => FALSE,
2007-03-27 05:13:55 +00:00
'help' => '',
'min_word_count' => '',
2007-01-03 11:10:58 +00:00
),
);
foreach ($types as $type) {
$type = (object) _node_type_set_defaults($type);
node_type_save($type);
}
// Default page to not be promoted and have comments disabled.
variable_set('node_options_page', array('status'));
variable_set('comment_page', COMMENT_NODE_DISABLED);
// Don't display date and author information for page nodes by default.
$theme_settings = variable_get('theme_settings', array());
$theme_settings['toggle_node_info_page'] = FALSE;
variable_set('theme_settings', $theme_settings);
2007-05-16 13:45:17 +00:00
// Update the menu router information.
menu_rebuild();
2007-03-25 20:49:06 +00:00
}