ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ILIAS\Wiki\WikiPrintViewProviderGUI Class Reference
+ Inheritance diagram for ILIAS\Wiki\WikiPrintViewProviderGUI:
+ Collaboration diagram for ILIAS\Wiki\WikiPrintViewProviderGUI:

Public Member Functions

 __construct (\ilLanguage $lng, \ilCtrl $ctrl, int $wiki_ref_id, ?array $selected_pages)
 PrintView constructor. More...
 
 getTemplateInjectors ()
 
 getPages ()
 
 getSelectionForm ()
 form which is featured in the modal form target is modified to open in new window (not yet possible with ks forms) the print/pdf message is added automatically More...
 
- Public Member Functions inherited from ILIAS\Export\AbstractPrintViewProvider
 setOffline (bool $offline)
 Set output mode. More...
 
 getOnSubmitCode ()
 
 autoPageBreak ()
 
 getSelectionForm ()
 
 getPages ()
 
 getTemplateInjectors ()
 

Protected Attributes

 $lng
 
 $selected_pages = null
 
 $wiki
 
 $ctrl
 
- Protected Attributes inherited from ILIAS\Export\AbstractPrintViewProvider
 $offline = false
 

Additional Inherited Members

- Data Fields inherited from ILIAS\Export\AbstractPrintViewProvider
const PRINT = "print"
 
const OFFLINE = "offline"
 
- Protected Member Functions inherited from ILIAS\Export\AbstractPrintViewProvider
 getOutputMode ()
 Get output mode. More...
 

Detailed Description

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

Definition at line 29 of file class.WikiPrintViewProviderGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Wiki\WikiPrintViewProviderGUI::__construct ( \ilLanguage  $lng,
\ilCtrl  $ctrl,
int  $wiki_ref_id,
?array  $selected_pages 
)

PrintView constructor.

Parameters
\ilLanguage$lng
\ilCtrl$ctrl
int$wiki_ref_id
array$selected_pages

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

References ILIAS\Wiki\WikiPrintViewProviderGUI\$ctrl, ILIAS\Wiki\WikiPrintViewProviderGUI\$lng, ILIAS\Repository\ctrl(), ilWikiPage\getAllWikiPages(), and ILIAS\Repository\lng().

63  {
64  $this->lng = $lng;
65  $this->ctrl = $ctrl;
66  $this->wiki = new \ilObjWiki($wiki_ref_id);
67  $this->selected_pages = (!is_null($selected_pages))
69  : array_map(
70  static function ($p) {
71  return $p["id"];
72  },
73  \ilWikiPage::getAllWikiPages($this->wiki->getId())
74  );
75  }
static getAllWikiPages(int $a_wiki_id)
+ Here is the call graph for this function:

Member Function Documentation

◆ getPages()

ILIAS\Wiki\WikiPrintViewProviderGUI::getPages ( )
Returns
string[]

Implements ILIAS\Export\PrintViewProvider.

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

References ILIAS\Export\AbstractPrintViewProvider\getOutputMode().

92  : array
93  {
94  $print_pages = [];
95  foreach ($this->selected_pages as $p_id) {
96  $page_gui = new \ilWikiPageGUI($p_id);
97  $page_gui->setWiki($this->wiki);
98  $page_gui->setOutputMode($this->getOutputMode());
99  $print_pages[] = $page_gui->showPage();
100  }
101 
102  return $print_pages;
103  }
+ Here is the call graph for this function:

◆ getSelectionForm()

ILIAS\Wiki\WikiPrintViewProviderGUI::getSelectionForm ( )

form which is featured in the modal form target is modified to open in new window (not yet possible with ks forms) the print/pdf message is added automatically

Returns
ilPropertyFormGUI|null

Implements ILIAS\Export\PrintViewProvider.

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

References ILIAS\Wiki\WikiPrintViewProviderGUI\$ctrl, ILIAS\Wiki\WikiPrintViewProviderGUI\$lng, ilObject\_lookupObjId(), ilWikiPage\getAllWikiPages(), and ilUtil\getImagePath().

106  {
107  $lng = $this->lng;
108  $ilCtrl = $this->ctrl;
109 
111  \ilObject::_lookupObjId($this->wiki->getRefId())
112  );
113 
114  $form = new \ilPropertyFormGUI();
115 
116  //var_dump($pages);
117  // selection type
118  $radg = new \ilRadioGroupInputGUI($lng->txt("cont_selection"), "sel_type");
119  $radg->setValue("page");
120  $op1 = new \ilRadioOption($lng->txt("cont_current_page"), "page");
121  $radg->addOption($op1);
122  $op2 = new \ilRadioOption($lng->txt("wiki_whole_wiki")
123  . " (" . $lng->txt("wiki_pages") . ": " . count($pages) . ")", "wiki");
124  $radg->addOption($op2);
125  $op3 = new \ilRadioOption($lng->txt("wiki_selected_pages"), "selection");
126  $radg->addOption($op3);
127 
128  $nl = new \ilNestedListInputGUI("", "obj_id");
129  $op3->addSubItem($nl);
130 
131  foreach ($pages as $p) {
132  $nl->addListNode(
133  $p["id"],
134  $p["title"],
135  0,
136  false,
137  false,
138  \ilUtil::getImagePath("icon_pg.svg"),
139  $lng->txt("wiki_page")
140  );
141  }
142 
143  $form->addItem($radg);
144 
145  $form->addCommandButton("printViewOrder", $lng->txt("wiki_show_print_view"));
146 
147  $form->setTitle($lng->txt("cont_print_selection"));
148  $form->setFormAction(
149  $ilCtrl->getFormActionByClass(
150  "ilWikiPageGUI",
151  "printViewOrder"
152  )
153  );
154 
155  return $form;
156  }
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static getAllWikiPages(int $a_wiki_id)
static _lookupObjId(int $ref_id)
+ Here is the call graph for this function:

◆ getTemplateInjectors()

ILIAS\Wiki\WikiPrintViewProviderGUI::getTemplateInjectors ( )
Returns
callable[] each callable gets the $tpl passed to inject css/js/...

Implements ILIAS\Export\PrintViewProvider.

Definition at line 77 of file class.WikiPrintViewProviderGUI.php.

References $tpl, and ilPageObjectGUI\OFFLINE.

77  : array
78  {
79  $resource_collector = new COPage\ResourcesCollector(
81  new \ilWikiPage()
82  );
83  $resource_injector = new COPage\ResourcesInjector($resource_collector);
84 
85  return [
86  function ($tpl) use ($resource_injector) {
87  $resource_injector->inject($tpl);
88  }
89  ];
90  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41

Field Documentation

◆ $ctrl

ILIAS\Wiki\WikiPrintViewProviderGUI::$ctrl
protected

◆ $lng

ILIAS\Wiki\WikiPrintViewProviderGUI::$lng
protected

◆ $selected_pages

ILIAS\Wiki\WikiPrintViewProviderGUI::$selected_pages = null
protected

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

◆ $wiki

ILIAS\Wiki\WikiPrintViewProviderGUI::$wiki
protected

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


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