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)
This commit is contained in:
Tristan Olive 2015-02-04 16:36:00 -05:00
parent 3beed68755
commit 8776873a20
11 changed files with 90 additions and 23 deletions

View File

@ -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',

View File

@ -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"

View File

@ -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' => '<em> <i> <strong> <b> <u> <del> <ins> <sub> <sup> <cite> <strike> <s> <tt> <span> <font> <abbr> <acronym> <dfn> <q> <bdo> <big> <small>',
// 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' => '<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>',
// 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;
}

View File

@ -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;

View File

@ -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');

View File

@ -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;

View File

@ -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');

View File

@ -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' => '',

View File

@ -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(

View File

@ -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' => '',

View File

@ -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');