ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
ILIAS\Survey\Mode\AbstractUIModifier Class Reference
+ Inheritance diagram for ILIAS\Survey\Mode\AbstractUIModifier:
+ Collaboration diagram for ILIAS\Survey\Mode\AbstractUIModifier:

Public Member Functions

 __construct (InternalGUIService $gui)
 
 setInternalService (InternalService $internal_service)
 
 getInternalService ()
 
 getSurveySettingsGeneral (\ilObjSurvey $survey)
 
 getSurveySettingsReminderTargets (\ilObjSurvey $survey, InternalGUIService $ui_service)
 
 getSurveySettingsResults (\ilObjSurvey $survey, InternalGUIService $ui_service)
 
 setValuesFromForm (\ilObjSurvey $survey, \ilPropertyFormGUI $form)
 
 setResultsOverviewToolbar (\ilObjSurvey $survey, int $user_id, \ilTemplate $eval_tpl)
 
 setResultsCompetenceToolbar (\ilObjSurvey $survey, int $user_id)
 
 setResultsDetailToolbar (\ilObjSurvey $survey, int $user_id, \ilTemplate $eval_tpl)
 
 setResultsParticipantToolbar (\ilObjSurvey $survey, int $user_id)
 
 addApprSelectionToToolbar (\ilObjSurvey $survey, \ilToolbarGUI $toolbar, int $user_id)
 
 getDetailPanels (array $participants, \ILIAS\Survey\Evaluation\EvaluationGUIRequest $request, \SurveyQuestionEvaluation $a_eval)
 
 setInternalService (InternalService $internal_service)
 
 getInternalService ()
 
 getSurveySettingsGeneral (\ilObjSurvey $survey)
 
 getSurveySettingsReminderTargets (\ilObjSurvey $survey, InternalGUIService $ui_service)
 
 getSurveySettingsResults (\ilObjSurvey $survey, InternalGUIService $ui_service)
 
 setValuesFromForm (\ilObjSurvey $survey, \ilPropertyFormGUI $form)
 
 setResultsOverviewToolbar (\ilObjSurvey $survey, int $user_id, \ilTemplate $eval_tpl)
 
 setResultsDetailToolbar (\ilObjSurvey $survey, int $user_id, \ilTemplate $eval_tpl)
 
 setResultsParticipantToolbar (\ilObjSurvey $survey, int $user_id)
 
 setResultsCompetenceToolbar (\ilObjSurvey $survey, int $user_id)
 
 getDetailPanels (array $participants, \ILIAS\Survey\Evaluation\EvaluationGUIRequest $request, \SurveyQuestionEvaluation $a_eval)
 

Protected Member Functions

 getExportAndPrintComponents (\ilObjSurvey $survey, bool $details, \ilTemplate $eval_tpl)
 
 getApprSelectionComponents (\ilObjSurvey $survey, int $user_id)
 
 buildExportButtonAndModal (\ilTemplate $eval_tpl, string $export_cmd)
 
 getExportModal ()
 
 getPanelTable (array $participants, \ILIAS\Survey\Evaluation\EvaluationGUIRequest $request, \SurveyQuestionEvaluation $a_eval)
 
 getPanelChart (\ILIAS\Survey\Evaluation\EvaluationGUIRequest $request, \SurveyQuestionEvaluation $a_eval)
 
 getPanelText (\ILIAS\Survey\Evaluation\EvaluationGUIRequest $request, \SurveyQuestionEvaluation $a_eval, \ilSurveyEvaluationResults $question_res)
 
 getPanelCard (\ilSurveyEvaluationResults $question_res)
 

Protected Attributes

InternalGUIService $gui
 
InternalService $service = null
 

Detailed Description

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Survey\Mode\AbstractUIModifier::__construct ( InternalGUIService  $gui)

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

38 {
39 $this->gui = $gui;
40 }

References ILIAS\Survey\Mode\AbstractUIModifier\$gui.

Member Function Documentation

◆ addApprSelectionToToolbar()

ILIAS\Survey\Mode\AbstractUIModifier::addApprSelectionToToolbar ( \ilObjSurvey  $survey,
\ilToolbarGUI  $toolbar,
int  $user_id 
)

Definition at line 331 of file class.AbstractUIModifier.php.

335 : void {
336 $lng = $this->service->gui()->lng();
337 $ctrl = $this->service->gui()->ctrl();
338 $req = $this->service->gui()->evaluation($survey)->request();
339
340 $evaluation_manager = $this->service->domain()->evaluation(
341 $survey,
342 $user_id,
343 $req->getAppraiseeId(),
344 $req->getRaterId()
345 );
346
347 if ($evaluation_manager->isMultiParticipantsView()) {
348 $appr_id = $evaluation_manager->getCurrentAppraisee();
349 $options = array();
350 if (!$appr_id) {
351 $options[""] = $lng->txt("please_select");
352 }
353
354 foreach ($evaluation_manager->getSelectableAppraisees() as $appraisee_usr_id) {
355 $options[$appraisee_usr_id] = \ilUserUtil::getNamePresentation(
356 $appraisee_usr_id,
357 false,
358 false,
359 "",
360 true
361 );
362 }
363
364 $appr = new \ilSelectInputGUI($lng->txt("survey_360_appraisee"), "appr_id");
365 $appr->setOptions($options);
366 $appr->setValue($appr_id);
367 $toolbar->addInputItem($appr, true);
368
369 $this->gui->button(
370 $lng->txt("survey_360_select_appraisee"),
371 $ctrl->getCmd()
372 )->submit()->toToolbar(false, $toolbar);
373
374 if ($appr_id) {
375 $toolbar->addSeparator();
376 }
377 }
378 }
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link='', bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path=null)
Default behaviour is:
catch(\Exception $e) $req
Definition: xapiproxy.php:78
global $lng
Definition: privfeed.php:31

References $lng, ILIAS\UI\Implementation\Component\Input\Field\$options, ilToolbarGUI\addInputItem(), ilToolbarGUI\addSeparator(), and ilUserUtil\getNamePresentation().

+ Here is the call graph for this function:

◆ buildExportButtonAndModal()

ILIAS\Survey\Mode\AbstractUIModifier::buildExportButtonAndModal ( \ilTemplate  $eval_tpl,
string  $export_cmd 
)
protected

Definition at line 262 of file class.AbstractUIModifier.php.

265 : void {
266 $lng = $this->gui->lng();
267 $ctrl = $this->gui->ctrl();
268 $toolbar = $this->gui->toolbar();
269 $ui_fac = $this->gui->ui()->factory();
270 $ui_ren = $this->gui->ui()->renderer();
271 $ui_request = $this->gui->http()->request();
272
273 $ctrl->setParameterByClass("ilsurveyevaluationgui", "export_cmd", $export_cmd);
274 $modal = $this->getExportModal();
275 $button = $ui_fac->button()->standard(
276 $lng->txt("export"),
277 "#"
278 )->withOnClick($modal->getShowSignal());
279
280 $toolbar->addComponent($button);
281 if ("POST" === $ui_request->getMethod()
282 && isset($ui_request->getQueryParams()["fallbackCmd"])
283 && $ui_request->getQueryParams()["fallbackCmd"] === "validateAndSubmitExportForm") {
284 $modal = $modal->withRequest($ui_request);
285 $eval_tpl->setVariable("MODAL", $ui_ren->render($modal->withOnLoad($modal->getShowSignal())));
286 } else {
287 $eval_tpl->setVariable("MODAL", $ui_ren->render($modal));
288 }
289 }

◆ getApprSelectionComponents()

ILIAS\Survey\Mode\AbstractUIModifier::getApprSelectionComponents ( \ilObjSurvey  $survey,
int  $user_id 
)
protected

Definition at line 250 of file class.AbstractUIModifier.php.

253 : array {
255 $survey,
256 $this->gui->toolbar(),
258 );
259 return [];
260 }
addApprSelectionToToolbar(\ilObjSurvey $survey, \ilToolbarGUI $toolbar, int $user_id)

◆ getDetailPanels()

ILIAS\Survey\Mode\AbstractUIModifier::getDetailPanels ( array  $participants,
\ILIAS\Survey\Evaluation\EvaluationGUIRequest  $request,
\SurveyQuestionEvaluation  $a_eval 
)

Implements ILIAS\Survey\Mode\UIModifier.

Definition at line 380 of file class.AbstractUIModifier.php.

384 : array {
385 $a_results = $a_eval->getResults();
386 $panels = [];
387 $ui_factory = $this->service->gui()->ui()->factory();
388
389 $a_tpl = new \ilTemplate(
390 "tpl.svy_results_details_panel.html",
391 true,
392 true,
393 "components/ILIAS/Survey/Evaluation"
394 );
395
396 $question_res = $a_results;
397 $matrix = false;
398 if (is_array($question_res)) {
399 $question_res = $question_res[0][1];
400 $matrix = true;
401 }
402
403 if (!is_object($question_res)) {
404 return [];
405 }
406
407 $question = $question_res->getQuestion();
408
409 $qst_title = $question->getTitle();
410 $svy_text = nl2br($question->getQuestiontext());
411
412 $anchor_id = "svyrdq" . $question->getId();
413 $title = "<span id='$anchor_id'>$qst_title</span>";
414 $panel_qst_card = $ui_factory->panel()->sub($title, $ui_factory->legacy()->content($svy_text))
415 ->withFurtherInformation($this->getPanelCard($question_res));
416
417 $panels[] = $panel_qst_card;
418
419 $a_tpl->setVariable(
420 "TABLE",
421 $this->getPanelTable(
422 $participants,
423 $request,
424 $a_eval
425 )
426 );
427
428 $a_tpl->setVariable(
429 "TEXT",
430 $this->getPanelText(
431 $request,
432 $a_eval,
433 $question_res
434 )
435 );
436
437 $a_tpl->setVariable(
438 "CHART",
439 $this->getPanelChart(
440 $request,
441 $a_eval
442 )
443 );
444
445 $panels[] = $ui_factory->panel()->sub("", $ui_factory->legacy()->content($a_tpl->get()));
446 return $panels;
447 }
getPanelChart(\ILIAS\Survey\Evaluation\EvaluationGUIRequest $request, \SurveyQuestionEvaluation $a_eval)
getPanelTable(array $participants, \ILIAS\Survey\Evaluation\EvaluationGUIRequest $request, \SurveyQuestionEvaluation $a_eval)
getPanelCard(\ilSurveyEvaluationResults $question_res)
getPanelText(\ILIAS\Survey\Evaluation\EvaluationGUIRequest $request, \SurveyQuestionEvaluation $a_eval, \ilSurveyEvaluationResults $question_res)

◆ getExportAndPrintComponents()

ILIAS\Survey\Mode\AbstractUIModifier::getExportAndPrintComponents ( \ilObjSurvey  $survey,
bool  $details,
\ilTemplate  $eval_tpl 
)
protected

Definition at line 206 of file class.AbstractUIModifier.php.

210 : array {
211 $components = [];
212
213 // Export button + modal
214 $this->buildExportButtonAndModal($eval_tpl, $details ? "exportDetailData" : "exportData");
215
216 if ($details) {
217 $pv = $this->service->gui()->print()->resultsDetails($survey->getRefId());
218 $this->service->gui()->ctrl()->setParameterByClass(
219 "ilSurveyEvaluationGUI",
220 "vw",
221 $this->service->gui()->evaluation($survey)->request()->getVW()
222 );
223 $this->service->gui()->ctrl()->setParameterByClass(
224 "ilSurveyEvaluationGUI",
225 "cp",
226 $this->service->gui()->evaluation($survey)->request()->getCP()
227 );
228 $modal_elements = $pv->getModalElements(
229 $this->service->gui()->ctrl()->getLinkTargetByClass(
230 "ilSurveyEvaluationGUI",
231 "printResultsDetailsSelection"
232 )
233 );
234 } else {
235 $pv = $this->service->gui()->print()->resultsOverview($survey->getRefId());
236 $modal_elements = $pv->getModalElements(
237 $this->service->gui()->ctrl()->getLinkTargetByClass(
238 "ilSurveyEvaluationGUI",
239 "printResultsOverviewSelection"
240 )
241 );
242 }
243
244 $components[] = $modal_elements->button;
245 $components[] = $modal_elements->modal;
246
247 return $components;
248 }
$components
buildExportButtonAndModal(\ilTemplate $eval_tpl, string $export_cmd)

◆ getExportModal()

ILIAS\Survey\Mode\AbstractUIModifier::getExportModal ( )
protected

Definition at line 291 of file class.AbstractUIModifier.php.

291 : Modal\RoundTrip|Form\Standard
292 {
293 $lng = $this->gui->lng();
294 $ctrl = $this->gui->ctrl();
295 $ui_fac = $this->gui->ui()->factory();
296
297 $post_url = $ctrl->getFormActionByClass("ilsurveyevaluationgui", "validateAndSubmitExportForm");
298
299 $inputs["export_format"] = $ui_fac->input()->field()->select(
300 $lng->txt("filetype"),
301 [
302 \ilSurveyEvaluationGUI::TYPE_XLS => $lng->txt("exp_type_excel"),
303 \ilSurveyEvaluationGUI::TYPE_SPSS => $lng->txt("exp_type_csv")
304 ]
305 )
306 //->withValue(\ilSurveyEvaluationGUI::TYPE_XLS)
307 ->withRequired(true);
308
309 $inputs["export_label"] = $ui_fac->input()->field()->select(
310 $lng->txt("title"),
311 [
312 "label_only" => $lng->txt("export_label_only"),
313 "title_only" => $lng->txt("export_title_only"),
314 "title_label" => $lng->txt("export_title_label")
315 ]
316 )
317 //->withValue("label_only")
318 ->withRequired(true);
319
320 $modal = $ui_fac->modal()->roundtrip(
321 $lng->txt("svy_export_format"),
322 null,
323 $inputs,
324 $post_url
325 )
326 ->withSubmitLabel($lng->txt("export"));
327
328 return $modal;
329 }

References ILIAS\UI\Implementation\Component\Input\$inputs, $lng, ilSurveyEvaluationGUI\TYPE_SPSS, and ilSurveyEvaluationGUI\TYPE_XLS.

◆ getInternalService()

ILIAS\Survey\Mode\AbstractUIModifier::getInternalService ( )

Implements ILIAS\Survey\Mode\UIModifier.

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

47 : InternalService
48 {
49 return $this->service;
50 }

References ILIAS\Survey\Mode\AbstractUIModifier\$service.

◆ getPanelCard()

ILIAS\Survey\Mode\AbstractUIModifier::getPanelCard ( \ilSurveyEvaluationResults  $question_res)
protected

Definition at line 574 of file class.AbstractUIModifier.php.

577 $ui_factory = $this->service->gui()->ui()->factory();
578 $lng = $this->service->gui()->lng();
579
580 $question = $question_res->getQuestion();
581 $kv = array();
582 $kv["users_answered"] = $question_res->getUsersAnswered();
583 $kv["users_skipped"] = $question_res->getUsersSkipped();
584
585 $card_table_tpl = new \ilTemplate(
586 "tpl.svy_results_details_card.html",
587 true,
588 true,
589 "components/ILIAS/Survey/Evaluation"
590 );
591
592 if (true) { // formerly check for matrix type, shouldnt be needed
593 if ($question_res->getModeValue() !== null) {
594 $kv["mode"] = wordwrap($question_res->getModeValueAsText(), 50, "<br />");
595 $kv["mode_nr_of_selections"] = $question_res->getModeNrOfSelections();
596 }
597 if ($question_res->getMedian() !== null) {
598 $kv["median"] = $question_res->getMedianAsText();
599 }
600 if ($question_res->getMean() !== null) {
601 $kv["arithmetic_mean"] = $question_res->getMean();
602 }
603 }
604
605 foreach ($kv as $key => $value) {
606 $card_table_tpl->setCurrentBlock("question_statistics_card");
607 $card_table_tpl->setVariable("QUESTION_STATISTIC_KEY", $lng->txt($key));
608 $card_table_tpl->setVariable("QUESTION_STATISTIC_VALUE", $value);
609 $card_table_tpl->parseCurrentBlock();
610 }
611
612 $svy_type_title = \SurveyQuestion::_getQuestionTypeName($question->getQuestionType());
613
614 return $ui_factory->card()
615 ->standard($svy_type_title)
616 ->withSections(
617 array($ui_factory->legacy()->content($card_table_tpl->get()))
618 );
619 }
static _getQuestionTypeName(string $type_tag)
Return the translation for a given question type.

◆ getPanelChart()

ILIAS\Survey\Mode\AbstractUIModifier::getPanelChart ( \ILIAS\Survey\Evaluation\EvaluationGUIRequest  $request,
\SurveyQuestionEvaluation  $a_eval 
)
protected

Reimplemented in ILIAS\Survey\Mode\IndividualFeedback\UIModifier.

Definition at line 493 of file class.AbstractUIModifier.php.

496 : string {
497 $a_results = $a_eval->getResults();
498
499 $a_tpl = new \ilTemplate(
500 "tpl.svy_results_details_chart.html",
501 true,
502 true,
503 "components/ILIAS/Survey/Evaluation"
504 );
505 if ($request->getShowChart()) {
506 $chart = $a_eval->getChart($a_results);
507 if ($chart) {
508 if (is_array($chart)) {
509 if (is_array($chart[1])) {
510 foreach ($chart[1] as $legend_item) {
511 $r = hexdec(substr($legend_item[1], 1, 2));
512 $g = hexdec(substr($legend_item[1], 3, 2));
513 $b = hexdec(substr($legend_item[1], 5, 2));
514
515 $a_tpl->setCurrentBlock("legend_bl");
516 $a_tpl->setVariable("LEGEND_CAPTION", $legend_item[0]);
517 $a_tpl->setVariable("LEGEND_COLOR", $legend_item[1]);
518 $a_tpl->setVariable("LEGEND_COLOR_SVG", $r . "," . $g . "," . $b);
519 $a_tpl->parseCurrentBlock();
520 }
521 }
522
523 $chart = $chart[0];
524 }
525
526 $a_tpl->setVariable("CHART", $chart);
527 }
528 }
529
530 return $a_tpl->get();
531 }

◆ getPanelTable()

ILIAS\Survey\Mode\AbstractUIModifier::getPanelTable ( array  $participants,
\ILIAS\Survey\Evaluation\EvaluationGUIRequest  $request,
\SurveyQuestionEvaluation  $a_eval 
)
protected

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

453 : string {
454 $a_results = $a_eval->getResults();
455
456 $a_tpl = new \ilTemplate(
457 "tpl.svy_results_details_table.html",
458 true,
459 true,
460 "components/ILIAS/Survey/Evaluation"
461 );
462
463 if ($request->getShowTable()) {
464 $grid = $a_eval->getGrid(
465 $a_results,
466 $request->getShowAbsolute(),
467 $request->getShowPercentage()
468 );
469 if ($grid) {
470 foreach ($grid["cols"] as $col) {
471 $a_tpl->setCurrentBlock("grid_col_header_bl");
472 $a_tpl->setVariable("COL_HEADER", $col);
473 $a_tpl->parseCurrentBlock();
474 }
475 foreach ($grid["rows"] as $cols) {
476 foreach ($cols as $idx => $col) {
477 if ($idx > 0) {
478 $a_tpl->touchBlock("grid_col_nowrap_bl");
479 }
480
481 $a_tpl->setCurrentBlock("grid_col_bl");
482 $a_tpl->setVariable("COL_CAPTION", trim((string) ($col ?? "")));
483 $a_tpl->parseCurrentBlock();
484 }
485
486 $a_tpl->touchBlock("grid_row_bl");
487 }
488 }
489 }
490 return $a_tpl->get();
491 }

◆ getPanelText()

ILIAS\Survey\Mode\AbstractUIModifier::getPanelText ( \ILIAS\Survey\Evaluation\EvaluationGUIRequest  $request,
\SurveyQuestionEvaluation  $a_eval,
\ilSurveyEvaluationResults  $question_res 
)
protected

Reimplemented in ILIAS\Survey\Mode\IndividualFeedback\UIModifier.

Definition at line 533 of file class.AbstractUIModifier.php.

537 : string {
538 $a_results = $a_eval->getResults();
539 $question = $question_res->getQuestion();
540 $lng = $this->service->gui()->lng();
541
542 $a_tpl = new \ilTemplate("tpl.svy_results_details_text.html", true, true, "components/ILIAS/Survey/Evaluation");
543
544 $texts = $a_eval->getTextAnswers($a_results);
545 if ($texts) {
546 if (array_key_exists("", $texts)) {
547 $a_tpl->setVariable("TEXT_HEADING", $lng->txt("given_answers"));
548 foreach ($texts[""] as $item) {
549 $a_tpl->setCurrentBlock("text_direct_item_bl");
550 $a_tpl->setVariable("TEXT_DIRECT", nl2br(htmlentities($item)));
551 $a_tpl->parseCurrentBlock();
552 }
553 } else {
554 $acc = new \ilAccordionGUI();
555 $acc->setId("svyevaltxt" . $question->getId());
556
557 $a_tpl->setVariable("TEXT_HEADING", $lng->txt("freetext_answers"));
558
559 foreach ($texts as $var => $items) {
560 $list = array("<ul class=\"small\">");
561 foreach ($items as $item) {
562 $list[] = "<li>" . nl2br(htmlentities($item)) . "</li>";
563 }
564 $list[] = "</ul>";
565 $acc->addItem((string) $var, implode("\n", $list));
566 }
567
568 $a_tpl->setVariable("TEXT_ACC", $acc->getHTML());
569 }
570 }
571 return $a_tpl->get();
572 }

◆ getSurveySettingsGeneral()

ILIAS\Survey\Mode\AbstractUIModifier::getSurveySettingsGeneral ( \ilObjSurvey  $survey)
Returns
\ilFormPropertyGUI[]

Implements ILIAS\Survey\Mode\UIModifier.

Reimplemented in ILIAS\Survey\Mode\Feedback360\UIModifier, and ILIAS\Survey\Mode\IndividualFeedback\UIModifier.

Definition at line 52 of file class.AbstractUIModifier.php.

54 : array {
55 return [];
56 }

◆ getSurveySettingsReminderTargets()

ILIAS\Survey\Mode\AbstractUIModifier::getSurveySettingsReminderTargets ( \ilObjSurvey  $survey,
InternalGUIService  $ui_service 
)
Returns
\ilFormPropertyGUI[]

Implements ILIAS\Survey\Mode\UIModifier.

Reimplemented in ILIAS\Survey\Mode\Feedback360\UIModifier, and ILIAS\Survey\Mode\IndividualFeedback\UIModifier.

Definition at line 58 of file class.AbstractUIModifier.php.

61 : array {
62 return [];
63 }

◆ getSurveySettingsResults()

ILIAS\Survey\Mode\AbstractUIModifier::getSurveySettingsResults ( \ilObjSurvey  $survey,
InternalGUIService  $ui_service 
)

◆ setInternalService()

ILIAS\Survey\Mode\AbstractUIModifier::setInternalService ( InternalService  $internal_service)

Implements ILIAS\Survey\Mode\UIModifier.

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

42 : void
43 {
44 $this->service = $internal_service;
45 }

◆ setResultsCompetenceToolbar()

ILIAS\Survey\Mode\AbstractUIModifier::setResultsCompetenceToolbar ( \ilObjSurvey  $survey,
int  $user_id 
)

Implements ILIAS\Survey\Mode\UIModifier.

Reimplemented in ILIAS\Survey\Mode\IndividualFeedback\UIModifier.

Definition at line 101 of file class.AbstractUIModifier.php.

104 : array {
105 return $this->getApprSelectionComponents($survey, $user_id);
106 }
getApprSelectionComponents(\ilObjSurvey $survey, int $user_id)

◆ setResultsDetailToolbar()

ILIAS\Survey\Mode\AbstractUIModifier::setResultsDetailToolbar ( \ilObjSurvey  $survey,
int  $user_id,
\ilTemplate  $eval_tpl 
)
Returns
\ILIAS\UI\Component\Component[]

Implements ILIAS\Survey\Mode\UIModifier.

Reimplemented in ILIAS\Survey\Mode\IndividualFeedback\UIModifier.

Definition at line 111 of file class.AbstractUIModifier.php.

