mirror of
https://github.com/processwire/processwire.git
synced 2025-08-26 08:04:38 +02:00
Fix issue processwire/processwire-issues#1617 using suggestion from @BitPoet
Co-authored-by: BitPoet <BitPoet@users.noreply.github.com>
This commit is contained in:
@@ -149,17 +149,17 @@ class InputfieldRepeater extends Inputfield implements InputfieldItemList {
|
|||||||
// custom repeater titles specified
|
// custom repeater titles specified
|
||||||
$hasCnt = stripos($repeaterTitle, '#n') !== false;
|
$hasCnt = stripos($repeaterTitle, '#n') !== false;
|
||||||
|
|
||||||
|
if(strpos($repeaterTitle, '#') !== false) {
|
||||||
|
$repeaterTitle = preg_replace('/#([a-f\d]{3,})/i', "$colorPrefix$1", $repeaterTitle);
|
||||||
|
if(strpos($repeaterTitle, $colorPrefix) !== false) $hasColorPrefix = true;
|
||||||
|
}
|
||||||
|
|
||||||
// update index numbers?
|
// update index numbers?
|
||||||
if($hasCnt) {
|
if($hasCnt) {
|
||||||
// replace "#n" with index number of repeater item
|
// replace "#n" with index number of repeater item
|
||||||
$repeaterTitle = str_replace("#n", "#$cnt", $repeaterTitle);
|
$repeaterTitle = str_replace("#n", "#$cnt", $repeaterTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(strpos($repeaterTitle, '#') !== false) {
|
|
||||||
$repeaterTitle = preg_replace('/#([a-f\d]{3,})/i', "$colorPrefix$1", $repeaterTitle);
|
|
||||||
if(strpos($repeaterTitle, $colorPrefix) !== false) $hasColorPrefix = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(strpos($repeaterTitle, '{') !== false) {
|
if(strpos($repeaterTitle, '{') !== false) {
|
||||||
// formatted {label}
|
// formatted {label}
|
||||||
$out = $page->getText($repeaterTitle, true);
|
$out = $page->getText($repeaterTitle, true);
|
||||||
|
Reference in New Issue
Block a user