private function build_form()
    {
        $form = new HTMLForm(__CLASS__);
        $fieldset = new FormFieldsetHTML('articles_configuration', LangLoader::get_message('configuration', 'admin-common'));
        $form->add_fieldset($fieldset);
        $fieldset->add_field(new FormFieldNumberEditor('number_articles_per_page', $this->admin_common_lang['config.items_number_per_page'], $this->config->get_number_articles_per_page(), array('min' => 1, 'max' => 50, 'required' => true), array(new FormFieldConstraintIntegerRange(1, 50))));
        $fieldset->add_field(new FormFieldNumberEditor('number_categories_per_page', $this->admin_common_lang['config.categories_number_per_page'], $this->config->get_number_categories_per_page(), array('min' => 1, 'max' => 50, 'required' => true), array(new FormFieldConstraintIntegerRange(1, 50))));
        $fieldset->add_field(new FormFieldCheckbox('display_icon_cats', $this->lang['articles_configuration.display_icon_cats'], $this->config->are_cats_icon_enabled(), array('events' => array('click' => '
			if (HTMLForms.getField("display_icon_cats").getValue()) {
				HTMLForms.getField("number_cols_display_cats").enable();
			} else { 
				HTMLForms.getField("number_cols_display_cats").disable();
			}'))));
        $fieldset->add_field(new FormFieldNumberEditor('number_cols_display_cats', $this->lang['articles_configuration.number_cols_display_cats'], $this->config->get_number_cols_display_cats(), array('min' => 1, 'max' => 4, 'required' => true), array(new FormFieldConstraintIntegerRange(1, 4))));
        $fieldset->add_field(new FormFieldCheckbox('notation_enabled', $this->admin_common_lang['config.notation_enabled'], $this->config->is_notation_enabled(), array('events' => array('click' => '
				if (HTMLForms.getField("notation_enabled").getValue()) {
					HTMLForms.getField("notation_scale").enable();
				} else {
					HTMLForms.getField("notation_scale").disable();
				}'))));
        $fieldset->add_field(new FormFieldNumberEditor('notation_scale', $this->admin_common_lang['config.notation_scale'], $this->config->get_notation_scale(), array('min' => 3, 'max' => 20, 'required' => true, 'hidden' => !$this->config->is_notation_enabled()), array(new FormFieldConstraintIntegerRange(3, 20))));
        $fieldset->add_field(new FormFieldCheckbox('comments_enabled', $this->admin_common_lang['config.comments_enabled'], $this->config->are_comments_enabled()));
        $fieldset->add_field(new FormFieldSimpleSelectChoice('display_type', $this->lang['articles_configuration.display_type'], $this->config->get_display_type(), array(new FormFieldSelectChoiceOption($this->lang['articles_configuration.display_type.mosaic'], ArticlesConfig::DISPLAY_MOSAIC), new FormFieldSelectChoiceOption($this->lang['articles_configuration.display_type.list'], ArticlesConfig::DISPLAY_LIST))));
        $fieldset->add_field(new FormFieldNumberEditor('number_character_to_cut', $this->lang['articles_configuration.number_character_to_cut'], $this->config->get_number_character_to_cut(), array('min' => 20, 'max' => 1000, 'required' => true), array(new FormFieldConstraintIntegerRange(20, 1000))));
        $fieldset->add_field(new FormFieldCheckbox('display_descriptions_to_guests', $this->lang['articles_configuration.display_descriptions_to_guests'], $this->config->are_descriptions_displayed_to_guests()));
        $fieldset->add_field(new FormFieldRichTextEditor('root_category_description', $this->admin_common_lang['config.root_category_description'], $this->config->get_root_category_description(), array('rows' => 8, 'cols' => 47)));
        $common_lang = LangLoader::get('common');
        $fieldset_authorizations = new FormFieldsetHTML('authorizations', $common_lang['authorizations'], array('description' => $this->admin_common_lang['config.authorizations.explain']));
        $form->add_fieldset($fieldset_authorizations);
        $auth_settings = new AuthorizationsSettings(array(new ActionAuthorization($common_lang['authorizations.read'], Category::READ_AUTHORIZATIONS), new ActionAuthorization($common_lang['authorizations.write'], Category::WRITE_AUTHORIZATIONS), new ActionAuthorization($common_lang['authorizations.contribution'], Category::CONTRIBUTION_AUTHORIZATIONS), new ActionAuthorization($common_lang['authorizations.moderation'], Category::MODERATION_AUTHORIZATIONS)));
        $auth_setter = new FormFieldAuthorizationsSetter('authorizations', $auth_settings);
        $auth_settings->build_from_auth_array($this->config->get_authorizations());
        $fieldset_authorizations->add_field($auth_setter);
        $this->submit_button = new FormButtonDefaultSubmit();
        $form->add_button($this->submit_button);
        $form->add_button(new FormButtonReset());
        $this->form = $form;
    }