From bb293ccfb5193d2f769af6a8422765784c205536 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Mon, 4 Jan 2010 23:08:34 +0000 Subject: #420358 follow-up by Dave Reid: Rename profiles default => standard and expert => minimal, for consistency with labels. --- includes/common.inc | 4 +- install.php | 24 +- modules/simpletest/drupal_web_test_case.php | 11 +- modules/system/system.install | 9 + modules/system/system.module | 4 +- profiles/default/default.info | 24 -- profiles/default/default.install | 414 ---------------------------- profiles/default/default.profile | 14 - profiles/expert/expert.info | 8 - profiles/expert/expert.install | 97 ------- profiles/expert/expert.profile | 11 - profiles/minimal/minimal.info | 8 + profiles/minimal/minimal.install | 95 +++++++ profiles/minimal/minimal.profile | 11 + profiles/standard/standard.info | 24 ++ profiles/standard/standard.install | 414 ++++++++++++++++++++++++++++ profiles/standard/standard.profile | 14 + 17 files changed, 596 insertions(+), 590 deletions(-) delete mode 100644 profiles/default/default.info delete mode 100644 profiles/default/default.install delete mode 100644 profiles/default/default.profile delete mode 100644 profiles/expert/expert.info delete mode 100644 profiles/expert/expert.install delete mode 100644 profiles/expert/expert.profile create mode 100644 profiles/minimal/minimal.info create mode 100644 profiles/minimal/minimal.install create mode 100644 profiles/minimal/minimal.profile create mode 100644 profiles/standard/standard.info create mode 100644 profiles/standard/standard.install create mode 100644 profiles/standard/standard.profile diff --git a/includes/common.inc b/includes/common.inc index 70c2f9024..b6b315b6e 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -228,7 +228,7 @@ function drupal_get_profile() { $profile = $install_state['parameters']['profile']; } else { - $profile = variable_get('install_profile', 'default'); + $profile = variable_get('install_profile', 'standard'); } return $profile; @@ -4381,7 +4381,7 @@ function drupal_json_encode($var) { * Converts an HTML-safe JSON string into its PHP equivalent. * * @see drupal_json_encode() - * @ingroup php_wrappers + * @ingroup php_wrappers */ function drupal_json_decode($var) { // json_decode() does not unescape <, > and &, so we do it with str_replace(). diff --git a/install.php b/install.php index f502272ed..9ccb90d23 100644 --- a/install.php +++ b/install.php @@ -909,7 +909,7 @@ function install_settings_form($form, &$form_state, &$install_state) { ); // Table prefix - $db_prefix = ($profile == 'default') ? 'drupal_' : $profile . '_'; + $db_prefix = ($profile == 'standard') ? 'drupal_' : $profile . '_'; $form['advanced_options']['db_prefix'] = array( '#type' => 'textfield', '#title' => st('Table prefix'), @@ -973,7 +973,7 @@ function install_database_errors($database, $settings_file) { try { db_run_tasks($database['driver']); - } + } catch (DatabaseTaskException $e) { // These are generic errors, so we do not have any specific key of the // database connection array to attach them to; therefore, we just put @@ -1094,7 +1094,7 @@ function install_select_profile_form($form, &$form_state, $profile_files) { foreach ($profile_files as $profile) { // TODO: is this right? include_once DRUPAL_ROOT . '/' . $profile->uri; - + $details = install_profile_info($profile->name); $profiles[$profile->name] = $details; @@ -1107,24 +1107,24 @@ function install_select_profile_form($form, &$form_state, $profile_files) { // Display radio buttons alphabetically by human-readable name, but always // put the core profiles first (if they are present in the filesystem). natcasesort($names); - if (isset($names['expert'])) { + if (isset($names['minimal'])) { // If the expert ("Minimal") core profile is present, put it in front of // any non-core profiles rather than including it with them alphabetically, // since the other profiles might be intended to group together in a // particular way. - $names = array('expert' => $names['expert']) + $names; + $names = array('minimal' => $names['minimal']) + $names; } - if (isset($names['default'])) { + if (isset($names['standard'])) { // If the default ("Standard") core profile is present, put it at the very // top of the list. This profile will have its radio button pre-selected, // so we want it to always appear at the top. - $names = array('default' => $names['default']) + $names; + $names = array('standard' => $names['standard']) + $names; } foreach ($names as $profile => $name) { $form['profile'][$name] = array( '#type' => 'radio', - '#value' => 'default', + '#value' => 'standard', '#return_value' => $profile, '#title' => $name, '#description' => isset($profiles[$profile]['description']) ? $profiles[$profile]['description'] : '', @@ -1182,7 +1182,7 @@ function install_select_locale(&$install_state) { // the user that the installer can be localized. Otherwise we assume the // user knows what he is doing. if (count($locales) == 1) { - if ($profilename == 'default' && $install_state['interactive']) { + if ($profilename == 'standard' && $install_state['interactive']) { drupal_set_title(st('Choose language')); if (!empty($install_state['parameters']['localize'])) { $output = '

' . st('With the addition of an appropriate translation package, this installer is capable of proceeding in another language of your choice. To install and use Drupal in a language other than English:') . '

'; @@ -1240,7 +1240,7 @@ function install_select_locale(&$install_state) { /** * Form API array definition for language selection. */ -function install_select_locale_form($form, &$form_state, $locales, $profilename = 'default') { +function install_select_locale_form($form, &$form_state, $locales, $profilename = 'standard') { include_once DRUPAL_ROOT . '/includes/iso.inc'; $languages = _locale_get_predefined_list(); foreach ($locales as $locale) { @@ -1257,7 +1257,7 @@ function install_select_locale_form($form, &$form_state, $locales, $profilename '#parents' => array('locale') ); } - if ($profilename == 'default') { + if ($profilename == 'standard') { $form['help'] = array( '#markup' => '

' . st('Learn how to install Drupal in other languages') . '

', ); @@ -1710,7 +1710,7 @@ function install_configure_form_submit($form, &$form_state) { // Enable update.module if this option was selected. if ($form_state['values']['update_status_module'][1]) { drupal_install_modules(array('update')); - + // Add the site maintenance account's email address to the list of // addresses to be notified when updates are available, if selected. if ($form_state['values']['update_status_module'][2]) { diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php index 6599fa1e1..be4dbf016 100644 --- a/modules/simpletest/drupal_web_test_case.php +++ b/modules/simpletest/drupal_web_test_case.php @@ -184,12 +184,12 @@ abstract class DrupalTestCase { /** * Delete an assertion record by message ID. - * + * * @param $message_id * Message ID of the assertion to delete. * @return * TRUE if the assertion was deleted, FALSE otherwise. - * + * * @see DrupalTestCase::insertAssert() */ public static function deleteAssert($message_id) { @@ -1137,8 +1137,8 @@ class DrupalWebTestCase extends DrupalTestCase { $this->preloadRegistry(); // Include the default profile - variable_set('install_profile', 'default'); - $profile_details = install_profile_info('default', 'en'); + variable_set('install_profile', 'standard'); + $profile_details = install_profile_info('standard', 'en'); // Install the modules specified by the default profile. drupal_install_modules($profile_details['dependencies'], TRUE); @@ -1158,7 +1158,7 @@ class DrupalWebTestCase extends DrupalTestCase { // Run default profile tasks. $install_state = array(); - drupal_install_modules(array('default'), TRUE); + drupal_install_modules(array('standard'), TRUE); // Rebuild caches. node_types_rebuild(); @@ -1173,7 +1173,6 @@ class DrupalWebTestCase extends DrupalTestCase { $user = user_load(1); // Restore necessary variables. - variable_set('install_profile', 'default'); variable_set('install_task', 'done'); variable_set('clean_url', $clean_url_original); variable_set('site_mail', 'simpletest@example.com'); diff --git a/modules/system/system.install b/modules/system/system.install index 478a09279..4a1e9ccdd 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -2718,6 +2718,15 @@ function system_update_7048() { ->execute(); } +/** + * Rename 'Default' profile to 'Standard.' + */ +function system_update_7049() { + if (variable_get('install_profile', 'standard') == 'default') { + variable_set('install_profile', 'standard'); + } +} + /** * @} End of "defgroup updates-6.x-to-7.x" * The next series of updates should start at 8000. diff --git a/modules/system/system.module b/modules/system/system.module index 850be5446..067f171c8 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -642,7 +642,7 @@ function system_menu() { ); } - // Modules + // Modules. $items['admin/modules'] = array( 'title' => 'Modules', 'description' => 'Enable or disable add-on modules for your site.', @@ -675,7 +675,7 @@ function system_menu() { 'file' => 'system.admin.inc', ); - // Configuration and modules. + // Configuration. $items['admin/config'] = array( 'title' => 'Configuration', 'page callback' => 'system_admin_config_page', diff --git a/profiles/default/default.info b/profiles/default/default.info deleted file mode 100644 index 85abfe2a2..000000000 --- a/profiles/default/default.info +++ /dev/null @@ -1,24 +0,0 @@ -; $Id$ -name = Standard -description = Install with commonly used features pre-configured. -version = VERSION -core = 7.x -dependencies[] = block -dependencies[] = color -dependencies[] = comment -dependencies[] = contextual -dependencies[] = dashboard -dependencies[] = help -dependencies[] = image -dependencies[] = menu -dependencies[] = path -dependencies[] = taxonomy -dependencies[] = dblog -dependencies[] = search -dependencies[] = shortcut -dependencies[] = toolbar -dependencies[] = overlay -dependencies[] = field_ui -dependencies[] = file -dependencies[] = rdf -files[] = default.profile diff --git a/profiles/default/default.install b/profiles/default/default.install deleted file mode 100644 index d9b2e5bcd..000000000 --- a/profiles/default/default.install +++ /dev/null @@ -1,414 +0,0 @@ - 'Filtered HTML', - 'weight' => 0, - 'filters' => array( - // URL filter. - 'filter_url' => array( - 'weight' => 0, - 'status' => 1, - ), - // HTML filter. - 'filter_html' => array( - 'weight' => 1, - 'status' => 1, - ), - // Line break filter. - 'filter_autop' => array( - 'weight' => 2, - 'status' => 1, - ), - // HTML corrector filter. - 'filter_htmlcorrector' => array( - 'weight' => 10, - 'status' => 1, - ), - ), - ); - $filtered_html_format = (object) $filtered_html_format; - filter_format_save($filtered_html_format); - - $full_html_format = array( - 'name' => 'Full HTML', - 'weight' => 1, - 'filters' => array( - // URL filter. - 'filter_url' => array( - 'weight' => 0, - 'status' => 1, - ), - // Line break filter. - 'filter_autop' => array( - 'weight' => 1, - 'status' => 1, - ), - // HTML corrector filter. - 'filter_htmlcorrector' => array( - 'weight' => 10, - 'status' => 1, - ), - ), - ); - $full_html_format = (object) $full_html_format; - filter_format_save($full_html_format); - - $plain_text_format = array( - 'name' => 'Plain text', - 'weight' => 10, - 'filters' => array( - // Escape all HTML. - 'filter_html_escape' => array( - 'weight' => 0, - 'status' => 1, - ), - // Line break filter. - 'filter_autop' => array( - 'weight' => 1, - 'status' => 1, - ), - ), - ); - $plain_text_format = (object) $plain_text_format; - filter_format_save($plain_text_format); - - // Set the fallback format to plain text. - variable_set('filter_fallback_format', $plain_text_format->format); - - // Enable some standard blocks. - $values = array( - array( - 'module' => 'system', - 'delta' => 'main', - 'theme' => 'garland', - 'status' => 1, - 'weight' => 0, - 'region' => 'content', - 'pages' => '', - 'cache' => -1, - ), - array( - 'module' => 'search', - 'delta' => 'form', - 'theme' => 'garland', - 'status' => 1, - 'weight' => -1, - 'region' => 'sidebar_first', - 'pages' => '', - 'cache' => -1, - ), - array( - 'module' => 'user', - 'delta' => 'login', - 'theme' => 'garland', - 'status' => 1, - 'weight' => 0, - 'region' => 'sidebar_first', - 'pages' => '', - 'cache' => -1, - ), - array( - 'module' => 'system', - 'delta' => 'navigation', - 'theme' => 'garland', - 'status' => 1, - 'weight' => 0, - 'region' => 'sidebar_first', - 'pages' => '', - 'cache' => -1, - ), - array( - 'module' => 'system', - 'delta' => 'management', - 'theme' => 'garland', - 'status' => 1, - 'weight' => 1, - 'region' => 'sidebar_first', - 'pages' => '', - 'cache' => -1, - ), - array( - 'module' => 'system', - 'delta' => 'powered-by', - 'theme' => 'garland', - 'status' => 1, - 'weight' => 10, - 'region' => 'footer', - 'pages' => '', - 'cache' => -1, - ), - array( - 'module' => 'system', - 'delta' => 'help', - 'theme' => 'garland', - 'status' => 1, - 'weight' => 0, - 'region' => 'help', - 'pages' => '', - 'cache' => -1, - ), - array( - 'module' => 'system', - 'delta' => 'main', - 'theme' => 'seven', - 'status' => 1, - 'weight' => 0, - 'region' => 'content', - 'pages' => '', - 'cache' => -1, - ), - array( - 'module' => 'system', - 'delta' => 'help', - 'theme' => 'seven', - 'status' => 1, - 'weight' => 0, - 'region' => 'help', - 'pages' => '', - 'cache' => -1, - ), - array( - 'module' => 'user', - 'delta' => 'login', - 'theme' => 'seven', - 'status' => 1, - 'weight' => 10, - 'region' => 'content', - 'pages' => '', - 'cache' => -1, - ), - array( - 'module' => 'user', - 'delta' => 'new', - 'theme' => 'seven', - 'status' => 1, - 'weight' => 0, - 'region' => 'dashboard_sidebar', - 'pages' => '', - 'cache' => -1, - ), - array( - 'module' => 'search', - 'delta' => 'form', - 'theme' => 'seven', - 'status' => 1, - 'weight' => -10, - 'region' => 'dashboard_sidebar', - 'pages' => '', - 'cache' => -1, - ), - ); - $query = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'pages', 'cache')); - foreach ($values as $record) { - $query->values($record); - } - $query->execute(); - - // 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'), - 'base' => 'node_content', - 'description' => st("Use pages for your static content, such as an 'About us' page."), - 'custom' => 1, - 'modified' => 1, - 'locked' => 0, - ), - array( - 'type' => 'article', - 'name' => st('Article'), - 'base' => 'node_content', - 'description' => st('Use articles for time-specific content like news, press releases or blog posts.'), - 'custom' => 1, - 'modified' => 1, - 'locked' => 0, - ), - ); - - foreach ($types as $type) { - $type = node_type_set_defaults($type); - node_type_save($type); - } - - // Insert default user-defined RDF mapping into the database. - $rdf_mappings = array( - array( - 'type' => 'node', - 'bundle' => 'page', - 'mapping' => array( - 'rdftype' => array('foaf:Document'), - ), - ), - array( - 'type' => 'node', - 'bundle' => 'article', - 'mapping' => array( - 'rdftype' => array('sioc:Item', 'foaf:Document'), - ), - ), - ); - foreach ($rdf_mappings as $rdf_mapping) { - rdf_mapping_save($rdf_mapping); - } - - // Default page to not be promoted and have comments disabled. - variable_set('node_options_page', array('status')); - variable_set('comment_page', COMMENT_NODE_HIDDEN); - - // Don't display date and author information for page nodes by default. - variable_set('node_submitted_page', FALSE); - - // Enable user picture support and set the default to a square thumbnail option. - variable_set('user_pictures', '1'); - variable_set('user_picture_dimensions', '1024x1024'); - variable_set('user_picture_file_size', '800'); - variable_set('user_picture_style', 'thumbnail'); - - // Create a default vocabulary named "Tags", enabled for the 'article' content type. - $description = st('Use tags to group articles on similar topics into categories.'); - $help = st('Enter a comma-separated list of words to describe your content.'); - $vocabulary = (object) array( - 'name' => 'Tags', - 'description' => $description, - 'machine_name' => 'tags', - 'help' => $help, - - ); - taxonomy_vocabulary_save($vocabulary); - $instance = array( - 'field_name' => 'taxonomy_' . $vocabulary->machine_name, - 'object_type' => 'node', - 'label' => $vocabulary->name, - 'bundle' => 'article', - 'description' => $vocabulary->help, - 'widget' => array( - 'type' => 'taxonomy_autocomplete', - 'weight' => 4, - ), - ); - field_create_instance($instance); - - - // Create an image field named "Image", enabled for the 'article' content type. - // Many of the following values will be defaulted, they're included here as an illustrative examples. - // @see: http://api.drupal.org/api/function/field_create_field/7 - - $field = array( - 'field_name' => 'field_image', - 'type' => 'image', - 'cardinality' => 1, - 'translatable' => TRUE, - 'locked' => FALSE, - 'indexes' => array('fid' => array('fid')), - 'settings' => array( - 'uri_scheme' => 'public', - 'default_image' => FALSE, - ), - 'storage' => array( - 'type' => 'field_sql_storage', - 'settings' => array(), - ), - ); - field_create_field($field); - - - // Many of the following values will be defaulted, they're included here as an illustrative examples. - // @see: http://api.drupal.org/api/function/field_create_instance/7 - $instance = array( - 'field_name' => 'field_image', - 'object_type' => 'node', - 'label' => 'Image', - 'bundle' => 'article', - 'description' => 'Upload an image to go with this article.', - 'required' => FALSE, - - 'settings' => array( - 'file_directory' => 'field/image', - 'file_extensions' => 'png gif jpg jpeg', - 'max_filesize' => '', - 'max_resolution' => '', - 'min_resolution' => '', - 'alt_field' => TRUE, - 'title_field' => '', - ), - - 'widget' => array( - 'type' => 'image_image', - 'settings' => array( - 'progress_indicator' => 'throbber', - 'preview_image_style' => 'thumbnail', - ), - 'weight' => -1, - ), - - 'display' => array( - 'full' => array( - 'label' => 'hidden', - 'type' => 'image__large', - 'settings' => array(), - 'weight' => -1, - ), - 'teaser' => array( - 'label' => 'hidden', - 'type' => 'image_link_content__medium', - 'settings' => array(), - 'weight' => -1, - ), - 'rss' => array( - 'label' => 'hidden', - 'type' => 'image__large', - 'settings' => array(), - 'weight' => -1, - ), - 'search_index' => array( - 'label' => 'hidden', - 'type' => 'image__large', - 'settings' => array(), - 'weight' => -1, - ), - 'search_results' => array( - 'label' => 'hidden', - 'type' => 'image__large', - 'settings' => array(), - 'weight' => -1, - ), - ), - ); - field_create_instance($instance); - - // Enable default permissions for system roles. - $filtered_html_permission = filter_permission_name($filtered_html_format); - user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access content', $filtered_html_permission)); - user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access content', 'access comments', 'post comments', 'post comments without approval', $filtered_html_permission)); - - // Create a default role for site administrators, with all available permissions assigned. - $admin_role = new stdClass(); - $admin_role->name = 'administrator'; - user_role_save($admin_role); - user_role_grant_permissions($admin_role->rid, array_keys(module_invoke_all('permission'))); - // Set this as the administrator role. - variable_set('user_admin_role', $admin_role->rid); - - // Update the menu router information. - menu_rebuild(); - - // Enable the admin theme. - db_update('system') - ->fields(array('status' => 1)) - ->condition('type', 'theme') - ->condition('name', 'seven') - ->execute(); - variable_set('admin_theme', 'seven'); - variable_set('node_admin_theme', '1'); -} diff --git a/profiles/default/default.profile b/profiles/default/default.profile deleted file mode 100644 index 89800f66b..000000000 --- a/profiles/default/default.profile +++ /dev/null @@ -1,14 +0,0 @@ - 'Plain text', - 'weight' => 10, - 'filters' => array( - // Escape all HTML. - 'filter_html_escape' => array( - 'weight' => 0, - 'status' => 1, - ), - // Line break filter. - 'filter_autop' => array( - 'weight' => 1, - 'status' => 1, - ), - ), - ); - $plain_text_format = (object) $plain_text_format; - filter_format_save($plain_text_format); - - // Set the fallback format to plain text. - variable_set('filter_fallback_format', $plain_text_format->format); - - // Enable some standard blocks. - $values = array( - array( - 'module' => 'system', - 'delta' => 'main', - 'theme' => 'garland', - 'status' => 1, - 'weight' => 0, - 'region' => 'content', - 'pages' => '', - 'cache' => -1, - ), - array( - 'module' => 'user', - 'delta' => 'login', - 'theme' => 'garland', - 'status' => 1, - 'weight' => 0, - 'region' => 'sidebar_first', - 'pages' => '', - 'cache' => -1, - ), - array( - 'module' => 'system', - 'delta' => 'navigation', - 'theme' => 'garland', - 'status' => 1, - 'weight' => 0, - 'region' => 'sidebar_first', - 'pages' => '', - 'cache' => -1, - ), - array( - 'module' => 'system', - 'delta' => 'management', - 'theme' => 'garland', - 'status' => 1, - 'weight' => 1, - 'region' => 'sidebar_first', - 'pages' => '', - 'cache' => -1, - ), - array( - 'module' => 'system', - 'delta' => 'help', - 'theme' => 'garland', - 'status' => 1, - 'weight' => 0, - 'region' => 'help', - 'pages' => '', - 'cache' => -1, - ), - ); - $query = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'pages', 'cache')); - foreach ($values as $record) { - $query->values($record); - } - $query->execute(); - - // Enable default permissions for system roles. - user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access content', 'use text format 1')); - user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access content', 'access comments', 'post comments', 'post comments without approval', 'use text format 1')); -} - - diff --git a/profiles/expert/expert.profile b/profiles/expert/expert.profile deleted file mode 100644 index aab82e9c6..000000000 --- a/profiles/expert/expert.profile +++ /dev/null @@ -1,11 +0,0 @@ - 'Plain text', + 'weight' => 10, + 'filters' => array( + // Escape all HTML. + 'filter_html_escape' => array( + 'weight' => 0, + 'status' => 1, + ), + // Line break filter. + 'filter_autop' => array( + 'weight' => 1, + 'status' => 1, + ), + ), + ); + $plain_text_format = (object) $plain_text_format; + filter_format_save($plain_text_format); + + // Set the fallback format to plain text. + variable_set('filter_fallback_format', $plain_text_format->format); + + // Enable some standard blocks. + $values = array( + array( + 'module' => 'system', + 'delta' => 'main', + 'theme' => 'garland', + 'status' => 1, + 'weight' => 0, + 'region' => 'content', + 'pages' => '', + 'cache' => -1, + ), + array( + 'module' => 'user', + 'delta' => 'login', + 'theme' => 'garland', + 'status' => 1, + 'weight' => 0, + 'region' => 'sidebar_first', + 'pages' => '', + 'cache' => -1, + ), + array( + 'module' => 'system', + 'delta' => 'navigation', + 'theme' => 'garland', + 'status' => 1, + 'weight' => 0, + 'region' => 'sidebar_first', + 'pages' => '', + 'cache' => -1, + ), + array( + 'module' => 'system', + 'delta' => 'management', + 'theme' => 'garland', + 'status' => 1, + 'weight' => 1, + 'region' => 'sidebar_first', + 'pages' => '', + 'cache' => -1, + ), + array( + 'module' => 'system', + 'delta' => 'help', + 'theme' => 'garland', + 'status' => 1, + 'weight' => 0, + 'region' => 'help', + 'pages' => '', + 'cache' => -1, + ), + ); + $query = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'pages', 'cache')); + foreach ($values as $record) { + $query->values($record); + } + $query->execute(); + + // Enable default permissions for system roles. + user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access content', 'use text format 1')); + user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access content', 'access comments', 'post comments', 'post comments without approval', 'use text format 1')); +} diff --git a/profiles/minimal/minimal.profile b/profiles/minimal/minimal.profile new file mode 100644 index 000000000..5fd06c3fc --- /dev/null +++ b/profiles/minimal/minimal.profile @@ -0,0 +1,11 @@ + 'Filtered HTML', + 'weight' => 0, + 'filters' => array( + // URL filter. + 'filter_url' => array( + 'weight' => 0, + 'status' => 1, + ), + // HTML filter. + 'filter_html' => array( + 'weight' => 1, + 'status' => 1, + ), + // Line break filter. + 'filter_autop' => array( + 'weight' => 2, + 'status' => 1, + ), + // HTML corrector filter. + 'filter_htmlcorrector' => array( + 'weight' => 10, + 'status' => 1, + ), + ), + ); + $filtered_html_format = (object) $filtered_html_format; + filter_format_save($filtered_html_format); + + $full_html_format = array( + 'name' => 'Full HTML', + 'weight' => 1, + 'filters' => array( + // URL filter. + 'filter_url' => array( + 'weight' => 0, + 'status' => 1, + ), + // Line break filter. + 'filter_autop' => array( + 'weight' => 1, + 'status' => 1, + ), + // HTML corrector filter. + 'filter_htmlcorrector' => array( + 'weight' => 10, + 'status' => 1, + ), + ), + ); + $full_html_format = (object) $full_html_format; + filter_format_save($full_html_format); + + $plain_text_format = array( + 'name' => 'Plain text', + 'weight' => 10, + 'filters' => array( + // Escape all HTML. + 'filter_html_escape' => array( + 'weight' => 0, + 'status' => 1, + ), + // Line break filter. + 'filter_autop' => array( + 'weight' => 1, + 'status' => 1, + ), + ), + ); + $plain_text_format = (object) $plain_text_format; + filter_format_save($plain_text_format); + + // Set the fallback format to plain text. + variable_set('filter_fallback_format', $plain_text_format->format); + + // Enable some standard blocks. + $values = array( + array( + 'module' => 'system', + 'delta' => 'main', + 'theme' => 'garland', + 'status' => 1, + 'weight' => 0, + 'region' => 'content', + 'pages' => '', + 'cache' => -1, + ), + array( + 'module' => 'search', + 'delta' => 'form', + 'theme' => 'garland', + 'status' => 1, + 'weight' => -1, + 'region' => 'sidebar_first', + 'pages' => '', + 'cache' => -1, + ), + array( + 'module' => 'user', + 'delta' => 'login', + 'theme' => 'garland', + 'status' => 1, + 'weight' => 0, + 'region' => 'sidebar_first', + 'pages' => '', + 'cache' => -1, + ), + array( + 'module' => 'system', + 'delta' => 'navigation', + 'theme' => 'garland', + 'status' => 1, + 'weight' => 0, + 'region' => 'sidebar_first', + 'pages' => '', + 'cache' => -1, + ), + array( + 'module' => 'system', + 'delta' => 'management', + 'theme' => 'garland', + 'status' => 1, + 'weight' => 1, + 'region' => 'sidebar_first', + 'pages' => '', + 'cache' => -1, + ), + array( + 'module' => 'system', + 'delta' => 'powered-by', + 'theme' => 'garland', + 'status' => 1, + 'weight' => 10, + 'region' => 'footer', + 'pages' => '', + 'cache' => -1, + ), + array( + 'module' => 'system', + 'delta' => 'help', + 'theme' => 'garland', + 'status' => 1, + 'weight' => 0, + 'region' => 'help', + 'pages' => '', + 'cache' => -1, + ), + array( + 'module' => 'system', + 'delta' => 'main', + 'theme' => 'seven', + 'status' => 1, + 'weight' => 0, + 'region' => 'content', + 'pages' => '', + 'cache' => -1, + ), + array( + 'module' => 'system', + 'delta' => 'help', + 'theme' => 'seven', + 'status' => 1, + 'weight' => 0, + 'region' => 'help', + 'pages' => '', + 'cache' => -1, + ), + array( + 'module' => 'user', + 'delta' => 'login', + 'theme' => 'seven', + 'status' => 1, + 'weight' => 10, + 'region' => 'content', + 'pages' => '', + 'cache' => -1, + ), + array( + 'module' => 'user', + 'delta' => 'new', + 'theme' => 'seven', + 'status' => 1, + 'weight' => 0, + 'region' => 'dashboard_sidebar', + 'pages' => '', + 'cache' => -1, + ), + array( + 'module' => 'search', + 'delta' => 'form', + 'theme' => 'seven', + 'status' => 1, + 'weight' => -10, + 'region' => 'dashboard_sidebar', + 'pages' => '', + 'cache' => -1, + ), + ); + $query = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'pages', 'cache')); + foreach ($values as $record) { + $query->values($record); + } + $query->execute(); + + // 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'), + 'base' => 'node_content', + 'description' => st("Use pages for your static content, such as an 'About us' page."), + 'custom' => 1, + 'modified' => 1, + 'locked' => 0, + ), + array( + 'type' => 'article', + 'name' => st('Article'), + 'base' => 'node_content', + 'description' => st('Use articles for time-specific content like news, press releases or blog posts.'), + 'custom' => 1, + 'modified' => 1, + 'locked' => 0, + ), + ); + + foreach ($types as $type) { + $type = node_type_set_defaults($type); + node_type_save($type); + } + + // Insert default user-defined RDF mapping into the database. + $rdf_mappings = array( + array( + 'type' => 'node', + 'bundle' => 'page', + 'mapping' => array( + 'rdftype' => array('foaf:Document'), + ), + ), + array( + 'type' => 'node', + 'bundle' => 'article', + 'mapping' => array( + 'rdftype' => array('sioc:Item', 'foaf:Document'), + ), + ), + ); + foreach ($rdf_mappings as $rdf_mapping) { + rdf_mapping_save($rdf_mapping); + } + + // Default page to not be promoted and have comments disabled. + variable_set('node_options_page', array('status')); + variable_set('comment_page', COMMENT_NODE_HIDDEN); + + // Don't display date and author information for page nodes by default. + variable_set('node_submitted_page', FALSE); + + // Enable user picture support and set the default to a square thumbnail option. + variable_set('user_pictures', '1'); + variable_set('user_picture_dimensions', '1024x1024'); + variable_set('user_picture_file_size', '800'); + variable_set('user_picture_style', 'thumbnail'); + + // Create a default vocabulary named "Tags", enabled for the 'article' content type. + $description = st('Use tags to group articles on similar topics into categories.'); + $help = st('Enter a comma-separated list of words to describe your content.'); + $vocabulary = (object) array( + 'name' => 'Tags', + 'description' => $description, + 'machine_name' => 'tags', + 'help' => $help, + + ); + taxonomy_vocabulary_save($vocabulary); + $instance = array( + 'field_name' => 'taxonomy_' . $vocabulary->machine_name, + 'object_type' => 'node', + 'label' => $vocabulary->name, + 'bundle' => 'article', + 'description' => $vocabulary->help, + 'widget' => array( + 'type' => 'taxonomy_autocomplete', + 'weight' => 4, + ), + ); + field_create_instance($instance); + + + // Create an image field named "Image", enabled for the 'article' content type. + // Many of the following values will be defaulted, they're included here as an illustrative examples. + // @see: http://api.drupal.org/api/function/field_create_field/7 + + $field = array( + 'field_name' => 'field_image', + 'type' => 'image', + 'cardinality' => 1, + 'translatable' => TRUE, + 'locked' => FALSE, + 'indexes' => array('fid' => array('fid')), + 'settings' => array( + 'uri_scheme' => 'public', + 'default_image' => FALSE, + ), + 'storage' => array( + 'type' => 'field_sql_storage', + 'settings' => array(), + ), + ); + field_create_field($field); + + + // Many of the following values will be defaulted, they're included here as an illustrative examples. + // @see: http://api.drupal.org/api/function/field_create_instance/7 + $instance = array( + 'field_name' => 'field_image', + 'object_type' => 'node', + 'label' => 'Image', + 'bundle' => 'article', + 'description' => 'Upload an image to go with this article.', + 'required' => FALSE, + + 'settings' => array( + 'file_directory' => 'field/image', + 'file_extensions' => 'png gif jpg jpeg', + 'max_filesize' => '', + 'max_resolution' => '', + 'min_resolution' => '', + 'alt_field' => TRUE, + 'title_field' => '', + ), + + 'widget' => array( + 'type' => 'image_image', + 'settings' => array( + 'progress_indicator' => 'throbber', + 'preview_image_style' => 'thumbnail', + ), + 'weight' => -1, + ), + + 'display' => array( + 'full' => array( + 'label' => 'hidden', + 'type' => 'image__large', + 'settings' => array(), + 'weight' => -1, + ), + 'teaser' => array( + 'label' => 'hidden', + 'type' => 'image_link_content__medium', + 'settings' => array(), + 'weight' => -1, + ), + 'rss' => array( + 'label' => 'hidden', + 'type' => 'image__large', + 'settings' => array(), + 'weight' => -1, + ), + 'search_index' => array( + 'label' => 'hidden', + 'type' => 'image__large', + 'settings' => array(), + 'weight' => -1, + ), + 'search_results' => array( + 'label' => 'hidden', + 'type' => 'image__large', + 'settings' => array(), + 'weight' => -1, + ), + ), + ); + field_create_instance($instance); + + // Enable default permissions for system roles. + $filtered_html_permission = filter_permission_name($filtered_html_format); + user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access content', $filtered_html_permission)); + user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access content', 'access comments', 'post comments', 'post comments without approval', $filtered_html_permission)); + + // Create a default role for site administrators, with all available permissions assigned. + $admin_role = new stdClass(); + $admin_role->name = 'administrator'; + user_role_save($admin_role); + user_role_grant_permissions($admin_role->rid, array_keys(module_invoke_all('permission'))); + // Set this as the administrator role. + variable_set('user_admin_role', $admin_role->rid); + + // Update the menu router information. + menu_rebuild(); + + // Enable the admin theme. + db_update('system') + ->fields(array('status' => 1)) + ->condition('type', 'theme') + ->condition('name', 'seven') + ->execute(); + variable_set('admin_theme', 'seven'); + variable_set('node_admin_theme', '1'); +} diff --git a/profiles/standard/standard.profile b/profiles/standard/standard.profile new file mode 100644 index 000000000..d8203d0e5 --- /dev/null +++ b/profiles/standard/standard.profile @@ -0,0 +1,14 @@ +