115 : array {
116 $components = [];
117
118 $request = $this->service
119 ->gui()
120 ->evaluation($survey)
121 ->request();
122
123 $gui = $this->service->gui();
124 $lng = $gui->lng();
125 $ctrl = $gui->ctrl();
126 $ui_fac = $gui->ui()->factory();
127
128 $config = $this->getInternalService()->domain()->modeFeatureConfig($survey->getMode());
129 if ($config->usesAppraisees()) {
130 $components = array_merge(
132 $this->getApprSelectionComponents($survey, $user_id)
133 );
134 }
135
136 $caption_options = [
137 "ap" => $lng->txt("svy_eval_captions_abs_perc"),
138 "a" => $lng->txt("svy_eval_captions_abs"),
139 "p" => $lng->txt("svy_eval_captions_perc"),
140 ];
141 $current_cp = $request->getCP();
142 $caption_items = [];
143 foreach ($caption_options as $key => $label) {
144 $ctrl->setParameterByClass("ilSurveyEvaluationGUI", "cp", $key);
145 $ctrl->setParameterByClass("ilSurveyEvaluationGUI", "vw", $request->getVW());
146 $caption_items[] = $ui_fac->button()->shy(
147 $label,
148 $ctrl->getLinkTargetByClass("ilSurveyEvaluationGUI", "evaluationdetails")
149 );
150 }
151 // reset parameter
152 $ctrl->setParameterByClass("ilSurveyEvaluationGUI", "cp", $current_cp);
153 $components[] = $ui_fac->dropdown()->standard($caption_items)
154 ->withLabel($caption_options[$current_cp] ?? $lng->txt("svy_eval_captions"));
155
156 // View dropdown (replaces ilSelectInputGUI "vw")
157 $view_options = [
158 "tc" => $lng->txt("svy_eval_view_tables_charts"),
159 "t" => $lng->txt("svy_eval_view_tables"),
160 "c" => $lng->txt("svy_eval_view_charts"),
161 ];
162 $current_vw = $request->getVW();
163 $view_items = [];
164 foreach ($view_options as $key => $label) {
165 $ctrl->setParameterByClass("ilSurveyEvaluationGUI", "vw", $key);
166 $ctrl->setParameterByClass("ilSurveyEvaluationGUI", "cp", $request->getCP());
167 $view_items[] = $ui_fac->button()->shy(
168 $label,
169 $ctrl->getLinkTargetByClass("ilSurveyEvaluationGUI", "evaluationdetails")
170 );
171 }
172 // reset parameter
173 $ctrl->setParameterByClass("ilSurveyEvaluationGUI", "vw", $current_vw);
174 $components[] = $ui_fac->dropdown()->standard($view_items)
175 ->withLabel($view_options[$current_vw] ?? $lng->txt("svy_eval_view"));
176
177 // Separator + export/print
178 $components = array_merge(
180 $this->getExportAndPrintComponents($survey, true, $eval_tpl)
181 );
182
183 return $components;
184 }
getExportAndPrintComponents(\ilObjSurvey $survey, bool $details, \ilTemplate $eval_tpl)

References $components, and $user_id.

◆ setResultsOverviewToolbar()

ILIAS\Survey\Mode\AbstractUIModifier::setResultsOverviewToolbar ( \ilObjSurvey  $survey,
int  $user_id,
\ilTemplate  $eval_tpl 
)

Implements ILIAS\Survey\Mode\UIModifier.

Definition at line 78 of file class.AbstractUIModifier.php.

82 : array {
83 $components = [];
84
85 $config = $this->getInternalService()->domain()->modeFeatureConfig($survey->getMode());
86 if ($config->usesAppraisees()) {
87 $components = array_merge(
90 );
91 }
92
93 $components = array_merge(
95 $this->getExportAndPrintComponents($survey, false, $eval_tpl)
96 );
97
98 return $components;
99 }

References $components, and $user_id.

◆ setResultsParticipantToolbar()

ILIAS\Survey\Mode\AbstractUIModifier::setResultsParticipantToolbar ( \ilObjSurvey  $survey,
int  $user_id 
)
Returns
\ILIAS\UI\Component\Component[]

Implements ILIAS\Survey\Mode\UIModifier.

Definition at line 189 of file class.AbstractUIModifier.php.

192 : array {
193 $components = [];
194
195 $config = $this->getInternalService()->domain()->modeFeatureConfig($survey->getMode());
196 if ($config->usesAppraisees()) {
197 $components = array_merge(
199 $this->getApprSelectionComponents($survey, $user_id)
200 );
201 }
202
203 return $components;
204 }

References $components, and $user_id.

◆ setValuesFromForm()

ILIAS\Survey\Mode\AbstractUIModifier::setValuesFromForm ( \ilObjSurvey  $survey,
\ilPropertyFormGUI  $form 
)

Field Documentation

◆ $gui

InternalGUIService ILIAS\Survey\Mode\AbstractUIModifier::$gui
protected

◆ $service

InternalService ILIAS\Survey\Mode\AbstractUIModifier::$service = null
protected

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