ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilForumLP Class Reference

Class ilForumLP. More...

+ Inheritance diagram for ilForumLP:
+ Collaboration diagram for ilForumLP:

Public Member Functions

 appendModeConfiguration (int $mode, ilRadioOption $modeElement)
 
 saveModeConfiguration (ilPropertyFormGUI $form, bool &$modeChanged)
 
 getDefaultMode ()
 
 getValidModes ()
 
 getModeText (int $mode)
 
- Public Member Functions inherited from ilObjectLP
 resetCaches ()
 
 isAnonymized ()
 
 getDefaultMode ()
 
 getValidModes ()
 
 getCurrentMode ()
 
 isActive ()
 
 getModeText (int $mode)
 
 getModeInfoText (int $mode)
 
 getSettingsInfo ()
 
 getCollectionInstance ()
 
 getMembers (bool $search=true)
 
 resetLPDataForCompleteObject (bool $recursive=true)
 
 resetLPDataForUserIds (array $user_ids, bool $recursive=true)
 
 handleToTrash ()
 
 handleDelete ()
 
 getMailTemplateId ()
 
 hasIndividualModeOptions ()
 
 initInvidualModeOptions (ilRadioGroupInputGUI $modeRadio)
 
 shouldFetchIndividualModeFromFormSubmission ()
 
 fetchIndividualModeFromFormSubmission (ilPropertyFormGUI $form)
 
 appendModeConfiguration (int $mode, ilRadioOption $modeElement)
 
 saveModeConfiguration (ilPropertyFormGUI $form, bool &$modeChanged)
 

Static Public Member Functions

static getDefaultModes (bool $lp_active)
 
- Static Public Member Functions inherited from ilObjectLP
static getInstance (int $obj_id)
 
static getTypeClass (string $type)
 
static getSupportedObjectTypes ()
 
static isSupportedObjectType (string $type)
 
static handleMove (int $source_ref_id)
 
static getLPMemberships (int $usr_id, array $obj_ids, ?int $parent_ref_id=null, bool $mapped_ref_ids=false)
 Get all objects where given user is member (from LP POV) More...
 
static supportsSpentSeconds (string $obj_type)
 
static supportsMark (string $obj_type)
 
static supportsMatrixView (string $obj_type)
 
static getDefaultModes (bool $lp_active)
 Get available type-specific default modes (no administration needed) More...
 
static saveTypeDefaults (array $data)
 
static getTypeDefault (string $type)
 

Additional Inherited Members

- Protected Member Functions inherited from ilObjectLP
 __construct (int $obj_id)
 
 resetCustomLPDataForUserIds (array $user_ids, bool $recursive=true)
 
 gatherLPUsers ()
 
 updateParentCollections ()
 
- Static Protected Member Functions inherited from ilObjectLP
static isLPMember (array &$res, int $usr_id, array $obj_ids)
 Find (lp-relevant) members for given object ids. More...
 
static findMembershipsByPath (array &$res, int $usr_id, int $parent_ref_id, array $obj_ids, bool $mapped_ref_ids=false)
 Find (lp-relevant) memberships by path. More...
 
static getTypeDefaultFromDB (string $type)
 
- Protected Attributes inherited from ilObjectLP
ilTree $tree
 
ilDBInterface $db
 
ilObjectDefinition $objectDefinition
 
int $obj_id
 
ilLPCollection $collection_instance = null
 
int $mode = null
 
- Static Protected Attributes inherited from ilObjectLP
static array $type_defaults = null
 

Detailed Description

Class ilForumLP.

Author
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de

Definition at line 25 of file class.ilForumLP.php.

Member Function Documentation

◆ appendModeConfiguration()

ilForumLP::appendModeConfiguration ( int  $mode,
ilRadioOption  $modeElement 
)

Definition at line 27 of file class.ilForumLP.php.

References $DIC, ilRadioOption\addSubItem(), ilForumProperties\getInstance(), ilLPObjSettings\LP_MODE_CONTRIBUTION_TO_DISCUSSION, and ilRadioOption\setTitle().

