[TikiWiki-commits] [Git][tikiwiki/tiki][27.x] [ENH] Add wysiwyg parameter to decouple textarea editing from WYSIWYG editor
"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <69b8f35de4edf_3b18c91479840@gitlab-sidekiq-low-urgency-cpu-bound-v2-7fb98cc9d4-l8pwf.mail> |
Victor Emanouilov pushed to branch 27.x at Tiki Wiki CMS Groupware / Tiki
Commits:
8f44cf08 by Steven ngesera at 2026-03-17T08:23:20+02:00
[ENH] Add wysiwyg parameter to decouple textarea editing from WYSIWYG editor
---
* [ENH] Add WYSIWYG support to Search Formatter plugins
See merge request tikiwiki/tiki!9740
- - - - -
2 changed files:
- lib/core/Search/Formatter/Builder.php
- lib/core/Search/Formatter/Plugin/SmartyTemplate.php
Changes:
=====================================
lib/core/Search/Formatter/Builder.php
=====================================
@@ -181,6 +181,11 @@ class Search_Formatter_Builder
$plugin->setEditable($arguments['editable'], 'format' . hash('sha256', $match->getArguments() . $match->getBody()));
}
+ if (isset($arguments['wysiwyg']) && method_exists($plugin, 'setWysiwyg')) {
+ $wysiwygValue = in_array($arguments['wysiwyg'], ['y', 'yes', '1', 1, true], true);
+ $plugin->setWysiwyg($wysiwygValue);
+ }
+
$this->subFormatters[$arguments['name']] = $plugin;
}
=====================================
lib/core/Search/Formatter/Plugin/SmartyTemplate.php
=====================================
@@ -13,6 +13,7 @@ class Search_Formatter_Plugin_SmartyTemplate implements Search_Formatter_Plugin_
private string $editable;
private string $editableId;
private ?string $context;
+ private $wysiwyg = null;
public function __construct($templateFile, $changeDelimiters = false)
{
@@ -42,6 +43,11 @@ class Search_Formatter_Plugin_SmartyTemplate implements Search_Formatter_Plugin_
$this->editableId = $id;
}
+ public function setWysiwyg($wysiwyg)
+ {
+ $this->wysiwyg = $wysiwyg;
+ }
+
public function setContext(?string $context)
{
$this->context = $context;
@@ -124,6 +130,14 @@ class Search_Formatter_Plugin_SmartyTemplate implements Search_Formatter_Plugin_
private function wrapEditableByContext($content)
{
if ($this->context !== 'actions') {
+ // Determine wysiwyg value: explicit setting takes priority,
+ // otherwise default to false for inline, true for block/dialog
+ if ($this->wysiwyg !== null) {
+ $wysiwygValue = $this->wysiwyg;
+ } else {
+ $wysiwygValue = $this->editable === 'inline' ? false : true;
+ }
+
return new Tiki_Render_Editable(
$content,
[
@@ -131,7 +145,7 @@ class Search_Formatter_Plugin_SmartyTemplate implements Search_Formatter_Plugin_
'field' => [
'id' => $this->editableId,
'type' => 'form',
- 'wysiwyg' => $this->editable === 'inline' ? false : true,
+ 'wysiwyg' => $wysiwygValue,
],
],
);
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/8f44cf08a865cd861d206507cea22f17286c82cc
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/8f44cf08a865cd861d206507cea22f17286c82cc
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help
_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs