4 include_once(
'./Modules/Portfolio/classes/class.ilObjPortfolioBaseGUI.php');
23 parent::__construct($a_id, self::PORTFOLIO_OBJECT_ID, 0);
33 if($a_perm ==
"create")
41 return $this->access_handler->checkAccess($a_perm,
"", $a_node_id);
56 $next_class = $this->ctrl->getNextClass($this);
57 $cmd = $this->ctrl->getCmd(
"view");
69 case "ilworkspaceaccessgui";
73 $this->tabs_gui->activateTab(
"share");
75 $this->tpl->setPermanentLink(
"prtf", $this->object->getId());
77 include_once(
'./Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php');
79 $this->ctrl->forwardCommand($wspacc);
83 case 'ilportfoliopagegui':
89 include_once
"Services/Form/classes/class.ilFileInputGUI.php";
99 case "ilobjstylesheetgui":
100 include_once (
"./Services/Style/classes/class.ilObjStyleSheetGUI.php");
101 $this->ctrl->setReturn($this,
"editStyleProperties");
102 $style_gui =
new ilObjStyleSheetGUI(
"", $this->object->getStyleSheetId(),
false,
false);
104 if (
$cmd ==
"create" ||
$_GET[
"new_type"]==
"sty")
106 $style_gui->setCreationMode(
true);
109 if (
$cmd ==
"confirmedDelete")
111 $this->
object->setStyleSheetId(0);
112 $this->
object->update();
115 $ret = $this->ctrl->forwardCommand($style_gui);
117 if (
$cmd ==
"save" ||
$cmd ==
"copyStyle" ||
$cmd ==
"importStyle")
120 $this->
object->setStyleSheetId($style_id);
121 $this->
object->update();
122 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
128 if(
$cmd !=
"preview")
144 $ilHelp->setScreenIdComponent(
"prtf");
148 $this->tabs_gui->addTab(
"pages",
149 $this->lng->txt(
"content"),
150 $this->ctrl->getLinkTarget($this,
"view"));
152 $this->tabs_gui->addTab(
"settings",
153 $this->lng->txt(
"settings"),
154 $this->ctrl->getLinkTarget($this,
"edit"));
156 $this->tabs_gui->addNonTabbedLink(
"preview",
157 $this->lng->txt(
"user_profile_preview"),
158 $this->ctrl->getLinkTarget($this,
"preview"));
160 $this->lng->loadLanguageModule(
"wsp");
161 $this->tabs_gui->addTab(
"share",
162 $this->lng->txt(
"wsp_permissions"),
163 $this->ctrl->getLinkTargetByClass(
"ilworkspaceaccessgui",
"share"));
169 if(!$this->creation_mode)
171 $this->ctrl->setParameter($this,
"prt_id", $this->object->getId());
174 parent::addLocatorItems();
176 $this->tpl->setLocator();
183 $title = $this->lng->txt(
"portfolio");
186 $title .=
": ".$this->object->getTitle();
188 $this->tpl->setTitle($title);
190 $this->lng->txt(
"portfolio"));
193 !$this->object->isOnline())
195 $this->tpl->setAlertProperties(array(
196 array(
"alert" =>
true,
197 "property" => $this->lng->txt(
"status"),
198 "value" => $this->lng->txt(
"offline"))
210 return array(self::CFORM_NEW => $this->
initCreateForm($a_new_type));
217 $this->ctrl->setParameter($this,
"new_type", $this->
getType());
219 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
221 $form->setFormAction($this->ctrl->getFormAction($this));
227 $ti->setRequired(
true);
239 $form->addItem($main);
241 $opt_scratch =
new ilRadioOption($this->lng->txt(
"prtf_creation_mode_scratch"),
"mode_scratch");
242 $main->addOption($opt_scratch);
249 $opt_scratch->addSubItem($type);
251 $type_page =
new ilRadioOption($this->lng->txt(
"page"),
"page");
252 $type->addOption($type_page);
258 $tf->setRequired(
true);
259 $type_page->addSubItem($tf);
262 include_once
"Services/Style/classes/class.ilPageLayout.php";
266 $options = array(0 => $this->lng->txt(
"none"));
267 foreach ($templates as $templ)
269 $templ->readObject();
270 $options[$templ->getId()] = $templ->getTitle();
273 $use_template =
new ilSelectInputGUI($this->lng->txt(
"prtf_use_page_layout"),
"tmpl");
275 $use_template->setOptions(
$options);
276 $type_page->addSubItem($use_template);
280 if(!$ilSetting->get(
'disable_wsp_blogs'))
283 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
285 $root =
$tree->readRootId();
288 $root =
$tree->getNodeData($root);
289 foreach (
$tree->getSubTree($root) as $node)
291 if ($node[
"type"] ==
"blog")
293 $options[$node[
"obj_id"]] = $node[
"title"];
300 $type_blog =
new ilRadioOption($this->lng->txt(
"obj_blog"),
"blog");
301 $type->addOption($type_blog);
305 $obj->setOptions(array(
""=>$this->lng->txt(
"please_select"))+
$options);
306 $type_blog->addSubItem($obj);
311 $type->setValue(
"page");
318 $opt_tmpl =
new ilRadioOption($this->lng->txt(
"prtf_creation_mode_template"),
"mode_tmpl");
319 $main->addOption($opt_tmpl);
321 include_once
"Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
323 if(!
sizeof($templates))
325 $opt_tmpl->setDisabled(
true);
331 $tmpl->setOptions(array(
""=>$this->lng->txt(
"please_select"))+$templates);
332 $opt_tmpl->addSubItem($tmpl);
337 $tmpl->setValue((
int)$_REQUEST[
"prtt_pre"]);
338 $main->setValue(
"mode_tmpl");
343 $form->setTitle($this->lng->txt(
"prtf_create_portfolio"));
344 $form->addCommandButton(
"save", $this->lng->txt(
"create"));
345 $form->addCommandButton(
"toRepository", $this->lng->txt(
"cancel"));
353 if($form->checkInput())
356 if($form->getInput(
"mode") ==
"mode_tmpl")
358 $_REQUEST[
"pt"] = $form->getInput(
"title");
363 return parent::save();
369 include_once(
"Modules/Portfolio/classes/class.ilPortfolioPage.php");
371 if(
$_POST[
"ptype"] ==
"page")
374 $page->setTitle(
$_POST[
"fpage"]);
377 $layout_id =
$_POST[
"tmpl"];
380 include_once(
"./Services/Style/classes/class.ilPageLayout.php");
382 $page->setXMLContent($layout_obj->getXMLContent());
388 $page->setTitle(
$_POST[
"blog"]);
393 $this->ctrl->setParameter($this,
"prt_id", $a_new_object->
getId());
394 $this->ctrl->redirect($this,
"view");
404 $ilAccess->checkAccess(
"read",
"", $exc_ref_id))
406 include_once
"Services/Link/classes/class.ilLink.php";
410 $this->ctrl->redirectByClass(
"ilportfoliorepositorygui",
"show");
415 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
417 $form->setFormAction($this->ctrl->getFormAction($this));
423 $ti->setRequired(
true);
424 $ti->setValue($this->object->getTitle());
437 $online->
setChecked($this->object->isOnline());
438 $form->addItem($online);
442 $form->setTitle($this->lng->txt(
"prtf_edit_portfolio"));
443 $form->addCommandButton(
"update", $this->lng->txt(
"save"));
444 $form->addCommandButton(
"view", $this->lng->txt(
"cancel"));
451 $a_values[
"online"] = $this->
object->isOnline();
453 parent::getEditFormCustomValues($a_values);
458 $this->
object->setOnline($a_form->
getInput(
"online"));
466 parent::updateCustom($a_form);
484 if(!$a_portfolio_id && $this->
object)
486 $a_portfolio_id = $this->
object->getId();
488 include_once
"Modules/Portfolio/classes/class.ilPortfolioPage.php";
490 $page->setPortfolioId($a_portfolio_id);
502 include_once(
"Modules/Portfolio/classes/class.ilPortfolioPageGUI.php");
504 $this->object->getId(),
507 $this->
object->hasPublicComments()
515 return "ilportfoliopagegui";
520 $old =
new ilRadioOption($this->lng->txt(
"prtf_existing_portfolio"),
"old");
521 $a_tgt->addOption($old);
525 foreach($all as $item)
527 $options[$item[
"id"]] = $item[
"title"];
532 $old->addSubItem($prtf);
534 $new =
new ilRadioOption($this->lng->txt(
"prtf_new_portfolio"),
"new");
535 $a_tgt->addOption($new);
540 $tf->setRequired(
true);
541 $new->addSubItem($tf);
557 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
559 $form->setFormAction($this->ctrl->getFormAction($this));
562 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
564 $root =
$tree->readRootId();
567 $root =
$tree->getNodeData($root);
568 foreach (
$tree->getSubTree($root,
true,
"blog") as $node)
570 $options[$node[
"obj_id"]] = $node[
"title"];
579 $this->ctrl->redirect($this,
"view");
585 $form->addItem($obj);
587 $form->setTitle($this->lng->txt(
"prtf_add_blog").
": ".
588 $this->
object->getTitle());
589 $form->addCommandButton(
"saveBlog", $this->lng->txt(
"save"));
590 $form->addCommandButton(
"view", $this->lng->txt(
"cancel"));
605 $page->setTitle($form->getInput(
"blog"));
609 $this->ctrl->redirect($this,
"view");
612 $this->tabs_gui->clearTargets();
613 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"),
614 $this->ctrl->getLinkTarget($this,
"view"));
616 $form->setValuesByPost();
617 $this->tpl->setContent($form->getHtml());
627 include_once
"Modules/Exercise/classes/class.ilExAssignment.php";
629 $exercise_id = $ass->getExerciseId();
637 if($ass->getDeadline() && $ass->getDeadline() - time() <= 0)
643 include_once
"./Services/Link/classes/class.ilLink.php";
647 $info = sprintf($this->lng->txt(
"prtf_exercise_info"),
649 "<a href=\"".$exc_link.
"\">".
653 if($a_add_submit && !$times_up)
655 $this->ctrl->setParameter($this,
"exc", $exercise_id);
656 $this->ctrl->setParameter($this,
"ass", $a_assignment_id);
657 $submit_link = $this->ctrl->getLinkTarget($this,
"finalize");
658 $this->ctrl->setParameter($this,
"ass",
"");
659 $this->ctrl->setParameter($this,
"exc",
"");
661 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
663 $button->setCaption(
"prtf_finalize_portfolio");
664 $button->setPrimary(
true);
665 $button->setUrl($submit_link);
666 $info .=
" ".$button->render();
673 $submitted = array_pop($submitted);
675 $this->ctrl->setParameter($this,
"ass", $a_assignment_id);
676 $dl_link = $this->ctrl->getLinkTarget($this,
"downloadExcSubFile");
677 $this->ctrl->setParameter($this,
"ass",
"");
682 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
684 $button->setCaption(
"download");
685 $button->setUrl($dl_link);
687 $info .=
"<br />".sprintf($this->lng->txt(
"prtf_exercise_submitted_info"),
699 $ass = $ass->getInstruction();
702 $tooltip .= nl2br($ass);
706 if (count($ass_files) > 0)
708 $tooltip .=
"<br /><br />";
710 foreach($ass_files as
$file)
712 $this->ctrl->setParameter($this,
"ass", $a_assignment_id);
713 $this->ctrl->setParameter($this,
"file", urlencode($file[
"name"]));
714 $dl_link = $this->ctrl->getLinkTarget($this,
"downloadExcAssFile");
715 $this->ctrl->setParameter($this,
"file",
"");
716 $this->ctrl->setParameter($this,
"ass",
"");
718 $tooltip .= $file[
"name"].
": <a href=\"".$dl_link.
"\">".
719 $this->lng->txt(
"download").
"</a>";
725 $ol_id =
"exc_ass_".$a_assignment_id;
727 include_once
"Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php";
731 $overlay->setAnchor($ol_id.
"_tr");
732 $overlay->setTrigger($ol_id.
"_tr",
"click", $ol_id.
"_tr");
733 $overlay->setAutoHide(
false);
738 $overlay->addTrigger($ol_id.
"_tr",
"click", $ol_id.
"_tr");
740 $info .=
"<div id=\"".$ol_id.
"_tr\"><a href=\"#\">".$this->lng->txt(
"exc_instruction").
"</a></div>".
741 "<div id=\"".$ol_id.
"\" style=\"display:none; background-color:white; border: 1px solid #bbb; padding: 10px;\">".$tooltip.
"</div>";
751 include_once
"Modules/Exercise/classes/class.ilExAssignment.php";
755 if (count($ass_files) > 0)
757 foreach($ass_files as
$file)
759 if($file[
"name"] == $_GET[
"file"])
772 include_once
"Modules/Exercise/classes/class.ilExAssignment.php";
776 if (count($submitted) > 0)
778 $submitted = array_pop($submitted);
782 $ass->getTitle().
" - ".
783 $user_data[
"firstname"].
" ".
784 $user_data[
"lastname"].
" (".
785 $user_data[
"login"].
").zip";
803 include_once
"Modules/Exercise/classes/class.ilObjExerciseGUI.php";
805 $exc_gui->submitPortfolio($this->object->getId());
808 $this->ctrl->redirect($this,
"view");
822 include_once
"Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
824 if(!
sizeof($templates) || !in_array($prtt_id, $templates))
830 $this->ctrl->setParameter($this,
"prtt", $prtt_id);
838 $this->tpl->setContent($a_form->getHTML());
852 $this->ctrl->setParameter($this,
"exc_id", (
int)$_REQUEST[
"exc_id"]);
853 $this->ctrl->setParameter($this,
"ass_id", (
int)$_REQUEST[
"ass_id"]);
856 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
858 $form->setFormAction($this->ctrl->getFormAction($this));
862 $form->addItem($tmpl);
866 $form->addItem($title);
869 if(!$ilSetting->get(
'disable_wsp_blogs'))
871 $blog_options = array();
872 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
874 $root =
$tree->readRootId();
877 $root =
$tree->getNodeData($root);
878 foreach (
$tree->getSubTree($root,
true,
"blog") as $node)
880 $blog_options[$node[
"obj_id"]] = $node[
"title"];
882 asort($blog_options);
886 $has_form_content =
false;
888 include_once
"Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php";
892 include_once
"Services/Skill/classes/class.ilPersonalSkill.php";
894 $skill_ids = array();
896 include_once
"Modules/Portfolio/classes/class.ilPortfolioTemplatePage.php";
899 switch($page[
"type"])
904 $source_page->buildDom(
true);
905 $dom = $source_page->getDom();
908 $dom = $dom->myDOMDocument;
910 $xpath =
new DOMXPath($dom);
911 $nodes = $xpath->query(
"//PageContent/Skills");
912 foreach($nodes as $node)
914 $skill_id = $node->getAttribute(
"Id");
915 if(!in_array($skill_id, $pskills))
917 $skill_ids[] = $skill_id;
925 $quota_sum += $source_page->getPageDiskSize();
927 if(
sizeof($skill_ids))
929 $has_form_content =
true;
934 if(!$ilSetting->get(
'disable_wsp_blogs'))
936 $has_form_content =
true;
938 $field_id =
"blog_".$page[
"id"];
941 $page[
"title"], $field_id);
943 $blog->setValue(
"blog_create");
944 $form->addItem($blog);
946 $new_blog =
new ilRadioOption($this->lng->txt(
"prtf_template_import_blog_create"),
"blog_create");
947 $blog->addOption($new_blog);
949 $title =
new ilTextInputGUI($this->lng->txt(
"title"), $field_id.
"_create_title");
950 $title->setRequired(
true);
951 $new_blog->addSubItem($title);
953 if(
sizeof($blog_options))
955 $reuse_blog =
new ilRadioOption($this->lng->txt(
"prtf_template_import_blog_reuse"),
"blog_resuse");
956 $blog->addOption($reuse_blog);
958 $obj =
new ilSelectInputGUI($this->lng->txt(
"obj_blog"), $field_id.
"_reuse_blog");
959 $obj->setRequired(
true);
960 $obj->setOptions(array(
""=>$this->lng->txt(
"please_select"))+$blog_options);
961 $reuse_blog->addSubItem($obj);
964 $blog->addOption(
new ilRadioOption($this->lng->txt(
"prtf_template_import_blog_ignore"),
"blog_ignore"));
972 include_once
"Services/Skill/classes/class.ilSkillTreeNode.php";
974 $skills->
setInfo($this->lng->txt(
"prtf_template_import_new_skills"));
975 $skills->setValue($skill_ids);
976 foreach($skill_ids as $skill_id)
980 $form->addItem($skills);
985 include_once
"Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
989 $this->ctrl->redirect($this,
"create");
994 if(!$has_form_content)
999 $form->setTitle($this->lng->txt(
"prtf_creation_mode").
": ".$this->lng->txt(
"prtf_creation_mode_template"));
1000 $form->addCommandButton(
"createPortfolioFromTemplateProcess", $this->lng->txt(
"continue"));
1001 $form->addCommandButton(
"toRepository", $this->lng->txt(
"cancel"));
1014 include_once
"Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
1016 if(!
sizeof($templates) || !in_array($prtt_id, $templates))
1026 $this->ctrl->setParameter($this,
"prtt", $prtt_id);
1029 if($form->checkInput())
1031 include_once
"Modules/Portfolio/classes/class.ilPortfolioTemplatePage.php";
1034 switch($page[
"type"])
1037 if(!$ilSetting->get(
'disable_wsp_blogs'))
1039 $field_id =
"blog_".$page[
"id"];
1040 switch($form->getInput($field_id))
1043 $recipe[$page[
"id"]] = array(
"blog",
"create",
1044 trim($form->getInput($field_id.
"_create_title")));
1048 $recipe[$page[
"id"]] = array(
"blog",
"reuse",
1049 (
int)$form->getInput($field_id.
"_reuse_blog"));
1053 $recipe[$page[
"id"]] = array(
"blog",
"ignore");
1061 $recipe[
"skills"] = (array)$form->getInput(
"skill_ids");
1065 $form->setValuesByPost();
1073 include_once
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
1075 $target->setTitle($title);
1079 $source->clonePagesAndSettings($source, $target, $recipe);
1086 $ilAccess->checkAccess(
"read",
"", $exc_ref_id))
1088 include_once
"Modules/Exercise/classes/class.ilObjExercise.php";
1089 include_once
"Modules/Exercise/classes/class.ilExAssignment.php";
1092 if($ass->getExerciseId() == $exc->getId() &&
1095 $exc->addResourceObject(
$target_id, $ass_id, $ilUser->getId());
1100 $this->ctrl->setParameter($this,
"prt_id",
$target_id);
1101 $this->ctrl->redirect($this,
"view");
1106 $id = explode(
"_", $a_target);
1108 $_GET[
"baseClass"] =
"ilsharedresourceGUI";
1109 $_GET[
"prt_id"] = $id[0];
1110 if(
sizeof($id) == 2)
1112 $_GET[
"gtp"] = $id[1];
1115 include(
"ilias.php");
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static _lookupName($a_user_id)
lookup user name
getPageGUIInstance($a_page_id)
Get portfolio template page gui instance.
createPortfolioFromTemplate(ilPropertyFormGUI $a_form=null)
This class represents an option in a radio group.
createPortfolioFromTemplateProcess($a_process_form=true)
setValue($a_value)
Set Value.
This class represents an option in a checkbox group.
const TITLE_LENGTH
max length of object title
getPageInstance($a_page_id=null, $a_portfolio_id=null)
Get portfolio template page instance.
static _getStaticLink($a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
static getFiles($a_exc_id, $a_ass_id)
Get files.
static getPortfoliosOfUser($a_user_id)
Get views of user.
Class ilObject Basic functions for all objects.
static setUseRelativeDates($a_status)
set use relative dates
static _lookupTitle($a_id)
lookup object title
Portfolio page gui class.
static getSelectedUserSkills($a_user_id)
Get personal selected user skills.
initCreatePortfolioFromTemplateForm($a_prtt_id, $a_title)
getEditFormCustomValues(array &$a_values)
static _isPersonalWorkspaceActive()
Static getter.
static _getAllReferences($a_id)
get all reference ids of object
Tree handler for personal workspace.
static useRelativeDates()
check if relative dates are used
initCopyPageFormOptions(ilFormPropertyGUI $a_tgt)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
checkPermission($a_perm, $a_cmd="")
saveBlog()
Create new portfolio blog page.
Portfolio view gui class.
initCreateForm($a_new_type)
if(!is_array($argv)) $options
getId()
get object id public
getDeliveredFiles($a_exc_id, $a_ass_id, $a_user_id, $a_filter_empty_filename=false)
was: getDeliveredFiles($a_member_id)
afterSave(ilObject $a_new_object)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
omitLocator($a_omit=true)
static setUserDefault($a_user_id, $a_portfolio_id=null)
Set the user default portfolio.
getAdditional()
Get Additonal Information.
setSize($a_size)
Set Size.
This is a utility class for the yui overlays.
This class represents a text property in a property form.
static formatDate(ilDateTime $date)
Format a date public.
static isUploadPossible($a_additional_size=null)
Page for portfolio template.
finalize()
Finalize and submit portfolio to exercise.
static getAvailablePortfolioTemplates($a_permission="read")
setMaxLength($a_maxlength)
Set Max Length.
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
updateCustom(ilPropertyFormGUI $a_form)
Portfolio view gui base class.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
initBlogForm()
Init blog page form.
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.
static getAllPages($a_portfolio_id)
Get pages of portfolio.
getExerciseInfo($a_assignment_id, $a_add_submit=false)
This class represents a non editable value in a property form.
setAdditional($a_additional)
Set Additonal Information.
Class ilObjStyleSheetGUI.
initCreationForms($a_new_type)
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
static activeLayouts($a_special_page=false, $a_module=null)
Get active layouts.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
initEditCustomForm(ilPropertyFormGUI $a_form)
preview($a_return=false, $a_content=false, $a_show_notes=true)
Show user page.
static redirect($a_script)
http redirect to other script
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")