ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ilGlossaryFlashcardGUI Class Reference

GUI class for glossary flashcards. More...

+ Collaboration diagram for ilGlossaryFlashcardGUI:

Public Member Functions

 __construct ()
 
 executeCommand ()
 
 listBoxes ()
 
 confirmResetBoxes ()
 
 cancelResetBoxes ()
 
 resetBoxes ()
 

Protected Member Functions

 getItemBox (int $nr)
 

Protected Attributes

ilCtrl $ctrl
 
ilLanguage $lng
 
ilGlobalTemplateInterface $tpl
 
ilTabsGUI $tabs_gui
 
UI Factory $ui_fac
 
UI Renderer $ui_ren
 
Presentation PresentationGUIRequest $request
 
Flashcard FlashcardManager $manager
 

Detailed Description

GUI class for glossary flashcards.

Author
Thomas Famula famul.nosp@m.a@le.nosp@m.ifos..nosp@m.de ilGlossaryFlashcardGUI: ilGlossaryFlashcardBoxGUI

Definition at line 30 of file class.ilGlossaryFlashcardGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilGlossaryFlashcardGUI::__construct ( )

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

References $DIC, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

42  {
43  global $DIC;
44 
45  $this->ctrl = $DIC->ctrl();
46  $this->lng = $DIC->language();
47  $this->tpl = $DIC->ui()->mainTemplate();
48  $this->tabs_gui = $DIC->tabs();
49  $this->ui_fac = $DIC->ui()->factory();
50  $this->ui_ren = $DIC->ui()->renderer();
51 
52  $this->request = $DIC->glossary()
53  ->internal()
54  ->gui()
55  ->presentation()
56  ->request();
57  $gs = $DIC->glossary()->internal();
58  $this->manager = $gs->domain()->flashcard($this->request->getRefId());
59  }
global $DIC
Definition: shib_login.php:26
+ Here is the call graph for this function:

Member Function Documentation

◆ cancelResetBoxes()

ilGlossaryFlashcardGUI::cancelResetBoxes ( )

Definition at line 156 of file class.ilGlossaryFlashcardGUI.php.

References ILIAS\Repository\ctrl().

156  : void
157  {
158  $this->ctrl->redirectByClass("ilglossarypresentationgui", "showFlashcards");
159  }
+ Here is the call graph for this function:

◆ confirmResetBoxes()

ilGlossaryFlashcardGUI::confirmResetBoxes ( )

Definition at line 141 of file class.ilGlossaryFlashcardGUI.php.

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

141  : void
142  {
143  $yes_button = $this->ui_fac->button()->standard(
144  $this->lng->txt("yes"),
145  $this->ctrl->getLinkTarget($this, "resetBoxes")
146  );
147  $no_button = $this->ui_fac->button()->standard(
148  $this->lng->txt("no"),
149  $this->ctrl->getLinkTarget($this, "cancelResetBoxes")
150  );
151  $cbox = $this->ui_fac->messageBox()->confirmation($this->lng->txt("glo_boxes_really_reset"))
152  ->withButtons([$yes_button, $no_button]);
153  $this->tpl->setContent($this->ui_ren->render($cbox));
154  }
+ Here is the call graph for this function:

◆ executeCommand()

ilGlossaryFlashcardGUI::executeCommand ( )

Definition at line 61 of file class.ilGlossaryFlashcardGUI.php.

References ILIAS\Repository\ctrl().

61  : void
62  {
63  $next_class = $this->ctrl->getNextClass($this);
64  $cmd = $this->ctrl->getCmd();
65 
66  switch ($next_class) {
67  case "ilglossaryflashcardboxgui":
68  $flash_boxes = new ilGlossaryFlashcardBoxGUI();
69  $this->ctrl->forwardCommand($flash_boxes);
70  break;
71 
72  default:
73  $cmd = $this->ctrl->getCmd("listBoxes");
74  $ret = $this->$cmd();
75  break;
76  }
77  }
GUI class for glossary flashcard boxes.
+ Here is the call graph for this function:

◆ getItemBox()

ilGlossaryFlashcardGUI::getItemBox ( int  $nr)
protected

Definition at line 110 of file class.ilGlossaryFlashcardGUI.php.

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by listBoxes().

110  : \ILIAS\UI\Component\Item\Item
111  {
112  $item_cnt = $this->manager->getItemsForBoxCount($nr);
113  $last_access = $this->manager->getLastAccessForBoxAsDaysText($nr);
114 
115  if (($this->manager->getUserTermsForBox($nr) && $nr !== Flashcard\FlashcardBox::LAST_BOX)
116  || ($this->manager->getAllTermsWithoutEntry() && $nr === Flashcard\FlashcardBox::FIRST_BOX)) {
117  $this->ctrl->setParameterByClass("ilglossaryflashcardboxgui", "box_id", $nr);
118  $title = $this->ui_fac->link()->standard(
119  $this->lng->txt("glo_box") . " " . $nr,
120  $this->ctrl->getLinkTargetByClass('ilglossaryflashcardboxgui', 'show')
121  );
122  } else {
123  $title = $this->lng->txt("glo_box") . " " . $nr;
124  }
125 
126  $box = $this->ui_fac->item()->standard($title);
127  if ($nr === Flashcard\FlashcardBox::LAST_BOX) {
128  $box = $box->withProperties([
129  $this->lng->txt("glo_flashcards") => (string) $item_cnt
130  ]);
131  } else {
132  $box = $box->withProperties([
133  $this->lng->txt("glo_flashcards") => (string) $item_cnt,
134  $this->lng->txt("glo_box_last_presented") => $last_access
135  ]);
136  }
137 
138  return $box;
139  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listBoxes()

ilGlossaryFlashcardGUI::listBoxes ( )

Definition at line 79 of file class.ilGlossaryFlashcardGUI.php.

References Vendor\Package\$b, ILIAS\Repository\ctrl(), getItemBox(), and ILIAS\Repository\lng().

79  : void
80  {
81  $flashcard_tpl = new ilTemplate("tpl.flashcard_overview.html", true, true, "components/ILIAS/Glossary");
82 
83  $reset_btn = $this->ui_fac->button()->standard(
84  $this->lng->txt("glo_reset_all_boxes"),
85  $this->ctrl->getLinkTarget($this, "confirmResetBoxes")
86  );
87  $flashcard_tpl->setVariable("RESET_BUTTON", $this->ui_ren->render($reset_btn));
88 
89  $intro_box = $this->ui_fac->panel()->standard(
90  $this->lng->txt("glo_introduction"),
91  $this->ui_fac->legacy()->content($this->lng->txt("glo_flashcards_intro"))
92  );
93  $flashcard_tpl->setVariable("INTRO_BOX", $this->ui_ren->render($intro_box));
94 
95  $boxes = [];
96  for ($b = 1; $b <= 5; $b++) {
97  $box = $this->getItemBox($b);
98  $boxes[] = $box;
99  }
100 
101  $boxes_pnl = $this->ui_fac->panel()->listing()->standard(
102  $this->lng->txt("glo_boxes"),
103  [$this->ui_fac->item()->group("", $boxes)]
104  );
105  $flashcard_tpl->setVariable("BOXES", $this->ui_ren->render($boxes_pnl));
106 
107  $this->tpl->setContent($flashcard_tpl->get());
108  }
+ Here is the call graph for this function:

◆ resetBoxes()

ilGlossaryFlashcardGUI::resetBoxes ( )

Definition at line 161 of file class.ilGlossaryFlashcardGUI.php.

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

161  : void
162  {
163  $this->manager->resetEntries();
164  $this->tpl->setOnScreenMessage('success', $this->lng->txt("glo_boxes_reset"), true);
165  $this->ctrl->redirectByClass("ilglossarypresentationgui", "showFlashcards");
166  }
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ilGlossaryFlashcardGUI::$ctrl
protected

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

◆ $lng

ilLanguage ilGlossaryFlashcardGUI::$lng
protected

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

◆ $manager

Flashcard FlashcardManager ilGlossaryFlashcardGUI::$manager
protected

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

◆ $request

Presentation PresentationGUIRequest ilGlossaryFlashcardGUI::$request
protected

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

◆ $tabs_gui

ilTabsGUI ilGlossaryFlashcardGUI::$tabs_gui
protected

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

◆ $tpl

ilGlobalTemplateInterface ilGlossaryFlashcardGUI::$tpl
protected

Definition at line 34 of file class.ilGlossaryFlashcardGUI.php.

◆ $ui_fac

UI Factory ilGlossaryFlashcardGUI::$ui_fac
protected

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

◆ $ui_ren

UI Renderer ilGlossaryFlashcardGUI::$ui_ren
protected

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


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