[TikiWiki-commits] [Git][tikiwiki/tiki][master] [DOC] SmartyTemplate.php: Clarify usage of 'column' key in PluginList context
Benoit Grégoire (@benoitg) via TikiWiki-cvs <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <688c110783092_2c4be26819989@gitlab-sidekiq-low-urgency-cpu-bound-v2-78ddbdb4c5-k8p6n.mail> |
Benoit Grégoire pushed to branch master at Tiki Wiki CMS Groupware / Tiki
Commits:
ff657cfd by Alain Cisirika at 2025-08-01T00:50:04+00:00
[DOC] SmartyTemplate.php: Clarify usage of 'column' key in PluginList context
---
* [FIX] SmartyTemplate.php:ERROR (E_WARNING): Undefined array key 'column'
See merge request tikiwiki/tiki!7719
- - - - -
1 changed file:
- lib/core/Search/Formatter/Plugin/SmartyTemplate.php
Changes:
=====================================
lib/core/Search/Formatter/Plugin/SmartyTemplate.php
=====================================
@@ -72,6 +72,18 @@ class Search_Formatter_Plugin_SmartyTemplate implements Search_Formatter_Plugin_
$smarty->setLeftDelimiter('{{');
$smarty->setRightDelimiter('}}');
}
+ // Format date fields in entries based on column settings, mainly used in PluginList.
+ /**
+ * `$this->data["column"]` is usually set by templates like:
+ * {OUTPUT(template="table")}
+ * {column field="status" label="Status"}
+ * {column field="name" label="Name"}
+ * {OUTPUT}
+ *
+ * For fields that are dates (from `$entries->getDateFields()`), we wrap the value in
+ * `<span class='text-nowrap'>` to keep it on one line. If the column doesn't have "mode" set
+ * to "raw", we set it to avoid further formatting.
+ */
// Make Date type field elements not wrap
if (! empty($this->data['column'])) {
foreach ($entries as $key_row => $entry) {
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/ff657cfd102e84804adfdf26c216a8e6cc81ffd6
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/ff657cfd102e84804adfdf26c216a8e6cc81ffd6
You're receiving this email because of your account on gitlab.com.
_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs