Skip to content

Commit

Permalink
Merge pull request #37 from chrometoasters/feature/cms-4.13-compatibi…
Browse files Browse the repository at this point in the history
…lity

CMS 4.13 compatibility
  • Loading branch information
michalkleiner authored May 21, 2023
2 parents 42b26d6 + 38fa1c2 commit 5d8302d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lang/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ en:
PublicDefinition_Description: 'Shown to users on the front-end; a brief definition of the term for those who view taxonomy terms as tags or filters.'
URLSegment_Description: 'A unique identifier used by the CMS (e.g. in URL filter parameters), which must be unique across all terms and taxonomies. It will be automatically generated from <i><b>Name</b></i>, if left blank. Use lower case, URL-safe characters, no spaces. Avoid parentheses. Required.'
InternalOnly_Description: 'When enabled, the taxonomy will be available for tagging by authors, and in various CMS configuration settings, but won’t be shown or made directly accessible to users. If disabled, the terms in this taxonomy will be displayed throughout the site as tags, labels and within filter options (e.g. during the listing and searching of content).'
SingleSelect_Checked_Readonly_Description: 'This taxonomy has been permanently configured to prevent more than one term being tagged to any individual content item. Typically, this is due to the mutually exclusive nature of the terms. If you wish to enable multi-select, all tags from the taxonomy must be removed from all content (not recommended). Currently, at least one %s has been tagged, possibly others. You might want to consider creating a new taxonomy instead.'
SingleSelect_Checked_Readonly_Description: 'This taxonomy has been permanently configured to prevent more than one term being tagged to any individual content item. Typically, this is due to the mutually exclusive nature of the terms. If you wish to enable multi-select, all tags from the taxonomy must be removed from all content (not recommended). Currently, at least one {taggedClass} has been tagged, possibly others. You might want to consider creating a new taxonomy instead.'
SingleSelect_Checked_Description: 'This taxonomy has been configured to prevent more than one term being tagged to any individual content item. Typically, this is due to the mutually exclusive nature of the terms. As soon as any term from the associated taxonomy is tagged to any content item, this option will become permanently set. As none of the terms have yet been used as tags, you can still disable this option.'
SingleSelect_Readonly_Description: 'This taxonomy type has been permanently configured to allow more than one term to be tagged to any individual content item. Typically, this is due to the synergistic nature of the terms. If you wish to enable single select, all tags from this taxonomy must be removed from all content (not recommended). Currently, at least one %s has been tagged, possibly others. You might want to consider creating a new taxonomy instead.'
SingleSelect_Readonly_Description: 'This taxonomy type has been permanently configured to allow more than one term to be tagged to any individual content item. Typically, this is due to the synergistic nature of the terms. If you wish to enable single select, all tags from this taxonomy must be removed from all content (not recommended). Currently, at least one {taggedClass} has been tagged, possibly others. You might want to consider creating a new taxonomy instead.'
SingleSelect_Description: 'If your taxonomy includes mutually exclusive terms or concepts, you <b>might</b> want to enable this option. It will restrict authors from applying more than one tag at a time to any individual content item. Caution: once enabled, this option is not intended to be turned off again; once content has been tagged with single select taxonomy terms, this option becomes permanently enabled.'
RequiredTypes_Description: 'Required taxonomies will prompt admins to select a term from these other taxonomies, too, when this current term is assigned to a page, block or file etc. If required taxonomies are set on the root term, then all descendant terms will inherit the requirements. Inheritance can be manually overridden, and further requirements set, on individual terms.'
Terms_Description: 'This is a flattened (non-hierarchical) list of all the descendant terms within this taxonomy. This is useful when you need a quick view of all the terms, as it saves you navigating through multiple child term screens.'
9 changes: 5 additions & 4 deletions src/Models/TaxonomyTerm.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public function getCMSFields()
$fields->removeByName('DataObjectTaxonomyTerms');

// Begin to use _t(), first disable 'missing_default_warning', which allows _t() to be called without default
i18n::config()->update('missing_default_warning', false);
i18n::config()->merge('missing_default_warning', false);

// Define a literalField that presents empty line , and could be reused in many occasionz.
$lineBreak = LiteralField::create('LineBreak', '<br />');
Expand Down Expand Up @@ -231,9 +231,10 @@ public function getCMSFields()
// provide description for different combination of states from the lang file
$singleSelectDescription = _t(
static::class
. '.SingleSelect' . ($checked ? '_Checked' : '') . ($readonly ? '_Readonly' : '') . '_Description'
);
$singleSelectField->setDescription(sprintf($singleSelectDescription, $taggedClass));
. '.SingleSelect' . ($checked ? '_Checked' : '') . ($readonly ? '_Readonly' : '') . '_Description',
null,
['taggedClass' => $taggedClass]);
$singleSelectField->setDescription($singleSelectDescription);
}


Expand Down

0 comments on commit 5d8302d

Please sign in to comment.