function __construct($name = null, $title = null, $value = null, $form = null, $rightTitle = null) { if ($form) { $data = $form->getData(); if (SimpleSpamProtector::PageCommentsExpired($data['ParentID'])) { $form->unsetAllActions(); $form->Fields = new FieldSet(); $form->setMessage(_t('SimpleSpamProtector.DISABLED', "Comments for this page have been disabled"), 'warning'); $form->makeReadonly(); } } $title .= _t('SimpleSpamProtector.WHATIS', "What is") . " " . rand(1, 10) . " + " . rand(1, 10); parent::__construct($name, $title, $value, $form, $rightTitle); }
function __construct($name, $title = null, $value = null, $form = null, $rightTitle = null) { parent::__construct($name, $title, $value, $form, $rightTitle); $this->jsOptions = self::$js_options; // try to auto-detect language-settings $lang = substr(i18n::get_locale(), 0, 2); if (in_array($lang, self::$valid_languages)) { $this->jsOptions['lang'] = $lang; } }