ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
ilPortfolioPageGUI Class Reference

Portfolio page gui class. More...

+ Inheritance diagram for ilPortfolioPageGUI:
+ Collaboration diagram for ilPortfolioPageGUI:

Public Member Functions

 __construct (int $a_portfolio_id, int $a_id=0, int $a_old_nr=0, bool $a_enable_comments=true)
 
 getParentType ()
 
 executeCommand ()
 execute command More...
 
 showPage ()
 display content of page More...
 
 getTabs (string $a_activate="")
 
 setEmbedded (bool $a_value)
 Set embedded mode: will suppress tabs. More...
 
 setAdditional (array $a_additional)
 Set Additonal Information. More...
 
 getAdditional ()
 Get Additonal Information. More...
 
 getJsOnloadCode ()
 
 postOutputProcessing (string $a_output)
 Finalizing output processing. More...
 
 getExportMaterial ()
 
 makePlaceHoldersClickable (string $a_html)
 
 getViewPageLink ()
 
 getViewPageText ()
 
 getPagePermaLink ()
 
 getCommentsHTMLExport ()
 
 finishEditing ()
 
- Public Member Functions inherited from ilPageObjectGUI
 __construct (string $a_parent_type, int $a_id, int $a_old_nr=0, bool $a_prevent_get_id=false, string $a_lang="", string $concrete_lang="")
 
 setTemplate (ilGlobalTemplateInterface $main_tpl)
 
 afterConstructor ()
 
 setAdvMdRecordObject (int $a_adv_ref_id, string $a_adv_type, string $a_adv_subtype="-")
 Set object, that defines the adv md records being used. More...
 
 getAdvMdRecordObject ()
 Get adv md record type. More...
 
 setParentType (string $a_val)
 
 getParentType ()
 
 setId (int $a_val)
 
 getId ()
 
 setOldNr (int $a_val)
 Set old nr (historic page) More...
 
 getOldNr ()
 
 setLanguage (string $a_val)
 
 getLanguage ()
 
 setEnablePCType (string $a_pc_type, bool $a_val)
 
 getEnablePCType (string $a_pc_type)
 
 setPageConfig (ilPageConfig $a_val)
 
 getPageConfig ()
 
 setPageObject (ilPageObject $a_pg_obj)
 
 getPageObject ()
 
 setOutputMode (string $a_mode=self::PRESENTATION)
 
 getOutputMode ()
 
 setTemplateOutput (bool $a_output=true)
 
 outputToTemplate ()
 
 setPresentationTitle (string $a_title="")
 
 getPresentationTitle ()
 
 setHeader (string $a_title="")
 
 getHeader ()
 
 setLinkParams (string $l_params="")
 
 getLinkParams ()
 
 setLinkFrame (string $l_frame="")
 
 getLinkFrame ()
 
 setPageLinker (\ILIAS\COPage\PageLinker $page_linker)
 
 getLinkXML ()
 
 setQuestionHTML (array $question_html)
 
 getQuestionHTML ()
 
 setTemplateTargetVar (string $a_variable)
 
 getTemplateTargetVar ()
 
 getTemplateOutputVar ()
 
 setSourcecodeDownloadScript (string $script_name)
 
 getSourcecodeDownloadScript ()
 
 setTabs (ilTabsGUI $a_tabs)
 
 setPageBackTitle (string $a_title)
 
 setFileDownloadLink (string $a_download_link)
 
 getFileDownloadLink ()
 
 setFullscreenLink (string $a_fullscreen_link)
 
 getFullscreenLink ()
 
 setIntLinkReturn (string $a_return)
 
 enableNotes (bool $a_enabled, int $a_parent_id)
 
 isEnabledNotes ()
 
 setOfflineDirectory (string $offdir)
 
 getOfflineDirectory ()
 
 setViewPageLink (string $a_link, string $a_target="")
 set link for "view page" button More...
 
 getViewPageLink ()
 
 getViewPageTarget ()
 
 getViewPageText ()
 
 setActivationListener (object $a_obj, string $a_meth)
 
 setEnabledNews (bool $a_enabled, int $a_news_obj_id=0, string $a_news_obj_type="")
 
 getEnabledNews ()
 
 setTabHook (object $a_object, string $a_function)
 
 setEditPreview (bool $a_editpreview)
 Set Display first Edit tab, then Preview tab, instead of Page and Edit. More...
 
 getEditPreview ()
 
 setEnabledTabs (bool $a_enabledtabs)
 
 getEnabledTabs ()
 
 setEnabledPageFocus (bool $a_enabledpagefocus)
 
 setOpenPlaceHolder (string $a_val)
 
 getOpenPlaceHolder ()
 
 getEnabledPageFocus ()
 
 setPrependingHtml (string $a_prependinghtml)
 
 getPrependingHtml ()
 
 setEnableEditing (bool $a_enableediting)
 
 getEnableEditing ()
 
 setRawPageContent (bool $a_rawpagecontent)
 Set Get raw page content only. More...
 
 getRawPageContent ()
 
 setStyleId (int $a_styleid)
 
 getStyleId ()
 
 setCompareMode (bool $a_val)
 
 getCompareMode ()
 
 setAbstractOnly (bool $a_val, string $pcid="")
 Get only abstract (first text paragraph) More...
 
 getAbstractOnly ()
 
 setRenderPageContainer (bool $a_val)
 
 getRenderPageContainer ()
 
 getDisabledText ()
 
 getEnabledHref ()
 
 setEnabledHref (bool $enable)
 
 activateMetaDataEditor (ilObject $a_rep_obj, string $a_type, int $a_sub_obj_id, ?object $a_observer_obj=null, string $a_observer_func="")
 Activate meda data editor. More...
 
 determineFileDownloadLink ()
 
 determineFullscreenLink ()
 
 determineSourcecodeDownloadScript ()
 
 getComponentPluginsXML ()
 Put information about activated plugins into XML. More...
 
 executeCommand ()
 execute command More...
 
 setQEditTabs (string $a_active)
 Set question editing tabs. More...
 
 onFeedbackEditingForwarding ()
 
 deactivatePage ()
 
 activatePage ()
 
 showPage ()
 display content of page More...
 
 replaceCurlyBrackets (string $output)
 
 getActivationCaptions ()
 Get captions for activation action menu entries. More...
 
 setEditMode ()
 Set edit mode. More...
 
 setDefaultLinkXml ()
 
 setLinkXml (string $xml)
 
 getProfileBackUrl ()
 
 setProfileBackUrl (string $url)
 
 downloadFile ()
 
 displayMediaFullscreen ()
 
 displayMedia (bool $a_fullscreen=false)
 
 showPageFullscreen ()
 
 download_paragraph ()
 download source code paragraph More...
 
 insertPageToc (string $a_output)
 
 insertResources (string $a_output)
 
 insertAdvTrigger (string $a_output)
 Insert adv content trigger. More...
 
 postOutputProcessing (string $a_output)
 Finalizing output processing. More...
 
 previewHistory ()
 Preview history. More...
 
 preview ()
 
 edit ()
 
 getBlockingInfoMessage ()
 
 insertJSAtPlaceholder ()
 
 presentation (string $a_mode=self::PRESENTATION)
 
 getHTML ()
 
 showMediaFullscreen (int $a_style_id=0)
 show fullscreen view of media object More...
 
 displayValidationError ($a_error)
 display validation error More...
 
 history ()
 Get history table as HTML. More...
 
 rollbackConfirmation ()
 Rollback confirmation. More...
 
 rollback ()
 Rollback to a previous version. More...
 
 setScreenIdComponent ()
 
 getMetaDataLink ()
 
 getTabs (string $a_activate="")
 
 compareVersion ()
 Compares two revisions of the page. More...
 
 replaceDiffTags (string $a_html)
 
 editActivation ()
 Edit activation (only, if scheduled page activation is activated in administration) More...
 
 initActivationForm ()
 Init activation form. More...
 
 getActivationFormValues ()
 Get values for activation form. More...
 
 saveActivation ()
 Save Activation. More...
 
 getNotesHTML (?object $a_content_object=null, bool $a_enable_private_notes=true, bool $a_enable_public_notes=false, bool $a_enable_notes_deletion=false, ?callable $a_callback=null, bool $export=false)
 Get html for public and/or private notes. More...
 
 processAnswer ()
 Process answer. More...
 
 initialOpenedContent ()
 Initially opened content. More...
 
 initOpenedContentForm ()
 
 saveInitialOpenedContent ()
 
 switchToLanguage ()
 Switch to language. More...
 
 confirmPageTranslationCreation ()
 Confirm page translation creation. More...
 
 editMasterLanguage ()
 Edit master language. More...
 
 createPageTranslation ()
 Create page translation. More...
 
 releasePageLock ()
 Release page lock. More...
 
 finishEditing ()
 
 getPagePermaLink ()
 
 getAdditionalPageActions ()
 Get additional page actions. More...
 
 afterDeleteContents ()
 

Data Fields

const EMBEDDED_NO_OUTPUT = -99
 
- Data Fields inherited from ilPageObjectGUI
const PRESENTATION = "presentation"
 
const EDIT = "edit"
 
const PREVIEW = "preview"
 
const OFFLINE = "offline"
 
const PRINTING = "print"
 
string $page_back_title = ""
 
ilPageObject $obj
 
string $presentation_title = ""
 
string $target_script = ""
 
string $return_location = ""
 
string $target_var = ""
 
string $template_output_var = ""
 
bool $output2template = false
 
string $link_params = ""
 
string $sourcecode_download_script = ""
 
bool $activation = false
 
bool $activated = true
 
bool $editpreview = false
 
bool $use_meta_data = false
 
ilObject $meta_data_rep_obj = null
 
int $meta_data_sub_obj_id = 0
 
string $meta_data_type = ""
 
object $meta_data_observer_obj = null
 
string $meta_data_observer_func = ""
 
bool $link_xml_set = false
 
bool $enableediting = true
 
bool $rawpagecontent = false
 
bool $enabledcontentincludes = false
 
bool $compare_mode = false
 
ilPageConfig $page_config = null
 
bool $tabs_enabled = true
 
bool $render_page_container = false
 
string $pl_start = "{{{{{"
 
string $pl_end = "}}}}}"
 

Protected Member Functions

 getPageContentUserId (int $a_user_id)
 
 renderPageElement (string $a_type, string $a_html)
 
 renderTeaser (string $a_type, string $a_title, string $a_options="")
 
 renderProfile (int $a_user_id, string $a_type, ?array $a_fields=null)
 
 renderVerification (int $a_user_id, string $a_type, int $a_id)
 
 dltstv ()
 
 dlexcv ()
 
 dlcrsv ()
 
 dlcmxv ()
 
 dlltiv ()
 
 dlscov ()
 
 dlcrta ()
 
 renderBlogTeaser (int $a_user_id, int $a_blog_id, ?array $a_posting_ids=null)
 
 renderSkills (int $a_user_id, int $a_skills_id)
 
 renderSkillsTeaser (int $a_user_id, int $a_skills_id)
 
 renderConsultationHoursTeaser (int $a_user_id, string $a_mode, ?array $a_group_ids=null)
 
 renderConsultationHours (int $a_user_id, string $a_mode, ?array $a_group_ids=null)
 
 isMyCoursesActive ()
 
 renderMyCoursesTeaser (int $a_user_id, $a_default_sorting)
 
 renderMyCourses (int $a_user_id, string $a_default_sorting)
 
 getCourseSortAction (ilCtrl $ctrl)
 Get course sort action. More...
 
 getCoursesOfUser (int $a_user_id, bool $a_add_path=false)
 
 parseLOUserResults (int $a_course_obj_id, int $a_user_id)
 
- Protected Member Functions inherited from ilPageObjectGUI
 initPageObject ()
 Init page object. More...
 
 showEditToolbar ()
 Show edit toolbar. More...
 
 setEditorToolContext ()
 Set editor tool context. More...
 
 initEditing ()
 
 showEditLockInfo ()
 
 setBackToEditTabs ()
 
 setBackToHistoryTabs ()
 
 checkLangPageAvailable (int $id, string $lang)
 
 isPageContainerToBeRendered ()
 
 addResourcesToTemplate (ilGlobalTemplateInterface $tpl)
 Add resources to template. More...
 

Protected Attributes

bool $enable_comments
 
int $portfolio_id
 
ILIAS Portfolio StandardGUIRequest $port_request
 
bool $embedded = false
 
ilObjectDefinition $obj_definition
 
ilTree $tree
 
array $js_onload_code = array()
 
array $additional = array()
 
array $export_material = array("js" => array(), "images" => array(), "files" => array())
 
int $requested_ppage
 
ILIAS UI Factory $ui_fac
 
ILIAS UI Renderer $ui_ren
 
- Protected Attributes inherited from ilPageObjectGUI
ILIAS TestQuestionPool Questions PublicInterface $questioninfo
 
ILIAS COPage Page PageManager $pm
 
ILIAS COPage Link LinkManager $link
 
ILIAS COPage InternalGUIService $gui
 
ILIAS COPage PC PCDefinition $pc_definition
 
ILIAS COPage Xsl XslManager $xsl
 
ILIAS COPage Editor GUIService $editor_gui
 
ILIAS Notes Service $notes
 
int $requested_ref_id
 
int $requested_pg_id
 
string $requested_file_id
 
string $requested_transl
 
int $requested_old_nr
 
EditGUIRequest $request
 
EditSessionRepository $edit_repo
 
string $exp_target_script = ""
 
string $exp_id = ""
 
string $exp_frame = ""
 
string $act_meth = ""
 
object $act_obj
 
int $notes_parent_id = 0
 
ilPropertyFormGUI $form
 
int $styleid = 0
 
bool $enabledpagefocus
 
string $link_xml
 
int $old_nr = 0
 
int $id
 
string $language
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilTabsGUI $tabs_gui
 
ilAccessHandler $access
 
ilLogger $log
 
ilObjUser $user
 
ilHelpGUI $help
 
string $output_mode = ""
 
string $parent_type = ""
 
string $file_download_link = ''
 
string $fullscreen_link = ''
 
string $link_frame = ''
 
ILIAS GlobalScreen ScreenContext ContextServices $tool_context
 
ILIAS DI UIServices $ui
 
ILIAS COPage PageLinker $page_linker
 
string $abstract_pcid = ""
 
ilToolbarGUI $toolbar
 
string $open_place_holder = ""
 
int $requested_user_id = 0
 
int $requested_q_id = 0
 
int $requested_history_mode = 0
 
bool $enabled_news = false
 
int $news_obj_id = 0
 
string $news_obj_type = ""
 
array $tab_hook = null
 
string $view_page_link = ""
 
string $view_page_target = ""
 
string $offline_directory = ""
 
bool $notes_enabled = false
 
string $prependinghtml = ""
 
string $header = ""
 
string $int_link_return = ""
 
bool $enabled_href = true
 
int $adv_ref_id = null
 
string $adv_type = null
 
string $adv_subtype = null
 
string $concrete_lang = ""
 
string $profile_back_url = ""
 
ilComponentFactory $component_factory
 
ILIAS COPage Compare PageCompare $compare
 

Static Protected Attributes

static int $initialized = 0
 
static bool $calender_initialized = false
 

Private Member Functions

 createPersistentCertificateUrl (int $a_id, ilUserCertificateRepository $userCertificateRepository, string $url)
 

Detailed Description

Portfolio page gui class.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om @ilCtrl_Calls ilPortfolioPageGUI: ilPageEditorGUI, ilEditClipboardGUI, ilMediaPoolTargetSelector @ilCtrl_Calls ilPortfolioPageGUI: ilPageObjectGUI, ILIAS\User\Profile\PublicProfileGUI @ilCtrl_Calls ilPortfolioPageGUI: ilCalendarMonthGUI, ilConsultationHoursGUI, ilLearningHistoryGUI

Definition at line 28 of file class.ilPortfolioPageGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilPortfolioPageGUI::__construct ( int  $a_portfolio_id,
int  $a_id = 0,
int  $a_old_nr = 0,
bool  $a_enable_comments = true 
)

Definition at line 47 of file class.ilPortfolioPageGUI.php.

