Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Use new class_description configuration #1271

Open
wants to merge 1 commit into
base: 6
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/en/04_defining-you-own-elements.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class MyElement extends BaseElement

private static $plural_name = 'my elements';

private static $description = 'What my custom element does';
private static $class_description = 'What my custom element does';

public function getCMSFields()
{
Expand Down
11 changes: 1 addition & 10 deletions src/Models/BaseElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,7 @@ class BaseElement extends DataObject implements CMSPreviewable

/**
* Describe the purpose of this element
*
* @config
* @var string
* @deprecated 5.4.0 use class_description instead.
*/
private static $description = 'Base element class';

private static $class_description = 'Base element class';

/**
Expand Down Expand Up @@ -1122,10 +1116,7 @@ public function getIcon()
*/
public function getTypeNice()
{
$description = $this->config()->uninherited('description');
if ($description) {
$description = _t(__CLASS__ . '.Description', $description);
}
$description = $this->i18n_classDescription();
$markup = ($description) ? ' <span class="element__note"> &mdash; ' . $description . '</span>' : '';

return DBField::create_field(
Expand Down
5 changes: 0 additions & 5 deletions src/Models/ElementContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ class ElementContent extends BaseElement

private static $plural_name = 'content blocks';

/**
* @deprecated 5.4.0 use class_description instead.
*/
private static $description = 'HTML text block';

private static $class_description = 'HTML text block';

/**
Expand Down