-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Core] Allow changing language stemmer when possible
- Loading branch information
Showing
13 changed files
with
612 additions
and
1 deletion.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
src/module-elasticsuite-core/Block/Adminhtml/System/Config/Comment.php
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,60 @@ | ||
<?php | ||
/** | ||
* DISCLAIMER | ||
* | ||
* Do not edit or add to this file if you wish to upgrade this module to newer versions in the future. | ||
* | ||
* @category Smile | ||
* @package Smile\ElasticsuiteCore | ||
* @author Richard BAYET <richard.bayet@smile.fr> | ||
* @copyright 2024 Smile | ||
* @license Open Software License ("OSL") v. 3.0 | ||
*/ | ||
|
||
namespace Smile\ElasticsuiteCore\Block\Adminhtml\System\Config; | ||
|
||
use Magento\Config\Block\System\Config\Form\Field; | ||
use Magento\Framework\Data\Form\Element\AbstractElement; | ||
|
||
/** | ||
* System config comment block. | ||
* Allows to display a label and a comment without a field label and the scope input. | ||
* This allows to display a comment at default scope for fields only available at the store view level. | ||
* | ||
* @category Smile | ||
* @package Smile\ElasticsuiteCore | ||
*/ | ||
class Comment extends Field | ||
{ | ||
/** | ||
* Retrieve HTML markup for given form element. | ||
* | ||
* @param AbstractElement $element Form element. | ||
* | ||
* @return string | ||
*/ | ||
public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element) | ||
{ | ||
$html = '<div class="elasticsuite config-comment-title">' . $element->getLabel() . '</div>'; | ||
$html .= '<div class="elasticsuite config-comment-content">' . $element->getComment() . '</div>'; | ||
|
||
return $this->decorateRowHtml($element, $html); | ||
} | ||
|
||
/** | ||
* Decorate field row html. | ||
* | ||
* @param AbstractElement $element Form element. | ||
* @param string $html Field row html. | ||
* | ||
* @return string | ||
*/ | ||
private function decorateRowHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element, $html) | ||
{ | ||
return sprintf( | ||
'<tr id="row_%s"><td colspan="3"><div class="elasticsuite config-comment">%s</div></td></tr>', | ||
$element->getHtmlId(), | ||
$html | ||
); | ||
} | ||
} |
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
Oops, something went wrong.