52 {
53 global $DIC;
54
55 $this->tpl = $DIC["tpl"];
56 $this->ctrl = $DIC->ctrl();
57 $this->user = $DIC->user();
58 $this->obj_definition = $DIC["objDefinition"];
59 $this->access = $DIC->access();
60 $this->tree = $DIC->repositoryTree();
61 $this->lng = $DIC->language();
62 $tpl = $DIC["tpl"];
63 $this->port_request = $DIC->portfolio()
64 ->internal()
65 ->gui()
66 ->standardRequest();
67 $this->ui_fac = $DIC->ui()->factory();
68 $this->ui_ren = $DIC->ui()->renderer();
69
70 $this->portfolio_id = $a_portfolio_id;
71 $this->enable_comments = $a_enable_comments;
72
73 parent::__construct($this->getParentType(), $a_id, $a_old_nr);
74 $this->getPageObject()->setPortfolioId($this->portfolio_id);
75
76 // content style
77
78 $tpl->setCurrentBlock("SyntaxStyle");
80 "LOCATION_SYNTAX_STYLESHEET",
82 );
84 $this->requested_ppage = $this->port_request->getPortfolioPageId();
85 }
ilGlobalTemplateInterface $tpl
setVariable(string $variable, $value='')
Sets the given variable to the given value.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ilPageObjectGUI\$tpl, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ilPageObjectGUI\getPageObject(), getParentType(), ilObjStyleSheet\getSyntaxStylePath(), ILIAS\Repository\lng(), ILIAS\UICore\GlobalTemplate\parseCurrentBlock(), ILIAS\UICore\GlobalTemplate\setCurrentBlock(), ILIAS\UICore\GlobalTemplate\setVariable(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ createPersistentCertificateUrl()

ilPortfolioPageGUI::createPersistentCertificateUrl ( int  $a_id,
ilUserCertificateRepository  $userCertificateRepository,
string  $url 
)
private

Definition at line 1124 of file class.ilPortfolioPageGUI.php.

1128 : string {
1129 try {
1130 $presentation = $userCertificateRepository->fetchActiveCertificateForPresentation($this->user->getId(), $a_id);
1131 } catch (Exception $e) {
1132 return "";
1133 }
1134 $caption = $this->lng->txt('certificate') . ': ';
1135 $caption .= $this->lng->txt($presentation->getUserCertificate()->getObjType()) . ' ';
1136 $caption .= '"' . $presentation->getObjectTitle() . '"';
1137
1138 return '<div><a href="' . $url . '">' . $caption . '</a></div>';
1139 }
fetchActiveCertificateForPresentation(int $userId, int $objectId)
$url
Definition: shib_logout.php:70

◆ dlcmxv()

ilPortfolioPageGUI::dlcmxv ( )
protected

Definition at line 431 of file class.ilPortfolioPageGUI.php.

431 : void
432 {
433 $id = $this->port_request->getVerificationId();
434 if ($id) {
436 $verification->downloadFromPortfolioPage($this->getPortfolioPage());
437 }
438 }

References $id, and ilObject2GUI\WORKSPACE_OBJECT_ID.

◆ dlcrsv()

ilPortfolioPageGUI::dlcrsv ( )
protected

Definition at line 422 of file class.ilPortfolioPageGUI.php.

422 : void
423 {
424 $id = $this->port_request->getVerificationId();
425 if ($id) {
427 $verification->downloadFromPortfolioPage($this->getPortfolioPage());
428 }
429 }
GUI class for course verification.

References $id, and ilObject2GUI\WORKSPACE_OBJECT_ID.

◆ dlcrta()

ilPortfolioPageGUI::dlcrta ( )
protected

Definition at line 458 of file class.ilPortfolioPageGUI.php.

458 : void
459 {
460 $objectId = $this->port_request->getVerificationId();
461 if ($objectId) {
463 $object->downloadFromPortfolioPage($this->getPortfolioPage(), $objectId, $this->user->getId());
464 }
465 }

References ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ dlexcv()

ilPortfolioPageGUI::dlexcv ( )
protected

Definition at line 413 of file class.ilPortfolioPageGUI.php.

413 : void
414 {
415 $id = $this->port_request->getVerificationId();
416 if ($id) {
418 $verification->downloadFromPortfolioPage($this->getPortfolioPage());
419 }
420 }
GUI class for exercise verification.

References $id, and ilObject2GUI\WORKSPACE_OBJECT_ID.

◆ dlltiv()

ilPortfolioPageGUI::dlltiv ( )
protected

Definition at line 440 of file class.ilPortfolioPageGUI.php.

440 : void
441 {
442 $id = $this->port_request->getVerificationId();
443 if ($id) {
445 $verification->downloadFromPortfolioPage($this->getPortfolioPage());
446 }
447 }

References $id, and ilObject2GUI\WORKSPACE_OBJECT_ID.

◆ dlscov()

ilPortfolioPageGUI::dlscov ( )
protected

Definition at line 449 of file class.ilPortfolioPageGUI.php.

449 : void
450 {
451 $id = $this->port_request->getVerificationId();
452 if ($id) {
454 $verification->downloadFromPortfolioPage($this->getPortfolioPage());
455 }
456 }
GUI class for scorm verification.

References $id, and ilObject2GUI\WORKSPACE_OBJECT_ID.

◆ dltstv()

ilPortfolioPageGUI::dltstv ( )
protected

Definition at line 404 of file class.ilPortfolioPageGUI.php.

404 : void
405 {
406 $id = $this->port_request->getVerificationId();
407 if ($id) {
409 $verification->downloadFromPortfolioPage($this->getPortfolioPage());
410 }
411 }
GUI class for test verification.

References $id, and ilObject2GUI\WORKSPACE_OBJECT_ID.

◆ executeCommand()

ilPortfolioPageGUI::executeCommand ( )

execute command

Reimplemented from ilPageObjectGUI.

Definition at line 105 of file class.ilPortfolioPageGUI.php.

105 : string
106 {
107 $ilCtrl = $this->ctrl;
108 $ilUser = $this->user;
109
110 $next_class = $this->ctrl->getNextClass($this);
111 $cmd = $this->ctrl->getCmd();
112
113 switch ($next_class) {
114 case "ilcalendarmonthgui":
115 $this->ctrl->saveParameter($this, "chuid");
116 // booking action
117 if ($cmd && $cmd !== "preview") {
119 if ($categories->getMode() === 0) {
120 $chuid = $this->port_request->getConsultationHourUserId();
121 if ($chuid > 0) {
122 $categories->setCHUserId($chuid);
123 }
124 $categories->initialize(ilCalendarCategories::MODE_PORTFOLIO_CONSULTATION, 0, true);
125 }
126
127 $req_seed = $this->port_request->getCalendarSeed();
128 if ($req_seed !== "") {
129 $seed = new ilDate($req_seed, IL_CAL_DATE);
130 } else {
131 $seed = new ilDate(time(), IL_CAL_UNIX);
132 }
133
134 $month_gui = new ilCalendarMonthGUI($seed);
135 return (string) $ilCtrl->forwardCommand($month_gui);
136 }
137
138 // calendar month navigation
139 //$ilCtrl->setParameter($this, "cmd", "preview");
140 return (string) self::EMBEDDED_NO_OUTPUT;
141 default:
142 $this->setPresentationTitle($this->getPageObject()->getTitle());
143 return (string) parent::executeCommand();
144 }
145 }
const IL_CAL_DATE
const IL_CAL_UNIX
static _getInstance($a_usr_id=0)
get singleton instance
Class for single dates.
setPresentationTitle(string $a_title="")

References ilPageObjectGUI\$ctrl, ilPageObjectGUI\$user, ilCalendarCategories\_getInstance(), ILIAS\Repository\ctrl(), EMBEDDED_NO_OUTPUT, ilPageObjectGUI\getPageObject(), ILIAS\GlobalScreen\Scope\Footer\Factory\getTitle(), IL_CAL_DATE, IL_CAL_UNIX, ilCalendarCategories\MODE_PORTFOLIO_CONSULTATION, and ilPageObjectGUI\setPresentationTitle().

+ Here is the call graph for this function:

◆ finishEditing()

ilPortfolioPageGUI::finishEditing ( )

Reimplemented from ilPageObjectGUI.

Reimplemented in ilPortfolioTemplatePageGUI.

Definition at line 1154 of file class.ilPortfolioPageGUI.php.

1154 : void
1155 {
1156 $this->ctrl->redirectByClass("ilObjPortfolioGUI", "view");
1157 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ getAdditional()

ilPortfolioPageGUI::getAdditional ( )

Get Additonal Information.

Definition at line 186 of file class.ilPortfolioPageGUI.php.

186 : array
187 {
188 return $this->additional;
189 }

References $additional.

◆ getCommentsHTMLExport()

ilPortfolioPageGUI::getCommentsHTMLExport ( )

Definition at line 1141 of file class.ilPortfolioPageGUI.php.

1141 : string
1142 {
1143 $notes_gui = new ilCommentGUI(
1144 $this->portfolio_id,
1145 $this->getPageObject()->getId(),
1146 "pfpg"
1147 );
1148 $notes_gui->enablePublicNotes(true);
1149 $notes_gui->setRepositoryMode(false);
1150 $notes_gui->setExportMode();
1151 return $notes_gui->getListHTML();
1152 }

References ILIAS\Survey\Mode\getId().

+ Here is the call graph for this function:

◆ getCoursesOfUser()

ilPortfolioPageGUI::getCoursesOfUser ( int  $a_user_id,
bool  $a_add_path = false 
)
protected

Definition at line 847 of file class.ilPortfolioPageGUI.php.

850 : array {
852
853 // see ilPDSelectedItemsBlockGUI
854
855 $items = ilParticipants::_getMembershipByType($a_user_id, ['crs']);
856
857 $repo_title = $tree->getNodeData(ROOT_FOLDER_ID);
858 $repo_title = $repo_title["title"];
859 if ($repo_title == "ILIAS") {
860 $repo_title = $this->lng->txt("repository");
861 }
862
863 $references = $lp_obj_refs = array();
864 foreach ($items as $obj_id) {
866 if (is_array($ref_id) && count($ref_id)) {
867 $ref_id = array_pop($ref_id);
868 if (!$tree->isDeleted($ref_id)) {
869 $visible = false;
870 $active = ilObjCourseAccess::_isActivated($obj_id, $visible, false);
871 if ($active && $visible) {
872 $references[$ref_id] = array(
873 'ref_id' => $ref_id,
874 'obj_id' => $obj_id,
875 'title' => ilObject::_lookupTitle($obj_id)
876 );
877
878 if ($a_add_path) {
879 $path = array();
880 foreach ($tree->getPathFull($ref_id) as $item) {
881 $path[] = $item["title"];
882 }
883 // top level comes first
884 if (count($path) === 2) {
885 $path[0] = 0;
886 } else {
887 $path[0] = 1;
888 }
889 $references[$ref_id]["path_sort"] = implode("__", $path);
890 array_shift($path);
891 array_pop($path);
892 if (!count($path)) {
893 array_unshift($path, $repo_title);
894 }
895 $references[$ref_id]["path"] = implode(" &rsaquo; ", $path);
896 }
897
898 $lp_obj_refs[$obj_id] = $ref_id;
899 }
900 }
901 }
902 }
903
904 // get lp data for valid courses
905
906 if (count($lp_obj_refs)) {
907 // listing the objectives should NOT depend on any LP status / setting
908 foreach ($lp_obj_refs as $obj_id => $ref_id) {
909 // only if set in DB (default mode is not relevant
911 $references[$ref_id]["objectives"] = $this->parseObjectives($obj_id, $a_user_id);
912 }
913 }
914
915 // LP must be active, personal and not anonymized
919 // see ilLPProgressTableGUI
920 $lp_data = ilTrQuery::getObjectsStatusForUser($a_user_id, $lp_obj_refs);
921 foreach ($lp_data as $item) {
922 $ref_id = $item["ref_ids"];
923 $references[$ref_id]["lp_status"] = $item["status"];
924 }
925 }
926 }
927
928 return $references;
929 }
static _isActivated(int $a_obj_id, ?bool &$a_visible_flag=null, bool $a_mind_member_view=true)
static _lookupViewMode(int $a_id)
static _getAllReferences(int $id)
get all reference ids for object ID
static _lookupTitle(int $obj_id)
static _getMembershipByType(int $a_usr_id, array $a_type, bool $a_only_member_role=false)
get membership by type Get course or group membership
static getObjectsStatusForUser(int $a_user_id, array $obj_refs)
getPathFull(int $a_endnode_id, int $a_startnode_id=0)
get path from a given startnode to a given endnode if startnode is not given the rootnode is startnod...
isDeleted(int $a_node_id)
This is a wrapper for isSaved() with a more useful name.
getNodeData(int $a_node_id, ?int $a_tree_pk=null)
get all information of a node.
const ROOT_FOLDER_ID
Definition: constants.php:32
$ref_id
Definition: ltiauth.php:66
$path
Definition: ltiservices.php:30

◆ getCourseSortAction()

ilPortfolioPageGUI::getCourseSortAction ( ilCtrl  $ctrl)
protected

Get course sort action.

Reimplemented in ilPortfolioTemplatePageGUI.

Definition at line 842 of file class.ilPortfolioPageGUI.php.

842 : string
843 {
844 return $ctrl->getFormActionByClass("ilobjportfoliogui", "preview");
845 }
getFormActionByClass( $a_class, ?string $a_fallback_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc

References ilCtrl\getFormActionByClass().

+ Here is the call graph for this function:

◆ getExportMaterial()

ilPortfolioPageGUI::getExportMaterial ( )

Definition at line 1013 of file class.ilPortfolioPageGUI.php.

1013 : array
1014 {
1016 }

◆ getJsOnloadCode()

ilPortfolioPageGUI::getJsOnloadCode ( )

Definition at line 191 of file class.ilPortfolioPageGUI.php.

191 : array
192 {
194 }

References $js_onload_code.

◆ getPageContentUserId()

ilPortfolioPageGUI::getPageContentUserId ( int  $a_user_id)
protected

Reimplemented in ilPortfolioTemplatePageGUI.

Definition at line 92 of file class.ilPortfolioPageGUI.php.

92 : int
93 {
94 // user id from content-xml
95 return $a_user_id;
96 }

◆ getPagePermaLink()

ilPortfolioPageGUI::getPagePermaLink ( )

Reimplemented from ilPageObjectGUI.

Definition at line 1118 of file class.ilPortfolioPageGUI.php.

1118 : string
1119 {
1121 return ilLink::_getStaticLink($pid, "prtf", true, "_" . $this->getId());
1122 }
static findPortfolioForPage(int $a_page_id)
Get portfolio id of page id.

References ilLink\_getStaticLink(), ilPortfolioPage\findPortfolioForPage(), and ILIAS\Survey\Mode\getId().

+ Here is the call graph for this function:

◆ getParentType()

ilPortfolioPageGUI::getParentType ( )

Reimplemented from ilPageObjectGUI.

Reimplemented in ilPortfolioTemplatePageGUI.

Definition at line 87 of file class.ilPortfolioPageGUI.php.

87 : string
88 {
89 return "prtf";
90 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ getTabs()

ilPortfolioPageGUI::getTabs ( string  $a_activate = "")

Reimplemented from ilPageObjectGUI.

Definition at line 160 of file class.ilPortfolioPageGUI.php.

160 : void
161 {
162 if (!$this->embedded) {
163 parent::getTabs($a_activate);
164 }
165 }

◆ getViewPageLink()

ilPortfolioPageGUI::getViewPageLink ( )

Reimplemented from ilPageObjectGUI.

Reimplemented in ilPortfolioTemplatePageGUI.

Definition at line 1103 of file class.ilPortfolioPageGUI.php.

1103 : string
1104 {
1105 global $DIC;
1106
1107 $ctrl = $DIC->ctrl();
1108
1109 $ctrl->setParameterByClass("ilobjportfoliogui", "user_page", $this->requested_ppage);
1110 return $ctrl->getLinkTargetByClass("ilobjportfoliogui", "preview");
1111 }
setParameterByClass(string $a_class, string $a_parameter, $a_value)
@inheritDoc
getLinkTargetByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc

References $DIC.

◆ getViewPageText()

ilPortfolioPageGUI::getViewPageText ( )

Reimplemented from ilPageObjectGUI.

Definition at line 1113 of file class.ilPortfolioPageGUI.php.

1113 : string
1114 {
1115 return $this->lng->txt("preview");
1116 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ isMyCoursesActive()

ilPortfolioPageGUI::isMyCoursesActive ( )
protected

Definition at line 616 of file class.ilPortfolioPageGUI.php.

616 : bool
617 {
618 $prfa_set = new ilSetting("prfa");
619 return (bool) $prfa_set->get("mycrs", true);
620 }
ILIAS Setting Class.

◆ makePlaceHoldersClickable()

ilPortfolioPageGUI::makePlaceHoldersClickable ( string  $a_html)

Definition at line 1018 of file class.ilPortfolioPageGUI.php.

1018 : string
1019 {
1020 $ilCtrl = $this->ctrl;
1021 $lng = $this->lng;
1022 $ilUser = $this->user;
1023
1024 $end = 0;
1025 $start = strpos($a_html, "{{{{{PlaceHolder#");
1026 if (is_int($start)) {
1027 $end = strpos($a_html, "}}}}}", $start);
1028 }
1029 while ($end > 0) {
1030 $param = substr($a_html, $start + 17, $end - $start - 17);
1031 $param = explode("#", $param);
1032
1033 $html = $param[2];
1034 switch ($param[2]) {
1035 case "Text":
1036 $html = $lng->txt("cont_text_placeh");
1037 break;
1038
1039 case "Media":
1040 $html = $lng->txt("cont_media_placeh");
1041 break;
1042
1043 case "Question":
1044 $html = $lng->txt("cont_question_placeh");
1045 break;
1046
1047 case "Verification":
1048 $html = $lng->txt("cont_verification_placeh");
1049 break;
1050 }
1051
1052 // only if not owner
1053 if ($ilUser->getId() === ilObjPortfolio::_lookupOwner($this->portfolio_id)
1054 && $this->getOutputMode() === "presentation") {
1055 switch ($param[2]) {
1056 case "Text":
1057 $ilCtrl->setParameterByClass("ilportfoliopagegui", "prt_id", $this->port_request->getPortfolioId());
1058 $ilCtrl->setParameterByClass("ilportfoliopagegui", "ppage", $this->getId());
1059 $ilCtrl->setParameterByClass("ilportfoliopagegui", "pl_pc_id", $param[0]);
1060 $ilCtrl->setParameterByClass("ilportfoliopagegui", "pl_hier_id", $param[1]);
1061 $href = $ilCtrl->getLinkTargetByClass("ilportfoliopagegui", "insertJSAtPlaceholder");
1062 $html = "<a href='" . $href . "'>" . $html . "</a>";
1063 break;
1064
1065 case "Media":
1066 $ilCtrl->setParameterByClass("ilpcmediaobjectgui", "prt_id", $this->port_request->getPortfolioId());
1067 $ilCtrl->setParameterByClass("ilpcmediaobjectgui", "ppage", $this->getId());
1068 $ilCtrl->setParameterByClass("ilpcmediaobjectgui", "pl_pc_id", $param[0]);
1069 $ilCtrl->setParameterByClass("ilpcmediaobjectgui", "pl_hier_id", $param[1]);
1070 $ilCtrl->setParameterByClass("ilpcmediaobjectgui", "subCmd", "insertNew");
1071 $href = $ilCtrl->getLinkTargetByClass(array("ilPortfolioPageGUI", "ilPageEditorGUI", "ilPCPlaceHolderGUI", "ilpcmediaobjectgui"), "insert");
1072 $html = "<a href='" . $href . "'>" . $html . "</a>";
1073 break;
1074
1075 /* see #34170, may need a different change, keep code to monitor
1076 case "Verification":
1077 $ilCtrl->setParameterByClass("ilPCVerificationGUI", "prt_id", $this->port_request->getPortfolioId());
1078 $ilCtrl->setParameterByClass("ilPCVerificationGUI", "ppage", $this->getId());
1079 $ilCtrl->setParameterByClass("ilPCVerificationGUI", "pl_pc_id", $param[0]);
1080 $ilCtrl->setParameterByClass("ilPCVerificationGUI", "pl_hier_id", $param[1]);
1081 $ilCtrl->setParameterByClass("ilPCVerificationGUI", "subCmd", "insertNew");
1082 $href = $ilCtrl->getLinkTargetByClass(array("ilPortfolioPageGUI", "ilPageEditorGUI", "ilPCPlaceHolderGUI", "ilPCVerificationGUI"), "insert");
1083 $html = "<a href='" . $href . "'>" . $html . "</a>";
1084 break;
1085 */
1086 }
1087 }
1088
1089 $h2 = substr($a_html, 0, $start) .
1090 $html .
1091 substr($a_html, $end + 5);
1092 $a_html = $h2;
1093
1094 $start = strpos($a_html, "{{{{{PlaceHolder#", $start + 5);
1095 $end = 0;
1096 if (is_int($start)) {
1097 $end = strpos($a_html, "}}}}}", $start);
1098 }
1099 }
1100 return $a_html;
1101 }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static _lookupOwner(int $obj_id)
Lookup owner user ID for object ID.
$param
Definition: xapitoken.php:44

References $lng, $param, ilObject\_lookupOwner(), and ILIAS\Survey\Mode\getId().

Referenced by postOutputProcessing().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseLOUserResults()

ilPortfolioPageGUI::parseLOUserResults ( int  $a_course_obj_id,
int  $a_user_id 
)
protected

Definition at line 981 of file class.ilPortfolioPageGUI.php.

984 : array {
985 $res = array();
986 $initial_status = "";
987
988 $lur = new ilLOUserResults($a_course_obj_id, $a_user_id);
989 foreach ($lur->getCourseResultsForUserPresentation() as $objective_id => $types) {
990 // show either initial or qualified for objective
991 if (isset($types[ilLOUserResults::TYPE_INITIAL])) {
992 $initial_status = $types[ilLOUserResults::TYPE_INITIAL]["status"];
993 }
994
995 // qualified test has priority
996 if (isset($types[ilLOUserResults::TYPE_QUALIFIED])) {
997 $result = $types[ilLOUserResults::TYPE_QUALIFIED];
998 $result["type"] = ilLOUserResults::TYPE_QUALIFIED;
999 $result["initial"] = $types[ilLOUserResults::TYPE_INITIAL] ?? null;
1000 } else {
1001 $result = $types[ilLOUserResults::TYPE_INITIAL];
1002 $result["type"] = ilLOUserResults::TYPE_INITIAL;
1003 }
1004
1005 $result["initial_status"] = $initial_status;
1006
1007 $res[$objective_id] = $result;
1008 }
1009
1010 return $res;
1011 }
$res
Definition: ltiservices.php:69

◆ postOutputProcessing()

ilPortfolioPageGUI::postOutputProcessing ( string  $a_output)

Finalizing output processing.

Maybe overwritten in derived classes, e.g. in wiki module.

Reimplemented from ilPageObjectGUI.

Definition at line 196 of file class.ilPortfolioPageGUI.php.

196 : string
197 {
198 $parts = array(
199 "Profile" => array("0-9", "a-z", "0-9a-z_;\W"), // user, mode, fields
200 "Verification" => array("0-9", "a-z", "0-9"), // user, type, id
201 "Blog" => array("0-9", "0-9", "0-9;\W"), // user, blog id, posting ids
202 "BlogTeaser" => array("0-9", "0-9", "0-9;\W"), // user, blog id, posting ids
203 "Skills" => array("0-9", "0-9"), // user, skill id
204 "SkillsTeaser" => array("0-9", "0-9"), // user, skill id
205 "ConsultationHours" => array("0-9", "a-z", "0-9;\W"), // user, mode, group ids
206 "ConsultationHoursTeaser" => array("0-9", "a-z", "0-9;\W"), // user, mode, group ids
207 "MyCourses" => array("0-9", "a-z*"), // user, sort
208 "MyCoursesTeaser" => array("0-9", "a-z*") // user, sort
209 );
210
211 foreach ($parts as $type => $def) {
212 // #15732 - allow optional parts
213 $def_parts = array();
214 foreach ($def as $part) {
215 $is_opt = (substr($part, -1) === "*");
216 if (!$is_opt) {
217 $def_parts[] = "#";
218 $end_marker = "+";
219 } else {
220 $def_parts[] = "#*";
221 $end_marker = "*";
222 $part = substr($part, 0, -1);
223 }
224 $def_parts[] = "([" . $part . "]" . $end_marker . ")";
225 }
226 $def = implode("", $def_parts);
227
228 if (preg_match_all(
229 "/" . $this->pl_start . $type . $def . $this->pl_end . "/",
230 $a_output,
231 $blocks
232 )) {
233 foreach ($blocks[0] as $idx => $block) {
234 switch ($type) {
235 case "Profile":
236 case "Blog":
237 case "BlogTeaser":
238 case "Skills":
239 case "SkillsTeaser":
240 case "ConsultationHours":
241 case "ConsultationHoursTeaser":
242 case "MyCourses":
243 case "MyCoursesTeaser":
244 $subs = null;
245 if (trim(($blocks[3][$idx] ?? ""))) {
246 foreach (explode(";", $blocks[3][$idx]) as $sub) {
247 if (trim($sub)) {
248 $subs[] = trim($sub);
249 }
250 }
251 }
252 $snippet = $this->{"render" . $type}(
253 $blocks[1][$idx],
254 $blocks[2][$idx],
255 $subs
256 );
257 break;
258
259 default:
260 $snippet = $this->{"render" . $type}(
261 $blocks[1][$idx],
262 $blocks[2][$idx],
263 $blocks[3][$idx]
264 );
265 break;
266 }
267
268 $snippet = $this->renderPageElement($type, $snippet);
269 $a_output = str_replace($block, $snippet, $a_output);
270 }
271 }
272 }
273
274 $a_output = $this->makePlaceHoldersClickable($a_output);
275
276 return $a_output;
277 }
renderPageElement(string $a_type, string $a_html)
makePlaceHoldersClickable(string $a_html)
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:61

References $parts, makePlaceHoldersClickable(), and renderPageElement().

+ Here is the call graph for this function:

◆ renderBlogTeaser()

ilPortfolioPageGUI::renderBlogTeaser ( int  $a_user_id,
int  $a_blog_id,
?array  $a_posting_ids = null 
)
protected

Definition at line 467 of file class.ilPortfolioPageGUI.php.

471 : string {
472 // not used
473 // $user_id = $this->getPageContentUserId($a_user_id);
474
475 $postings = "";
476 if ($a_posting_ids) {
477 $postings = array("<ul>");
478 foreach ($a_posting_ids as $post) {
480 $postings[] = "<li>" . $post->getTitle() . " - " .
481 ilDatePresentation::formatDate($post->getCreated()) . "</li>";
482 }
483 $postings[] = "</ul>";
484 $postings = implode("\n", $postings);
485 }
486
487 return $this->renderTeaser("blog", $this->lng->txt("obj_blog") . ' "' .
488 ilObject::_lookupTitle($a_blog_id) . '"', $postings);
489 }
Class ilBlogPosting.
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
renderTeaser(string $a_type, string $a_title, string $a_options="")
$post
Definition: ltitoken.php:46

References $post, and ilDatePresentation\formatDate().

+ Here is the call graph for this function:

◆ renderConsultationHours()

ilPortfolioPageGUI::renderConsultationHours ( int  $a_user_id,
string  $a_mode,
?array  $a_group_ids = null 
)
protected

Definition at line 552 of file class.ilPortfolioPageGUI.php.

556 : string {
557 $ilUser = $this->user;
558 if ($this->getOutputMode() === "preview") {
559 return $this->renderConsultationHoursTeaser($a_user_id, $a_mode, $a_group_ids);
560 }
561
562 if ($this->getOutputMode() === "offline") {
563 return "";
564 }
565
566 if ($this->getOutputMode() === "print") {
567 return "";
568 }
569
570 $user_id = $this->getPageContentUserId($a_user_id);
571
572 // only if not owner
573 $bkid = 0;
574 if ($ilUser->getId() !== $user_id) {
575 $bkid = $user_id;
576 }
577 $this->ctrl->setParameter($this, "chuid", $user_id);
578
579 if ($a_mode !== "manual") {
580 $a_group_ids = null;
581 }
583 if (!self::$calender_initialized) {
586 0,
587 true
588 );
589 self::$calender_initialized = true;
590 }
591
592 $seed = $this->port_request->getCalendarSeed();
593 if ($seed === "") {
594 $seed = new ilDate(time(), IL_CAL_UNIX);
595 } else {
596 $seed = new ilDate($seed, IL_CAL_DATE);
597 }
598
599 $month_gui = new ilCalendarMonthGUI($seed);
600 if ($bkid > 0) {
601 $month_gui->setBkId($bkid);
602 }
603 $month_gui->setConsulationHoursUserId($user_id);
604
605 // custom schedule filter: handle booking group ids
607 $month_gui->addScheduleFilter($filter);
608
609 $this->tpl->addCss(ilUtil::getStyleSheetLocation('filesystem', 'delos.css'));
610
611 $this->lng->loadLanguageModule("dateplaner");
612 return '<h3>' . $this->lng->txt("app_consultation_hours") . '</h3>' .
613 $this->ctrl->getHTML($month_gui);
614 }
Calendar schedule filter for consultation hour bookings.
renderConsultationHoursTeaser(int $a_user_id, string $a_mode, ?array $a_group_ids=null)
getPageContentUserId(int $a_user_id)
static getStyleSheetLocation(string $mode="output", string $a_css_name="")
get full style sheet file name (path inclusive) of current user

◆ renderConsultationHoursTeaser()

ilPortfolioPageGUI::renderConsultationHoursTeaser ( int  $a_user_id,
string  $a_mode,
?array  $a_group_ids = null 
)
protected

Definition at line 519 of file class.ilPortfolioPageGUI.php.

523 : string {
524 // not used
525 // $user_id = $this->getPageContentUserId($a_user_id);
526 if ($a_mode === "auto") {
527 $mode = $this->lng->txt("cont_cach_mode_automatic");
528 $groups = null;
529 }
530 // begin-abandon ch_groups
531 /*
532 else {
533 $mode = $this->lng->txt("cont_cach_mode_manual");
534
535 $groups = array();
536 foreach ($a_group_ids as $grp_id) {
537 $groups[] = ilConsultationHourGroups::lookupTitle($grp_id);
538 }
539 $groups = " (" . implode(", ", $groups) . ")";
540 }
541 */
542 // end-abandon ch_groups
543
544 $this->lng->loadLanguageModule("dateplaner");
545 return $this->renderTeaser(
546 "consultation_hours",
547 $this->lng->txt("app_consultation_hours"),
548 $mode . $groups
549 );
550 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ renderMyCourses()

ilPortfolioPageGUI::renderMyCourses ( int  $a_user_id,
string  $a_default_sorting 
)
protected

Definition at line 639 of file class.ilPortfolioPageGUI.php.

642 : string {
643 $ilAccess = $this->access;
644 $ilUser = $this->user;
645 $ilCtrl = $this->ctrl;
646
647 if ($this->getOutputMode() === "preview") {
648 return $this->renderMyCoursesTeaser($a_user_id, $a_default_sorting);
649 }
650
651 if (!$this->isMyCoursesActive()) {
652 return "";
653 }
654
655 $img_path = null;
657
658 $user_id = $this->getPageContentUserId($a_user_id);
659
660 // sorting pref
661 $req_sorting = $this->port_request->getCourseSorting();
662 if (in_array($req_sorting, array("alpha", "loc"))) {
663 $ilUser->writePref("prtf_mcrs_sort", $req_sorting);
664 }
665 $sorting = $ilUser->getPref("prtf_mcrs_sort");
666 if (!$sorting) {
667 $sorting = $a_default_sorting;
668 }
669
670 $data = $this->getCoursesOfUser($user_id, ($sorting === "loc"));
671 if (count($data)) {
672 if ($sorting !== "loc") {
673 $data = ilArrayUtil::sortArray($data, "title", "ASC");
674 } else {
675 $data = ilArrayUtil::sortArray($data, "path_sort", "ASC");
676 }
677
678 $tpl = new ilTemplate("tpl.pc_my_courses.html", true, true, "components/ILIAS/Portfolio");
679 $tpl->setVariable("TITLE", $this->lng->txt("prtf_page_element_my_courses_title"));
680 $tpl->setVariable("INFO", $this->lng->txt("prtf_page_element_my_courses_info")); // #14464
681
682 $this->lng->loadLanguageModule("trac");
683 $this->lng->loadLanguageModule("crs");
684
685 // sorting
686 if ($this->getOutputMode() !== "print") {
687 $options = array(
688 "alpha" => $this->lng->txt("cont_mycourses_sortorder_alphabetical"),
689 "loc" => $this->lng->txt("cont_mycourses_sortorder_location")
690 );
692 "SORT_SELECT",
694 $sorting,
695 "srt",
696 $options,
697 false,
698 true,
699 0,
700 "",
701 ["onchange" => "form.submit()"]
702 )
703 );
704 $tpl->setVariable("SORT_FORM", $this->getCourseSortAction($ilCtrl));
705 }
706
707 $old_path = null;
708
709 foreach ($data as $course) {
710 if (($sorting === "loc") && $course["path"] != $old_path) {
711 $tpl->setCurrentBlock("path_bl");
712 $tpl->setVariable("PATH", $course["path"]);
714
715 $old_path = $course["path"];
716 }
717
718 if (isset($course["lp_status"])) {
719 $lp_icon_rendered = $lp_icons->renderIconForStatus($course["lp_status"]);
720
721 $tpl->setCurrentBlock("lp_bl");
722 $tpl->setVariable("LP_ICON", $lp_icon_rendered);
724 }
725
726 $do_links = false;
727 if ($ilUser->getId() !== ANONYMOUS_USER_ID) {
728 $do_links = $ilAccess->checkAccessOfUser($ilUser->getId(), "read", "", $course["ref_id"], "crs") ||
729 ($ilAccess->checkAccessOfUser($ilUser->getId(), "visible", "", $course["ref_id"], "crs") &&
730 $ilAccess->checkAccessOfUser($ilUser->getId(), "join", "", $course["ref_id"], "crs"));
731 }
732
733 if (isset($course["objectives"])) {
734 $loc_settings = ilLOSettings::getInstanceByObjId($course["obj_id"]);
735 $has_initial_test = (bool) $loc_settings->getInitialTest();
736
737 foreach ($course["objectives"] as $objtv) {
738 if ($do_links) {
739 $params = array("oobj" => $objtv["id"]);
740 $url = ilLink::_getLink($course["ref_id"], "crs", $params);
741
742 // #15510
743 $url .= "#objtv_acc_" . $objtv["id"];
744
745 if ($this->getOutputMode() !== "print") {
746 $tpl->touchBlock("objective_dnone");
747 }
748
749 $tpl->setCurrentBlock("objective_link_bl");
750
751 $objtv_link = $this->ui_fac->link()->standard(
752 $objtv["title"],
753 $url
754 );
755 if (trim($objtv["desc"] ?? "") !== "") {
756 $desc = nl2br($objtv["desc"]);
757 $objtv_link = $objtv_link->withHelpTopics(...$this->ui_fac->helpTopics($desc));
758 }
759
760 $tpl->setVariable("OBJECTIVE_LINK", $this->ui_ren->render($objtv_link));
761 } else {
762 $tpl->setCurrentBlock("objective_nolink_bl");
763 $tpl->setVariable("OBJECTIVE_NOLINK_TITLE", $objtv["title"]);
764 }
766
767 $objtv_icon = ilObject::_getIcon($objtv["id"], 'big', "lobj");
768 if ($img_path) {
769 $objtv_icon = $img_path . basename($objtv_icon);
770 }
771
772 $tpl->setCurrentBlock("objective_bl");
773 $tpl->setVariable("OBJTV_ICON_URL", $objtv_icon);
774 $tpl->setVariable("OBJTV_ICON_ALT", $this->lng->txt("crs_objectives"));
775
776 if (isset($objtv["type"])) {
778 "LP_OBJTV_PROGRESS",
780 $has_initial_test,
781 $objtv["id"],
782 $objtv,
783 true,
784 false,
785 self::$initialized
786 )
787 );
788 }
789
791 }
792
793 $tpl->setCurrentBlock("objectives_bl");
794 $tpl->setVariable("OBJTV_LIST_CRS_ID", $course["obj_id"]);
796 }
797
798 // always check against current user
799 if ($do_links) {
800 $tpl->setCurrentBlock("course_link_bl");
801 $tpl->setVariable("COURSE_LINK_TITLE", $course["title"]);
802 $tpl->setVariable("COURSE_LINK_URL", ilLink::_getLink($course["ref_id"]));
803 } else {
804 $tpl->setCurrentBlock("course_nolink_bl");
805 $tpl->setVariable("COURSE_NOLINK_TITLE", $course["title"]);
806 }
808
809 $crs_icon = ilObject::_getIcon($course["obj_id"], 'small', 'crs');
810 if ($img_path) {
811 $crs_icon = $img_path . basename($crs_icon);
812 }
813
814 $tpl->setCurrentBlock("course_bl");
815
816 if (isset($course["objectives"])) {
817 $tpl->setVariable("TOGGLE_CLASS", "ilPCMyCoursesToggle");
818 } else {
819 $tpl->setVariable("NO_TOGGLE", ' style="visibility:hidden;"');
820 }
821
822 $tpl->setVariable("CRS_ICON_URL", $crs_icon);
823 $tpl->setVariable("CRS_ICON_ALT", $this->lng->txt("obj_crs"));
825 }
826
827 // #15508
828 if (!self::$initialized) {
829 $GLOBALS["tpl"]->addJavaScript("assets/js/ilPortfolio.js");
830 $GLOBALS["tpl"]->addOnLoadCode("ilPortfolio.init()");
831 }
832 self::$initialized++;
833
834 return $tpl->get();
835 }
836 return "";
837 }
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
static buildObjectiveProgressBar(bool $a_has_initial_test, int $a_objective_id, array $a_lo_result, bool $a_list_mode=false, bool $a_sub=false, ?string $a_tt_suffix=null)
Render progressbar(s) for given objective and result data.
static getInstanceByObjId(int $a_obj_id)
static getInstance(int $variant=ilLPStatusIcons::ICON_VARIANT_DEFAULT, ?\ILIAS\UI\Renderer $renderer=null, ?\ILIAS\UI\Factory $factory=null)
static formSelect( $selected, string $varname, array $options, bool $multiple=false, bool $direct_text=false, int $size=0, string $style_class="", array $attribs=[], bool $disabled=false)
Builds a select form field with options and shows the selected option first.
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
ilAccessHandler $access
getCourseSortAction(ilCtrl $ctrl)
Get course sort action.
renderMyCoursesTeaser(int $a_user_id, $a_default_sorting)
getCoursesOfUser(int $a_user_id, bool $a_add_path=false)
special template class to simplify handling of ITX/PEAR
const ANONYMOUS_USER_ID
Definition: constants.php:27
touchBlock(string $block)
overwrites ITX::touchBlock.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:31
$GLOBALS["DIC"]
Definition: wac.php:54

◆ renderMyCoursesTeaser()

ilPortfolioPageGUI::renderMyCoursesTeaser ( int  $a_user_id,
  $a_default_sorting 
)
protected

Definition at line 622 of file class.ilPortfolioPageGUI.php.

625 : string {
626 // not used
627 // $user_id = $this->getPageContentUserId($a_user_id);
628
629 $title = $this->isMyCoursesActive()
630 ? "my_courses"
631 : "my_courses_inactive";
632
633 return $this->renderTeaser(
634 $title,
635 $this->lng->txt("prtf_page_element_my_courses_title")
636 );
637 }

◆ renderPageElement()

ilPortfolioPageGUI::renderPageElement ( string  $a_type,
string  $a_html 
)
protected

Reimplemented in ilPortfolioTemplatePageGUI.

Definition at line 279 of file class.ilPortfolioPageGUI.php.

282 : string {
283 return trim($a_html);
284 }

Referenced by postOutputProcessing().

+ Here is the caller graph for this function:

◆ renderProfile()

ilPortfolioPageGUI::renderProfile ( int  $a_user_id,
string  $a_type,
?array  $a_fields = null 
)
protected

Definition at line 302 of file class.ilPortfolioPageGUI.php.

306 : string {
307 $ilCtrl = $this->ctrl;
308
309 $user_id = $this->getPageContentUserId($a_user_id);
310
311 $pub_profile = new PublicProfileGUI($user_id);
312 $pub_profile->setEmbedded(true, ($this->getOutputMode() === "offline"));
313
314 // full circle: additional was set in the original public user profile call
315 $pub_profile->setAdditional($this->getAdditional());
316
317 if ($a_type === "manual" && is_array($a_fields) && count($a_fields) > 0) {
318 $prefs = array();
319 foreach ($a_fields as $field) {
320 $field = trim($field);
321 if ($field) {
322 $prefs["public_" . $field] = "y";
323 }
324 }
325
326 $pub_profile->setCustomPrefs($prefs);
327 }
328
329 if ($this->getOutputMode() !== "offline") {
330 return $ilCtrl->getHTML($pub_profile);
331 }
332
333 return $pub_profile->getEmbeddable();
334 }
GUI class for public user profile presentation.
getAdditional()
Get Additonal Information.

