ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 ()
 
- 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 ()
 
 checkOffset (int $offset)
 
 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="", ?RoundTrip $modal=null)
 
 getBlockCommands ()
 
 getHTML ()
 
 getAsynch ()
 Use this for final get before sending asynchronous output (ajax) per echo to output. More...
 
 getPaginationViewControl ()
 Fill previous/next row. More...
 
 getViewControlsForPanel ()
 
 sortObject ()
 
 addSortOption (string $option, string $label, bool $active)
 
 setSortTarget (string $target)
 
 addPresentation (string $label, string $target, bool $active)
 
 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 ()
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 
 getLegacyContent ()
 Get legacy content. 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...
 
 getActionsForPanel ()
 
 send (string $output)
 Send. More...
 

Protected Attributes

ILIAS Wiki InternalGUIService $gui
 
int $wpg_id
 
int $ref_id
 
ilWikiPage $pageob
 
ilObjWiki $wiki
 
- Protected Attributes inherited from ilBlockGUI
ILIAS UI Renderer $renderer
 
Factory $factory
 
object $gui_object
 
ILIAS Container Block StandardGUIRequest $request
 
ILIAS Container 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
 

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 34 of file class.ilWikiFunctionsBlockGUI.php.

35 {
36 global $DIC;
37
39 ->wiki()
40 ->internal()
41 ->gui()
42 ->request();
43
44 $this->gui = $DIC->wiki()
45 ->internal()
46 ->gui();
47
48 $this->ctrl = $DIC->ctrl();
49 $this->lng = $DIC->language();
50 $this->user = $DIC->user();
51 $this->access = $DIC->access();
52 $lng = $DIC->language();
53
55
56 $lng->loadLanguageModule("wiki");
57 $this->setEnableNumInfo(false);
58
59 $this->setTitle($lng->txt("wiki_functions"));
60 $this->allow_moving = false;
61
62 $this->ref_id = $request->getRefId();
63 $this->wpg_id = $request->getWikiPageId();
64
65 $this->wiki = new ilObjWiki($this->ref_id);
66
67 $this->setPresentation(self::PRES_SEC_LEG);
68 }
ilLanguage $lng
setTitle(string $a_title)
setPresentation(int $type)
ILIAS Container 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...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

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 83 of file class.ilWikiFunctionsBlockGUI.php.

84 {
85 $ilCtrl = $this->ctrl;
86
87 $next_class = $ilCtrl->getNextClass();
88 $cmd = $ilCtrl->getCmd("getHTML");
89
90 switch ($next_class) {
91 default:
92 return $this->$cmd();
93 }
94 }
getNextClass($a_gui_class=null)
@inheritDoc

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

+ Here is the call graph for this function:

◆ getBlockType()

ilWikiFunctionsBlockGUI::getBlockType ( )

Reimplemented from ilBlockGUI.

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

70 : string
71 {
72 return self::$block_type;
73 }

References $block_type.

◆ getLegacyContent()

ilWikiFunctionsBlockGUI::getLegacyContent ( )
protected

Get legacy content.

Returns
string

Reimplemented from ilBlockGUI.

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

105 : string
106 {
107 $ilCtrl = $this->ctrl;
109 $ilAccess = $this->access;
110 $ui_factory = $this->gui->ui()->factory();
111 $ui_renderer = $this->gui->ui()->renderer();
112
113 $tpl = new ilTemplate("tpl.wiki_side_block_content.html", true, true, "components/ILIAS/Wiki");
114
115 $wp = $this->getPageObject();
116 $ilCtrl->setParameterByClass(ilWikiPageGUI::class, "wpg_id", $this->wpg_id);
117
118 // info
119 $actions[] = array(
120 "txt" => $lng->txt("info_short"),
121 "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "infoScreen")
122 );
123
124 // recent changes
125 $actions[] = array(
126 "txt" => $lng->txt("wiki_recent_changes"),
127 "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "recentChanges")
128 );
129
130 foreach ($actions as $a) {
131 $tpl->setCurrentBlock("action");
132 $tpl->setVariable("HREF", $a["href"]);
133 $tpl->setVariable("TXT", $a["txt"]);
135
136 $tpl->touchBlock("item");
137 }
138
139
140 $actions = array();
141
142 // all pages
143 $actions[] = array(
144 "txt" => $lng->txt("wiki_all_pages"),
145 "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "allPages")
146 );
147
148 // new pages
149 $actions[] = array(
150 "txt" => $lng->txt("wiki_new_pages"),
151 "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "newPages")
152 );
153
154 // popular pages
155 $actions[] = array(
156 "txt" => $lng->txt("wiki_popular_pages"),
157 "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "popularPages")
158 );
159
160 // orphaned pages
161 $actions[] = array(
162 "txt" => $lng->txt("wiki_orphaned_pages"),
163 "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "orphanedPages")
164 );
165
166
167 // page lists
168 $dd_actions = [];
169 foreach ($actions as $a) {
170 $dd_actions[] = $ui_factory->link()->standard(
171 $a["txt"],
172 $a["href"]
173 );
174 }
175 $dd = $ui_factory->dropdown()->standard($dd_actions)->withLabel($lng->txt("wiki_page_lists"));
176 $tpl->setCurrentBlock("plain");
177 $tpl->setVariable("PLAIN", $ui_renderer->render($dd));
179 $tpl->touchBlock("item");
180
181
182 // page actions
183 $dd_actions = [];
184
185 if ($ilAccess->checkAccess("write", "", $this->ref_id)) {
186 // rating
187 if (ilObjWiki::_lookupRating($this->getPageObject()->getWikiId())) {
188 if (!$this->getPageObject()->getRating()) {
189 $dd_actions[] = $ui_factory->link()->standard(
190 $lng->txt("wiki_activate_page_rating"),
191 $ilCtrl->getLinkTargetByClass("ilwikipagegui", "activateWikiPageRating")
192 );
193 } else {
194 $dd_actions[] = $ui_factory->link()->standard(
195 $lng->txt("wiki_deactivate_page_rating"),
196 $ilCtrl->getLinkTargetByClass("ilwikipagegui", "deactivateWikiPageRating")
197 );
198 }
199 }
200 }
201
202 if ($ilAccess->checkAccess("write", "", $this->ref_id) ||
203 $ilAccess->checkAccess("edit_page_meta", "", $this->ref_id)) {
204 // unhide advmd?
205 if (count(ilAdvancedMDRecord::_getSelectedRecordsByObject("wiki", $this->ref_id, "wpg")) &&
207 $dd_actions[] = $ui_factory->link()->standard(
208 $lng->txt("wiki_unhide_meta_adv_records"),
209 $ilCtrl->getLinkTargetByClass("ilwikipagegui", "unhideAdvancedMetaData")
210 );
211 }
212 }
213
214 if (($ilAccess->checkAccess("edit_content", "", $this->ref_id) && !$this->getPageObject()->getBlocked())
215 || $ilAccess->checkAccess("write", "", $this->ref_id)) {
216 // rename
217 $dd_actions[] = $ui_factory->link()->standard(
218 $lng->txt("wiki_rename_page"),
219 $ilCtrl->getLinkTargetByClass("ilwikipagegui", "renameWikiPage")
220 );
221 }
222
223 if (ilWikiPerm::check("activate_wiki_protection", $this->ref_id)) {
224 // block/unblock
225 if ($this->getPageObject()->getBlocked()) {
226 $dd_actions[] = $ui_factory->link()->standard(
227 $lng->txt("wiki_unblock_page"),
228 $ilCtrl->getLinkTargetByClass("ilwikipagegui", "unblockWikiPage")
229 );
230 } else {
231 $dd_actions[] = $ui_factory->link()->standard(
232 $lng->txt("wiki_block_page"),
233 $ilCtrl->getLinkTargetByClass("ilwikipagegui", "blockWikiPage")
234 );
235 }
236 }
237
238 if (ilWikiPerm::check("delete_wiki_pages", $this->ref_id)) {
239 // delete page
240 $st_page = ilObjWiki::_lookupStartPage($this->getPageObject()->getParentId());
241 if ($st_page !== $this->getPageObject()->getTitle()) {
242 $dd_actions[] = $ui_factory->link()->standard(
243 $lng->txt("wiki_delete_page"),
244 $ilCtrl->getLinkTargetByClass("ilwikipagegui", "deleteWikiPageConfirmationScreen")
245 );
246 }
247 }
248
249 if ($ilAccess->checkAccess("write", "", $this->ref_id)) {
250 $wpt = new ilWikiPageTemplate($this->getPageObject()->getParentId());
251 $ilCtrl->setParameterByClass(ilWikiPageTemplateGUI::class, "wpg_id", $this->getPageObject()->getId());
252 if (!$wpt->isPageTemplate($this->getPageObject()->getId())) {
253 $dd_actions[] = $ui_factory->link()->standard(
254 $lng->txt("wiki_add_template"),
255 $ilCtrl->getLinkTargetByClass("ilwikipagetemplategui", "addPageTemplateFromPageAction")
256 );
257 } else {
258 $dd_actions[] = $ui_factory->link()->standard(
259 $lng->txt("wiki_remove_template_status"),
260 $ilCtrl->getLinkTargetByClass("ilwikipagetemplategui", "removePageTemplateFromPageAction")
261 );
262 }
263 }
264
265 $dd = $ui_factory->dropdown()->standard($dd_actions)->withLabel($lng->txt("wiki_page_actions"));
266
267 if ($ilAccess->checkAccess("write", "", $this->ref_id) ||
268 $ilAccess->checkAccess("read", "", $this->ref_id)) {
269 $tpl->setCurrentBlock("plain");
270 $tpl->setVariable("PLAIN", $ui_renderer->render($dd));
272 $tpl->touchBlock("item");
273 }
274
275 // permissions
276 // if ($ilAccess->checkAccess('edit_permission', "", $this->ref_id))
277 // {
278 // $actions[] = array(
279 // "txt" => $lng->txt("perm_settings"),
280 // "href" => $ilCtrl->getLinkTargetByClass(array("ilobjwikigui", "ilpermissiongui"), "perm")
281 // );
282 // }
283
284 $actions = array();
285
286 // settings
287 if ($ilAccess->checkAccess('write', "", $this->ref_id)) {
288 $actions[] = array(
289 "txt" => $lng->txt("wiki_contributors"),
290 "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "listContributors")
291 );
292 }
293
294 // manage
295 if (ilWikiPerm::check("wiki_html_export", $this->ref_id)) {
296 if (!$this->wiki->isCommentsExportPossible()) {
297 $actions[] = array(
298 "txt" => $lng->txt("wiki_html_export"),
299 "id" => "il_wiki_user_export",
300 "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "initUserHTMLExport")
301 );
302 } else {
303 $this->lng->loadLanguageModule("note");
304 $comments_helper = new \ILIAS\Notes\Export\ExportHelperGUI();
305 $comments_modal = $comments_helper->getCommentIncludeModalDialog(
306 $this->lng->txt("wiki_html_export"),
307 $this->lng->txt("note_html_export_include_comments"),
308 "il.Wiki.Pres.performHTMLExport();",
309 "il.Wiki.Pres.performHTMLExportWithComments();",
310 true
311 );
312 $actions[] = array(
313 "txt" => $lng->txt("wiki_html_export"),
314 "modal" => $comments_modal,
315 "id" => "il_wiki_user_export2",
316 );
317 }
318 }
319
320 // manage
321 if ($ilAccess->checkAccess('write', "", $this->ref_id)) {
322 $actions[] = array(
323 "txt" => $lng->txt("settings"),
324 "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "editSettings")
325 );
326 } elseif ($ilAccess->checkAccess('statistics_read', "", $this->ref_id)) {
327 $actions[] = array(
328 "txt" => $lng->txt("statistics"),
329 "href" => $ilCtrl->getLinkTargetByClass(array("ilobjwikigui", "ilwikistatgui"), "initial")
330 );
331 }
332
333 $modal_html = "";
334 foreach ($actions as $a) {
335 $tpl->setCurrentBlock("action");
336 if (($a["modal"] ?? "") != "") {
337 $signal = $a["modal"]->getShowSignal();
338 $onclick = "$(document).trigger('" . $signal . "', {'id': '" . $signal . "','triggerer':$(this), 'options': JSON.parse('[]')}); return false;";
339 $tpl->setVariable("ONCLICK", ' onclick="' . $onclick . '" ');
340 $tpl->setVariable("HREF", "#");
341 $modal_html .= $this->ui->renderer()->render($a["modal"]);
342 } else {
343 $tpl->setVariable("HREF", $a["href"]);
344 }
345 $tpl->setVariable("TXT", $a["txt"]);
346 if (($a["id"] ?? "") != "") {
347 $tpl->setVariable("ACT_ID", "id='" . $a["id"] . "'");
348 }
350
351 $tpl->touchBlock("item");
352 }
353
354 return $tpl->get() . $modal_html;
355 }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:544
static _getSelectedRecordsByObject(string $a_obj_type, int $a_id, string $a_sub_type="", bool $is_ref_id=true)
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(), ilTemplate\touchBlock(), ilLanguage\txt(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ getPageObject()

ilWikiFunctionsBlockGUI::getPageObject ( )

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

101 : ilWikiPage
102 {
103 return $this->pageob;
104 }
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 75 of file class.ilWikiFunctionsBlockGUI.php.

75 : bool
76 {
77 return false;
78 }

◆ setPageObject()

ilWikiFunctionsBlockGUI::setPageObject ( ilWikiPage  $a_pageob)

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

96 : void
97 {
98 $this->pageob = $a_pageob;
99 }

Field Documentation

◆ $block_type

ilWikiFunctionsBlockGUI::$block_type = "wikiside"
static

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

Referenced by getBlockType().

◆ $gui

ILIAS Wiki InternalGUIService ilWikiFunctionsBlockGUI::$gui
protected

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

◆ $pageob

ilWikiPage ilWikiFunctionsBlockGUI::$pageob
protected

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

Referenced by getPageObject().

◆ $ref_id

int ilWikiFunctionsBlockGUI::$ref_id
protected

Definition at line 30 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 32 of file class.ilWikiFunctionsBlockGUI.php.

◆ $wpg_id

int ilWikiFunctionsBlockGUI::$wpg_id
protected

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


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