LuceneSettingsForm::__construct PHP Method

__construct() public method

Constructor
public __construct ( &$plugin, &$embeddedServer )
$plugin LucenePlugin
    function __construct(&$plugin, &$embeddedServer)
    {
        $this->_plugin =& $plugin;
        $this->_embeddedServer =& $embeddedServer;
        parent::__construct($plugin->getTemplatePath() . 'settingsForm.tpl');
        // Server configuration.
        $this->addCheck(new FormValidatorUrl($this, 'searchEndpoint', FORM_VALIDATOR_REQUIRED_VALUE, 'plugins.generic.lucene.settings.searchEndpointRequired'));
        // The username is used in HTTP basic authentication and according to RFC2617 it therefore may not contain a colon.
        $this->addCheck(new FormValidatorRegExp($this, 'username', FORM_VALIDATOR_REQUIRED_VALUE, 'plugins.generic.lucene.settings.usernameRequired', '/^[^:]+$/'));
        $this->addCheck(new FormValidator($this, 'password', FORM_VALIDATOR_REQUIRED_VALUE, 'plugins.generic.lucene.settings.passwordRequired'));
        $this->addCheck(new FormValidator($this, 'instId', FORM_VALIDATOR_REQUIRED_VALUE, 'plugins.generic.lucene.settings.instIdRequired'));
        // Search feature configuration.
        $this->addCheck(new FormValidatorInSet($this, 'autosuggestType', FORM_VALIDATOR_REQUIRED_VALUE, 'plugins.generic.lucene.settings.internalError', array_keys($this->_getAutosuggestTypes())));
        $binaryFeatureSwitches = $this->_getFormFields(true);
        foreach ($binaryFeatureSwitches as $binaryFeatureSwitch) {
            $this->addCheck(new FormValidatorBoolean($this, $binaryFeatureSwitch, 'plugins.generic.lucene.settings.internalError'));
        }
        // Index administration.
        $journalsToReindex = array_keys($this->_getJournalsToReindex());
        $this->addCheck(new FormValidatorInSet($this, 'journalToReindex', FORM_VALIDATOR_REQUIRED_VALUE, 'plugins.generic.lucene.settings.internalError', $journalsToReindex));
    }