◆ renderSkills()

ilPortfolioPageGUI::renderSkills ( int  $a_user_id,
int  $a_skills_id 
)
protected

Definition at line 491 of file class.ilPortfolioPageGUI.php.

494 : string {
495 if ($this->getOutputMode() === "preview") {
496 return $this->renderSkillsTeaser($a_user_id, $a_skills_id);
497 }
498
499 $user_id = $this->getPageContentUserId($a_user_id);
500
502 if ($this->getOutputMode() === "offline") {
503 $gui->setOfflineMode("./files/");
504 }
505 return $gui->getSkillHTML($a_skills_id, $user_id);
506 }
ILIAS COPage InternalGUIService $gui
Personal skills GUI class.
renderSkillsTeaser(int $a_user_id, int $a_skills_id)

◆ renderSkillsTeaser()

ilPortfolioPageGUI::renderSkillsTeaser ( int  $a_user_id,
int  $a_skills_id 
)
protected

Definition at line 508 of file class.ilPortfolioPageGUI.php.

511 : string {
512 // not used
513 // $user_id = $this->getPageContentUserId($a_user_id);
514
515 return $this->renderTeaser("skills", $this->lng->txt("skills") . ' "' .
516 ilSkillTreeNode::_lookupTitle($a_skills_id) . '"');
517 }
static _lookupTitle(int $a_obj_id, int $a_tref_id=0)

