Skip to content

Commit

Permalink
Portfolio: Add link to show own portfolio in course - refs BT#18201
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelFQC committed Jan 20, 2021
1 parent 052058d commit c6b06d7
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions main/inc/lib/PortfolioController.php
Expand Up @@ -595,6 +595,7 @@ public function index(HttpRequest $httpRequest)
if ($this->course) {
$frmTagList = $this->createFormTagFilter();
$frmStudentList = $this->createFormStudentFilter($listByUser);
$frmStudentList->setDefaults(['user' => $this->owner->getId()]);
} else {
$categories = $this->getCategoriesForIndex($currentUserId);
}
Expand Down Expand Up @@ -1132,7 +1133,7 @@ private function createFormStudentFilter(bool $listByUser = false): FormValidato
$this->baseUrl,
'',
[],
FormValidator::LAYOUT_INLINE
FormValidator::LAYOUT_BOX
);
$slctStudentOptions = [];

Expand All @@ -1150,9 +1151,19 @@ private function createFormStudentFilter(bool $listByUser = false): FormValidato

$frmStudentList->addSelectAjax(
'user',
get_lang('Learner'),
get_lang('SelectLearnerPortfolio'),
$slctStudentOptions,
['url' => api_get_path(WEB_AJAX_PATH)."course.ajax.php?$urlParams"]
[
'url' => api_get_path(WEB_AJAX_PATH)."course.ajax.php?$urlParams",
'placeholder' => get_lang('SearchStudent')
]
);
$frmStudentList->addHtml('<hr>');
$frmStudentList->addHtml(
Display::url(
get_lang('SeeMyPortfolio'),
$this->baseUrl.http_build_query(['user' => api_get_user_id()])
)
);

return $frmStudentList;
Expand Down

0 comments on commit c6b06d7

Please sign in to comment.