4 include_once(
'./Modules/Portfolio/classes/class.ilObjPortfolioBaseGUI.php');
24 parent::__construct($a_id, self::PORTFOLIO_OBJECT_ID, 0);
34 if($a_perm ==
"create")
42 return $this->access_handler->checkAccess($a_perm,
"", $a_node_id);
59 $next_class = $this->ctrl->getNextClass($this);
60 $cmd = $this->ctrl->getCmd(
"view");
72 case "ilworkspaceaccessgui";
76 $this->tabs_gui->activateTab(
"share");
78 if($this->access_handler->getPermissions($this->object->getId()) &&
79 !$this->
object->isOnline())
84 $this->tpl->setPermanentLink(
"prtf", $this->
object->getId());
86 include_once(
'./Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php');
88 $this->ctrl->forwardCommand($wspacc);
92 case 'ilportfoliopagegui':
98 include_once
"Services/Form/classes/class.ilFileInputGUI.php";
108 case "ilobjstylesheetgui":
109 include_once (
"./Services/Style/Content/classes/class.ilObjStyleSheetGUI.php");
110 $this->ctrl->setReturn($this,
"editStyleProperties");
113 if (
$cmd ==
"create" ||
$_GET[
"new_type"]==
"sty")
115 $style_gui->setCreationMode(
true);
118 if (
$cmd ==
"confirmedDelete")
120 $this->
object->setStyleSheetId(0);
121 $this->
object->update();
124 $ret = $this->ctrl->forwardCommand($style_gui);
126 if (
$cmd ==
"save" ||
$cmd ==
"copyStyle" ||
$cmd ==
"importStyle")
129 $this->
object->setStyleSheetId($style_id);
130 $this->
object->update();
131 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
135 case "ilportfolioexercisegui":
136 $this->ctrl->setReturn($this,
"view");
137 include_once
"Modules/Portfolio/classes/class.ilPortfolioExerciseGUI.php";
139 $this->ctrl->forwardCommand($gui);
144 if(
$cmd !=
"preview")
160 $ilHelp->setScreenIdComponent(
"prtf");
164 $this->tabs_gui->addTab(
"pages",
165 $this->lng->txt(
"content"),
166 $this->ctrl->getLinkTarget($this,
"view"));
168 $this->tabs_gui->addTab(
"settings",
169 $this->lng->txt(
"settings"),
170 $this->ctrl->getLinkTarget($this,
"edit"));
172 $this->tabs_gui->addNonTabbedLink(
"preview",
173 $this->lng->txt(
"user_profile_preview"),
174 $this->ctrl->getLinkTarget($this,
"preview"));
176 $this->lng->loadLanguageModule(
"wsp");
177 $this->tabs_gui->addTab(
"share",
178 $this->lng->txt(
"wsp_permissions"),
179 $this->ctrl->getLinkTargetByClass(
"ilworkspaceaccessgui",
"share"));
185 if(!$this->creation_mode)
187 $this->ctrl->setParameter($this,
"prt_id", $this->
object->getId());
190 parent::addLocatorItems();
192 $this->tpl->setLocator();
199 $title = $this->lng->txt(
"portfolio");
202 $title .=
": ".$this->object->getTitle();
204 $this->tpl->setTitle(
$title);
206 $this->lng->txt(
"portfolio"));
209 !$this->
object->isOnline())
211 $this->tpl->setAlertProperties(
array(
212 array(
"alert" =>
true,
213 "property" => $this->lng->txt(
"status"),
214 "value" => $this->lng->txt(
"offline"))
233 $this->ctrl->setParameter($this,
"new_type", $this->
getType());
235 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
237 $form->setFormAction($this->ctrl->getFormAction($this));
243 $ti->setRequired(
true);
255 $form->addItem($main);
257 $opt_scratch =
new ilRadioOption($this->lng->txt(
"prtf_creation_mode_scratch"),
"mode_scratch");
258 $main->addOption($opt_scratch);
265 $opt_scratch->addSubItem($type);
267 $type_page =
new ilRadioOption($this->lng->txt(
"page"),
"page");
268 $type->addOption($type_page);
274 $tf->setRequired(
true);
275 $type_page->addSubItem($tf);
278 include_once
"Services/COPage/Layout/classes/class.ilPageLayout.php";
283 foreach ($templates as $templ)
285 $templ->readObject();
286 $options[$templ->getId()] = $templ->getTitle();
289 $use_template =
new ilSelectInputGUI($this->lng->txt(
"prtf_use_page_layout"),
"tmpl");
291 $use_template->setOptions(
$options);
292 $type_page->addSubItem($use_template);
296 if(!$ilSetting->get(
'disable_wsp_blogs'))
299 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
301 $root =
$tree->readRootId();
304 $root =
$tree->getNodeData($root);
305 foreach (
$tree->getSubTree($root) as $node)
307 if ($node[
"type"] ==
"blog")
309 $options[$node[
"obj_id"]] = $node[
"title"];
316 $type_blog =
new ilRadioOption($this->lng->txt(
"obj_blog"),
"blog");
317 $type->addOption($type_blog);
321 $obj->setOptions(
array(
""=>$this->lng->txt(
"please_select"))+
$options);
322 $type_blog->addSubItem($obj);
327 $this->lng->loadLanguageModule(
'pd');
328 $url = $this->ctrl->getLinkTargetByClass(
"ilpersonaldesktopgui",
"jumpToWorkspace");
329 $url =
'<a href="'.$url.
'">'.$this->lng->txt(
"pd_personal_workspace").
'</a>';
332 $type->setValue(
"page");
339 $opt_tmpl =
new ilRadioOption($this->lng->txt(
"prtf_creation_mode_template"),
"mode_tmpl");
340 $main->addOption($opt_tmpl);
342 include_once
"Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
344 if(!
sizeof($templates))
346 $opt_tmpl->setDisabled(
true);
352 $tmpl->setOptions(
array(
""=>$this->lng->txt(
"please_select"))+$templates);
353 $opt_tmpl->addSubItem($tmpl);
356 if((
int)$_REQUEST[
"prtt_pre"])
358 $tmpl->setValue((
int)$_REQUEST[
"prtt_pre"]);
359 $main->setValue(
"mode_tmpl");
364 $form->setTitle($this->lng->txt(
"prtf_create_portfolio"));
365 $form->addCommandButton(
"save", $this->lng->txt(
"create"));
366 $form->addCommandButton(
"toRepository", $this->lng->txt(
"cancel"));
374 if($form->checkInput())
377 if($form->getInput(
"mode") ==
"mode_tmpl")
379 $_REQUEST[
"pt"] = $form->getInput(
"title");
384 return parent::save();
390 include_once(
"Modules/Portfolio/classes/class.ilPortfolioPage.php");
392 if(
$_POST[
"ptype"] ==
"page")
395 $page->setTitle(
$_POST[
"fpage"]);
398 $layout_id =
$_POST[
"tmpl"];
401 include_once(
"./Services/COPage/Layout/classes/class.ilPageLayout.php");
403 $page->setXMLContent($layout_obj->getXMLContent());
409 $page->setTitle(
$_POST[
"blog"]);
414 $this->ctrl->setParameter($this,
"prt_id", $a_new_object->
getId());
415 $this->ctrl->redirect($this,
"view");
423 $exc_ref_id = (int)$_REQUEST[
"exc_id"];
425 $ilAccess->checkAccess(
"read",
"", $exc_ref_id))
427 include_once
"Services/Link/classes/class.ilLink.php";
431 $this->ctrl->redirectByClass(
"ilportfoliorepositorygui",
"show");
436 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
438 $form->setFormAction($this->ctrl->getFormAction($this));
444 $ti->setRequired(
true);
445 $ti->setValue($this->
object->getTitle());
459 $form->addItem($online);
463 $form->setTitle($this->lng->txt(
"prtf_edit_portfolio"));
464 $form->addCommandButton(
"update", $this->lng->txt(
"save"));
465 $form->addCommandButton(
"view", $this->lng->txt(
"cancel"));
472 $a_values[
"online"] = $this->
object->isOnline();
474 parent::getEditFormCustomValues($a_values);
479 $this->
object->setOnline($a_form->
getInput(
"online"));
487 parent::updateCustom($a_form);
505 if(!$a_portfolio_id && $this->
object)
507 $a_portfolio_id = $this->
object->getId();
509 include_once
"Modules/Portfolio/classes/class.ilPortfolioPage.php";
511 $page->setPortfolioId($a_portfolio_id);
523 include_once(
"Modules/Portfolio/classes/class.ilPortfolioPageGUI.php");
528 $this->
object->hasPublicComments()
536 return "ilportfoliopagegui";
547 $a_tgt->addOption(
$old);
551 foreach($all as $item)
553 $options[$item[
"id"]] = $item[
"title"];
558 $old->addSubItem($prtf);
561 $a_tgt->addOption(
$new);
566 $tf->setRequired(
true);
567 $new->addSubItem($tf);
583 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
585 $form->setFormAction($this->ctrl->getFormAction($this));
588 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
590 $root =
$tree->readRootId();
593 $root =
$tree->getNodeData($root);
594 foreach (
$tree->getSubTree($root,
true,
"blog") as $node)
596 $options[$node[
"obj_id"]] = $node[
"title"];
605 $this->lng->loadLanguageModule(
'pd');
606 $url = $this->ctrl->getLinkTargetByClass(
"ilpersonaldesktopgui",
"jumpToWorkspace");
607 $url =
'<a href="'.$url.
'">'.$this->lng->txt(
"pd_personal_workspace").
'</a>';
610 $this->ctrl->redirect($this,
"view");
616 $form->addItem($obj);
618 $form->setTitle($this->lng->txt(
"prtf_add_blog").
": ".
619 $this->
object->getTitle());
620 $form->addCommandButton(
"saveBlog", $this->lng->txt(
"save"));
621 $form->addCommandButton(
"view", $this->lng->txt(
"cancel"));
636 $page->setTitle($form->getInput(
"blog"));
640 $this->ctrl->redirect($this,
"view");
643 $this->tabs_gui->clearTargets();
644 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"),
645 $this->ctrl->getLinkTarget($this,
"view"));
647 $form->setValuesByPost();
648 $this->tpl->setContent($form->getHtml());
658 $title = trim($_REQUEST[
"pt"]);
659 $prtt_id = (int)$_REQUEST[
"prtt"];
662 include_once
"Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
664 if(!
sizeof($templates) || !in_array($prtt_id, $templates))
670 $this->ctrl->setParameter($this,
"prtt", $prtt_id);
678 $this->tpl->setContent($a_form->getHTML());
690 if((
int)$_REQUEST[
"exc_id"])
692 $this->ctrl->setParameter($this,
"exc_id", (
int)$_REQUEST[
"exc_id"]);
693 $this->ctrl->setParameter($this,
"ass_id", (
int)$_REQUEST[
"ass_id"]);
696 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
698 $form->setFormAction($this->ctrl->getFormAction($this));
702 $form->addItem($tmpl);
705 $title->setValue($a_title);
709 if(!$ilSetting->get(
'disable_wsp_blogs'))
711 $blog_options =
array();
712 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
714 $root =
$tree->readRootId();
717 $root =
$tree->getNodeData($root);
718 foreach (
$tree->getSubTree($root,
true,
"blog") as $node)
720 $blog_options[$node[
"obj_id"]] = $node[
"title"];
722 asort($blog_options);
726 $has_form_content =
false;
728 include_once
"Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php";
732 include_once
"Services/Skill/classes/class.ilPersonalSkill.php";
734 $skill_ids =
array();
736 include_once
"Modules/Portfolio/classes/class.ilPortfolioTemplatePage.php";
739 switch($page[
"type"])
744 $source_page->buildDom(
true);
745 $dom = $source_page->getDom();
748 $dom = $dom->myDOMDocument;
750 $xpath =
new DOMXPath($dom);
751 $nodes = $xpath->query(
"//PageContent/Skills");
752 foreach($nodes as $node)
754 $skill_id = $node->getAttribute(
"Id");
755 if(!in_array($skill_id, $pskills))
757 $skill_ids[] = $skill_id;
765 $quota_sum += $source_page->getPageDiskSize();
767 if(
sizeof($skill_ids))
769 $has_form_content =
true;
774 if(!$ilSetting->get(
'disable_wsp_blogs'))
776 $has_form_content =
true;
778 $field_id =
"blog_".$page[
"id"];
781 $page[
"title"], $field_id);
783 $blog->setValue(
"blog_create");
784 $form->addItem($blog);
786 $new_blog =
new ilRadioOption($this->lng->txt(
"prtf_template_import_blog_create"),
"blog_create");
787 $blog->addOption($new_blog);
790 $title->setRequired(
true);
791 $new_blog->addSubItem(
$title);
793 if(
sizeof($blog_options))
795 $reuse_blog =
new ilRadioOption($this->lng->txt(
"prtf_template_import_blog_reuse"),
"blog_resuse");
796 $blog->addOption($reuse_blog);
798 $obj =
new ilSelectInputGUI($this->lng->txt(
"obj_blog"), $field_id.
"_reuse_blog");
799 $obj->setRequired(
true);
800 $obj->setOptions(
array(
""=>$this->lng->txt(
"please_select"))+$blog_options);
801 $reuse_blog->addSubItem($obj);
804 $blog->addOption(
new ilRadioOption($this->lng->txt(
"prtf_template_import_blog_ignore"),
"blog_ignore"));
812 include_once
"Services/Skill/classes/class.ilSkillTreeNode.php";
814 $skills->
setInfo($this->lng->txt(
"prtf_template_import_new_skills"));
815 $skills->setValue($skill_ids);
816 foreach($skill_ids as $skill_id)
820 $form->addItem($skills);
825 include_once
"Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
829 $this->ctrl->redirect($this,
"create");
834 if(!$has_form_content)
839 $form->setTitle($this->lng->txt(
"prtf_creation_mode").
": ".$this->lng->txt(
"prtf_creation_mode_template"));
840 $form->addCommandButton(
"createPortfolioFromTemplateProcess", $this->lng->txt(
"continue"));
841 $form->addCommandButton(
"toRepository", $this->lng->txt(
"cancel"));
850 $title = trim($_REQUEST[
"pt"]);
851 $prtt_id = (int)$_REQUEST[
"prtt"];
854 include_once
"Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
856 if(!
sizeof($templates) || !in_array($prtt_id, $templates))
866 $this->ctrl->setParameter($this,
"prtt", $prtt_id);
869 if($form->checkInput())
871 include_once
"Modules/Portfolio/classes/class.ilPortfolioTemplatePage.php";
874 switch($page[
"type"])
877 if(!$ilSetting->get(
'disable_wsp_blogs'))
879 $field_id =
"blog_".$page[
"id"];
880 switch($form->getInput($field_id))
883 $recipe[$page[
"id"]] =
array(
"blog",
"create",
884 trim($form->getInput($field_id.
"_create_title")));
888 $recipe[$page[
"id"]] =
array(
"blog",
"reuse",
889 (
int)$form->getInput($field_id.
"_reuse_blog"));
893 $recipe[$page[
"id"]] =
array(
"blog",
"ignore");
901 $recipe[
"skills"] = (
array)$form->getInput(
"skill_ids");
905 $form->setValuesByPost();
913 include_once
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
919 $source->clonePagesAndSettings($source,
$target, $recipe);
922 $exc_ref_id = (int)$_REQUEST[
"exc_id"];
923 $ass_id = (int)$_REQUEST[
"ass_id"];
926 $ilAccess->checkAccess(
"read",
"", $exc_ref_id))
928 include_once
"Modules/Exercise/classes/class.ilObjExercise.php";
929 include_once
"Modules/Exercise/classes/class.ilExAssignment.php";
932 if($ass->getExerciseId() == $exc->getId() &&
936 include_once
"Modules/Exercise/classes/class.ilExSubmission.php";
943 $this->ctrl->setParameter($this,
"prt_id",
$target_id);
944 $this->ctrl->redirect($this,
"view");
947 public static function _goto($a_target)
949 $id = explode(
"_", $a_target);
951 $_GET[
"baseClass"] =
"ilsharedresourceGUI";
952 $_GET[
"prt_id"] = $id[0];
955 $_GET[
"gtp"] = $id[1];
958 include(
"ilias.php");
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getPageGUIInstance($a_page_id)
Get portfolio template page gui instance.
static getAllPortfolioPages($a_portfolio_id)
Get pages of portfolio.
createPortfolioFromTemplate(ilPropertyFormGUI $a_form=null)
This class represents an option in a radio group.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
createPortfolioFromTemplateProcess($a_process_form=true)
initCopyPageFormOptions(ilPropertyFormGUI $a_form)
addResourceObject($a_wsp_id, $a_text=null)
Add personal resource to assigment.
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 getPortfoliosOfUser($a_user_id)
Get views of user.
Class ilObject Basic functions for all objects.
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.
Class ilPortfolioExerciseGUI.
Tree handler for personal workspace.
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
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 class represents a text property in a property form.
static isUploadPossible($a_additional_size=null)
Page for portfolio template.
static getAvailablePortfolioTemplates($a_permission="read")
setMaxLength($a_maxlength)
Set Max Length.
updateCustom(ilPropertyFormGUI $a_form)
Create styles array
The data for the language used.
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.
This class represents a non editable value in a property form.
Create new PHPExcel object
obj_idprivate
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.
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="")