◆ renderTeaser()

ilPortfolioPageGUI::renderTeaser ( string  $a_type,
string  $a_title,
string  $a_options = "" 
)
protected

Definition at line 286 of file class.ilPortfolioPageGUI.php.

290 : string {
291 $options = "";
292 if ($a_options) {
293 $options = '<div class="il_Footer">' . $this->lng->txt("prtf_page_element_teaser_settings") .
294 ": " . $a_options . '</div>';
295 }
296
297 return '<div style="margin:5px" class="ilBox"><h3>' . $a_title . '</h3>' .
298 '<div class="il_Description_no_margin">' . $this->lng->txt("prtf_page_element_teaser_" . $a_type) . '</div>' .
299 $options . '</div>';
300 }

References ILIAS\UI\Implementation\Component\Input\Field\$options, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ renderVerification()

ilPortfolioPageGUI::renderVerification ( int  $a_user_id,
string  $a_type,
int  $a_id 
)
protected
Exceptions
ilException

Definition at line 339 of file class.ilPortfolioPageGUI.php.

343 : string {
344 $objDefinition = $this->obj_definition;
345
346 $outputMode = $this->getOutputMode();
347
348 // not used
349 // $user_id = $this->getPageContentUserId($a_user_id);
350 if ($a_type === 'crta' && $outputMode === 'offline') {
351 $fileService = new ilPortfolioCertificateFileService();
352
353 $certificatePdfFile = $fileService->createCertificateFilePath($a_user_id, $a_id);
354 $this->export_material["files"][] = $certificatePdfFile;
355
356 $url = 'files/' . basename($certificatePdfFile);
357
358 $userCertificateRepository = new ilUserCertificateRepository();
359
360 return $this->createPersistentCertificateUrl($a_id, $userCertificateRepository, $url);
361 }
362
363 if ($a_type === 'crta' && $outputMode === 'print') {
364 $userCertificateRepository = new ilUserCertificateRepository();
365 $url = $this->getPagePermaLink();
366
367 return $this->createPersistentCertificateUrl($a_id, $userCertificateRepository, $url);
368 }
369
370 if ($a_type === 'crta') {
371 $this->ctrl->setParameter($this, "dlid", $a_id);
372 $url = $this->ctrl->getLinkTarget($this, "dl" . $a_type);
373 $this->ctrl->setParameter($this, "dlid", "");
374
375 $userCertificateRepository = new ilUserCertificateRepository();
376
377 return $this->createPersistentCertificateUrl($a_id, $userCertificateRepository, $url);
378 }
379
380 if (!ilObject::_exists($a_id)) {
381 return $this->lng->txt('deleted');
382 }
383
384 $class = "ilObj" . $objDefinition->getClassName($a_type) . "GUI";
385 $verification = new $class($a_id, ilObject2GUI::WORKSPACE_OBJECT_ID);
386
387 if ($outputMode === "print") {
388 $url = $this->getPagePermaLink();
389 } elseif ($outputMode !== "offline") {
390 // direct download link
391 $this->ctrl->setParameter($this, "dlid", $a_id);
392 $url = $this->ctrl->getLinkTarget($this, "dl" . $a_type);
393 $this->ctrl->setParameter($this, "dlid", "");
394 } else {
395 $file = $verification->getObject()->getFilePath();
396 $url = "files/" . basename($file);
397
398 $this->export_material["files"][] = $file;
399 }
400
401 return $verification->render(true, $url);
402 }
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
ilObjectDefinition $obj_definition
createPersistentCertificateUrl(int $a_id, ilUserCertificateRepository $userCertificateRepository, string $url)

