public function appendEventFilterDocumentation(array $context) { if (in_array('validate-xsrf', $context['selected'])) { $context['documentation'][] = new XMLElement('p', __('To validate a XSRF token, ensure it is passed in the form.')); $context['documentation'][] = contentAjaxEventDocumentation::processDocumentationCode(Widget::Input('xsrf', '{$cookie-xsrf-token}', 'hidden')); } }
public function addFilterDocumentationToEvent(array $context) { if (in_array('recaptcha2', $context['selected'])) { $context['documentation'][] = new XMLElement('h3', 'reCAPTCHA v.2.0 Verification'); $context['documentation'][] = new XMLElement('p', __('Add following code to form.')); $context['documentation'][] = contentAjaxEventDocumentation::processDocumentationCode('<div class="g-recaptcha" data-sitekey="your-public-key"></div>'); $context['documentation'][] = new XMLElement('p', 'Each entry will be passed to the <a href="https://www.google.com/recaptcha/">reCAPTCHA v2.0 filtering service</a>. <strong>Note: Be sure to set your reCAPTCHA public and private API keys in the <a href="' . URL . '/symphony/system/preferences/">Symphony Preferences</a>.</strong>'); $context['documentation'][] = new XMLElement('p', 'The following is an example of the XML returned form this filter:'); $code = '<filter type="recaptcha2" status="passed" /> <filter type="recaptcha2" status="failed">Wrong captcha.</filter>'; $context['documentation'][] = contentAjaxEventDocumentation::processDocumentationCode($code); } }