73 string $certificatePath,
101 $placeholderDescriptionObject
126 if (null ===
$tree) {
128 $tree = $DIC[
'tree'];
153 $form = $this->settingsFromFactory->createForm($certificateGUI, $certificateObject);
155 $objectLearningProgressSettings =
new ilLPObjSettings($this->object->getId());
157 $mode = $objectLearningProgressSettings->
getMode();
161 $formSection = new \ilFormSectionHeaderGUI();
163 $form->addItem($formSection);
165 $exp = $subitems->getExplorerGUI();
166 $exp->setSkipRootNode(
true);
167 $exp->setRootId($this->object->getRefId());
168 $exp->setTypeWhiteList($this->
getLPTypes($this->object->getId()));
181 $mode = $olp->getModeText($olp->getCurrentMode());
183 if (in_array($olp->getCurrentMode(), $invalid_modes)) {
184 $mode =
'<strong>' . $mode .
'</strong>';
186 return $objectHelper->lookupTitle($obj_id) .
' (' . $mode .
')';
189 $subitems->setRequired(
true);
190 $form->addItem($subitems);
199 public function save(array $formFields)
203 $titlesOfObjectsWithInvalidModes = array();
205 if (isset($formFields[
'subitems'])) {
206 $refIds = $formFields[
'subitems'];
209 foreach ($refIds as $refId) {
210 $objectId = $this->objectHelper->lookupObjId((
int) $refId);
213 if (in_array($currentMode, $invalidModes)) {
214 $titlesOfObjectsWithInvalidModes[] = $this->objectHelper->lookupTitle($objectId);
218 if (
sizeof($titlesOfObjectsWithInvalidModes)) {
219 $message = sprintf($this->
language->txt(
'certificate_learning_progress_must_be_active'), implode(
', ', $titlesOfObjectsWithInvalidModes));
223 $this->setting->set(
'cert_subitems_' . $this->object->getId(), json_encode($formFields[
'subitems']));
232 $formFields = $this->settingsFromFactory->fetchFormFieldData($content);
234 $formFields[
'subitems'] = json_decode($this->setting->get(
'cert_subitems_' . $this->object->getId(), json_encode(array())));
235 if ($formFields[
'subitems'] ===
'null' || $formFields[
'subitems'] === null) {
236 $formFields[
'subitems'] = array();
249 $root = $this->tree->getNodeData($a_parent_ref_id);
250 $sub_items = $this->tree->getSubTree(
$root);
251 array_shift($sub_items);
253 foreach ($sub_items as $node) {
254 if ($this->lpHelper->isSupportedObjectType($node[
'type'])) {
255 $class = $this->lpHelper->getTypeClass($node[
'type']);
256 $modes = $class::getDefaultModes($this->trackingHelper->enabledLearningProgress());
258 if (
sizeof($modes) > 1) {
272 $invalid_modes = array(
278 if (!$this->trackingHelper->enabledLearningProgress()) {
292 return $invalid_modes;
This class provides processing control methods.
const LP_MODE_MANUAL_BY_TUTOR
if(!array_key_exists('StateId', $_REQUEST)) $id
const LP_MODE_COLLECTION_MANUAL
const LP_MODE_COLLECTION_TLT
catch(Exception $e) $message
if(isset($_POST['submit'])) $form
getId()
get object id public
special template class to simplify handling of ITX/PEAR
GUI class to create PDF certificates.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
const LP_MODE_DEACTIVATED
const LP_MODE_COLLECTION_MOBS
static getInstance($a_obj_id)