27  : void
28  {
29  global $DIC;
30 
32  $num_postings = new ilNumberInputGUI(
33  $DIC->language()->txt('trac_frm_contribution_num_postings'),
34  'number_of_postings'
35  );
36  $num_postings->allowDecimals(false);
37  $num_postings->setMinValue(1);
38  $num_postings->setMaxValue(99999);
39  $num_postings->setSize(4);
40  $num_postings->setRequired(true);
41  if (is_int(ilForumProperties::getInstance($this->obj_id)->getLpReqNumPostings())) {
42  $requiredNumberOfPostings = ilForumProperties::getInstance($this->obj_id)->getLpReqNumPostings();
43  $num_postings->setValue((string) $requiredNumberOfPostings);
44  } else {
45  $num_postings->setValue('');
46  }
47  $modeElement->addSubItem($num_postings);
48 
49  // Use the default text presentation of the base class
50  $modeElement->setTitle(parent::getModeText($mode));
51  }
52  }
static getInstance(int $a_obj_id=0)
const LP_MODE_CONTRIBUTION_TO_DISCUSSION
global $DIC
Definition: feed.php:28
setTitle(string $a_title)
+ Here is the call graph for this function:

◆ getDefaultMode()

ilForumLP::getDefaultMode ( )

Definition at line 88 of file class.ilForumLP.php.

References ilLPObjSettings\LP_MODE_DEACTIVATED.

88  : int
89  {
91  }

◆ getDefaultModes()

static ilForumLP::getDefaultModes ( bool  $lp_active)
static

Definition at line 74 of file class.ilForumLP.php.

References ilLPObjSettings\LP_MODE_CONTRIBUTION_TO_DISCUSSION, and ilLPObjSettings\LP_MODE_DEACTIVATED.

74  : array
75  {
76  if ($lp_active) {
77  return [
80  ];
81  }
82 
83  return [
85  ];
86  }
const LP_MODE_CONTRIBUTION_TO_DISCUSSION

◆ getModeText()

ilForumLP::getModeText ( int  $mode)

Definition at line 101 of file class.ilForumLP.php.

References $DIC, ilObjectLP\getCurrentMode(), ilForumProperties\getInstance(), and ilLPObjSettings\LP_MODE_CONTRIBUTION_TO_DISCUSSION.

101  : string
102  {
103  global $DIC;
104 
105  $text = parent::getModeText($mode);
106 
108  $mode === $this->getCurrentMode() &&
109  is_int(($number_of_postings = ilForumProperties::getInstance($this->obj_id)->getLpReqNumPostings()))) {
110  try {
111  $text = sprintf(
112  match ($number_of_postings) {
113  1 => $DIC->language()->txt('trac_frm_contribution_num_postings_info_s'),
114  default => $DIC->language()->txt('trac_frm_contribution_num_postings_info_p')
115  },
116  $text,
117  $number_of_postings
118  );
119  } catch (Throwable) {
120  }
121  }
122 
123  return $text;
124  }
static getInstance(int $a_obj_id=0)
const LP_MODE_CONTRIBUTION_TO_DISCUSSION
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

◆ getValidModes()

ilForumLP::getValidModes ( )

◆ saveModeConfiguration()

ilForumLP::saveModeConfiguration ( ilPropertyFormGUI  $form,
bool &  $modeChanged 
)

Definition at line 54 of file class.ilForumLP.php.

References ilPropertyFormGUI\getInput(), and ilForumProperties\getInstance().

54  : void
55  {
56  $frm_properties = ilForumProperties::getInstance($this->obj_id);
57 
58  $current_value = $frm_properties->getLpReqNumPostings();
59 
60  if (is_numeric($form->getInput('number_of_postings'))) {
61  $frm_properties->setLpReqNumPostings(
62  (int) $form->getInput('number_of_postings')
63  );
64  } else {
65  $frm_properties->setLpReqNumPostings(null);
66  }
67  $frm_properties->update();
68 
69  if ($current_value !== $frm_properties->getLpReqNumPostings()) {
70  $modeChanged = true;
71  }
72  }
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
static getInstance(int $a_obj_id=0)
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: