ILIAS  release_8 Revision v8.24
ilWikiFunctionsBlockGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilWikiFunctionsBlockGUI:
+ Collaboration diagram for ilWikiFunctionsBlockGUI:

Public Member Functions

 __construct ()
 
 getBlockType ()
 
 executeCommand ()
 execute command More...
 
 setPageObject (ilWikiPage $a_pageob)
 
 getPageObject ()
 
 fillDataSection ()
 Standard implementation for row based data. More...
 
- Public Member Functions inherited from ilBlockGUI
 __construct ()
 
 getBlockType ()
 
 setData (array $a_data)
 
 getData ()
 
 setPresentation (int $type)
 
 getPresentation ()
 
 setBlockId (string $a_block_id="0")
 
 getBlockId ()
 
 setGuiObject (object $a_gui_object)
 Set GuiObject. More...
 
 getGuiObject ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setOffset (int $a_offset)
 
 getOffset ()
 
 correctOffset ()
 
 setLimit (int $a_limit)
 
 getLimit ()
 
 setEnableEdit (bool $a_enableedit)
 
 getEnableEdit ()
 
 setRepositoryMode (bool $a_repositorymode)
 
 getRepositoryMode ()
 
 setSubtitle (string $a_subtitle)
 
 getSubtitle ()
 
 setRefId (int $a_refid)
 Set Ref Id (only used if isRepositoryObject() is true). More...
 
 getRefId ()
 
 setAdminCommands (bool $a_admincommands)
 
 getAdminCommands ()
 
 setEnableNumInfo (bool $a_enablenuminfo)
 
 getEnableNumInfo ()
 
 setProperties (array $a_properties)
 This function is supposed to be used for block type specific properties, that should be inherited through ilColumnGUI->setBlockProperties. More...
 
 getProperty (string $a_property)
 
 setProperty (string $a_property, string $a_value)
 
 setRowTemplate (string $a_rowtemplatename, string $a_rowtemplatedir="")
 Set Row Template Name. More...
 
 getNavParameter ()
 
 getConfigParameter ()
 
 getMoveParameter ()
 
 getRowTemplateName ()
 
 getRowTemplateDir ()
 
 addBlockCommand (string $a_href, string $a_text, string $a_onclick="")
 
 getBlockCommands ()
 
 getHTML ()
 
 fillHeaderCommands ()
 
 fillHeaderTitleBlock ()
 
 setDataSection (string $a_content)
 Call this from overwritten fillDataSection(), if standard row based data is not used. More...
 
 fillDataSection ()
 Standard implementation for row based data. More...
 
 fillRow (array $a_set)
 
 fillFooter ()
 
 fillPreviousNext ()
 
 setPreviousNextLinks ()
 
 getAsynch ()
 Use this for final get before sending asynchronous output (ajax) per echo to output. More...
 
 getPaginationViewControl ()
 Fill previous/next row. More...
 
 getHTMLNew ()
 
 getNoItemFoundContent ()
 

Static Public Attributes

static $block_type = "wikiside"
 
static $st_data
 

Protected Member Functions

 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 getLegacyContent ()
 Get legacy content. More...
 
- Protected Member Functions inherited from ilBlockGUI
 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 specialCharsAsEntities (string $string)
 
 initCommands ()
 
 fillRowColor (string $a_placeholder="CSS_ROW")
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 
 getLegacyContent ()
 Get legacy content. More...
 
 getViewControls ()
 Get view controls. More...
 
 getListItemForData (array $data)
 Get list item for data array. More...
 
 handleNavigation ()
 Handle navigation. More...
 
 loadData ()
 Load data for current page. More...
 
 getListItemGroups ()
 Get items. More...
 
 addRepoCommands ()
 Add repo commands. More...
 
 send (string $output)
 Send. More...
 

Protected Attributes

int $ref_id
 
ilWikiPage $pageob
 
ilObjWiki $wiki
 
bool $new_rendering = true
 
- Protected Attributes inherited from ilBlockGUI
object $gui_object
 
ILIAS Block StandardGUIRequest $request
 
ILIAS Block BlockManager $block_manager
 
bool $repositorymode = false
 
ILIAS DI UIServices $ui
 
array $data = array()
 
bool $enablenuminfo = true
 
array $footer_links = array()
 
string $block_id = "0"
 
bool $allow_moving = true
 
array $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 
array $block_commands = array()
 
int $max_count = 0
 
bool $close_command = false
 
bool $image = false
 
array $property = []
 
string $nav_value = ""
 
string $css_row = ""
 
string $title = ""
 
bool $admincommands = false
 
array $dropdown
 
ilTemplate $tpl
 
ilGlobalTemplateInterface $main_tpl
 
ilObjUser $user
 
ilCtrl $ctrl
 
ilAccessHandler $access
 
ilLanguage $lng
 
ilObjectDefinition $obj_def
 
int $presentation
 
int $requested_ref_id
 
bool $new_rendering = false
 

Additional Inherited Members

- Static Public Member Functions inherited from ilBlockGUI
static getScreenMode ()
 
- Data Fields inherited from ilBlockGUI
const PRES_MAIN_LEG = 0
 
const PRES_SEC_LEG = 1
 
const PRES_SEC_LIST = 2
 
const PRES_MAIN_LIST = 3
 
const PRES_MAIN_TILE = 4
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning BlockGUI class for wiki functions block

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e

Definition at line 24 of file class.ilWikiFunctionsBlockGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilWikiFunctionsBlockGUI::__construct ( )

Reimplemented from ilBlockGUI.

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

33 {
34 global $DIC;
35
37 ->wiki()
38 ->internal()
39 ->gui()
40 ->editing()
41 ->request();
42
43 $this->ctrl = $DIC->ctrl();
44 $this->lng = $DIC->language();
45 $this->user = $DIC->user();
46 $this->access = $DIC->access();
47 $lng = $DIC->language();
48
50
51 $lng->loadLanguageModule("wiki");
52 $this->setEnableNumInfo(false);
53
54 $this->setTitle($lng->txt("wiki_functions"));
55 $this->allow_moving = false;
56
57 $this->ref_id = $request->getRefId();
58
59 $this->wiki = new ilObjWiki($this->ref_id);
60
61 $this->setPresentation(self::PRES_SEC_LEG);
62 }
ilLanguage $lng
setTitle(string $a_title)
setPresentation(int $type)
ILIAS Block StandardGUIRequest $request
setEnableNumInfo(bool $a_enablenuminfo)
loadLanguageModule(string $a_module)
Load language module.
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, ilBlockGUI\$lng, ilBlockGUI\$request, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilLanguage\loadLanguageModule(), ilBlockGUI\setEnableNumInfo(), ilBlockGUI\setPresentation(), ilBlockGUI\setTitle(), ilLanguage\txt(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilWikiFunctionsBlockGUI::executeCommand ( )

execute command

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

78 {
79 $ilCtrl = $this->ctrl;
80
81 $next_class = $ilCtrl->getNextClass();
82 $cmd = $ilCtrl->getCmd("getHTML");
83
84 switch ($next_class) {
85 default:
86 return $this->$cmd();
87 }
88 }
getNextClass($a_gui_class=null)
@inheritDoc

References ilBlockGUI\$ctrl, and ilCtrl\getNextClass().

+ Here is the call graph for this function:

◆ fillDataSection()

ilWikiFunctionsBlockGUI::fillDataSection ( )

Standard implementation for row based data.

Overwrite this and call setContent for other data.

Reimplemented from ilBlockGUI.

Definition at line 100 of file class.ilWikiFunctionsBlockGUI.php.

100 : void
101 {
102 $this->setDataSection($this->getLegacyContent());
103 }
setDataSection(string $a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.

References getLegacyContent(), and ilBlockGUI\setDataSection().

+ Here is the call graph for this function:

◆ getBlockType()

ilWikiFunctionsBlockGUI::getBlockType ( )

Reimplemented from ilBlockGUI.

Definition at line 64 of file class.ilWikiFunctionsBlockGUI.php.

64 : string
65 {
66 return self::$block_type;
67 }

References $block_type.

◆ getLegacyContent()

ilWikiFunctionsBlockGUI::getLegacyContent ( )
protected

Get legacy content.

Returns
string

Reimplemented from ilBlockGUI.

Definition at line 112 of file class.ilWikiFunctionsBlockGUI.php.

112 : string
113 {
114 $ilCtrl = $this->ctrl;
116 $ilAccess = $this->access;
117
118 $tpl = new ilTemplate("tpl.wiki_side_block_content.html", true, true, "Modules/Wiki");
119
120 $wp = $this->getPageObject();
121
122 // info
123 $actions[] = array(
124 "txt" => $lng->txt("info_short"),
125 "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "infoScreen")
126 );
127
128 // recent changes
129 $actions[] = array(
130 "txt" => $lng->txt("wiki_recent_changes"),
131 "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "recentChanges")
132 );
133
134 foreach ($actions as $a) {
135 $tpl->setCurrentBlock("action");
136 $tpl->setVariable("HREF", $a["href"]);
137 $tpl->setVariable("TXT", $a["txt"]);
139
140 $tpl->touchBlock("item");
141 }
142
143
144 $actions = array();
145
146 // all pages
147 $actions[] = array(
148 "txt" => $lng->txt("wiki_all_pages"),
149 "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "allPages")
150 );
151
152 // new pages
153 $actions[] = array(
154 "txt" => $lng->txt("wiki_new_pages"),
155 "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "newPages")
156 );
157
158 // popular pages
159 $actions[] = array(
160 "txt" => $lng->txt("wiki_popular_pages"),
161 "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "popularPages")
162 );
163
164 // orphaned pages
165 $actions[] = array(
166 "txt" => $lng->txt("wiki_orphaned_pages"),
167 "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "orphanedPages")
168 );
169
170
171 // page lists
172 $list = new ilAdvancedSelectionListGUI();
173 $list->setListTitle($lng->txt("wiki_page_lists"));
175 $list->setId("wiki_pglists");
176
177 foreach ($actions as $a) {
178 $list->addItem(
179 $a["txt"],
180 "",
181 $a["href"]
182 );
183 }
184 $tpl->setCurrentBlock("plain");
185 $tpl->setVariable("PLAIN", $list->getHTML());
187 $tpl->touchBlock("item");
188
189
190 // page actions
191 $list = new ilAdvancedSelectionListGUI();
193 $list->setListTitle($lng->txt("wiki_page_actions"));
194 $list->setId("wiki_pgactions");
195
196 if ($ilAccess->checkAccess("write", "", $this->ref_id)) {
197 // rating
198 if (ilObjWiki::_lookupRating($this->getPageObject()->getWikiId())) {
199 if (!$this->getPageObject()->getRating()) {
200 $list->addItem(
201 $lng->txt("wiki_activate_page_rating"),
202 "",
203 $ilCtrl->getLinkTargetByClass("ilwikipagegui", "activateWikiPageRating")
204 );
205 } else {
206 $list->addItem(
207 $lng->txt("wiki_deactivate_page_rating"),
208 "",
209 $ilCtrl->getLinkTargetByClass("ilwikipagegui", "deactivateWikiPageRating")
210 );
211 }
212 }
213 }
214
215 if ($ilAccess->checkAccess("write", "", $this->ref_id) ||
216 $ilAccess->checkAccess("edit_page_meta", "", $this->ref_id)) {
217 // unhide advmd?
218 if (count(ilAdvancedMDRecord::_getSelectedRecordsByObject("wiki", $this->ref_id, "wpg")) &&
220 $list->addItem(
221 $lng->txt("wiki_unhide_meta_adv_records"),
222 "",
223 $ilCtrl->getLinkTargetByClass("ilwikipagegui", "unhideAdvancedMetaData")
224 );
225 }
226 }
227
228 if (($ilAccess->checkAccess("edit_content", "", $this->ref_id) && !$this->getPageObject()->getBlocked())
229 || $ilAccess->checkAccess("write", "", $this->ref_id)) {
230 // rename
231 $list->addItem(
232 $lng->txt("wiki_rename_page"),
233 "",
234 $ilCtrl->getLinkTargetByClass("ilwikipagegui", "renameWikiPage")
235 );
236 }
237
238 if (ilWikiPerm::check("activate_wiki_protection", $this->ref_id)) {
239 // block/unblock
240 if ($this->getPageObject()->getBlocked()) {
241 $list->addItem(
242 $lng->txt("wiki_unblock_page"),
243 "",
244 $ilCtrl->getLinkTargetByClass("ilwikipagegui", "unblockWikiPage")
245 );
246 } else {
247 $list->addItem(
248 $lng->txt("wiki_block_page"),
249 "",
250 $ilCtrl->getLinkTargetByClass("ilwikipagegui", "blockWikiPage")
251 );
252 }
253 }
254
255 if (ilWikiPerm::check("delete_wiki_pages", $this->ref_id)) {
256 // delete page
257 $st_page = ilObjWiki::_lookupStartPage($this->getPageObject()->getParentId());
258 if ($st_page !== $this->getPageObject()->getTitle()) {
259 $list->addItem(
260 $lng->txt("wiki_delete_page"),
261 "",
262 $ilCtrl->getLinkTargetByClass("ilwikipagegui", "deleteWikiPageConfirmationScreen")
263 );
264 }
265 }
266
267 if ($ilAccess->checkAccess("write", "", $this->ref_id)) {
268 $wpt = new ilWikiPageTemplate($this->getPageObject()->getParentId());
269 if (!$wpt->isPageTemplate($this->getPageObject()->getId())) {
270 $list->addItem(
271 $lng->txt("wiki_add_template"),
272 "",
273 $ilCtrl->getLinkTargetByClass("ilwikipagetemplategui", "addPageTemplateFromPageAction")
274 );
275 } else {
276 $list->addItem(
277 $lng->txt("wiki_remove_template_status"),
278 "",
279 $ilCtrl->getLinkTargetByClass("ilwikipagetemplategui", "removePageTemplateFromPageAction")
280 );
281 }
282 }
283
284 if ($ilAccess->checkAccess("write", "", $this->ref_id) ||
285 $ilAccess->checkAccess("read", "", $this->ref_id)) {
286 $tpl->setCurrentBlock("plain");
287 $tpl->setVariable("PLAIN", $list->getHTML());
289 $tpl->touchBlock("item");
290 }
291
292 // permissions
293 // if ($ilAccess->checkAccess('edit_permission', "", $this->ref_id))
294 // {
295 // $actions[] = array(
296 // "txt" => $lng->txt("perm_settings"),
297 // "href" => $ilCtrl->getLinkTargetByClass(array("ilobjwikigui", "ilpermissiongui"), "perm")
298 // );
299 // }
300
301 $actions = array();
302
303 // settings
304 if ($ilAccess->checkAccess('write', "", $this->ref_id)) {
305 $actions[] = array(
306 "txt" => $lng->txt("wiki_contributors"),
307 "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "listContributors")
308 );
309 }
310
311 // manage
312 if (ilWikiPerm::check("wiki_html_export", $this->ref_id)) {
313 if (!$this->wiki->isCommentsExportPossible()) {
314 $actions[] = array(
315 "txt" => $lng->txt("wiki_html_export"),
316 "id" => "il_wiki_user_export",
317 "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "initUserHTMLExport")
318 );
319 } else {
320 $this->lng->loadLanguageModule("note");
321 $comments_helper = new \ILIAS\Notes\Export\ExportHelperGUI();
322 $comments_modal = $comments_helper->getCommentIncludeModalDialog(
323 $this->lng->txt("wiki_html_export"),
324 $this->lng->txt("note_html_export_include_comments"),
325 "il.Wiki.Pres.performHTMLExport();",
326 "il.Wiki.Pres.performHTMLExportWithComments();",
327 true
328 );
329 $actions[] = array(
330 "txt" => $lng->txt("wiki_html_export"),
331 "modal" => $comments_modal
332 );
333 }
334 }
335
336 // manage
337 if ($ilAccess->checkAccess('write', "", $this->ref_id)) {
338 $actions[] = array(
339 "txt" => $lng->txt("settings"),
340 "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "editSettings")
341 );
342 } elseif ($ilAccess->checkAccess('statistics_read', "", $this->ref_id)) {
343 $actions[] = array(
344 "txt" => $lng->txt("statistics"),
345 "href" => $ilCtrl->getLinkTargetByClass(array("ilobjwikigui", "ilwikistatgui"), "initial")
346 );
347 }
348
349 $modal_html = "";
350 foreach ($actions as $a) {
351 $tpl->setCurrentBlock("action");
352 if (($a["modal"] ?? "") != "") {
353 $signal = $a["modal"]->getShowSignal();
354 $onclick = "$(document).trigger('" . $signal . "', {'id': '" . $signal . "','triggerer':$(this), 'options': JSON.parse('[]')}); return false;";
355 $tpl->setVariable("ONCLICK", ' onclick="' . $onclick . '" ');
356 $tpl->setVariable("HREF", "#");
357 $modal_html .= $this->ui->renderer()->render($a["modal"]);
358 } else {
359 $tpl->setVariable("HREF", $a["href"]);
360 }
361 $tpl->setVariable("TXT", $a["txt"]);
362 if (($a["id"] ?? "") != "") {
363 $tpl->setVariable("ACT_ID", "id='" . $a["id"] . "'");
364 }
366
367 $tpl->touchBlock("item");
368 }
369
370 return $tpl->get() . $modal_html;
371 }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:514
static _getSelectedRecordsByObject(string $a_obj_type, int $a_id, string $a_sub_type="", bool $is_ref_id=true)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilAccessHandler $access
ilTemplate $tpl
static _lookupRating(int $a_wiki_id)
Lookup whether rating is activated.
static _lookupStartPage(int $a_wiki_id)
special template class to simplify handling of ITX/PEAR
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
get(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
Returns a block with all replacements done.
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
touchBlock(string $block)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static lookupAdvancedMetadataHidden(int $a_page_id)
static check(string $a_perm, int $a_ref_id, string $a_cmd="")
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples

References Vendor\Package\$a, ilBlockGUI\$access, ilBlockGUI\$ctrl, ilBlockGUI\$lng, ilBlockGUI\$tpl, ilAdvancedMDRecord\_getSelectedRecordsByObject(), ilObjWiki\_lookupRating(), ilObjWiki\_lookupStartPage(), ilWikiPerm\check(), ilTemplate\get(), ILIAS\Survey\Mode\getId(), getPageObject(), ilBlockGUI\getTitle(), ILIAS\Repository\lng(), ilWikiPage\lookupAdvancedMetadataHidden(), ilTemplate\parseCurrentBlock(), ilTemplate\setCurrentBlock(), HTML_Template_IT\setVariable(), ilAdvancedSelectionListGUI\STYLE_LINK, ilTemplate\touchBlock(), ilLanguage\txt(), and ILIAS\Repository\ui().

Referenced by fillDataSection().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPageObject()

ilWikiFunctionsBlockGUI::getPageObject ( )

Definition at line 95 of file class.ilWikiFunctionsBlockGUI.php.

96 {
97 return $this->pageob;
98 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $pageob.

Referenced by getLegacyContent().

+ Here is the caller graph for this function:

◆ isRepositoryObject()

ilWikiFunctionsBlockGUI::isRepositoryObject ( )
protected

Returns whether block has a corresponding repository object.

Reimplemented from ilBlockGUI.

Definition at line 69 of file class.ilWikiFunctionsBlockGUI.php.

69 : bool
70 {
71 return false;
72 }

◆ setPageObject()

ilWikiFunctionsBlockGUI::setPageObject ( ilWikiPage  $a_pageob)

Definition at line 90 of file class.ilWikiFunctionsBlockGUI.php.

90 : void
91 {
92 $this->pageob = $a_pageob;
93 }

Field Documentation

◆ $block_type

ilWikiFunctionsBlockGUI::$block_type = "wikiside"
static

Definition at line 26 of file class.ilWikiFunctionsBlockGUI.php.

Referenced by getBlockType().

◆ $new_rendering

bool ilWikiFunctionsBlockGUI::$new_rendering = true
protected

Definition at line 109 of file class.ilWikiFunctionsBlockGUI.php.

◆ $pageob

ilWikiPage ilWikiFunctionsBlockGUI::$pageob
protected

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

Referenced by getPageObject().

◆ $ref_id

int ilWikiFunctionsBlockGUI::$ref_id
protected

Definition at line 28 of file class.ilWikiFunctionsBlockGUI.php.

◆ $st_data

ilWikiFunctionsBlockGUI::$st_data
static

Definition at line 27 of file class.ilWikiFunctionsBlockGUI.php.

◆ $wiki

ilObjWiki ilWikiFunctionsBlockGUI::$wiki
protected

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


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