From 8776873a20f698367806d352e498300f8a811c57 Mon Sep 17 00:00:00 2001 From: Tristan Olive Date: Wed, 4 Feb 2015 16:36:00 -0500 Subject: [PATCH] Fixed input format warnings when refreshing translation strings: * Added plain text input format * Enable translation of input only when in plain text format * Updated views to use the plain text format for headers, footers, and empty text (placeholder) (DBOINCP-141) --- .../boinc_standard.features.inc | 10 +-- .../boinc_standard/boinc_standard.info | 1 + .../boinc_standard.input_formats.inc | 82 +++++++++++++++++-- .../boinc_standard.strongarm.inc | 2 +- .../friends/friends.views_default.inc | 6 +- .../internationalization.strongarm.inc | 2 +- .../all/features/news/news.views_default.inc | 2 +- .../stats_charts.views_default.inc | 2 +- .../team_forums/team_forums.views_default.inc | 2 +- .../features/teams/teams.views_default.inc | 2 +- .../user_account_host_list.views_default.inc | 2 +- 11 files changed, 90 insertions(+), 23 deletions(-) diff --git a/drupal/sites/all/features/boinc_standard/boinc_standard.features.inc b/drupal/sites/all/features/boinc_standard/boinc_standard.features.inc index d52b21feb0..86c518f953 100644 --- a/drupal/sites/all/features/boinc_standard/boinc_standard.features.inc +++ b/drupal/sites/all/features/boinc_standard/boinc_standard.features.inc @@ -33,8 +33,8 @@ function boinc_standard_flag_default_flags() { 'title' => 'Comment Abuse', 'global' => FALSE, 'types' => array( - '0' => 'news', - '1' => 'forum', + '0' => 'forum', + '1' => 'news', ), 'flag_short' => 'Report', 'flag_long' => 'Report this content as offensive.', @@ -67,8 +67,8 @@ function boinc_standard_flag_default_flags() { 'title' => 'Node Abuse', 'global' => FALSE, 'types' => array( - '0' => 'profile', - '1' => 'forum', + '0' => 'forum', + '1' => 'profile', ), 'flag_short' => 'Report', 'flag_long' => 'Report this content as offensive.', @@ -91,7 +91,7 @@ function boinc_standard_flag_default_flags() { 'show_on_teaser' => 0, 'show_on_form' => 0, 'access_author' => '', - 'i18n' => 0, + 'i18n' => '0', 'module' => 'boinc_standard', 'locked' => array( '0' => 'name', diff --git a/drupal/sites/all/features/boinc_standard/boinc_standard.info b/drupal/sites/all/features/boinc_standard/boinc_standard.info index 4dc21a3134..fb9a4a760b 100644 --- a/drupal/sites/all/features/boinc_standard/boinc_standard.info +++ b/drupal/sites/all/features/boinc_standard/boinc_standard.info @@ -60,6 +60,7 @@ features[ctools][] = "panels_mini:panels_default:1" features[ctools][] = "strongarm:strongarm:1" features[ctools][] = "wysiwyg:wysiwyg:2" features[filter_formats][] = "php_code" +features[filter_formats][] = "plain_text" features[filter_formats][] = "rich_text" features[flag][] = "abuse_comment" features[flag][] = "abuse_node" diff --git a/drupal/sites/all/features/boinc_standard/boinc_standard.input_formats.inc b/drupal/sites/all/features/boinc_standard/boinc_standard.input_formats.inc index a4bf398912..39529584da 100644 --- a/drupal/sites/all/features/boinc_standard/boinc_standard.input_formats.inc +++ b/drupal/sites/all/features/boinc_standard/boinc_standard.input_formats.inc @@ -15,6 +15,7 @@ function boinc_standard_input_formats() { ); $input_format->filters = array( 'php' => array( + // Delta => Weight for: PHP evaluator '0' => '0', ), ); @@ -27,25 +28,34 @@ function boinc_standard_input_formats() { $input_format->roles = array( 1 => 'anonymous user', 2 => 'authenticated user', - 3 => 'administrator', - 4 => 'content editor', - 5 => 'moderator', ); $input_format->cache = TRUE; $input_format->settings = array( // Settings for: tableofcontents module 'tableofcontents' => array( + // Hide the table of contents tags 'tableofcontents_hide_table' => 0, + // Whether an automatic table of content should be added 'tableofcontents_automatic' => '0', + // Number of headers before an automatic table of content is added 'tableofcontents_min_limit' => '5', + // Remove Table of Contents tags from teasers 'tableofcontents_remove_teaser' => 1, + // Allow users to override the settings within the table of contents tag itself 'tableofcontents_allow_override' => 1, + // Ensure title is safe (i.e. use check_plain() to avoid XSS attacks.) 'tableofcontents_safe_title' => 1, + // Table of Contents Title 'tableofcontents_title' => 'Table of Contents', + // Minimum heading level 'tableofcontents_minlevel' => '2', - 'tableofcontents_maxlevel' => '2', - 'tableofcontents_hide_show' => 0, + // Maximum heading level + 'tableofcontents_maxlevel' => '3', + // Include link to hide/show table of contents + 'tableofcontents_hide_show' => 1, + // Start with the table of content collapsed 'tableofcontents_collapsed' => 0, + // Select what is stripped from the header titles 'tableofcontents_id_stripping' => array( 'digits' => 0, 'dashes' => 0, @@ -53,53 +63,109 @@ function boinc_standard_input_formats() { 'underscores' => 0, 'colons' => 0, ), + // Identifier introducer 'tableofcontents_identifier_introducer' => 'header', + // Identifier and number separator 'tableofcontents_id_separator' => '-', + // How to generate missing header identifiers 'tableofcontents_id_generator' => 'title', + // List of tags allowed in table headers 'tableofcontents_allowed_tags' => ' ', + // Add the comments to the table of contents 'tableofcontents_comments' => 0, + // Select header level at which comments start 'tableofcontents_comments_level' => '3', - 'tableofcontents_back_to_top' => 'Back to top', + // Back to top label + 'tableofcontents_back_to_top' => '', + // Back to top location 'tableofcontents_back_to_top_location' => 'bottom', + // Minimum level where Back to Top appears 'tableofcontents_back_to_top_minlevel' => '2', - 'tableofcontents_back_to_top_maxlevel' => '2', + // Maximum level where Back to Top appears + 'tableofcontents_back_to_top_maxlevel' => '4', + // Back to top anchor 'tableofcontents_back_to_top_anchor' => 'toc', + // Scroll back to the table of contents 'tableofcontents_scroll_back_to_top' => 0, - 'tableofcontents_numbering' => '4', + // Numbering method + 'tableofcontents_numbering' => '0', + // Add the number to the headers 'tableofcontents_number_headers' => 0, + // Numbering mode 'tableofcontents_number_mode' => '0', + // Numbering prefix 'tableofcontents_number_start_letter' => '', + // Numbering separator 'tableofcontents_number_separator' => '.', + // Numbering suffix 'tableofcontents_number_end_letter' => '.', ), // Settings for: bbcode module 'bbcode' => array( + // Convert addresses to links 'bbcode_make_links' => '1', + // Spam link deterrent 'bbcode_filter_nofollow' => '0', + // Email address encoding 'bbcode_encode_mailto' => '1', + // Smart paragraph and line breaks 'bbcode_paragraph_breaks' => '2', + // Print debugging info 'bbcode_debug' => '0', ), // Settings for: pathologic module 'pathologic' => array( + // Also considered local 'filter_pathologic_local_paths' => '/', 'filter_pathologic_absolute' => 1, ), ); $input_format->filters = array( 'tableofcontents' => array( + // Delta => Weight for: Table of contents '0' => '-10', ), 'bbcode' => array( + // Delta => Weight for: BBCode '0' => '-9', ), 'pathologic' => array( + // Delta => Weight for: Pathologic '0' => '-8', ), ); $input_format->machine = 'rich_text'; $input_formats['rich_text'] = $input_format; + $input_format = new stdClass; + $input_format->api_version = 1; + $input_format->name = 'Plain text'; + $input_format->roles = array( + 3519698132 => 'administrator', + ); + $input_format->cache = TRUE; + $input_format->settings = array( + // Settings for: filter module + 'filter' => array( + // Filter HTML tags + 'filter_html' => '2', + // Allowed HTML tags + 'allowed_html' => '
    1. ', + // Display HTML help + 'filter_html_help' => 0, + // Spam link deterrent + 'filter_html_nofollow' => 0, + ), + ); + $input_format->filters = array( + 'filter' => array( + // Delta => Weight for: HTML filter + '0' => '10', + ), + ); + $input_format->machine = 'plain_text'; + $input_formats['plain_text'] = $input_format; + return $input_formats; } diff --git a/drupal/sites/all/features/boinc_standard/boinc_standard.strongarm.inc b/drupal/sites/all/features/boinc_standard/boinc_standard.strongarm.inc index 4a9e8ecfb4..1616c55d04 100644 --- a/drupal/sites/all/features/boinc_standard/boinc_standard.strongarm.inc +++ b/drupal/sites/all/features/boinc_standard/boinc_standard.strongarm.inc @@ -31,7 +31,7 @@ function boinc_standard_strongarm() { $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ $strongarm->api_version = 1; $strongarm->name = 'format'; - $strongarm->value = '4'; + $strongarm->value = '5'; $export['format'] = $strongarm; $strongarm = new stdClass; diff --git a/drupal/sites/all/features/friends/friends.views_default.inc b/drupal/sites/all/features/friends/friends.views_default.inc index e2a4fcc18c..ac3883007d 100644 --- a/drupal/sites/all/features/friends/friends.views_default.inc +++ b/drupal/sites/all/features/friends/friends.views_default.inc @@ -96,7 +96,7 @@ function friends_views_default_views() { 'type' => 'none', )); $handler->override_option('empty', 'No Friends have been added.'); - $handler->override_option('empty_format', '1'); + $handler->override_option('empty_format', '5'); $handler->override_option('use_pager', '1'); $handler->override_option('distinct', 1); $handler->override_option('style_plugin', 'table'); @@ -483,7 +483,7 @@ function friends_views_default_views() { )); $handler->override_option('title', 'Friend Requests'); $handler->override_option('header', 'These are users who would like to be your friend.'); - $handler->override_option('header_format', '1'); + $handler->override_option('header_format', '5'); $handler->override_option('header_empty', 0); $handler->override_option('empty', 'No Friend Requests.'); $handler->override_option('style_options', array( @@ -712,7 +712,7 @@ function friends_views_default_views() { )); $handler->override_option('title', 'Awaiting Friend Approvals'); $handler->override_option('header', 'These are users who you have requested to be friends with.'); - $handler->override_option('header_format', '1'); + $handler->override_option('header_format', '5'); $handler->override_option('header_empty', 1); $handler->override_option('empty', 'No Friend Requests.'); $handler->override_option('path', 'account/%/friends/flagged'); diff --git a/drupal/sites/all/features/internationalization/internationalization.strongarm.inc b/drupal/sites/all/features/internationalization/internationalization.strongarm.inc index d4c514f663..c0b9cedd69 100644 --- a/drupal/sites/all/features/internationalization/internationalization.strongarm.inc +++ b/drupal/sites/all/features/internationalization/internationalization.strongarm.inc @@ -11,7 +11,7 @@ function internationalization_strongarm() { $strongarm->api_version = 1; $strongarm->name = 'i18nstrings_allowed_formats'; $strongarm->value = array( - 0 => 4, + 0 => 5, ); $export['i18nstrings_allowed_formats'] = $strongarm; diff --git a/drupal/sites/all/features/news/news.views_default.inc b/drupal/sites/all/features/news/news.views_default.inc index 3f833f18b1..370e238ebc 100644 --- a/drupal/sites/all/features/news/news.views_default.inc +++ b/drupal/sites/all/features/news/news.views_default.inc @@ -102,7 +102,7 @@ function news_views_default_views() { 'type' => 'none', )); $handler->override_option('empty', 'No news is good news...'); - $handler->override_option('empty_format', '1'); + $handler->override_option('empty_format', '5'); $handler->override_option('items_per_page', 3); $handler->override_option('use_pager', '1'); $handler->override_option('row_plugin', 'node'); diff --git a/drupal/sites/all/features/stats_charts/stats_charts.views_default.inc b/drupal/sites/all/features/stats_charts/stats_charts.views_default.inc index d956472b31..3df2ceddb8 100644 --- a/drupal/sites/all/features/stats_charts/stats_charts.views_default.inc +++ b/drupal/sites/all/features/stats_charts/stats_charts.views_default.inc @@ -919,7 +919,7 @@ echo l(t(\'Show computers\'), \'account/\' . get_drupal_id($data->id) . \'/compu )); $handler->override_option('title', 'Statistics'); $handler->override_option('empty', 'empty...'); - $handler->override_option('empty_format', '4'); + $handler->override_option('empty_format', '5'); $handler->override_option('row_options', array( 'inline' => array(), 'separator' => '', diff --git a/drupal/sites/all/features/team_forums/team_forums.views_default.inc b/drupal/sites/all/features/team_forums/team_forums.views_default.inc index fb539d343f..9a5f5ecadf 100644 --- a/drupal/sites/all/features/team_forums/team_forums.views_default.inc +++ b/drupal/sites/all/features/team_forums/team_forums.views_default.inc @@ -438,7 +438,7 @@ function team_forums_views_default_views() { )); $handler = $view->new_display('panel_pane', 'Topic list', 'panel_pane_1'); $handler->override_option('empty', 'No topics yet...'); - $handler->override_option('empty_format', '1'); + $handler->override_option('empty_format', '5'); $handler->override_option('use_pager', '1'); $handler->override_option('style_plugin', 'table'); $handler->override_option('style_options', array( diff --git a/drupal/sites/all/features/teams/teams.views_default.inc b/drupal/sites/all/features/teams/teams.views_default.inc index 154995c37c..dd0a001818 100644 --- a/drupal/sites/all/features/teams/teams.views_default.inc +++ b/drupal/sites/all/features/teams/teams.views_default.inc @@ -3888,7 +3888,7 @@ echo l(t(\'Remove\'), "community/teams/{$team_id}/edit/admins/remove/{$user_id}" $handler->override_option('header_format', '1'); $handler->override_option('header_empty', 1); $handler->override_option('empty', 'There are currently no team admins.'); - $handler->override_option('empty_format', '4'); + $handler->override_option('empty_format', '5'); $handler->override_option('style_plugin', 'table'); $handler->override_option('style_options', array( 'grouping' => '', diff --git a/drupal/sites/all/features/user_account_host_list/user_account_host_list.views_default.inc b/drupal/sites/all/features/user_account_host_list/user_account_host_list.views_default.inc index 519b40b395..db46a07652 100644 --- a/drupal/sites/all/features/user_account_host_list/user_account_host_list.views_default.inc +++ b/drupal/sites/all/features/user_account_host_list/user_account_host_list.views_default.inc @@ -703,7 +703,7 @@ function user_account_host_list_views_default_views() { 'type' => 'none', )); $handler->override_option('empty', ' '); - $handler->override_option('empty_format', '1'); + $handler->override_option('empty_format', '5'); $handler->override_option('items_per_page', 20); $handler->override_option('use_pager', '1'); $handler->override_option('style_plugin', 'table');