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);
52 $title = $this->lng->txt(
"portfolio");
55 $title .=
": ".$this->object->getTitle();
57 $this->tpl->setTitle($title);
59 $this->lng->txt(
"portfolio"));
61 $next_class = $this->ctrl->getNextClass($this);
62 $cmd = $this->ctrl->getCmd(
"view");
74 case "ilworkspaceaccessgui";
78 $this->tabs_gui->activateTab(
"share");
80 include_once(
'Services/PermanentLink/classes/class.ilPermanentLinkGUI.php');
84 include_once(
'./Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php');
86 $this->ctrl->forwardCommand($wspacc);
90 case 'ilportfoliopagegui':
96 include_once
"Services/Form/classes/class.ilFileInputGUI.php";
106 case "ilobjstylesheetgui":
107 include_once (
"./Services/Style/classes/class.ilObjStyleSheetGUI.php");
108 $this->ctrl->setReturn($this,
"editStyleProperties");
109 $style_gui =
new ilObjStyleSheetGUI(
"", $this->object->getStyleSheetId(),
false,
false);
111 if (
$cmd ==
"create" ||
$_GET[
"new_type"]==
"sty")
113 $style_gui->setCreationMode(
true);
116 if (
$cmd ==
"confirmedDelete")
118 $this->
object->setStyleSheetId(0);
119 $this->
object->update();
122 $ret = $this->ctrl->forwardCommand($style_gui);
124 if (
$cmd ==
"save" ||
$cmd ==
"copyStyle" ||
$cmd ==
"importStyle")
127 $this->
object->setStyleSheetId($style_id);
128 $this->
object->update();
129 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
134 if(
$cmd !=
"preview")
150 $ilHelp->setScreenIdComponent(
"prtf");
154 $this->tabs_gui->addTab(
"pages",
155 $this->lng->txt(
"content"),
156 $this->ctrl->getLinkTarget($this,
"view"));
158 $this->tabs_gui->addTab(
"settings",
159 $this->lng->txt(
"settings"),
160 $this->ctrl->getLinkTarget($this,
"edit"));
162 $this->tabs_gui->addNonTabbedLink(
"preview",
163 $this->lng->txt(
"user_profile_preview"),
164 $this->ctrl->getLinkTarget($this,
"preview"));
166 $this->lng->loadLanguageModule(
"wsp");
167 $this->tabs_gui->addTab(
"share",
168 $this->lng->txt(
"wsp_permissions"),
169 $this->ctrl->getLinkTargetByClass(
"ilworkspaceaccessgui",
"share"));
175 if(!$this->creation_mode)
177 $this->ctrl->setParameter($this,
"prt_id", $this->object->getId());
180 parent::addLocatorItems();
182 $this->tpl->setLocator();
192 return array(self::CFORM_NEW => $this->
initCreateForm($a_new_type));
199 $this->ctrl->setParameter($this,
"new_type", $this->
getType());
201 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
203 $form->setFormAction($this->ctrl->getFormAction($this));
209 $ti->setRequired(
true);
221 $form->addItem($main);
223 $opt_scratch =
new ilRadioOption($this->lng->txt(
"prtf_creation_mode_scratch"),
"mode_scratch");
224 $main->addOption($opt_scratch);
231 $opt_scratch->addSubItem($type);
233 $type_page =
new ilRadioOption($this->lng->txt(
"page"),
"page");
234 $type->addOption($type_page);
240 $tf->setRequired(
true);
241 $type_page->addSubItem($tf);
244 include_once
"Services/Style/classes/class.ilPageLayout.php";
248 $options = array(0 => $this->lng->txt(
"none"));
249 foreach ($templates as $templ)
251 $templ->readObject();
252 $options[$templ->getId()] = $templ->getTitle();
255 $use_template =
new ilSelectInputGUI($this->lng->txt(
"prtf_use_page_layout"),
"tmpl");
257 $use_template->setOptions(
$options);
258 $type_page->addSubItem($use_template);
262 if(!$ilSetting->get(
'disable_wsp_blogs'))
265 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
267 $root =
$tree->readRootId();
270 $root =
$tree->getNodeData($root);
271 foreach (
$tree->getSubTree($root) as $node)
273 if ($node[
"type"] ==
"blog")
275 $options[$node[
"obj_id"]] = $node[
"title"];
282 $type_blog =
new ilRadioOption($this->lng->txt(
"obj_blog"),
"blog");
283 $type->addOption($type_blog);
287 $obj->setOptions(array(
""=>$this->lng->txt(
"please_select"))+
$options);
288 $type_blog->addSubItem($obj);
293 $type->setValue(
"page");
300 $opt_tmpl =
new ilRadioOption($this->lng->txt(
"prtf_creation_mode_template"),
"mode_tmpl");
301 $main->addOption($opt_tmpl);
303 include_once
"Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
305 if(!
sizeof($templates))
307 $opt_tmpl->setDisabled(
true);
313 $tmpl->setOptions(array(
""=>$this->lng->txt(
"please_select"))+$templates);
314 $opt_tmpl->addSubItem($tmpl);
319 $tmpl->setValue((
int)$_REQUEST[
"prtt_pre"]);
320 $main->setValue(
"mode_tmpl");
325 $form->setTitle($this->lng->txt(
"prtf_create_portfolio"));
326 $form->addCommandButton(
"save", $this->lng->txt(
"save"));
327 $form->addCommandButton(
"toRepository", $this->lng->txt(
"cancel"));
335 if($form->checkInput())
338 if($form->getInput(
"mode") ==
"mode_tmpl")
340 $_REQUEST[
"pt"] = $form->getInput(
"title");
345 return parent::save();
351 include_once(
"Modules/Portfolio/classes/class.ilPortfolioPage.php");
353 if(
$_POST[
"ptype"] ==
"page")
356 $page->setTitle(
$_POST[
"fpage"]);
359 $layout_id =
$_POST[
"tmpl"];
362 include_once(
"./Services/Style/classes/class.ilPageLayout.php");
364 $page->setXMLContent($layout_obj->getXMLContent());
370 $page->setTitle(
$_POST[
"blog"]);
375 $this->ctrl->setParameter($this,
"prt_id", $a_new_object->
getId());
376 $this->ctrl->redirect($this,
"view");
386 $ilAccess->checkAccess(
"read",
"", $exc_ref_id))
388 include_once
"Services/Link/classes/class.ilLink.php";
392 $this->ctrl->redirectByClass(
"ilportfoliorepositorygui",
"show");
397 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
399 $form->setFormAction($this->ctrl->getFormAction($this));
405 $ti->setRequired(
true);
406 $ti->setValue($this->object->getTitle());
419 $online->
setChecked($this->object->isOnline());
420 $form->addItem($online);
424 $form->setTitle($this->lng->txt(
"prtf_edit_portfolio"));
425 $form->addCommandButton(
"update", $this->lng->txt(
"save"));
426 $form->addCommandButton(
"view", $this->lng->txt(
"cancel"));
433 $a_values[
"online"] = $this->
object->isOnline();
435 parent::getEditFormCustomValues($a_values);
440 $this->
object->setOnline($a_form->
getInput(
"online"));
448 parent::updateCustom($a_form);
466 if(!$a_portfolio_id && $this->
object)
468 $a_portfolio_id = $this->
object->getId();
470 include_once
"Modules/Portfolio/classes/class.ilPortfolioPage.php";
472 $page->setPortfolioId($a_portfolio_id);
484 include_once(
"Modules/Portfolio/classes/class.ilPortfolioPageGUI.php");
486 $this->object->getId(),
489 $this->
object->hasPublicComments()
497 return "ilportfoliopagegui";
502 $old =
new ilRadioOption($this->lng->txt(
"prtf_existing_portfolio"),
"old");
503 $a_tgt->addOption($old);
507 foreach($all as $item)
509 $options[$item[
"id"]] = $item[
"title"];
514 $old->addSubItem($prtf);
516 $new =
new ilRadioOption($this->lng->txt(
"prtf_new_portfolio"),
"new");
517 $a_tgt->addOption($new);
522 $tf->setRequired(
true);
523 $new->addSubItem($tf);
539 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
541 $form->setFormAction($this->ctrl->getFormAction($this));
544 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
546 $root =
$tree->readRootId();
549 $root =
$tree->getNodeData($root);
550 foreach (
$tree->getSubTree($root) as $node)
552 if ($node[
"type"] ==
"blog")
554 $options[$node[
"obj_id"]] = $node[
"title"];
564 $this->ctrl->redirect($this,
"view");
570 $form->addItem($obj);
572 $form->setTitle($this->lng->txt(
"prtf_add_blog").
": ".
573 $this->
object->getTitle());
574 $form->addCommandButton(
"saveBlog", $this->lng->txt(
"save"));
575 $form->addCommandButton(
"view", $this->lng->txt(
"cancel"));
590 $page->setTitle($form->getInput(
"blog"));
594 $this->ctrl->redirect($this,
"view");
597 $this->tabs_gui->clearTargets();
598 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"),
599 $this->ctrl->getLinkTarget($this,
"view"));
601 $form->setValuesByPost();
602 $this->tpl->setContent($form->getHtml());
612 include_once
"Modules/Exercise/classes/class.ilExAssignment.php";
614 $exercise_id = $ass->getExerciseId();
622 if($ass->getDeadline() && $ass->getDeadline() - time() <= 0)
628 include_once
"./Services/Link/classes/class.ilLink.php";
632 $info = sprintf($this->lng->txt(
"prtf_exercise_info"),
634 "<a href=\"".$exc_link.
"\">".
638 if($a_add_submit && !$times_up)
640 $this->ctrl->setParameter($this,
"exc", $exercise_id);
641 $this->ctrl->setParameter($this,
"ass", $a_assignment_id);
642 $submit_link = $this->ctrl->getLinkTarget($this,
"finalize");
643 $this->ctrl->setParameter($this,
"ass",
"");
644 $this->ctrl->setParameter($this,
"exc",
"");
645 $info .=
" <a class=\"submit emphsubmit\" href=\"".$submit_link.
"\">".$this->lng->txt(
"prtf_finalize_portfolio").
"</a>";
652 $submitted = array_pop($submitted);
654 $this->ctrl->setParameter($this,
"ass", $a_assignment_id);
655 $dl_link = $this->ctrl->getLinkTarget($this,
"downloadExcSubFile");
656 $this->ctrl->setParameter($this,
"ass",
"");
661 $info .=
"<br />".sprintf($this->lng->txt(
"prtf_exercise_submitted_info"),
663 "<a href=\"".$dl_link.
"\" class=\"submit\">".$this->lng->txt(
"download").
"</a>");
673 $ass = $ass->getInstruction();
676 $tooltip .= nl2br($ass);
680 if (count($ass_files) > 0)
682 $tooltip .=
"<br /><br />";
684 foreach($ass_files as
$file)
686 $this->ctrl->setParameter($this,
"ass", $a_assignment_id);
687 $this->ctrl->setParameter($this,
"file", urlencode($file[
"name"]));
688 $dl_link = $this->ctrl->getLinkTarget($this,
"downloadExcAssFile");
689 $this->ctrl->setParameter($this,
"file",
"");
690 $this->ctrl->setParameter($this,
"ass",
"");
692 $tooltip .= $file[
"name"].
": <a href=\"".$dl_link.
"\">".
693 $this->lng->txt(
"download").
"</a>";
699 $ol_id =
"exc_ass_".$a_assignment_id;
701 include_once
"Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php";
705 $overlay->setAnchor($ol_id.
"_tr");
706 $overlay->setTrigger($ol_id.
"_tr",
"click", $ol_id.
"_tr");
707 $overlay->setAutoHide(
false);
712 $overlay->addTrigger($ol_id.
"_tr",
"click", $ol_id.
"_tr");
714 $info .=
"<div id=\"".$ol_id.
"_tr\"><a href=\"#\">".$this->lng->txt(
"exc_instruction").
"</a></div>".
715 "<div id=\"".$ol_id.
"\" style=\"display:none; background-color:white; border: 1px solid #bbb; padding: 10px;\">".$tooltip.
"</div>";
725 include_once
"Modules/Exercise/classes/class.ilExAssignment.php";
729 if (count($ass_files) > 0)
731 foreach($ass_files as
$file)
733 if($file[
"name"] == $_GET[
"file"])
746 include_once
"Modules/Exercise/classes/class.ilExAssignment.php";
750 if (count($submitted) > 0)
752 $submitted = array_pop($submitted);
756 $ass->getTitle().
" - ".
757 $user_data[
"firstname"].
" ".
758 $user_data[
"lastname"].
" (".
759 $user_data[
"login"].
").zip";
777 include_once
"Modules/Exercise/classes/class.ilObjExerciseGUI.php";
779 $exc_gui->submitPortfolio($this->object->getId());
782 $this->ctrl->redirect($this,
"view");
796 include_once
"Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
798 if(!
sizeof($templates) || !in_array($prtt_id, $templates))
804 $this->ctrl->setParameter($this,
"prtt", $prtt_id);
812 $this->tpl->setContent($a_form->getHTML());
826 $this->ctrl->setParameter($this,
"exc_id", (
int)$_REQUEST[
"exc_id"]);
827 $this->ctrl->setParameter($this,
"ass_id", (
int)$_REQUEST[
"ass_id"]);
830 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
832 $form->setFormAction($this->ctrl->getFormAction($this));
836 $form->addItem($tmpl);
840 $form->addItem($title);
843 if(!$ilSetting->get(
'disable_wsp_blogs'))
845 $blog_options = array();
846 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
848 $root =
$tree->readRootId();
851 $root =
$tree->getNodeData($root);
852 foreach (
$tree->getSubTree($root) as $node)
854 if ($node[
"type"] ==
"blog")
856 $blog_options[$node[
"obj_id"]] = $node[
"title"];
859 asort($blog_options);
863 $has_form_content =
false;
865 include_once
"Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php";
869 include_once
"Services/Skill/classes/class.ilPersonalSkill.php";
871 $skill_ids = array();
873 include_once
"Modules/Portfolio/classes/class.ilPortfolioTemplatePage.php";
876 switch($page[
"type"])
881 $source_page->buildDom(
true);
882 $dom = $source_page->getDom();
885 $dom = $dom->myDOMDocument;
887 $xpath =
new DOMXPath($dom);
888 $nodes = $xpath->query(
"//PageContent/Skills");
889 foreach($nodes as $node)
891 $skill_id = $node->getAttribute(
"Id");
892 if(!in_array($skill_id, $pskills))
894 $skill_ids[] = $skill_id;
902 $quota_sum += $source_page->getPageDiskSize();
904 if(
sizeof($skill_ids))
906 $has_form_content =
true;
911 if(!$ilSetting->get(
'disable_wsp_blogs'))
913 $has_form_content =
true;
915 $field_id =
"blog_".$page[
"id"];
918 $page[
"title"], $field_id);
920 $blog->setValue(
"blog_create");
921 $form->addItem($blog);
923 $new_blog =
new ilRadioOption($this->lng->txt(
"prtf_template_import_blog_create"),
"blog_create");
924 $blog->addOption($new_blog);
926 $title =
new ilTextInputGUI($this->lng->txt(
"title"), $field_id.
"_create_title");
927 $title->setRequired(
true);
928 $new_blog->addSubItem($title);
930 if(
sizeof($blog_options))
932 $reuse_blog =
new ilRadioOption($this->lng->txt(
"prtf_template_import_blog_reuse"),
"blog_resuse");
933 $blog->addOption($reuse_blog);
935 $obj =
new ilSelectInputGUI($this->lng->txt(
"obj_blog"), $field_id.
"_reuse_blog");
936 $obj->setRequired(
true);
937 $obj->setOptions(array(
""=>$this->lng->txt(
"please_select"))+$blog_options);
938 $reuse_blog->addSubItem($obj);
941 $blog->addOption(
new ilRadioOption($this->lng->txt(
"prtf_template_import_blog_ignore"),
"blog_ignore"));
949 include_once
"Services/Skill/classes/class.ilSkillTreeNode.php";
951 $skills->
setInfo($this->lng->txt(
"prtf_template_import_new_skills"));
952 $skills->setValue($skill_ids);
953 foreach($skill_ids as $skill_id)
957 $form->addItem($skills);
962 include_once
"Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
966 $this->ctrl->redirect($this,
"create");
971 if(!$has_form_content)
976 $form->setTitle($this->lng->txt(
"prtf_creation_mode").
": ".$this->lng->txt(
"prtf_creation_mode_template"));
977 $form->addCommandButton(
"createPortfolioFromTemplateProcess", $this->lng->txt(
"continue"));
978 $form->addCommandButton(
"toRepository", $this->lng->txt(
"cancel"));
991 include_once
"Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
993 if(!
sizeof($templates) || !in_array($prtt_id, $templates))
1003 $this->ctrl->setParameter($this,
"prtt", $prtt_id);
1006 if($form->checkInput())
1008 include_once
"Modules/Portfolio/classes/class.ilPortfolioTemplatePage.php";
1011 switch($page[
"type"])
1014 if(!$ilSetting->get(
'disable_wsp_blogs'))
1016 $field_id =
"blog_".$page[
"id"];
1017 switch($form->getInput($field_id))
1020 $recipe[$page[
"id"]] = array(
"blog",
"create",
1021 trim($form->getInput($field_id.
"_create_title")));
1025 $recipe[$page[
"id"]] = array(
"blog",
"reuse",
1026 (
int)$form->getInput($field_id.
"_reuse_blog"));
1030 $recipe[$page[
"id"]] = array(
"blog",
"ignore");
1038 $recipe[
"skills"] = (array)$form->getInput(
"skill_ids");
1042 $form->setValuesByPost();
1050 include_once
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
1052 $target->setTitle($title);
1056 $source->clonePagesAndSettings($source, $target, $recipe);
1063 $ilAccess->checkAccess(
"read",
"", $exc_ref_id))
1065 include_once
"Modules/Exercise/classes/class.ilObjExercise.php";
1066 include_once
"Modules/Exercise/classes/class.ilExAssignment.php";
1069 if($ass->getExerciseId() == $exc->getId() &&
1072 $exc->addResourceObject(
$target_id, $ass_id, $ilUser->getId());
1077 $this->ctrl->setParameter($this,
"prt_id",
$target_id);
1078 $this->ctrl->redirect($this,
"view");
1083 $id = explode(
"_", $a_target);
1085 $_GET[
"baseClass"] =
"ilsharedresourceGUI";
1086 $_GET[
"prt_id"] = $id[0];
1087 if(
sizeof($id) == 2)
1089 $_GET[
"gtp"] = $id[1];
1092 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.
Class for permanent links.
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)
getHTML()
Get HTML for link.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
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="")