-
Notifications
You must be signed in to change notification settings - Fork 645
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11035 from engram-design/4.0
Add `Element::getElementHtml()` to allow elements to define their own HTML for the element icon
- Loading branch information
Showing
5 changed files
with
93 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
/** | ||
* @link https://craftcms.com/ | ||
* @copyright Copyright (c) Pixel & Tonic, Inc. | ||
* @license https://craftcms.github.io/license/ | ||
*/ | ||
|
||
namespace craft\events; | ||
|
||
use craft\base\ElementInterface; | ||
|
||
use yii\base\Event; | ||
|
||
/** | ||
* DefineElementInnerHtmlEvent class. | ||
* | ||
* @author Pixel & Tonic, Inc. <[email protected]> | ||
* @since 4.0.0 | ||
*/ | ||
class DefineElementInnerHtmlEvent extends Event | ||
{ | ||
/** | ||
* @var ElementInterface The element being rendered via `\craft\helpers\Cp::elementHtml()`. | ||
*/ | ||
public ElementInterface $element; | ||
|
||
/** | ||
* @var string The context the element is going to be shown in (`index`, `field`, etc.). | ||
*/ | ||
public string $context; | ||
|
||
/** | ||
* @var string The size of the element (`small` or `large`). | ||
*/ | ||
public string $size; | ||
|
||
/** | ||
* @var bool Whether the element status should be shown (if the element type has statuses). | ||
*/ | ||
public bool $showStatus; | ||
|
||
/** | ||
* @var bool Whether the element thumb should be shown (if the element has one). | ||
*/ | ||
public bool $showThumb; | ||
|
||
/** | ||
* @var bool Whether the element label should be shown. | ||
*/ | ||
public bool $showLabel; | ||
|
||
/** | ||
* @var bool Whether to show the draft name beside the label if the element is a draft of a published element. | ||
*/ | ||
public bool $showDraftName; | ||
|
||
/** | ||
* @var string The element’s pre-rendered inner HTML. | ||
*/ | ||
public string $innerHtml; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters