TheBigK
Well-known member
I'm totally embarrassed to post so many noob questions here. I'm however refusing to give up on coding. Being shameless and asking questions seems to be my only option.
The following array inside the template that handles censor words is beyond my comprehension.
I've no clue what's happening here:-
1. name="{$fieldPrefix}[{$preparedOption.option_id}][{$counter}][word]"
and similarly for the second input field as well. I looked at the abstract class XenForption_CensorWords to figure out what's going on and what fetches the right values; but with no use.
I'd really appreciate if anyone could spend a few minutes explaining this. And again, I'm sorry for so many questions.
The following array inside the template that handles censor words is beyond my comprehension.
PHP:
<xen:require js="js/xenforo/options_censor.js" />
<xen:controlunit label="{$preparedOption.title}" hint="{$preparedOption.hint}">
<xen:explain>{xen:raw $preparedOption.explain}</xen:explain>
<xen:html>
<ul>
<xen:foreach loop="$choices" key="$counter" value="$choice">
<li>
<xen:textbox name="{$fieldPrefix}[{$preparedOption.option_id}][{$counter}][word]" value="{$choice.word}" placeholder="{xen:phrase word_or_phrase}" size="20" />
<xen:textbox name="{$fieldPrefix}[{$preparedOption.option_id}][{$counter}][replace]" value="{$choice.replace}" placeholder="{xen:phrase replacement_optional}" size="20" />
</li>
</xen:foreach>
<li class="CensorWordOptionListener">
<xen:textbox name="{$fieldPrefix}[{$preparedOption.option_id}][{$nextCounter}][word]" value="" placeholder="{xen:phrase word_or_phrase}" size="20" />
<xen:textbox name="{$fieldPrefix}[{$preparedOption.option_id}][{$nextCounter}][replace]" value="" placeholder="{xen:phrase replacement_optional}" size="20" />
</li>
</ul>
<input type="hidden" name="{$listedFieldName}" value="{$preparedOption.option_id}" />
{xen:raw $editLink}
</xen:html>
</xen:controlunit>
I've no clue what's happening here:-
1. name="{$fieldPrefix}[{$preparedOption.option_id}][{$counter}][word]"
and similarly for the second input field as well. I looked at the abstract class XenForption_CensorWords to figure out what's going on and what fetches the right values; but with no use.
I'd really appreciate if anyone could spend a few minutes explaining this. And again, I'm sorry for so many questions.