19 declare(strict_types=1);
37 $ui_factory = $DIC->ui()->factory();
39 $lng = $DIC->language();
41 $num_postings = $ui_factory->input()->field()->numeric(
42 $lng->txt(
'trac_frm_contribution_num_postings')
45 $refinery->int()->isGreaterThanOrEqual(1),
46 $refinery->int()->isLessThanOrEqual(99999)
48 )->withRequired(
true);
52 $num_postings = $num_postings->withValue($requiredNumberOfPostings);
55 return [
'number_of_postings' => $num_postings];
59 string $selected_group,
65 $current_value = $frm_properties->getLpReqNumPostings();
67 if (is_numeric($group_data[
'number_of_postings'] ??
null)) {
68 $frm_properties->setLpReqNumPostings(
69 (
int) $group_data[
'number_of_postings']
72 $frm_properties->setLpReqNumPostings(null);
74 $frm_properties->update();
76 if ($current_value !== $frm_properties->getLpReqNumPostings()) {
112 $text = parent::getModeText($mode);
119 match ($number_of_postings) {
120 1 => $DIC->language()->txt(
'trac_frm_contribution_num_postings_info_s'),
121 default => $DIC->language()->txt(
'trac_frm_contribution_num_postings_info_p')
appendModeConfiguration(int $mode)
saveModeConfiguration(string $selected_group, array $group_data, bool &$modeChanged)
static getInstance(int $a_obj_id=0)
const LP_MODE_CONTRIBUTION_TO_DISCUSSION
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static getDefaultModes(bool $lp_active)
const LP_MODE_DEACTIVATED