42        $this->lng = 
$DIC->language();
 
   43        $this->
help = $DIC[
"ilHelp"];
 
   45        $this->access = 
$DIC->access();
 
   46        $this->
user = $DIC->user();
 
   47        $this->ctrl = 
$DIC->ctrl();
 
   48        $this->
ui = $DIC->ui();
 
   50        $this->tool_context = 
$DIC->globalScreen()->tool()->context();
 
   55        $this->ctrl->saveParameter($this, 
"exc_back_ref_id");
 
   65        if ($a_perm == 
"create") {
 
   71        return $this->access_handler->checkAccess($a_perm, 
"", $a_node_id);
 
   82        $next_class = $this->ctrl->getNextClass($this);
 
   83        $cmd = $this->ctrl->getCmd(
"view");
 
   89        switch ($next_class) {
 
   90            case "ilworkspaceaccessgui":
 
   93                    $this->tabs_gui->activateTab(
"share");
 
   95                    if ($this->access_handler->getPermissions($this->object->getId()) &&
 
   96                        !$this->object->isOnline()) {
 
  100                    $this->tpl->setPermanentLink(
"prtf", $this->object->getId());
 
  104                    $this->ctrl->forwardCommand($wspacc);
 
  108            case 'ilportfoliopagegui':
 
  122            case "ilobjstylesheetgui":
 
  123                $this->ctrl->setReturn($this, 
"editStyleProperties");
 
  124                $style_gui = 
new ilObjStyleSheetGUI(
"", $this->object->getStyleSheetId(), 
false, 
false);
 
  125                $style_gui->enableWrite(
true);
 
  126                $style_gui->omitLocator();
 
  127                if ($cmd == 
"create" || 
$_GET[
"new_type"] == 
"sty") {
 
  128                    $style_gui->setCreationMode(
true);
 
  131                if ($cmd == 
"confirmedDelete") {
 
  132                    $this->
object->setStyleSheetId(0);
 
  133                    $this->
object->update();
 
  136                $ret = $this->ctrl->forwardCommand($style_gui);
 
  138                if ($cmd == 
"save" || $cmd == 
"copyStyle" || $cmd == 
"importStyle") {
 
  140                    $this->
object->setStyleSheetId($style_id);
 
  141                    $this->
object->update();
 
  142                    $this->ctrl->redirectByClass(
"ilobjstylesheetgui", 
"edit");
 
  146            case "ilportfolioexercisegui":
 
  147                $this->ctrl->setReturn($this, 
"view");
 
  149                $this->ctrl->forwardCommand($gui);
 
  154                if ($cmd != 
"preview") {
 
  172        if (!is_object($this->
object) || $this->object->getId() <= 0) {
 
  177        $assignments = $pe->getAssignmentsOfPortfolio();
 
  178        if (count($assignments) > 0) {
 
  179            $ass_ids = array_map(
function (
$i) {
 
  192        $ilHelp->setScreenIdComponent(
"prtf");
 
  195            $this->tabs_gui->addTab(
 
  197                $this->lng->txt(
"content"),
 
  198                $this->ctrl->getLinkTarget($this, 
"view")
 
  201            $this->tabs_gui->addTab(
 
  203                $this->lng->txt(
"settings"),
 
  204                $this->ctrl->getLinkTarget($this, 
"edit")
 
  207            $this->tabs_gui->addNonTabbedLink(
 
  209                $this->lng->txt(
"user_profile_preview"),
 
  210                $this->ctrl->getLinkTarget($this, 
"preview")
 
  213            $this->lng->loadLanguageModule(
"wsp");
 
  214            $this->tabs_gui->addTab(
 
  216                $this->lng->txt(
"wsp_permissions"),
 
  217                $this->ctrl->getLinkTargetByClass(
"ilworkspaceaccessgui", 
"share")
 
  224        if (!$this->creation_mode) {
 
  225            $this->ctrl->setParameter($this, 
"prt_id", $this->object->getId());
 
  228        parent::addLocatorItems();
 
  230        $this->tpl->setLocator();
 
  237        $title = $this->lng->txt(
"portfolio");
 
  239            $title .= 
": " . $this->
object->getTitle();
 
  241        $this->tpl->setTitle($title);
 
  242        $this->tpl->setTitleIcon(
 
  244            $this->lng->txt(
"portfolio")
 
  248            !$this->object->isOnline()) {
 
  249            $this->tpl->setAlertProperties(array(
 
  250                array(
"alert" => 
true,
 
  251                    "property" => $this->lng->txt(
"status"),
 
  252                    "value" => $this->lng->txt(
"offline"))
 
  272        $new_type = $_REQUEST[
"new_type"];
 
  275        $this->ctrl->saveParameter($this, 
"crtptrefid");
 
  277        $this->ctrl->saveParameter($this, 
"crtcb");
 
  280            $ilErr->raiseError($this->lng->txt(
"permission_denied"), 
$ilErr->MESSAGE);
 
  282            $this->lng->loadLanguageModule($new_type);
 
  283            $this->ctrl->setParameter($this, 
"new_type", $new_type);
 
  288            if (
$_GET[
"cpfl"] && isset($forms[self::CFORM_CLONE])) {
 
  289                $forms = array(self::CFORM_CLONE => $forms[self::CFORM_CLONE]);
 
  315            $root = 
$tree->readRootId();
 
  317                $root = 
$tree->getNodeData($root);
 
  318                foreach (
$tree->getSubTree($root) as $node) {
 
  319                    if ($node[
"type"] == 
"blog") {
 
  320                        $options[$node[
"obj_id"]] = $node[
"title"];
 
  325            if (!
sizeof($options)) {
 
  328                $this->lng->loadLanguageModule(
'pd');
 
  329                $url = $this->ctrl->getLinkTargetByClass(
"ilDashboardGUI", 
"jumpToWorkspace");
 
  330                $text = $this->lng->txt(
"mm_personal_and_shared_r");
 
  332                $text = sprintf($this->lng->txt(
"prtf_no_blogs_info"), $text);
 
  334                $mbox = 
$ui->factory()->messageBox()->info($text)
 
  335                    ->withLinks([
$ui->factory()->link()->standard(
 
  336                        $this->lng->txt(
"mm_personal_and_shared_r"),
 
  349        return array(self::CFORM_NEW => $this->
initCreateForm($a_new_type));
 
  356        $this->ctrl->setParameter($this, 
"new_type", $this->
getType());
 
  359        $form->setFormAction($this->ctrl->getFormAction($this));
 
  365        $ti->setRequired(
true);
 
  369        $main->setValue(
"mode_scratch");
 
  370        $form->addItem($main);
 
  372        $opt_scratch = 
new ilRadioOption($this->lng->txt(
"prtf_creation_mode_scratch"), 
"mode_scratch");
 
  373        $main->addOption($opt_scratch);
 
  379        $type->setRequired(
true);
 
  380        $opt_scratch->addSubItem(
$type);
 
  382        $type_page = 
new ilRadioOption($this->lng->txt(
"page"), 
"page");
 
  383        $type->addOption($type_page);
 
  387        $tf->setMaxLength(128);
 
  389        $tf->setRequired(
true);
 
  390        $type_page->addSubItem($tf);
 
  395            $options = array(0 => $this->lng->txt(
"none"));
 
  396            foreach ($templates as $templ) {
 
  397                $templ->readObject();
 
  398                $options[$templ->getId()] = $templ->getTitle();
 
  401            $use_template = 
new ilSelectInputGUI($this->lng->txt(
"prtf_use_page_layout"), 
"tmpl");
 
  402            $use_template->setRequired(
true);
 
  403            $use_template->setOptions($options);
 
  404            $type_page->addSubItem($use_template);
 
  411            $root = 
$tree->readRootId();
 
  413                $root = 
$tree->getNodeData($root);
 
  414                foreach (
$tree->getSubTree($root) as $node) {
 
  415                    if ($node[
"type"] == 
"blog") {
 
  416                        $options[$node[
"obj_id"]] = $node[
"title"];
 
  421            if (
sizeof($options)) {
 
  422                $type_blog = 
new ilRadioOption($this->lng->txt(
"obj_blog"), 
"blog");
 
  423                $type->addOption($type_blog);
 
  426                $obj->setRequired(
true);
 
  427                $obj->setOptions(array(
"" => $this->lng->txt(
"please_select")) + $options);
 
  428                $type_blog->addSubItem($obj);
 
  430                $type->setValue(
"page");
 
  437        $opt_tmpl = 
new ilRadioOption($this->lng->txt(
"prtf_creation_mode_template"), 
"mode_tmpl");
 
  438        $main->addOption($opt_tmpl);
 
  441        if (!
sizeof($templates)) {
 
  442            $opt_tmpl->setDisabled(
true);
 
  445            $tmpl->setRequired(
true);
 
  446            $tmpl->setOptions(array(
"" => $this->lng->txt(
"please_select")) + $templates);
 
  447            $opt_tmpl->addSubItem($tmpl);
 
  450            if ((
int) $_REQUEST[
"prtt_pre"]) {
 
  451                $tmpl->setValue((
int) $_REQUEST[
"prtt_pre"]);
 
  452                $main->setValue(
"mode_tmpl");
 
  457        $form->setTitle($this->lng->txt(
"prtf_create_portfolio"));
 
  458        $form->addCommandButton(
"save", $this->lng->txt(
"create"));
 
  459        $form->addCommandButton(
"toRepository", $this->lng->txt(
"cancel"));
 
  467        if ($form->checkInput()) {
 
  469            if ($form->getInput(
"mode") == 
"mode_tmpl") {
 
  470                $_REQUEST[
"pt"] = $form->getInput(
"title");
 
  471                $_REQUEST[
"prtt_pre"] = (int) $_REQUEST[
"prtt"];
 
  477        return parent::save();
 
  484        if (
$_POST[
"ptype"] == 
"page") {
 
  486            $page->setTitle(
$_POST[
"fpage"]);
 
  489            $layout_id = 
$_POST[
"tmpl"];
 
  492                $page->setXMLContent($layout_obj->getXMLContent());
 
  496            $page->setTitle(
$_POST[
"blog"]);
 
  500        ilUtil::sendSuccess($this->lng->txt(
"prtf_portfolio_created"), 
true);
 
  501        $this->ctrl->setParameter($this, 
"prt_id", $a_new_object->
getId());
 
  502        $this->ctrl->redirect($this, 
"view");
 
  510        $exc_ref_id = (int) $_REQUEST[
"exc_id"];
 
  512            $ilAccess->checkAccess(
"read", 
"", $exc_ref_id)) {
 
  516        $this->ctrl->redirectByClass(
"ilportfoliorepositorygui", 
"show");
 
  522        $form->setFormAction($this->ctrl->getFormAction($this));
 
  528        $ti->setRequired(
true);
 
  529        $ti->setValue($this->object->getTitle());
 
  542        $online->setChecked($this->object->isOnline());
 
  543        $form->addItem($online);
 
  547        $form->setTitle($this->lng->txt(
"prtf_edit_portfolio"));
 
  548        $form->addCommandButton(
"update", $this->lng->txt(
"save"));
 
  549        $form->addCommandButton(
"view", $this->lng->txt(
"cancel"));
 
  556        $a_values[
"online"] = $this->
object->isOnline();
 
  558        parent::getEditFormCustomValues($a_values);
 
  563        $this->
object->setOnline($a_form->
getInput(
"online"));
 
  570        parent::updateCustom($a_form);
 
  588        if (!$a_portfolio_id && $this->
object) {
 
  589            $a_portfolio_id = $this->
object->getId();
 
  592        $page->setPortfolioId($a_portfolio_id);
 
  605            $this->object->getId(),
 
  608            $this->object->hasPublicComments()
 
  616        return "ilportfoliopagegui";
 
  622        $a_tgt->setRequired(
true);
 
  625        $old = 
new ilRadioOption($this->lng->txt(
"prtf_existing_portfolio"), 
"old");
 
  626        $a_tgt->addOption($old);
 
  630        foreach ($all as $item) {
 
  631            $options[$item[
"id"]] = $item[
"title"];
 
  634        $prtf->setRequired(
true);
 
  635        $prtf->setOptions($options);
 
  636        $old->addSubItem($prtf);
 
  638        $new = 
new ilRadioOption($this->lng->txt(
"prtf_new_portfolio"), 
"new");
 
  639        $a_tgt->addOption($new);
 
  642        $tf->setMaxLength(128);
 
  644        $tf->setRequired(
true);
 
  645        $new->addSubItem($tf);
 
  662        $form->setFormAction($this->ctrl->getFormAction($this));
 
  666        $root = 
$tree->readRootId();
 
  668            $root = 
$tree->getNodeData($root);
 
  669            foreach (
$tree->getSubTree($root, 
true, 
"blog") as $node) {
 
  670                $options[$node[
"obj_id"]] = $node[
"title"];
 
  677        $radg->setInfo($this->lng->txt(
""));
 
  678        $radg->setValue(
"new");
 
  679        $radg->setInfo($this->lng->txt(
""));
 
  681        $op1 = 
new ilRadioOption($this->lng->txt(
"prtf_add_new_blog"), 
"new", $this->lng->txt(
"prtf_add_new_blog_info"));
 
  682        $radg->addOption($op1);
 
  683        $form->addItem($radg);
 
  687        $ti->setRequired(
true);
 
  688        $op1->addSubItem($ti);
 
  691        if (
sizeof($options)) {
 
  692            $op2 = 
new ilRadioOption($this->lng->txt(
"prtf_add_existing_blog"), 
"existing");
 
  693            $radg->addOption($op2);
 
  696            $obj->setOptions($options);
 
  697            $op2->addSubItem($obj);
 
  700        $form->setTitle($this->lng->txt(
"prtf_add_blog") . 
": " .
 
  701            $this->object->getTitle());
 
  702        $form->addCommandButton(
"saveBlog", $this->lng->txt(
"save"));
 
  703        $form->addCommandButton(
"view", $this->lng->txt(
"cancel"));
 
  718        if ($form->checkInput() && $this->checkPermissionBool(
"write")) {
 
  719            if ($form->getInput(
"creation_mode") == 
"existing") {
 
  722                $page->setTitle($form->getInput(
"blog"));
 
  726                $blog->setTitle($form->getInput(
"title"));
 
  733                if (!
$tree->getRootId()) {
 
  743                $page->setTitle($blog->getId());
 
  747            ilUtil::sendSuccess($this->lng->txt(
"prtf_blog_page_created"), 
true);
 
  748            $this->ctrl->redirect($this, 
"view");
 
  751        $this->tabs_gui->clearTargets();
 
  752        $this->tabs_gui->setBackTarget(
 
  753            $this->lng->txt(
"back"),
 
  754            $this->ctrl->getLinkTarget($this, 
"view")
 
  757        $form->setValuesByPost();
 
  758        $this->tpl->setContent($form->getHtml());
 
  768        $title = trim($_REQUEST[
"pt"]);
 
  769        $prtt_id = (int) $_REQUEST[
"prtt"];
 
  773        if (!
sizeof($templates) || !in_array($prtt_id, $templates)) {
 
  778        $this->ctrl->setParameter($this, 
"prtt", $prtt_id);
 
  784            $this->tpl->setContent($a_form->getHTML());
 
  795        if ((
int) $_REQUEST[
"exc_id"]) {
 
  796            $this->ctrl->setParameter($this, 
"exc_id", (
int) $_REQUEST[
"exc_id"]);
 
  797            $this->ctrl->setParameter($this, 
"ass_id", (
int) $_REQUEST[
"ass_id"]);
 
  801        $form->setFormAction($this->ctrl->getFormAction($this));
 
  805        $form->addItem($tmpl);
 
  808        $title->setValue($a_title);
 
  809        $form->addItem($title);
 
  813            $blog_options = array();
 
  815            $root = 
$tree->readRootId();
 
  817                $root = 
$tree->getNodeData($root);
 
  818                foreach (
$tree->getSubTree($root, 
true, 
"blog") as $node) {
 
  819                    $blog_options[$node[
"obj_id"]] = $node[
"title"];
 
  821                asort($blog_options);
 
  825        $has_form_content = 
false;
 
  831        $skill_ids = array();
 
  834            switch ($page[
"type"]) {
 
  838                    $source_page->buildDom(
true);
 
  842                        $quota_sum += $source_page->getPageDiskSize();
 
  844                    if (
sizeof($skill_ids)) {
 
  845                        $has_form_content = 
true;
 
  851                        $has_form_content = 
true;
 
  853                        $field_id = 
"blog_" . $page[
"id"];
 
  856                            $page[
"title"], $field_id);
 
  857                        $blog->setRequired(
true);
 
  858                        $blog->setValue(
"blog_create");
 
  859                        $form->addItem($blog);
 
  861                        $new_blog = 
new ilRadioOption($this->lng->txt(
"prtf_template_import_blog_create"), 
"blog_create");
 
  862                        $blog->addOption($new_blog);
 
  864                        $title = 
new ilTextInputGUI($this->lng->txt(
"title"), $field_id . 
"_create_title");
 
  865                        $title->setRequired(
true);
 
  866                        $new_blog->addSubItem($title);
 
  868                        if (
sizeof($blog_options)) {
 
  869                            $reuse_blog = 
new ilRadioOption($this->lng->txt(
"prtf_template_import_blog_reuse"), 
"blog_resuse");
 
  870                            $blog->addOption($reuse_blog);
 
  872                            $obj = 
new ilSelectInputGUI($this->lng->txt(
"obj_blog"), $field_id . 
"_reuse_blog");
 
  873                            $obj->setRequired(
true);
 
  874                            $obj->setOptions(array(
"" => $this->lng->txt(
"please_select")) + $blog_options);
 
  875                            $reuse_blog->addSubItem($obj);
 
  878                        $blog->addOption(
new ilRadioOption($this->lng->txt(
"prtf_template_import_blog_ignore"), 
"blog_ignore"));
 
  886            $skills->setInfo($this->lng->txt(
"prtf_template_import_new_skills"));
 
  887            $skills->setValue($skill_ids);
 
  888            foreach ($skill_ids as $skill_id) {
 
  891            $form->addItem($skills);
 
  897                $this->ctrl->redirect($this, 
"create");
 
  902        if (!$has_form_content) {
 
  906        $form->setTitle($this->lng->txt(
"prtf_creation_mode") . 
": " . $this->lng->txt(
"prtf_creation_mode_template"));
 
  907        $form->addCommandButton(
"createPortfolioFromTemplateProcess", $this->lng->txt(
"continue"));
 
  908        $form->addCommandButton(
"toRepository", $this->lng->txt(
"cancel"));
 
  919        $title = trim($_REQUEST[
"pt"]);
 
  920        $prtt_id = (int) $_REQUEST[
"prtt"];
 
  924        if (!
sizeof($templates) || !in_array($prtt_id, $templates)) {
 
  931        if ($a_process_form) {
 
  932            $this->ctrl->setParameter($this, 
"prtt", $prtt_id);
 
  935            if ($form->checkInput()) {
 
  937                    switch ($page[
"type"]) {
 
  940                                $field_id = 
"blog_" . $page[
"id"];
 
  941                                switch ($form->getInput($field_id)) {
 
  943                                        $recipe[$page[
"id"]] = array(
"blog", 
"create",
 
  944                                            trim($form->getInput($field_id . 
"_create_title")));
 
  948                                        $recipe[$page[
"id"]] = array(
"blog", 
"reuse",
 
  949                                            (
int) $form->getInput($field_id . 
"_reuse_blog"));
 
  953                                        $recipe[$page[
"id"]] = array(
"blog", 
"ignore");
 
  961                $recipe[
"skills"] = (array) $form->getInput(
"skill_ids");
 
  963                $form->setValuesByPost();
 
  972        $target->setTitle($title);
 
  981        ilUtil::sendSuccess($this->lng->txt(
"prtf_portfolio_created_from_template"), 
true);
 
  982        $this->ctrl->setParameter($this, 
"prt_id", 
$target_id);
 
  983        $this->ctrl->redirect($this, 
"preview");
 
  991        $prtt_id = (int) $_REQUEST[
"prtt_pre"];
 
  998        if (!
sizeof($templates) || !in_array($prtt_id, $templates)) {
 
 1007        $target->setTitle($title);
 
 1016        ilUtil::sendSuccess($this->lng->txt(
"prtf_portfolio_created_from_template"), 
true);
 
 1017        $this->ctrl->setParameter($this, 
"prt_id", 
$target_id);
 
 1018        $this->ctrl->redirect($this, 
"preview");
 
 1022    public static function _goto($a_target)
 
 1029        $id = explode(
"_", $a_target);
 
 1031        $_GET[
"baseClass"] = 
"ilsharedresourceGUI";
 
 1032        $ctrl->setParameterByClass(
"ilobjportfoliogui", 
"prt_id", $id[0]);
 
 1033        if (
sizeof($id) == 2) {
 
 1034            $ctrl->setParameterByClass(
"ilobjportfoliogui", 
"user_page", $id[1]);
 
 1036        $ctrl->redirectByClass([
"ilsharedresourceGUI", 
"ilobjportfoliogui"], 
"preview");
 
 1044        $title = trim($_REQUEST[
"pt"]);
 
 1045        $prtt_id = (int) $_REQUEST[
"prtt"];
 
 1048        $ass_template_id = 0;
 
 1049        if ((
int) $_REQUEST[
"ass_id"] > 0) {
 
 1056            if (!
sizeof($templates) || !in_array($prtt_id, $templates)) {
 
 1057                if ($ass_template_id != $prtt_id) {
 
 1068            $skill_ids = array();
 
 1072                switch ($page[
"type"]) {
 
 1075                            $recipe[$page[
"id"]] = array(
"blog", 
"create", $page[
'title']);
 
 1080                        $source_page->buildDom(
true);
 
 1082                            $quota_sum += $source_page->getPageDiskSize();
 
 1092                    $this->ctrl->redirect($this, 
"create");
 
 1097                $recipe[
"skills"] = $skill_ids;
 
 1103        $target->setTitle($title);
 
 1115        $this->ctrl->setParameter($this, 
"prt_id", 
$target_id);
 
 1117            ilUtil::sendSuccess($this->lng->txt(
"prtf_portfolio_created_from_template"), 
true);
 
 1118            $this->ctrl->redirect($this, 
"preview");
 
 1120            ilUtil::sendSuccess($this->lng->txt(
"prtf_portfolio_created"), 
true);
 
 1121            $this->ctrl->redirect($this, 
"view");
 
 1130        $exc_ref_id = (int) $_REQUEST[
"exc_id"];
 
 1131        $ass_id = (int) $_REQUEST[
"ass_id"];
 
 1135            $ilAccess->checkAccess(
"read", 
"", $exc_ref_id)) {
 
 1138            if ($ass->getExerciseId() == $exc->getId() &&
 
 1142                $sub->addResourceObject($a_target_id);
 
 1155        $dom = $a_source_page->getDom();
 
 1157            $dom = $dom->myDOMDocument;
 
 1159        $xpath = 
new DOMXPath($dom);
 
 1160        $nodes = $xpath->query(
"//PageContent/Skills");
 
 1161        foreach ($nodes as $node) {
 
 1162            $skill_id = $node->getAttribute(
"Id");
 
 1163            if (!in_array($skill_id, $a_pskills)) {
 
 1164                $a_skill_ids[] = $skill_id;
 
 1171        return $a_skill_ids;
 
 1187        $tpl->setContent($form->getHTML());
 
 1200        $tabs = 
$DIC->tabs();
 
 1202        $tabs->clearTargets();
 
 1203        $tabs->setBackTarget(
$lng->txt(
"back"), 
$ilCtrl->getLinkTarget($this, 
"view"));
 
 1211        $form->setPreventDoubleSubmission(
false);
 
 1214        if ($this->declaration_authorship->getForUser($this->user) != 
"") {
 
 1215            $cb = 
new ilCheckboxInputGUI($this->lng->txt(
"prtf_decl_authorship"), 
"decl_author");
 
 1216            $cb->setInfo($this->declaration_authorship->getForUser($this->user));
 
 1217            $form->addItem($cb);
 
 1222        $cb->setInfo($this->lng->txt(
"prtf_signature_info"));
 
 1223        $form->addItem($cb);
 
 1228        $radg->setValue(
"all_pages");
 
 1230        $radg->addOption($op2);
 
 1232        $radg->addOption($op3);
 
 1235        $op3->addSubItem($nl);
 
 1237        foreach ($pages as $p) {
 
 1256                    $lng->txt(
"obj_blog")
 
 1259                foreach ($pages2 as $p2) {
 
 1273        $form->addItem($radg);
 
 1275        $form->addCommandButton(
"exportPDF", 
$lng->txt(
"prtf_pdf"));
 
 1276        if (DEVMODE == 
"1") {
 
 1277            $form->addCommandButton(
"exportPDFDev", 
$lng->txt(
"prtf_pdf") . 
" (DEV)");
 
 1280        $form->setTitle(
$lng->txt(
"prtf_print_options"));
 
 1281        $form->setFormAction(
$ilCtrl->getFormAction($this, 
"exportPDF"));
 
 1308        $html = preg_replace(
"/\?dummy\=[0-9]+/", 
"", $html);
 
 1309        $html = preg_replace(
"/\?vers\=[0-9A-Za-z\-]+/", 
"", $html);
 
 1311        $html = preg_replace(
"/src=\"\\.\\//ims", 
"src=\"" . 
ILIAS_HTTP_PATH . 
"/", $html);
 
 1312        $html = preg_replace(
"/href=\"\\.\\//ims", 
"href=\"" . 
ILIAS_HTTP_PATH . 
"/", $html);
 
 1337        $resource_collector = new \ILIAS\COPage\ResourcesCollector(
 
 1341        $resource_injector = new \ILIAS\COPage\ResourcesInjector($resource_collector);
 
 1343        $tpl->setBodyClass(
"ilPrtfPdfBody");
 
 1350        $resource_injector->inject(
$tpl);
 
 1356        $cover_tpl = 
new ilTemplate(
"tpl.prtf_cover.html", 
true, 
true, 
"Modules/Portfolio");
 
 1357        foreach ($pages as $page) {
 
 1359                if (
$_POST[
"sel_type"] == 
"selection" && (!is_array(
$_POST[
"obj_id"]) || !in_array($page[
"id"], 
$_POST[
"obj_id"]))) {
 
 1362                $cover_tpl->setCurrentBlock(
"content_item");
 
 1363                $cover_tpl->setVariable(
"ITEM_TITLE", $page[
"title"]);
 
 1364                $cover_tpl->parseCurrentBlock();
 
 1366                $cover_tpl->setCurrentBlock(
"content_item");
 
 1368                $cover_tpl->parseCurrentBlock();
 
 1372        if (
$_POST[
"signature"]) {
 
 1373            $cover_tpl->setCurrentBlock(
"signature");
 
 1374            $cover_tpl->setVariable(
"TXT_SIGNATURE", 
$lng->txt(
"prtf_signature_date"));
 
 1375            $cover_tpl->parseCurrentBlock();
 
 1378        if (
$_POST[
"decl_author"]) {
 
 1379            $cover_tpl->setCurrentBlock(
"decl_author");
 
 1380            $cover_tpl->setVariable(
 
 1382                nl2br($this->declaration_authorship->getForUser($this->user))
 
 1384            $cover_tpl->parseCurrentBlock();
 
 1387        $cover_tpl->setVariable(
"PORTFOLIO_TITLE", $this->object->getTitle());
 
 1390        $cover_tpl->setVariable(
"TXT_AUTHOR", 
$lng->txt(
"prtf_author"));
 
 1391        $cover_tpl->setVariable(
"TXT_LINK", 
$lng->txt(
"prtf_link"));
 
 1392        $cover_tpl->setVariable(
"TXT_DATE", 
$lng->txt(
"prtf_date_of_print"));
 
 1395        $author_str = $author[
"firstname"] . 
" " . $author[
"lastname"];
 
 1396        $cover_tpl->setVariable(
"AUTHOR", $author_str);
 
 1399        $cover_tpl->setVariable(
"LINK", $href);
 
 1403        $cover_tpl->setVariable(
"DATE", $date_str);
 
 1405        $page_content .= $cover_tpl->get();
 
 1406        $page_content .= 
'<p style="page-break-after:always;"></p>';
 
 1408        $page_head_tpl = 
new ilTemplate(
"tpl.prtf_page_head.html", 
true, 
true, 
"Modules/Portfolio");
 
 1409        $page_head_tpl->setVariable(
"AUTHOR", $author_str);
 
 1410        $page_head_tpl->setVariable(
"DATE", $date_str);
 
 1411        $page_head_str = $page_head_tpl->get();
 
 1413        foreach ($pages as $page) {
 
 1415                if (
$_POST[
"sel_type"] == 
"selection" && (!is_array(
$_POST[
"obj_id"]) || !in_array($page[
"id"], 
$_POST[
"obj_id"]))) {
 
 1420                $page_gui->setOutputMode(
"print");
 
 1421                $page_gui->setPresentationTitle($page[
"title"]);
 
 1422                $html = $this->ctrl->getHTML($page_gui);
 
 1423                $page_content .= $page_head_str . $html;
 
 1425                if ($a_pdf_export) {
 
 1426                    $page_content .= 
'<p style="page-break-after:always;"></p>';
 
 1430                foreach ($pages2 as $p2) {
 
 1431                    if (
$_POST[
"sel_type"] == 
"selection" && (!is_array(
$_POST[
"obj_id"]) || !in_array(
"b" . $p2[
"id"], 
$_POST[
"obj_id"]))) {
 
 1435                    $page_gui->setFileDownloadLink(
"#");
 
 1436                    $page_gui->setFullscreenLink(
"#");
 
 1437                    $page_gui->setSourcecodeDownloadScript(
"#");
 
 1438                    $page_gui->setOutputMode(
"print");
 
 1439                    $page_content .= $page_head_str . $page_gui->showPage(
ilObject::_lookupTitle($page[
"title"]) . 
": " . $page_gui->getBlogPosting()->getTitle());
 
 1441                    if ($a_pdf_export) {
 
 1442                        $page_content .= 
'<p style="page-break-after:always;"></p>';
 
 1448        $page_content = 
'<div class="ilInvisibleBorder">' . $page_content . 
'</div>';
 
 1450        if (!$a_pdf_export) {
 
 1451            $page_content .= 
'<script type="text/javascript" language="javascript1.2"> 
 1453                                        il.Util.addOnLoad(function () { 
 1460        $tpl->setVariable(
"CONTENT", $page_content);
 
 1462        if (!$a_pdf_export) {
 
 1463            $tpl->printToStdout(
false);
 
 1484        if (!$this->object->isOnline()) {
 
 1485            $f = 
$ui->factory();
 
 1486            $renderer = 
$ui->renderer();
 
 1488            $buttons = [
$f->button()->standard(
 
 1489                $lng->txt(
"prtf_set_online"),
 
 1490                $ctrl->getLinkTarget($this, 
"setOnlineAndShare")
 
 1493            return $renderer->render(
$f->messageBox()->info(
$lng->txt(
"prtf_no_offline_share_info"))
 
 1494                ->withButtons($buttons));
 
 1508            $this->
object->setOnline(
true);
 
 1509            $this->
object->update();
 
 1510            ilUtil::sendSuccess(
$lng->txt(
"prtf_has_been_set_online"), 
true);
 
 1512        $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".
special template class to simplify handling of ITX/PEAR
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.
triggerAssignmentTool()
Trigger assignment tool.
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, $add_token=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.
Exercise info for portfolios.
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.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc