19declare(strict_types=1);
37 $ui_factory =
$DIC->ui()->factory();
41 $num_postings = $ui_factory->input()->field()->numeric(
42 $lng->txt(
'trac_frm_contribution_num_postings')
43 )->withAdditionalTransformation(
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);
115 $mode === $this->getCurrentMode() &&
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')
126 }
catch (Throwable) {
static getDefaultModes(bool $lp_active)
Get available type-specific default modes (no administration needed)
appendModeConfiguration(int $mode)
saveModeConfiguration(string $selected_group, array $group_data, bool &$modeChanged)
static getInstance(int $a_obj_id=0)
const LP_MODE_DEACTIVATED
const LP_MODE_CONTRIBUTION_TO_DISCUSSION
Base class for object lp connectors.
static getInstance(int $obj_id)