49 $this->tabs_gui =& $ilTabs;
50 $this->gui_object =& $a_gui_object;
52 $this->private_notes_enabled =
false;
53 $this->news_enabled =
false;
54 $this->feedback_enabled =
false;
55 $this->learning_progress_enabled =
false;
56 $this->form_action =
"";
57 $this->top_formbuttons = array();
58 $this->hiddenelements = array();
66 global $rbacsystem,
$tpl, $ilAccess;
69 $this->lng->loadLanguageModule(
"barometer");
71 $next_class = $this->ctrl->getNextClass($this);
73 $cmd = $this->ctrl->getCmd(
"showSummary");
74 $this->ctrl->setReturn($this,
"showSummary");
88 case "ilpublicuserprofilegui":
89 include_once(
"./Services/User/classes/class.ilPublicUserProfileGUI.php");
91 $user_profile->setBackUrl($this->ctrl->getLinkTarget($this,
"showSummary"));
92 $html = $this->ctrl->forwardCommand($user_profile);
93 $tpl->setContent($html);
96 case "ilcommonactiondispatchergui":
97 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
99 $this->ctrl->forwardCommand($gui);
103 return $this->
$cmd();
116 $this->table_class = $a_val;
134 $this->private_notes_enabled = $a_enable;
142 $this->learning_progress_enabled = $a_enable;
151 $this->feedback_enabled = $a_enable;
159 $this->news_enabled = $a_enable;
167 $this->news_editing = $a_enable;
179 $this->block_property[$a_block_type][$a_property] = $a_value;
184 return $this->block_property;
193 $this->section[$this->sec_nr][
"title"] = $a_title;
194 $this->section[$this->sec_nr][
"hidden"] = (bool)$this->hidden;
202 $this->form_action = $a_form_action;
210 $this->form_action =
"";
222 $this->section[$this->sec_nr][
"properties"][] =
223 array(
"name" => $a_name,
"value" => $a_value,
230 function addPropertyCheckbox($a_name, $a_checkbox_name, $a_checkbox_value, $a_checkbox_label =
"", $a_checkbox_checked =
false)
232 $checkbox =
"<input type=\"checkbox\" name=\"$a_checkbox_name\" value=\"$a_checkbox_value\" id=\"$a_checkbox_name$a_checkbox_value\"";
233 if ($a_checkbox_checked)
235 $checkbox .=
" checked=\"checked\"";
238 if (strlen($a_checkbox_label))
240 $checkbox .=
" <label for=\"$a_checkbox_name$a_checkbox_value\">$a_checkbox_label</label>";
242 $this->section[$this->sec_nr][
"properties"][] =
243 array(
"name" => $a_name,
"value" => $checkbox);
249 function addPropertyTextinput($a_name, $a_input_name, $a_input_value =
"", $a_input_size =
"", $direct_button_command =
"", $direct_button_label =
"", $direct_button_primary =
false)
251 $input =
"<span class=\"form-inline\"><input class=\"form-control\" type=\"text\" name=\"$a_input_name\" id=\"$a_input_name\"";
252 if (strlen($a_input_value))
256 if (strlen($a_input_size))
258 $input .=
" size=\"" . $a_input_size .
"\"";
261 if (strlen($direct_button_command) && strlen($direct_button_label))
264 if($direct_button_primary)
266 $css =
" btn-primary";
268 $input .=
" <input type=\"submit\" class=\"btn btn-default".$css.
"\" name=\"cmd[$direct_button_command]\" value=\"$direct_button_label\" />";
271 $this->section[$this->sec_nr][
"properties"][] =
272 array(
"name" =>
"<label for=\"$a_input_name\">$a_name</label>",
"value" => $input);
278 function addButton($a_title, $a_link, $a_frame =
"", $a_position =
"top", $a_primary =
false)
280 if ($a_position ==
"top")
282 $this->top_buttons[] =
283 array(
"title" => $a_title,
"link" => $a_link,
"target" => $a_frame,
"primary" => $a_primary);
293 if ($a_position ==
"top")
295 array_push($this->top_formbuttons,
296 array(
"command" => $a_command,
"title" => $a_title)
303 array_push($this->hiddenelements, array(
"name" => $a_name,
"value" => $a_value));
313 $lng->loadLanguageModule(
"meta");
315 include_once(
"./Services/MetaData/classes/class.ilMD.php");
316 $md =
new ilMD($a_rep_obj_id,$a_obj_id, $a_type);
318 if ($md_gen = $md->getGeneral())
323 foreach($md_gen->getDescriptionIds() as $id)
325 $md_des = $md_gen->getDescription($id);
326 $description = $md_des->getDescription();
332 foreach($ids = $md_gen->getLanguageIds() as $id)
334 $md_lan = $md_gen->getLanguage($id);
335 if ($md_lan->getLanguageCode() !=
"")
337 $langs[] = $lng->txt(
"meta_l_".$md_lan->getLanguageCode());
340 $langs = implode($langs,
", ");
344 foreach($ids = $md_gen->getKeywordIds() as $id)
346 $md_key = $md_gen->getKeyword($id);
347 $keywords[] = $md_key->getKeyword();
349 $keywords = implode($keywords,
", ");
353 if(is_object($lifecycle = $md->getLifecycle()))
356 foreach(($ids = $lifecycle->getContributeIds()) as $con_id)
358 $md_con = $lifecycle->getContribute($con_id);
359 if ($md_con->getRole() ==
"Author")
361 foreach($ent_ids = $md_con->getEntityIds() as $ent_id)
363 $md_ent = $md_con->getEntity($ent_id);
364 $author = $author.$sep.$md_ent->getEntity();
373 if(is_object($rights = $md->getRights()))
375 include_once(
'Services/MetaData/classes/class.ilMDUtils.php');
380 #if(is_object($educational = $md->getEducational()))
382 # $learning_time = $educational->getTypicalLearningTime();
385 if(is_object($educational = $md->getEducational()))
387 if($seconds = $educational->getTypicalLearningTimeSeconds())
397 if ($description !=
"")
420 if ($copyright !=
"")
425 if ($learning_time !=
"")
427 $this->
addProperty($lng->txt(
"meta_typical_learning_time"),
439 $this->
addSection($lng->txt(
"additional_info"));
440 $a_obj = $this->gui_object->object;
443 if (is_object($a_obj))
446 $type = $a_obj->getType();
451 include_once(
'./Services/Link/classes/class.ilLink.php');
454 include_once
'Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
462 include_once
'Services/PermanentLink/classes/class.ilPermanentLinkGUI.php';
464 $pm->setIncludePermanentLinkText(
false);
465 $pm->setAlignCenter(
false);
473 $title = $ilObjDataCache->lookupTitle($a_obj->getId());
478 if ($ilAccess->checkAccess(
"write",
"",
$ref_id) ||
479 $ilAccess->checkAccess(
"edit_permissions",
"",
$ref_id))
481 $obj_id = $a_obj->getId();
486 if ($tree->isInTree($r))
491 if (count($refs) > 1)
497 $cont_loc->addContextItems($r,
true);
498 $links.= $sep.$cont_loc->getHTML();
503 '<div class="small">'.$links.
'</div>'
513 $lng->txt(
"create_date"),
517 if ($ilUser->getId() != ANONYMOUS_USER_ID and $a_obj->getOwner())
519 include_once
'./Services/Object/classes/class.ilObjectFactory.php';
520 include_once
'./Services/User/classes/class.ilObjUser.php';
531 if (!is_object($ownerObj) || $ownerObj->getType() !=
"usr")
533 $this->
addProperty($lng->txt(
"owner"), $lng->txt(
"no_owner"));
535 else if ($ownerObj->hasPublicProfile())
537 $ilCtrl->setParameterByClass(
"ilpublicuserprofilegui",
"user_id", $ownerObj->getId());
538 $this->
addProperty($lng->txt(
"owner"),$ownerObj->getPublicName(),$ilCtrl->getLinkTargetByClass(
"ilpublicuserprofilegui",
"getHTML"));
542 $this->
addProperty($lng->txt(
"owner"),$ownerObj->getPublicName());
547 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
548 if ($ilUser->getId() != ANONYMOUS_USER_ID &&
551 $size = $a_obj->getDiskUsage();
552 if (
$size !== null) {
557 require_once
'Services/Tracking/classes/class.ilChangeEvent.php';
560 if ($ilUser->getId() != ANONYMOUS_USER_ID)
565 $count_user_reads = 0;
566 $count_anonymous_reads = 0;
567 foreach ($readEvents as $evt)
569 if ($evt[
'usr_id'] == ANONYMOUS_USER_ID)
571 $count_anonymous_reads += $evt[
'read_count'];
575 $count_user_reads += $evt[
'read_count'];
583 if ($count_anonymous_reads > 0)
585 $this->
addProperty($this->lng->txt(
"readcount_anonymous_users"),$count_anonymous_reads);
587 if ($count_user_reads > 0)
589 $this->
addProperty($this->lng->txt(
"readcount_users"),$count_user_reads);
591 if ($count_users > 0)
593 $this->
addProperty($this->lng->txt(
"accesscount_registered_users"),$count_users);
600 require_once(
'Services/WebDAV/classes/class.ilDAVServer.php');
604 if ($ilUser->getId() != ANONYMOUS_USER_ID)
609 if ($ilias->account->getId() != ANONYMOUS_USER_ID)
611 $locks =& $davLocks->getLocksOnObjectObj($a_obj->getId());
612 if (count($locks) > 0)
614 $lockUser =
new ilObjUser($locks[0][
'ilias_owner']);
616 $lockUser->getPublicName()
618 "./ilias.php?user=".$locks[0][
'ilias_owner'].
'&cmd=showUserProfile&cmdClass=ilpersonaldesktopgui&cmdNode=1&baseClass=ilPersonalDesktopGUI'
634 global
$tpl, $ilAccess;
648 include_once(
"Services/Block/classes/class.ilColumnGUI.php");
652 if (!$ilCtrl->isAsynch())
661 $html = $ilCtrl->forwardCommand($column_gui);
668 $html = $ilCtrl->forwardCommand($column_gui);
687 include_once(
"Services/Block/classes/class.ilColumnGUI.php");
691 if ($ilCtrl->getNextClass() ==
"ilcolumngui" &&
695 $html = $ilCtrl->forwardCommand($column_gui);
699 if (!$ilCtrl->isAsynch())
701 if ($this->news_enabled)
703 $html = $ilCtrl->getHTML($column_gui);
716 global
$lng, $ilAccess;
718 $column_gui->setEnableEdit($this->news_editing);
719 $column_gui->setRepositoryMode(
true);
725 $this->open_form_tag = $a_val;
730 $this->close_form_tag = $a_val;
740 $tpl =
new ilTemplate(
"tpl.infoscreen.html" ,
true,
true,
"Services/InfoScreen");
743 if ($this->form_action ==
"")
748 require_once
'Services/jQuery/classes/class.iljQueryUtil.php';
753 $tpl->touchBlock(
"hidden_js");
754 if($this->show_hidden_toggle)
756 $this->
addButton($lng->txt(
"show_hidden_sections"),
"JavaScript:toggleSections(this, '".$lng->txt(
"show_hidden_sections") .
"', '".$lng->txt(
"hide_visible_sections") .
"');");
764 if (count($this->top_buttons) > 0)
766 $tpl->addBlockfile(
"TOP_BUTTONS",
"top_buttons",
"tpl.buttons.html");
768 foreach($this->top_buttons as $button)
771 $tpl->setCurrentBlock(
"btn_cell");
772 $tpl->setVariable(
"BTN_LINK", $button[
"link"]);
773 $tpl->setVariable(
"BTN_TARGET", $button[
"target"]);
774 $tpl->setVariable(
"BTN_TXT", $button[
"title"]);
775 if($button[
"primary"])
777 $tpl->setVariable(
"BTN_CLASS",
" btn-primary");
779 $tpl->parseCurrentBlock();
784 if ((count($this->top_formbuttons) > 0) && (strlen($this->form_action) > 0))
786 $tpl->addBlockfile(
"TOP_FORMBUTTONS",
"top_submitbuttons",
"tpl.submitbuttons.html",
"Services/InfoScreen");
788 foreach($this->top_formbuttons as $button)
791 $tpl->setCurrentBlock(
"btn_submit_cell");
792 $tpl->setVariable(
"BTN_COMMAND", $button[
"command"]);
793 $tpl->setVariable(
"BTN_NAME", $button[
"title"]);
794 $tpl->parseCurrentBlock();
799 if (strlen($this->form_action) > 0)
801 if($this->open_form_tag)
803 $tpl->setCurrentBlock(
"formtop");
804 $tpl->setVariable(
"FORMACTION", $this->form_action);
805 $tpl->parseCurrentBlock();
808 if($this->close_form_tag)
810 $tpl->touchBlock(
"formbottom");
814 if (count($this->hiddenelements))
816 foreach ($this->hiddenelements as $hidden)
818 $tpl->setCurrentBlock(
"hidden_element");
819 $tpl->setVariable(
"HIDDEN_NAME", $hidden[
"name"]);
820 $tpl->setVariable(
"HIDDEN_VALUE", $hidden[
"value"]);
821 $tpl->parseCurrentBlock();
829 $tpl->setCurrentBlock(
"learning_progress");
830 $tpl->setVariable(
"LP_TABLE",$html);
831 $tpl->parseCurrentBlock();
835 if ($this->private_notes_enabled && !$ilSetting->get(
'disable_notes'))
838 $tpl->setCurrentBlock(
"notes");
839 $tpl->setVariable(
"NOTES", $html);
840 $tpl->parseCurrentBlock();
844 if (is_object($this->gui_object->object))
847 if ($tags_set->get(
"enable") && $ilUser->getId() != ANONYMOUS_USER_ID)
853 if(is_object($this->gui_object->object))
859 for($i = 1; $i <= $this->sec_nr; $i++)
861 if (is_array($this->section[$i][
"properties"]))
864 foreach($this->section[$i][
"properties"] as $property)
866 if ($property[
"name"] !=
"")
868 if ($property[
"link"] ==
"")
870 $tpl->setCurrentBlock(
"pv");
871 $tpl->setVariable(
"TXT_PROPERTY_VALUE", $property[
"value"]);
872 $tpl->parseCurrentBlock();
876 $tpl->setCurrentBlock(
"lpv");
877 $tpl->setVariable(
"TXT_PROPERTY_LVALUE", $property[
"value"]);
878 $tpl->setVariable(
"LINK_PROPERTY_VALUE", $property[
"link"]);
879 $tpl->parseCurrentBlock();
881 $tpl->setCurrentBlock(
"property_row");
882 $tpl->setVariable(
"TXT_PROPERTY", $property[
"name"]);
883 $tpl->parseCurrentBlock();
887 $tpl->setCurrentBlock(
"property_full_row");
888 $tpl->setVariable(
"TXT_PROPERTY_FULL_VALUE", $property[
"value"]);
889 $tpl->parseCurrentBlock();
894 if($this->section[$i][
"hidden"])
896 $tpl->setVariable(
"SECTION_HIDDEN",
" style=\"display:none;\"");
897 $tpl->setVariable(
"SECTION_ID",
"hidable_".$i);
901 $tpl->setVariable(
"SECTION_ID", $i);
904 $tpl->setVariable(
"TXT_SECTION", $this->section[$i][
"title"]);
905 $tpl->touchBlock(
"row");
916 if(!$rbacsystem->checkAccess(
'read',$this->gui_object->object->getRefId()))
920 if($ilUser->getId() == ANONYMOUS_USER_ID)
925 include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
931 include_once
'./Services/Object/classes/class.ilObjectLP.php';
938 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
940 $this->lng->loadLanguageModule(
'trac');
944 $a_tpl->setVariable(
"TXT_SECTION",
945 $this->lng->txt(
'learning_progress'));
946 $a_tpl->parseCurrentBlock();
950 $i_tpl =
new ilTemplate(
"tpl.lp_edit_manual_info_page.html",
true,
true,
"Services/Tracking");
951 $i_tpl->setVariable(
"INFO_EDITED", $this->lng->txt(
"trac_info_edited"));
953 $this->gui_object->object->getId()),
955 array(0 => $this->lng->txt(
'trac_not_completed'),
956 1 => $this->lng->txt(
'trac_completed')),
959 $i_tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
960 $a_tpl->setCurrentBlock(
"pv");
961 $a_tpl->setVariable(
"TXT_PROPERTY_VALUE", $i_tpl->get());
962 $a_tpl->parseCurrentBlock();
963 $a_tpl->setCurrentBlock(
"property_row");
964 $a_tpl->setVariable(
"TXT_PROPERTY", $this->lng->txt(
'trac_status'));
965 $a_tpl->parseCurrentBlock();
970 if($this->gui_object->object->getType() ==
'lm' ||
971 $this->gui_object->object->getType() ==
'htlm')
973 $a_tpl->setCurrentBlock(
"pv");
975 include_once
'Services/Tracking/classes/class.ilLearningProgress.php';
977 if($progress[
'access_time'])
979 $a_tpl->setVariable(
"TXT_PROPERTY_VALUE",
984 $a_tpl->setVariable(
"TXT_PROPERTY_VALUE",
985 $this->lng->txt(
'trac_not_accessed'));
988 $a_tpl->parseCurrentBlock();
989 $a_tpl->setCurrentBlock(
"property_row");
990 $a_tpl->setVariable(
"TXT_PROPERTY", $this->lng->txt(
'trac_last_access'));
991 $a_tpl->parseCurrentBlock();
995 $a_tpl->setCurrentBlock(
"pv");
996 $a_tpl->setVariable(
"TXT_PROPERTY_VALUE",
997 (
int) $progress[
'visits']);
998 $a_tpl->parseCurrentBlock();
999 $a_tpl->setCurrentBlock(
"property_row");
1000 $a_tpl->setVariable(
"TXT_PROPERTY", $this->lng->txt(
'trac_visits'));
1001 $a_tpl->parseCurrentBlock();
1005 if($this->gui_object->object->getType() ==
'lm')
1008 $a_tpl->setCurrentBlock(
"pv");
1009 $a_tpl->setVariable(
"TXT_PROPERTY_VALUE",
1011 $a_tpl->parseCurrentBlock();
1012 $a_tpl->setCurrentBlock(
"property_row");
1013 $a_tpl->setVariable(
"TXT_PROPERTY", $this->lng->txt(
'trac_spent_time'));
1014 $a_tpl->parseCurrentBlock();
1020 $a_tpl->touchBlock(
"row");
1027 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
1029 $lp_marks =
new ilLPMarks($this->gui_object->object->getId(),$ilUser->getId());
1031 $lp_marks->update();
1033 require_once
'Services/Tracking/classes/class.ilLPStatusWrapper.php';
1036 $this->lng->loadLanguageModule(
'trac');
1038 $this->ctrl->redirect($this,
"");
1051 $next_class = $this->ctrl->getNextClass($this);
1052 include_once(
"Services/Notes/classes/class.ilNoteGUI.php");
1053 $notes_gui =
new ilNoteGUI($this->gui_object->object->getId(), 0,
1054 $this->gui_object->object->getType());
1057 if($ilSetting->get(
"disable_comments"))
1063 $ref_id = $this->gui_object->object->getRefId();
1064 $has_write = $ilAccess->checkAccess(
"write",
"",
$ref_id);
1066 if($has_write && $ilSetting->get(
"comments_del_tutor", 1))
1068 $notes_gui->enablePublicNotesDeletion(
true);
1076 $ilAccess->checkAccess(
"edit_permissions",
"",
$ref_id))
1078 $notes_gui->enableCommentsSettings();
1086 if ($next_class ==
"ilnotegui")
1088 $html = $this->ctrl->forwardCommand($notes_gui);
1092 $html = $notes_gui->getNotesHTML();
1107 if(strlen($a_section))
1111 include_once(
'Services/LDAP/classes/class.ilLDAPRoleGroupMapping.php');
1113 if($infos = $ldap_mapping->getInfoStrings($this->gui_object->object->getId()))
1115 $info_combined =
'<div style="color:green;">';
1117 foreach($infos as $info_string)
1121 $info_combined .=
'<br />';
1123 $info_combined .= $info_string;
1125 $info_combined .=
'</div>';
1126 $this->
addProperty($this->lng->txt(
'applications'),$info_combined);
1135 $this->
getTabs($this->tabs_gui);
1143 global $rbacsystem,
$ilUser,$ilAccess;
1145 $next_class = $this->ctrl->getNextClass($this);
1146 $force_active = ($next_class ==
"ilnotegui")
1150 $tabs_gui->addSubTabTarget(
'summary',
1151 $this->ctrl->getLinkTarget($this,
"showSummary"),
1152 array(
"showSummary",
""),
1153 get_class($this),
"", $force_active);
1164 $lng->loadLanguageModule(
"tagging");
1167 include_once(
"Services/Tagging/classes/class.ilTaggingGUI.php");
1169 $tagging_gui->setObject($this->gui_object->object->getId(),
1170 $this->gui_object->object->getType());
1172 $this->
addSection($lng->txt(
"tagging_tags"));
1174 if ($tags_set->get(
"enable_all_users"))
1176 $this->
addProperty($lng->txt(
"tagging_all_users"),
1177 $tagging_gui->getAllUserTagsForObjectHTML());
1181 $tagging_gui->getTaggingInputHTML());
1186 include_once(
"Services/Tagging/classes/class.ilTaggingGUI.php");
1188 $tagging_gui->setObject($this->gui_object->object->getId(),
1189 $this->gui_object->object->getType());
1190 $tagging_gui->saveInput();
1193 $this->ctrl->redirect($this,
"");
1200 $this->hidden =
true;
1201 $this->show_hidden_toggle = (bool)$a_add_toggle;
1208 return "<a onClick=\"toggleSections(this, '".$lng->txt(
"show_hidden_sections") .
"', '".$lng->txt(
"hide_visible_sections") .
"'); return false;\" href=\"#\">".$lng->txt(
"show_hidden_sections").
"</a>";