◆ setAdditional()

ilPortfolioPageGUI::setAdditional ( array  $a_additional)

Set Additonal Information.

Definition at line 178 of file class.ilPortfolioPageGUI.php.

178 : void
179 {
180 $this->additional = $a_additional;
181 }

◆ setEmbedded()

ilPortfolioPageGUI::setEmbedded ( bool  $a_value)

Set embedded mode: will suppress tabs.

Definition at line 170 of file class.ilPortfolioPageGUI.php.

170 : void
171 {
172 $this->embedded = $a_value;
173 }

◆ showPage()

ilPortfolioPageGUI::showPage ( )

display content of page

Reimplemented from ilPageObjectGUI.

Reimplemented in ilPortfolioTemplatePageGUI.

Definition at line 147 of file class.ilPortfolioPageGUI.php.

147 : string
148 {
149 $ilUser = $this->user;
150
151 if (!$this->getPageObject()) {
152 return "";
153 }
154
155 $this->setTemplateOutput(false);
156 // $this->setPresentationTitle($this->getPageObject()->getTitle());
157 return parent::showPage();
158 }
setTemplateOutput(bool $a_output=true)

References ilPageObjectGUI\$user, ilPageObjectGUI\getPageObject(), and ilPageObjectGUI\setTemplateOutput().

+ Here is the call graph for this function:

Field Documentation

◆ $additional

array ilPortfolioPageGUI::$additional = array()
protected

Definition at line 39 of file class.ilPortfolioPageGUI.php.

Referenced by getAdditional().

◆ $calender_initialized

bool ilPortfolioPageGUI::$calender_initialized = false
staticprotected

Definition at line 42 of file class.ilPortfolioPageGUI.php.

◆ $embedded

bool ilPortfolioPageGUI::$embedded = false
protected

Definition at line 35 of file class.ilPortfolioPageGUI.php.

◆ $enable_comments

bool ilPortfolioPageGUI::$enable_comments
protected

Definition at line 31 of file class.ilPortfolioPageGUI.php.

◆ $export_material

array ilPortfolioPageGUI::$export_material = array("js" => array(), "images" => array(), "files" => array())
protected

Definition at line 40 of file class.ilPortfolioPageGUI.php.

◆ $initialized

int ilPortfolioPageGUI::$initialized = 0
staticprotected

Definition at line 41 of file class.ilPortfolioPageGUI.php.

◆ $js_onload_code

array ilPortfolioPageGUI::$js_onload_code = array()
protected

Definition at line 38 of file class.ilPortfolioPageGUI.php.

Referenced by getJsOnloadCode().

◆ $obj_definition

ilObjectDefinition ilPortfolioPageGUI::$obj_definition
protected

Definition at line 36 of file class.ilPortfolioPageGUI.php.

◆ $port_request

ILIAS Portfolio StandardGUIRequest ilPortfolioPageGUI::$port_request
protected

Definition at line 33 of file class.ilPortfolioPageGUI.php.

◆ $portfolio_id

int ilPortfolioPageGUI::$portfolio_id
protected

Definition at line 32 of file class.ilPortfolioPageGUI.php.

◆ $requested_ppage

int ilPortfolioPageGUI::$requested_ppage
protected

Definition at line 43 of file class.ilPortfolioPageGUI.php.

◆ $tree

ilTree ilPortfolioPageGUI::$tree
protected

Definition at line 37 of file class.ilPortfolioPageGUI.php.

◆ $ui_fac

ILIAS UI Factory ilPortfolioPageGUI::$ui_fac
protected

Definition at line 44 of file class.ilPortfolioPageGUI.php.

◆ $ui_ren

ILIAS UI Renderer ilPortfolioPageGUI::$ui_ren
protected

Definition at line 45 of file class.ilPortfolioPageGUI.php.

◆ EMBEDDED_NO_OUTPUT

const ilPortfolioPageGUI::EMBEDDED_NO_OUTPUT = -99

The documentation for this class was generated from the following file: