ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\Blog\BlogPrintViewProviderGUI Class Reference
+ Inheritance diagram for ILIAS\Blog\BlogPrintViewProviderGUI:
+ Collaboration diagram for ILIAS\Blog\BlogPrintViewProviderGUI:

Public Member Functions

 __construct (\ilLanguage $lng, \ilCtrl $ctrl, \ilObjBlog $blog, int $node_id, object $access_handler, int $style_id, ?array $selected_pages=null)
 
 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

ilLanguage $lng
 
array $selected_pages = null
 
ilObjBlog $blog
 
ilCtrl $ctrl
 
object $access_handler
 
int $style_sheet_id = 0
 
int $node_id = 0
 
- 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 30 of file class.BlogPrintViewProviderGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Blog\BlogPrintViewProviderGUI::__construct ( \ilLanguage  $lng,
\ilCtrl  $ctrl,
\ilObjBlog  $blog,
int  $node_id,
object  $access_handler,
int  $style_id,
?array  $selected_pages = null 
)

Definition at line 40 of file class.BlogPrintViewProviderGUI.php.

References ILIAS\Blog\BlogPrintViewProviderGUI\$access_handler, ILIAS\Blog\BlogPrintViewProviderGUI\$blog, ILIAS\Blog\BlogPrintViewProviderGUI\$ctrl, ILIAS\Blog\BlogPrintViewProviderGUI\$lng, ILIAS\Blog\BlogPrintViewProviderGUI\$node_id, ILIAS\Blog\BlogPrintViewProviderGUI\$selected_pages, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Member Function Documentation

◆ getPages()

ILIAS\Blog\BlogPrintViewProviderGUI::getPages ( )
Returns
string[]

Implements ILIAS\Export\PrintViewProvider.

Definition at line 74 of file class.BlogPrintViewProviderGUI.php.

References ilBlogPosting\getAllPostings(), and ILIAS\Export\AbstractPrintViewProvider\getOutputMode().

74  : array
75  {
76  $print_pages = [];
77 
78  $selected_pages = (count($this->selected_pages) > 0)
79  ? $this->selected_pages
80  : array_map(static function ($i) {
81  return $i["id"];
82  }, \ilBlogPosting::getAllPostings($this->blog->getId()));
83 
84  foreach ($selected_pages as $p_id) {
85  $page_gui = new \ilBlogPostingGUI(
86  $this->node_id,
87  $this->access_handler,
88  $p_id,
89  0,
90  false,
91  false,
92  $this->style_sheet_id
93  );
94  $page_gui->setOutputMode($this->getOutputMode());
95  $print_pages[] = $page_gui->showPage();
96  }
97 
98  return $print_pages;
99  }
static getAllPostings(int $a_blog_id, int $a_limit=1000, int $a_offset=0)
Get all postings of blog.
+ Here is the call graph for this function:

◆ getSelectionForm()

ILIAS\Blog\BlogPrintViewProviderGUI::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 101 of file class.BlogPrintViewProviderGUI.php.

References ILIAS\Blog\BlogPrintViewProviderGUI\$ctrl, ILIAS\Blog\BlogPrintViewProviderGUI\$lng, ilBlogPosting\getAllPostings(), and ilUtil\getImagePath().

102  {
103  $lng = $this->lng;
104  $ilCtrl = $this->ctrl;
105  $postings = \ilBlogPosting::getAllPostings($this->blog->getId());
106  $lng->loadLanguageModule("content");
107  $lng->loadLanguageModule("blog");
108  $form = new \ilPropertyFormGUI();
109 
110  //var_dump($pages);
111  // selection type
112  $radg = new \ilRadioGroupInputGUI($lng->txt("cont_selection"), "sel_type");
113  $radg->setValue("page");
114  $op1 = new \ilRadioOption($lng->txt("blog_whole_blog")
115  . " (" . $lng->txt("blog_postings") . ": " . count($postings) . ")", "wiki");
116  $radg->addOption($op1);
117  $op2 = new \ilRadioOption($lng->txt("blog_selected_pages"), "selection");
118  $radg->addOption($op2);
119 
120  $nl = new \ilNestedListInputGUI("", "obj_id");
121  $op2->addSubItem($nl);
122 
123  foreach ($postings as $p) {
124  $nl->addListNode(
125  $p["id"],
126  $p["title"],
127  "0",
128  false,
129  false,
130  \ilUtil::getImagePath("standard/icon_pg.svg"),
131  $lng->txt("blog_posting")
132  );
133  }
134 
135  $form->addItem($radg);
136 
137  $form->addCommandButton("printPostings", $lng->txt("blog_show_print_view"));
138 
139  $form->setTitle($lng->txt("cont_print_selection"));
140  $form->setFormAction(
141  $ilCtrl->getFormActionByClass(
142  "ilObjBlogGUI",
143  "printPostings"
144  )
145  );
146 
147  return $form;
148  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static getAllPostings(int $a_blog_id, int $a_limit=1000, int $a_offset=0)
Get all postings of blog.
loadLanguageModule(string $a_module)
Load language module.
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:

◆ getTemplateInjectors()

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

Implements ILIAS\Export\PrintViewProvider.

Definition at line 59 of file class.BlogPrintViewProviderGUI.php.

References ilPageObjectGUI\OFFLINE.

59  : array
60  {
61  $resource_collector = new COPage\ResourcesCollector(
63  new \ilBlogPosting()
64  );
65  $resource_injector = new COPage\ResourcesInjector($resource_collector);
66 
67  return [
68  function ($tpl) use ($resource_injector) {
69  $resource_injector->inject($tpl);
70  }
71  ];
72  }
Class ilBlogPosting.

Field Documentation

◆ $access_handler

object ILIAS\Blog\BlogPrintViewProviderGUI::$access_handler
protected

◆ $blog

ilObjBlog ILIAS\Blog\BlogPrintViewProviderGUI::$blog
protected

◆ $ctrl

ilCtrl ILIAS\Blog\BlogPrintViewProviderGUI::$ctrl
protected

◆ $lng

ilLanguage ILIAS\Blog\BlogPrintViewProviderGUI::$lng
protected

◆ $node_id

int ILIAS\Blog\BlogPrintViewProviderGUI::$node_id = 0
protected

◆ $selected_pages

array ILIAS\Blog\BlogPrintViewProviderGUI::$selected_pages = null
protected

◆ $style_sheet_id

int ILIAS\Blog\BlogPrintViewProviderGUI::$style_sheet_id = 0
protected

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


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