4include_once(
'./Modules/Portfolio/classes/class.ilObjPortfolioBaseGUI.php');
 
   41        $this->lng = 
$DIC->language();
 
   42        $this->help = 
$DIC[
"ilHelp"];
 
   44        $this->access = 
$DIC->access();
 
   45        $this->
user = $DIC->user();
 
   46        $this->ctrl = 
$DIC->ctrl();
 
   47        $this->ui = 
$DIC->ui();
 
   49        parent::__construct($a_id, self::PORTFOLIO_OBJECT_ID, 0);
 
   52        $this->ctrl->saveParameter($this, 
"exc_back_ref_id");
 
   62        if ($a_perm == 
"create") {
 
   68        return $this->access_handler->checkAccess($a_perm, 
"", $a_node_id);
 
   79        $next_class = $this->ctrl->getNextClass($this);
 
   80        $cmd = $this->ctrl->getCmd(
"view");
 
   90        switch ($next_class) {
 
   91            case "ilworkspaceaccessgui":
 
   94                    $this->tabs_gui->activateTab(
"share");
 
   96                    if ($this->access_handler->getPermissions($this->object->getId()) &&
 
   97                        !$this->object->isOnline()) {
 
  101                    $this->tpl->setPermanentLink(
"prtf", $this->object->getId());
 
  103                    include_once(
'./Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php');
 
  106                    $this->ctrl->forwardCommand($wspacc);
 
  110            case 'ilportfoliopagegui':
 
  115                    include_once 
"Services/Form/classes/class.ilFileInputGUI.php";
 
  125            case "ilobjstylesheetgui":
 
  126                include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheetGUI.php");
 
  127                $this->ctrl->setReturn($this, 
"editStyleProperties");
 
  128                $style_gui = 
new ilObjStyleSheetGUI(
"", $this->object->getStyleSheetId(), 
false, 
false);
 
  129                $style_gui->omitLocator();
 
  130                if ($cmd == 
"create" || 
$_GET[
"new_type"] == 
"sty") {
 
  131                    $style_gui->setCreationMode(
true);
 
  134                if ($cmd == 
"confirmedDelete") {
 
  135                    $this->
object->setStyleSheetId(0);
 
  136                    $this->
object->update();
 
  139                $ret = $this->ctrl->forwardCommand($style_gui);
 
  141                if ($cmd == 
"save" || $cmd == 
"copyStyle" || $cmd == 
"importStyle") {
 
  143                    $this->
object->setStyleSheetId($style_id);
 
  144                    $this->
object->update();
 
  145                    $this->ctrl->redirectByClass(
"ilobjstylesheetgui", 
"edit");
 
  149            case "ilportfolioexercisegui":
 
  150                $this->ctrl->setReturn($this, 
"view");
 
  151                include_once 
"Modules/Portfolio/classes/class.ilPortfolioExerciseGUI.php";
 
  153                $this->ctrl->forwardCommand($gui);
 
  158                if ($cmd != 
"preview") {
 
  173        $ilHelp->setScreenIdComponent(
"prtf");
 
  176            $this->tabs_gui->addTab(
 
  178                $this->lng->txt(
"content"),
 
  179                $this->ctrl->getLinkTarget($this, 
"view")
 
  182            $this->tabs_gui->addTab(
 
  184                $this->lng->txt(
"settings"),
 
  185                $this->ctrl->getLinkTarget($this, 
"edit")
 
  188            $this->tabs_gui->addNonTabbedLink(
 
  190                $this->lng->txt(
"user_profile_preview"),
 
  191                $this->ctrl->getLinkTarget($this, 
"preview")
 
  194            $this->lng->loadLanguageModule(
"wsp");
 
  195            $this->tabs_gui->addTab(
 
  197                $this->lng->txt(
"wsp_permissions"),
 
  198                $this->ctrl->getLinkTargetByClass(
"ilworkspaceaccessgui", 
"share")
 
  205        if (!$this->creation_mode) {
 
  206            $this->ctrl->setParameter($this, 
"prt_id", $this->object->getId());
 
  209        parent::addLocatorItems();
 
  211        $this->tpl->setLocator();
 
  218        $title = $this->lng->txt(
"portfolio");
 
  220            $title .= 
": " . $this->
object->getTitle();
 
  222        $this->tpl->setTitle(
$title);
 
  223        $this->tpl->setTitleIcon(
 
  225            $this->lng->txt(
"portfolio")
 
  229            !$this->object->isOnline()) {
 
  230            $this->tpl->setAlertProperties(array(
 
  231                array(
"alert" => 
true,
 
  232                    "property" => $this->lng->txt(
"status"),
 
  233                    "value" => $this->lng->txt(
"offline"))
 
  253        $new_type = $_REQUEST[
"new_type"];
 
  256        $this->ctrl->saveParameter($this, 
"crtptrefid");
 
  258        $this->ctrl->saveParameter($this, 
"crtcb");
 
  261            $ilErr->raiseError($this->lng->txt(
"permission_denied"), 
$ilErr->MESSAGE);
 
  263            $this->lng->loadLanguageModule($new_type);
 
  264            $this->ctrl->setParameter($this, 
"new_type", $new_type);
 
  269            if (
$_GET[
"cpfl"] && isset($forms[self::CFORM_CLONE])) {
 
  270                $forms = array(self::CFORM_CLONE => $forms[self::CFORM_CLONE]);
 
  295            include_once 
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
 
  301                    if ($node[
"type"] == 
"blog") {
 
  302                        $options[$node[
"obj_id"]] = $node[
"title"];
 
  310                $this->lng->loadLanguageModule(
'pd');
 
  311                $url = $this->ctrl->getLinkTargetByClass(
"ilpersonaldesktopgui", 
"jumpToWorkspace");
 
  312                $text = $this->lng->txt(
"pd_personal_workspace");
 
  314                $text = sprintf($this->lng->txt(
"prtf_no_blogs_info"), 
$text);
 
  316                $mbox = 
$ui->factory()->messageBox()->info(
$text)
 
  317                    ->withLinks([
$ui->factory()->link()->standard(
 
  318                        $this->lng->txt(
"pd_personal_workspace"),
 
  331        return array(self::CFORM_NEW => $this->
initCreateForm($a_new_type));
 
  338        $this->ctrl->setParameter($this, 
"new_type", $this->
getType());
 
  340        include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
  342        $form->setFormAction($this->ctrl->getFormAction($this));
 
  348        $ti->setRequired(
true);
 
  359        $main->setValue(
"mode_scratch");
 
  360        $form->addItem($main);
 
  362        $opt_scratch = 
new ilRadioOption($this->lng->txt(
"prtf_creation_mode_scratch"), 
"mode_scratch");
 
  363        $main->addOption($opt_scratch);
 
  369        $type->setRequired(
true);
 
  370        $opt_scratch->addSubItem(
$type);
 
  372        $type_page = 
new ilRadioOption($this->lng->txt(
"page"), 
"page");
 
  373        $type->addOption($type_page);
 
  377        $tf->setMaxLength(128);
 
  379        $tf->setRequired(
true);
 
  380        $type_page->addSubItem($tf);
 
  383        include_once 
"Services/COPage/Layout/classes/class.ilPageLayout.php";
 
  386            $options = array(0 => $this->lng->txt(
"none"));
 
  387            foreach ($templates as $templ) {
 
  388                $templ->readObject();
 
  389                $options[$templ->getId()] = $templ->getTitle();
 
  392            $use_template = 
new ilSelectInputGUI($this->lng->txt(
"prtf_use_page_layout"), 
"tmpl");
 
  393            $use_template->setRequired(
true);
 
  394            $use_template->setOptions(
$options);
 
  395            $type_page->addSubItem($use_template);
 
  401            include_once 
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
 
  407                    if ($node[
"type"] == 
"blog") {
 
  408                        $options[$node[
"obj_id"]] = $node[
"title"];
 
  414                $type_blog = 
new ilRadioOption($this->lng->txt(
"obj_blog"), 
"blog");
 
  415                $type->addOption($type_blog);
 
  418                $obj->setRequired(
true);
 
  419                $obj->setOptions(array(
"" => $this->lng->txt(
"please_select")) + 
$options);
 
  420                $type_blog->addSubItem($obj);
 
  422                $type->setValue(
"page");
 
  429        $opt_tmpl = 
new ilRadioOption($this->lng->txt(
"prtf_creation_mode_template"), 
"mode_tmpl");
 
  430        $main->addOption($opt_tmpl);
 
  432        include_once 
"Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
 
  434        if (!
sizeof($templates)) {
 
  435            $opt_tmpl->setDisabled(
true);
 
  438            $tmpl->setRequired(
true);
 
  439            $tmpl->setOptions(array(
"" => $this->lng->txt(
"please_select")) + $templates);
 
  440            $opt_tmpl->addSubItem($tmpl);
 
  443            if ((
int) $_REQUEST[
"prtt_pre"]) {
 
  444                $tmpl->setValue((
int) $_REQUEST[
"prtt_pre"]);
 
  445                $main->setValue(
"mode_tmpl");
 
  450        $form->setTitle($this->lng->txt(
"prtf_create_portfolio"));
 
  451        $form->addCommandButton(
"save", $this->lng->txt(
"create"));
 
  452        $form->addCommandButton(
"toRepository", $this->lng->txt(
"cancel"));
 
  460        if (
$form->checkInput()) {
 
  462            if (
$form->getInput(
"mode") == 
"mode_tmpl") {
 
  463                $_REQUEST[
"pt"] = 
$form->getInput(
"title");
 
  464                $_REQUEST[
"prtt_pre"] = (int) $_REQUEST[
"prtt"];
 
  470        return parent::save();
 
  476        include_once(
"Modules/Portfolio/classes/class.ilPortfolioPage.php");
 
  478        if (
$_POST[
"ptype"] == 
"page") {
 
  480            $page->setTitle(
$_POST[
"fpage"]);
 
  483            $layout_id = 
$_POST[
"tmpl"];
 
  485                include_once(
"./Services/COPage/Layout/classes/class.ilPageLayout.php");
 
  487                $page->setXMLContent($layout_obj->getXMLContent());
 
  491            $page->setTitle(
$_POST[
"blog"]);
 
  495        ilUtil::sendSuccess($this->lng->txt(
"prtf_portfolio_created"), 
true);
 
  496        $this->ctrl->setParameter($this, 
"prt_id", $a_new_object->
getId());
 
  497        $this->ctrl->redirect($this, 
"view");
 
  505        $exc_ref_id = (int) $_REQUEST[
"exc_id"];
 
  507            $ilAccess->checkAccess(
"read", 
"", $exc_ref_id)) {
 
  508            include_once 
"Services/Link/classes/class.ilLink.php";
 
  512        $this->ctrl->redirectByClass(
"ilportfoliorepositorygui", 
"show");
 
  517        include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
  519        $form->setFormAction($this->ctrl->getFormAction($this));
 
  525        $ti->setRequired(
true);
 
  526        $ti->setValue($this->object->getTitle());
 
  539        $online->setChecked($this->object->isOnline());
 
  540        $form->addItem($online);
 
  544        $form->setTitle($this->lng->txt(
"prtf_edit_portfolio"));
 
  545        $form->addCommandButton(
"update", $this->lng->txt(
"save"));
 
  546        $form->addCommandButton(
"view", $this->lng->txt(
"cancel"));
 
  553        $a_values[
"online"] = $this->
object->isOnline();
 
  555        parent::getEditFormCustomValues($a_values);
 
  560        $this->
object->setOnline($a_form->
getInput(
"online"));
 
  567        parent::updateCustom($a_form);
 
  585        if (!$a_portfolio_id && $this->
object) {
 
  586            $a_portfolio_id = $this->
object->getId();
 
  588        include_once 
"Modules/Portfolio/classes/class.ilPortfolioPage.php";
 
  590        $page->setPortfolioId($a_portfolio_id);
 
  602        include_once(
"Modules/Portfolio/classes/class.ilPortfolioPageGUI.php");
 
  604            $this->object->getId(),
 
  607            $this->object->hasPublicComments()
 
  615        return "ilportfoliopagegui";
 
  621        $a_tgt->setRequired(
true);
 
  624        $old = 
new ilRadioOption($this->lng->txt(
"prtf_existing_portfolio"), 
"old");
 
  625        $a_tgt->addOption($old);
 
  629        foreach ($all as $item) {
 
  630            $options[$item[
"id"]] = $item[
"title"];
 
  633        $prtf->setRequired(
true);
 
  635        $old->addSubItem($prtf);
 
  637        $new = 
new ilRadioOption($this->lng->txt(
"prtf_new_portfolio"), 
"new");
 
  638        $a_tgt->addOption($new);
 
  641        $tf->setMaxLength(128);
 
  643        $tf->setRequired(
true);
 
  644        $new->addSubItem($tf);
 
  660        include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
  662        $form->setFormAction($this->ctrl->getFormAction($this));
 
  665        include_once 
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
 
  670            foreach (
$tree->getSubTree(
$root, 
true, 
"blog") as $node) {
 
  671                $options[$node[
"obj_id"]] = $node[
"title"];
 
  678        $radg->setInfo($this->lng->txt(
""));
 
  679        $radg->setValue(
"new");
 
  680        $radg->setInfo($this->lng->txt(
""));
 
  682        $op1 = 
new ilRadioOption($this->lng->txt(
"prtf_add_new_blog"), 
"new", $this->lng->txt(
"prtf_add_new_blog_info"));
 
  683        $radg->addOption($op1);
 
  684        $form->addItem($radg);
 
  688        $ti->setRequired(
true);
 
  689        $op1->addSubItem($ti);
 
  693            $op2 = 
new ilRadioOption($this->lng->txt(
"prtf_add_existing_blog"), 
"existing");
 
  694            $radg->addOption($op2);
 
  698            $op2->addSubItem($obj);
 
  701        $form->setTitle($this->lng->txt(
"prtf_add_blog") . 
": " .
 
  702            $this->object->getTitle());
 
  703        $form->addCommandButton(
"saveBlog", $this->lng->txt(
"save"));
 
  704        $form->addCommandButton(
"view", $this->lng->txt(
"cancel"));
 
  719        if (
$form->checkInput() && $this->checkPermissionBool(
"write")) {
 
  720            if (
$form->getInput(
"creation_mode") == 
"existing") {
 
  723                $page->setTitle(
$form->getInput(
"blog"));
 
  727                $blog->setTitle(
$form->getInput(
"title"));
 
  730                include_once 
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
 
  735                if (!
$tree->getRootId()) {
 
  739                include_once 
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
 
  746                $page->setTitle($blog->getId());
 
  750            ilUtil::sendSuccess($this->lng->txt(
"prtf_blog_page_created"), 
true);
 
  751            $this->ctrl->redirect($this, 
"view");
 
  754        $this->tabs_gui->clearTargets();
 
  755        $this->tabs_gui->setBackTarget(
 
  756            $this->lng->txt(
"back"),
 
  757            $this->ctrl->getLinkTarget($this, 
"view")
 
  760        $form->setValuesByPost();
 
  761        $this->tpl->setContent(
$form->getHtml());
 
  771        $title = trim($_REQUEST[
"pt"]);
 
  772        $prtt_id = (int) $_REQUEST[
"prtt"];
 
  775        include_once 
"Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
 
  777        if (!
sizeof($templates) || !in_array($prtt_id, $templates)) {
 
  782        $this->ctrl->setParameter($this, 
"prtt", $prtt_id);
 
  788            $this->tpl->setContent($a_form->getHTML());
 
  799        if ((
int) $_REQUEST[
"exc_id"]) {
 
  800            $this->ctrl->setParameter($this, 
"exc_id", (
int) $_REQUEST[
"exc_id"]);
 
  801            $this->ctrl->setParameter($this, 
"ass_id", (
int) $_REQUEST[
"ass_id"]);
 
  804        include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
  806        $form->setFormAction($this->ctrl->getFormAction($this));
 
  810        $form->addItem($tmpl);
 
  813        $title->setValue($a_title);
 
  818            $blog_options = array();
 
  819            include_once 
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
 
  824                foreach (
$tree->getSubTree(
$root, 
true, 
"blog") as $node) {
 
  825                    $blog_options[$node[
"obj_id"]] = $node[
"title"];
 
  827                asort($blog_options);
 
  831        $has_form_content = 
false;
 
  833        include_once 
"Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php";
 
  837        include_once 
"Services/Skill/classes/class.ilPersonalSkill.php";
 
  839        $skill_ids = array();
 
  841        include_once 
"Modules/Portfolio/classes/class.ilPortfolioTemplatePage.php";
 
  843            switch ($page[
"type"]) {
 
  847                    $source_page->buildDom(
true);
 
  851                        $quota_sum += $source_page->getPageDiskSize();
 
  853                    if (
sizeof($skill_ids)) {
 
  854                        $has_form_content = 
true;
 
  860                        $has_form_content = 
true;
 
  862                        $field_id = 
"blog_" . $page[
"id"];
 
  865                            $page[
"title"], $field_id);
 
  866                        $blog->setRequired(
true);
 
  867                        $blog->setValue(
"blog_create");
 
  868                        $form->addItem($blog);
 
  870                        $new_blog = 
new ilRadioOption($this->lng->txt(
"prtf_template_import_blog_create"), 
"blog_create");
 
  871                        $blog->addOption($new_blog);
 
  874                        $title->setRequired(
true);
 
  875                        $new_blog->addSubItem(
$title);
 
  877                        if (
sizeof($blog_options)) {
 
  878                            $reuse_blog = 
new ilRadioOption($this->lng->txt(
"prtf_template_import_blog_reuse"), 
"blog_resuse");
 
  879                            $blog->addOption($reuse_blog);
 
  881                            $obj = 
new ilSelectInputGUI($this->lng->txt(
"obj_blog"), $field_id . 
"_reuse_blog");
 
  882                            $obj->setRequired(
true);
 
  883                            $obj->setOptions(array(
"" => $this->lng->txt(
"please_select")) + $blog_options);
 
  884                            $reuse_blog->addSubItem($obj);
 
  887                        $blog->addOption(
new ilRadioOption($this->lng->txt(
"prtf_template_import_blog_ignore"), 
"blog_ignore"));
 
  894            include_once 
"Services/Skill/classes/class.ilSkillTreeNode.php";
 
  896            $skills->setInfo($this->lng->txt(
"prtf_template_import_new_skills"));
 
  897            $skills->setValue($skill_ids);
 
  898            foreach ($skill_ids as $skill_id) {
 
  901            $form->addItem($skills);
 
  905            include_once 
"Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
 
  908                $this->ctrl->redirect($this, 
"create");
 
  913        if (!$has_form_content) {
 
  917        $form->setTitle($this->lng->txt(
"prtf_creation_mode") . 
": " . $this->lng->txt(
"prtf_creation_mode_template"));
 
  918        $form->addCommandButton(
"createPortfolioFromTemplateProcess", $this->lng->txt(
"continue"));
 
  919        $form->addCommandButton(
"toRepository", $this->lng->txt(
"cancel"));
 
  930        $title = trim($_REQUEST[
"pt"]);
 
  931        $prtt_id = (int) $_REQUEST[
"prtt"];
 
  934        include_once 
"Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
 
  936        if (!
sizeof($templates) || !in_array($prtt_id, $templates)) {
 
  943        if ($a_process_form) {
 
  944            $this->ctrl->setParameter($this, 
"prtt", $prtt_id);
 
  947            if (
$form->checkInput()) {
 
  948                include_once 
"Modules/Portfolio/classes/class.ilPortfolioTemplatePage.php";
 
  950                    switch ($page[
"type"]) {
 
  953                                $field_id = 
"blog_" . $page[
"id"];
 
  954                                switch (
$form->getInput($field_id)) {
 
  956                                        $recipe[$page[
"id"]] = array(
"blog", 
"create",
 
  957                                            trim(
$form->getInput($field_id . 
"_create_title")));
 
  961                                        $recipe[$page[
"id"]] = array(
"blog", 
"reuse",
 
  962                                            (
int) 
$form->getInput($field_id . 
"_reuse_blog"));
 
  966                                        $recipe[$page[
"id"]] = array(
"blog", 
"ignore");
 
  974                $recipe[
"skills"] = (array) 
$form->getInput(
"skill_ids");
 
  976                $form->setValuesByPost();
 
  984        include_once 
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
 
  995        ilUtil::sendSuccess($this->lng->txt(
"prtf_portfolio_created_from_template"), 
true);
 
  996        $this->ctrl->setParameter($this, 
"prt_id", 
$target_id);
 
  997        $this->ctrl->redirect($this, 
"preview");
 
 1005        $prtt_id = (int) $_REQUEST[
"prtt_pre"];
 
 1011        include_once 
"Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
 
 1013        if (!
sizeof($templates) || !in_array($prtt_id, $templates)) {
 
 1021        include_once 
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
 
 1032        ilUtil::sendSuccess($this->lng->txt(
"prtf_portfolio_created_from_template"), 
true);
 
 1033        $this->ctrl->setParameter($this, 
"prt_id", 
$target_id);
 
 1034        $this->ctrl->redirect($this, 
"preview");
 
 1038    public static function _goto($a_target)
 
 1045        $id = explode(
"_", $a_target);
 
 1047        $_GET[
"baseClass"] = 
"ilsharedresourceGUI";
 
 1048        $ctrl->setParameterByClass(
"ilobjportfoliogui", 
"prt_id", 
$id[0]);
 
 1049        if (
sizeof(
$id) == 2) {
 
 1050            $ctrl->setParameterByClass(
"ilobjportfoliogui", 
"user_page", 
$id[1]);
 
 1052        $ctrl->redirectByClass([
"ilsharedresourceGUI", 
"ilobjportfoliogui"], 
"preview");
 
 1060        include_once 
"Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
 
 1061        include_once 
"Modules/Portfolio/classes/class.ilPortfolioTemplatePage.php";
 
 1062        include_once 
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
 
 1064        $title = trim($_REQUEST[
"pt"]);
 
 1065        $prtt_id = (int) $_REQUEST[
"prtt"];
 
 1068        $ass_template_id = 0;
 
 1069        if ((
int) $_REQUEST[
"ass_id"] > 0) {
 
 1070            include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
 
 1077            if (!
sizeof($templates) || !in_array($prtt_id, $templates)) {
 
 1078                if ($ass_template_id != $prtt_id) {
 
 1084            include_once 
"Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php";
 
 1089            include_once 
"Services/Skill/classes/class.ilPersonalSkill.php";
 
 1091            $skill_ids = array();
 
 1095                switch ($page[
"type"]) {
 
 1098                            $recipe[$page[
"id"]] = array(
"blog", 
"create", $page[
'title']);
 
 1103                        $source_page->buildDom(
true);
 
 1105                            $quota_sum += $source_page->getPageDiskSize();
 
 1113                include_once 
"Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
 
 1116                    $this->ctrl->redirect($this, 
"create");
 
 1121                $recipe[
"skills"] = $skill_ids;
 
 1139        $this->ctrl->setParameter($this, 
"prt_id", 
$target_id);
 
 1141            ilUtil::sendSuccess($this->lng->txt(
"prtf_portfolio_created_from_template"), 
true);
 
 1142            $this->ctrl->redirect($this, 
"preview");
 
 1144            ilUtil::sendSuccess($this->lng->txt(
"prtf_portfolio_created"), 
true);
 
 1145            $this->ctrl->redirect($this, 
"view");
 
 1154        $exc_ref_id = (int) $_REQUEST[
"exc_id"];
 
 1155        $ass_id = (int) $_REQUEST[
"ass_id"];
 
 1159            $ilAccess->checkAccess(
"read", 
"", $exc_ref_id)) {
 
 1160            include_once 
"Modules/Exercise/classes/class.ilObjExercise.php";
 
 1161            include_once 
"Modules/Exercise/classes/class.ilExAssignment.php";
 
 1164            if ($ass->getExerciseId() == $exc->getId() &&
 
 1167                include_once 
"Modules/Exercise/classes/class.ilExSubmission.php";
 
 1169                $sub->addResourceObject($a_target_id);
 
 1182        $dom = $a_source_page->getDom();
 
 1184            $dom = $dom->myDOMDocument;
 
 1186        $xpath = 
new DOMXPath($dom);
 
 1187        $nodes = $xpath->query(
"//PageContent/Skills");
 
 1188        foreach (
$nodes as $node) {
 
 1189            $skill_id = $node->getAttribute(
"Id");
 
 1190            if (!in_array($skill_id, $a_pskills)) {
 
 1191                $a_skill_ids[] = $skill_id;
 
 1198        return $a_skill_ids;
 
 1229        $tabs->clearTargets();
 
 1230        $tabs->setBackTarget(
$lng->txt(
"back"), 
$ilCtrl->getLinkTarget($this, 
"view"));
 
 1235        include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 1239        $form->setPreventDoubleSubmission(
false);
 
 1242        if ($this->declaration_authorship->getForUser($this->user) != 
"") {
 
 1243            $cb = 
new ilCheckboxInputGUI($this->lng->txt(
"prtf_decl_authorship"), 
"decl_author");
 
 1244            $cb->setInfo($this->declaration_authorship->getForUser($this->user));
 
 1245            $form->addItem($cb);
 
 1250        $cb->setInfo($this->lng->txt(
"prtf_signature_info"));
 
 1251        $form->addItem($cb);
 
 1256        $radg->setValue(
"all_pages");
 
 1258        $radg->addOption($op2);
 
 1260        $radg->addOption($op3);
 
 1262        include_once(
"./Services/Form/classes/class.ilNestedListInputGUI.php");
 
 1264        $op3->addSubItem($nl);
 
 1266        foreach ($pages as $p) {
 
 1285                    $lng->txt(
"obj_blog")
 
 1288                foreach ($pages2 as $p2) {
 
 1302        $form->addItem($radg);
 
 1304        $form->addCommandButton(
"exportPDF", 
$lng->txt(
"prtf_pdf"));
 
 1305        if (DEVMODE == 
"1") {
 
 1306            $form->addCommandButton(
"exportPDFDev", 
$lng->txt(
"prtf_pdf") . 
" (DEV)");
 
 1309        $form->setTitle(
$lng->txt(
"prtf_print_options"));
 
 1310        $form->setFormAction(
$ilCtrl->getFormAction($this, 
"exportPDF"));
 
 1329        require_once 
'Services/WebAccessChecker/classes/class.ilWACSignedPath.php';
 
 1338        $html = preg_replace(
"/\?dummy\=[0-9]+/", 
"", 
$html);
 
 1339        $html = preg_replace(
"/\?vers\=[0-9A-Za-z\-]+/", 
"", 
$html);
 
 1341        $html = preg_replace(
"/src=\"\\.\\//ims", 
"src=\"" . ILIAS_HTTP_PATH . 
"/", 
$html);
 
 1342        $html = preg_replace(
"/href=\"\\.\\//ims", 
"href=\"" . ILIAS_HTTP_PATH . 
"/", 
$html);
 
 1367        $tpl->setBodyClass(
"ilPrtfPdfBody");
 
 1369        $tpl->setCurrentBlock(
"AdditionalStyle");
 
 1371        $tpl->parseCurrentBlock();
 
 1373        $tpl->setCurrentBlock(
"ContentStyle");
 
 1375            "LOCATION_CONTENT_STYLESHEET",
 
 1378        $tpl->parseCurrentBlock();
 
 1384        $tpl->setCurrentBlock(
"SyntaxStyle");
 
 1386            "LOCATION_SYNTAX_STYLESHEET",
 
 1389        $tpl->parseCurrentBlock();
 
 1392        include_once(
"./Modules/Portfolio/classes/class.ilPortfolioPageGUI.php");
 
 1397        $cover_tpl = 
new ilTemplate(
"tpl.prtf_cover.html", 
true, 
true, 
"Modules/Portfolio");
 
 1398        foreach ($pages as $page) {
 
 1400                if (
$_POST[
"sel_type"] == 
"selection" && (!is_array(
$_POST[
"obj_id"]) || !in_array($page[
"id"], 
$_POST[
"obj_id"]))) {
 
 1403                $cover_tpl->setCurrentBlock(
"content_item");
 
 1404                $cover_tpl->setVariable(
"ITEM_TITLE", $page[
"title"]);
 
 1405                $cover_tpl->parseCurrentBlock();
 
 1407                $cover_tpl->setCurrentBlock(
"content_item");
 
 1409                $cover_tpl->parseCurrentBlock();
 
 1413        if (
$_POST[
"signature"]) {
 
 1414            $cover_tpl->setCurrentBlock(
"signature");
 
 1415            $cover_tpl->setVariable(
"TXT_SIGNATURE", 
$lng->txt(
"prtf_signature_date"));
 
 1416            $cover_tpl->parseCurrentBlock();
 
 1419        if (
$_POST[
"decl_author"]) {
 
 1420            $cover_tpl->setCurrentBlock(
"decl_author");
 
 1421            $cover_tpl->setVariable(
 
 1423                nl2br($this->declaration_authorship->getForUser($this->user))
 
 1425            $cover_tpl->parseCurrentBlock();
 
 1428        $cover_tpl->setVariable(
"PORTFOLIO_TITLE", $this->object->getTitle());
 
 1431        $cover_tpl->setVariable(
"TXT_AUTHOR", 
$lng->txt(
"prtf_author"));
 
 1432        $cover_tpl->setVariable(
"TXT_LINK", 
$lng->txt(
"prtf_link"));
 
 1433        $cover_tpl->setVariable(
"TXT_DATE", 
$lng->txt(
"prtf_date_of_print"));
 
 1436        $author_str = $author[
"firstname"] . 
" " . $author[
"lastname"];
 
 1437        $cover_tpl->setVariable(
"AUTHOR", $author_str);
 
 1439        include_once(
'./Services/Link/classes/class.ilLink.php');
 
 1441        $cover_tpl->setVariable(
"LINK", $href);
 
 1445        $cover_tpl->setVariable(
"DATE", $date_str);
 
 1447        $page_content .= $cover_tpl->get();
 
 1448        $page_content .= 
'<p style="page-break-after:always;"></p>';
 
 1450        $page_head_tpl = 
new ilTemplate(
"tpl.prtf_page_head.html", 
true, 
true, 
"Modules/Portfolio");
 
 1451        $page_head_tpl->setVariable(
"AUTHOR", $author_str);
 
 1452        $page_head_tpl->setVariable(
"DATE", $date_str);
 
 1453        $page_head_str = $page_head_tpl->get();
 
 1455        foreach ($pages as $page) {
 
 1457                if (
$_POST[
"sel_type"] == 
"selection" && (!is_array(
$_POST[
"obj_id"]) || !in_array($page[
"id"], 
$_POST[
"obj_id"]))) {
 
 1462                $page_gui->setOutputMode(
"print");
 
 1463                $page_gui->setPresentationTitle($page[
"title"]);
 
 1464                $html = $this->ctrl->getHTML($page_gui);
 
 1465                $page_content .= $page_head_str . 
$html;
 
 1467                if ($a_pdf_export) {
 
 1468                    $page_content .= 
'<p style="page-break-after:always;"></p>';
 
 1472                foreach ($pages2 as $p2) {
 
 1473                    if (
$_POST[
"sel_type"] == 
"selection" && (!is_array(
$_POST[
"obj_id"]) || !in_array(
"b" . $p2[
"id"], 
$_POST[
"obj_id"]))) {
 
 1477                    $page_gui->setFileDownloadLink(
"#");
 
 1478                    $page_gui->setFullscreenLink(
"#");
 
 1479                    $page_gui->setSourcecodeDownloadScript(
"#");
 
 1480                    $page_gui->setOutputMode(
"print");
 
 1481                    $page_content .= $page_head_str . $page_gui->showPage(
ilObject::_lookupTitle($page[
"title"]) . 
": " . $page_gui->getBlogPosting()->getTitle());
 
 1483                    if ($a_pdf_export) {
 
 1484                        $page_content .= 
'<p style="page-break-after:always;"></p>';
 
 1490        $page_content = 
'<div class="ilInvisibleBorder">' . $page_content . 
'</div>';
 
 1492        if (!$a_pdf_export) {
 
 1493            $page_content .= 
'<script type="text/javascript" language="javascript1.2"> 
 1495                                        il.Util.addOnLoad(function () { 
 1502        $tpl->setVariable(
"CONTENT", $page_content);
 
 1504        if (!$a_pdf_export) {
 
 1508            $tpl->fillJavaScriptFiles();
 
 1509            $ret = 
$tpl->get(
"DEFAULT", 
false, 
false, 
false, 
true, 
false, 
false);
 
 1525        if (!$this->object->isOnline()) {
 
 1526            $f = 
$ui->factory();
 
 1527            $renderer = 
$ui->renderer();
 
 1529            $buttons = [
$f->button()->standard(
 
 1530                $lng->txt(
"prtf_set_online"),
 
 1531                $ctrl->getLinkTarget($this, 
"setOnlineAndShare")
 
 1534            return $renderer->render(
$f->messageBox()->info(
$lng->txt(
"prtf_no_offline_share_info"))
 
 1535                ->withButtons($buttons));
 
 1549            $this->
object->setOnline(
true);
 
 1550            $this->
object->update();
 
 1551            ilUtil::sendSuccess(
$lng->txt(
"prtf_has_been_set_online"), 
true);
 
 1553        $ilCtrl->redirectByClass(
"ilworkspaceaccessgui", 
"");
 
An exception for terminatinating execution or to throw for unit testing.
Class ilBlogPosting GUI class.
static getAllPostings($a_blog_id, $a_limit=1000, $a_offset=0)
Get all postings of blog.
This class represents an option in a checkbox group.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
static setUseRelativeDates($a_status)
set use relative dates
static _isPersonalWorkspaceActive()
Static getter.
static isUploadPossible($a_additional_size=null)
Exercise submission //TODO: This class has to much static methods related to delivered "files".
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
static _getStaticLink( $a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
This class represents a non editable value in a property form.
Portfolio view gui base class.
initEditCustomForm(ilPropertyFormGUI $a_form)
Add custom fields to update form.
getAdditional()
Get Additonal Information.
preview($a_return=false, $a_content=false, $a_show_notes=true)
Show user page.
Portfolio view gui class.
setOnlineAndShare()
Set online and switch to share screen.
getType()
Functions that must be overwritten.
getSkillsToPortfolioAssignment($a_pskills, $a_skill_ids, $a_source_page)
getOfflineMessage()
Get offline message for sharing tab.
initEditForm()
Init object edit form.
exportPDFSelection()
Export PDF selection.
executeCommand()
execute command
getPageGUIInstance($a_page_id)
Get portfolio template page gui instance.
exportPDF($a_dev_mode=false)
create()
create new object form
saveBlog()
Create new portfolio blog page.
createPortfolioFromAssignment()
initCreateForm($a_new_type)
Init object creation form.
getPageInstance($a_page_id=null, $a_portfolio_id=null)
Get portfolio template page instance.
getCreateInfoMessage()
Get cereat info message.
afterSave(ilObject $a_new_object)
Post (successful) object creation hook.
printView($a_pdf_export=false)
getEditFormCustomValues(array &$a_values)
Add values to custom edit fields.
setTitleAndDescription()
called by prepare output
createPortfolioFromTemplate(ilPropertyFormGUI $a_form=null)
createFromTemplateDirect($title="")
Create portfolio template direct.
createPortfolioFromTemplateProcess($a_process_form=true)
updateCustom(ilPropertyFormGUI $a_form)
Insert custom update form values into object.
initCopyPageFormOptions(ilPropertyFormGUI $a_form)
setTabs()
create tabs (repository/workspace switch)
initBlogForm()
Init blog page form.
initPDFSelectionForm()
Init print view selection form.
initCreationForms($a_new_type)
Init creation froms.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
initCreatePortfolioFromTemplateForm($a_prtt_id, $a_title)
linkPortfolioToAssignment($a_target_id)
static getAvailablePortfolioTemplates($a_permission="read")
static setUserDefault($a_user_id, $a_portfolio_id=null)
Set the user default portfolio.
static getPortfoliosOfUser($a_user_id)
Get views of user.
Class ilObjStyleSheetGUI.
static getContentPrintStyle()
get content print style
static getSyntaxStylePath()
get syntax style path
static getContentStylePath($a_style_id, $add_random=true)
get content style path
static _lookupName($a_user_id)
lookup user name
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
static _lookupOwner($a_id)
lookup object owner
getCreationFormsHTML(array $a_forms)
Get HTML for creation forms (accordion)
Class ilObject Basic functions for all objects.
const TITLE_LENGTH
max length of object title
static _lookupTitle($a_id)
lookup object title
static _lookupObjectId($a_ref_id)
lookup object id
getId()
get object id @access public
static prepareGenerationRequest($service, $purpose)
Prepare the content processing for a PDF generation request This function should be called as in a re...
static activeLayouts($a_special_page=false, $a_module=null)
Get active layouts.
static getSelectedUserSkills($a_user_id)
Get personal selected user skills.
Declaration of authorship (data gateway)
Class ilPortfolioExerciseGUI.
Portfolio page gui class.
static getAllPortfolioPages($a_portfolio_id)
Get pages of portfolio.
Page for portfolio template.
This class represents an option in a radio group.
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.
special template class to simplify handling of ITX/PEAR
This class represents a text property in a property form.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static redirect($a_script)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static setTokenMaxLifetimeInSeconds($token_max_lifetime_in_seconds)
Access handler for personal workspace.
Tree handler for personal workspace.
if(!empty($this->data['faventry'])) $tabs
if(!array_key_exists('StateId', $_REQUEST)) $id
catch(Exception $e) $message
if(isset($_POST['submit'])) $form