ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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, string $lang="-")
+ 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 94 of file class.WikiPrintViewProviderGUI.php.

References ILIAS\Export\AbstractPrintViewProvider\getOutputMode().

94  : array
95  {
96  $print_pages = [];
97  foreach ($this->selected_pages as $p_id) {
98  $page_gui = new \ilWikiPageGUI(
99  $p_id,
100  0,
101  $this->wiki->getRefId()
102  );
103  $page_gui->setWiki($this->wiki);
104  $page_gui->setOutputMode($this->getOutputMode());
105  $print_pages[] = $page_gui->showPage();
106  }
107 
108  return $print_pages;
109  }
+ 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 111 of file class.WikiPrintViewProviderGUI.php.

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

112  {
113  $lng = $this->lng;
114  $ilCtrl = $this->ctrl;
115 
117  \ilObject::_lookupObjId($this->wiki->getRefId())
118  );
119 
120  $form = new \ilPropertyFormGUI();
121 
122  //var_dump($pages);
123  // selection type
124  $radg = new \ilRadioGroupInputGUI($lng->txt("cont_selection"), "sel_type");
125  $radg->setValue("page");
126  $op1 = new \ilRadioOption($lng->txt("cont_current_page"), "page");
127  $radg->addOption($op1);
128  $op2 = new \ilRadioOption($lng->txt("wiki_whole_wiki")
129  . " (" . $lng->txt("wiki_pages") . ": " . count($pages) . ")", "wiki");
130  $radg->addOption($op2);
131  $op3 = new \ilRadioOption($lng->txt("wiki_selected_pages"), "selection");
132  $radg->addOption($op3);
133 
134  $nl = new \ilNestedListInputGUI("", "obj_id");
135  $op3->addSubItem($nl);
136 
137  foreach ($pages as $p) {
138  $nl->addListNode(
139  $p["id"],
140  $p["title"],
141  0,
142  false,
143  false,
144  \ilUtil::getImagePath("standard/icon_pg.svg"),
145  $lng->txt("wiki_page")
146  );
147  }
148 
149  $form->addItem($radg);
150 
151  $form->addCommandButton("printViewOrder", $lng->txt("wiki_show_print_view"));
152 
153  $form->setTitle($lng->txt("cont_print_selection"));
154  $form->setFormAction(
155  $ilCtrl->getFormActionByClass(
156  "ilWikiPageGUI",
157  "printViewOrder"
158  )
159  );
160 
161  return $form;
162  }
static _lookupObjId(int $ref_id)
static getImagePath(string $image_name, 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, string $lang="-")
+ 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 ilPageObjectGUI\OFFLINE.

77  : array
78  {
79  $page = new \ilWikiPage();
80  $page->setEmptyPageXml();
81  $resource_collector = new COPage\ResourcesCollector(
83  $page
84  );
85  $resource_injector = new COPage\ResourcesInjector($resource_collector);
86 
87  return [
88  function ($tpl) use ($resource_injector) {
89  $resource_injector->inject($tpl);
90  }
91  ];
92  }

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: