ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilWikiFunctionsBlockGUI Class Reference

BlockGUI class for wiki functions block. More...

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

Public Member Functions

 __construct ()
 Constructor. More...
 
 getBlockType ()
 
Returns
string
More...
 
 executeCommand ()
 execute command More...
 
 setPageObject ($a_pageob)
 Set Page Object. More...
 
 getPageObject ()
 Get Page Object. More...
 
 getHTML ()
 Get bloch HTML code. More...
 
 fillDataSection ()
 Fill data section. More...
 
- Public Member Functions inherited from ilBlockGUI
 getBlockType ()
 
 __construct ()
 Constructor. More...
 
 setData ($a_data)
 Set Data. More...
 
 getData ()
 Get Data. More...
 
 setPresentation (int $type)
 Set presentation. More...
 
 getPresentation ()
 Get presentation type. More...
 
 setBlockId ($a_block_id=0)
 Set Block Id. More...
 
 getBlockId ()
 Get Block Id. More...
 
 setGuiObject (&$a_gui_object)
 Set GuiObject. More...
 
 getGuiObject ()
 Get GuiObject. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setOffset ($a_offset)
 Set Offset. More...
 
 getOffset ()
 Get Offset. More...
 
 correctOffset ()
 
 setLimit ($a_limit)
 Set Limit. More...
 
 getLimit ()
 Get Limit. More...
 
 setEnableEdit ($a_enableedit)
 Set EnableEdit. More...
 
 getEnableEdit ()
 Get EnableEdit. More...
 
 setRepositoryMode ($a_repositorymode)
 Set RepositoryMode. More...
 
 getRepositoryMode ()
 Get RepositoryMode. More...
 
 setSubtitle ($a_subtitle)
 Set Subtitle. More...
 
 getSubtitle ()
 Get Subtitle. More...
 
 setRefId ($a_refid)
 Set Ref Id (only used if isRepositoryObject() is true). More...
 
 getRefId ()
 Get Ref Id (only used if isRepositoryObject() is true). More...
 
 setAdminCommands (bool $a_admincommands)
 Set Administration Commmands. More...
 
 getAdminCommands ()
 Get Administration Commmands. More...
 
 setEnableNumInfo ($a_enablenuminfo)
 Set Enable Item Number Info. More...
 
 getEnableNumInfo ()
 Get Enable Item Number Info. More...
 
 setProperties ($a_properties)
 This function is supposed to be used for block type specific properties, that should be inherited through ilColumnGUI->setBlockProperties. More...
 
 getProperty ($a_property)
 
 setProperty ($a_property, $a_value)
 
 setRowTemplate ($a_rowtemplatename, $a_rowtemplatedir="")
 Set Row Template Name. More...
 
 getNavParameter ()
 
 getConfigParameter ()
 
 getMoveParameter ()
 
 getRowTemplateName ()
 Get Row Template Name. More...
 
 getRowTemplateDir ()
 Get Row Template Directory. More...
 
 addBlockCommand (string $a_href, string $a_text, string $a_onclick="")
 Add Block Command. More...
 
 getBlockCommands ()
 Get Block commands. More...
 
 getHTML ()
 Get HTML. More...
 
 fillHeaderCommands ()
 Fill header commands block. More...
 
 fillHeaderTitleBlock ()
 Fill header title block (title and. More...
 
 setDataSection ($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 ($a_set)
 
 fillFooter ()
 
 fillPreviousNext ()
 Fill previous/next row. More...
 
 setPreviousNextLinks ()
 Get previous/next linkbar. More...
 
 getAsynch ()
 Use this for final get before sending asynchronous output (ajax) per echo to output. More...
 
 getPaginationViewControl ()
 Fill previous/next row. More...
 
 getHTMLNew ()
 Get HTML. More...
 

Static Public Member Functions

static getScreenMode ()
 Get Screen Mode for current command. More...
 
static getScreenMode ()
 Get Screen Mode for current command. More...
 

Static Public Attributes

static $block_type = "wikiside"
 
static $st_data
 

Protected Member Functions

 isRepositoryObject ()
 Returns whether block has a corresponding repository object.
Returns
bool
More...
 
 getLegacyContent ()
 Get legacy content.
Returns
string
More...
 
- Protected Member Functions inherited from ilBlockGUI
 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 initCommands ()
 Init commands. More...
 
 fillRowColor ($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...
 
 getNoItemFoundContent ()
 No item entry. More...
 

Protected Attributes

 $new_rendering = true
 
- Protected Attributes inherited from ilBlockGUI
 $ui
 
 $data = array()
 
 $enablenuminfo = true
 
 $footer_links = array()
 
 $block_id = 0
 
 $allow_moving = true
 
 $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 
 $block_commands = array()
 
 $max_count = false
 
 $close_command = false
 
 $image = false
 
 $property = false
 
 $nav_value = ""
 
 $css_row = ""
 
 $title = ""
 
 $admincommands = false
 
 $dropdown
 
 $tpl
 
 $main_tpl
 
 $user
 
 $ctrl
 
 $access
 
 $lng
 
 $obj_def
 
 $presentation
 
 $new_rendering = false
 

Additional Inherited Members

- 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
 

Detailed Description

BlockGUI class for wiki functions block.

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

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

Constructor & Destructor Documentation

◆ __construct()

ilWikiFunctionsBlockGUI::__construct ( )

Constructor.

Reimplemented from ilBlockGUI.

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

23 {
24 global $DIC;
25
26 $this->ctrl = $DIC->ctrl();
27 $this->lng = $DIC->language();
28 $this->user = $DIC->user();
29 $this->access = $DIC->access();
30 $lng = $DIC->language();
31
33
34 $lng->loadLanguageModule("wiki");
35 $this->setEnableNumInfo(false);
36
37 $this->setTitle($lng->txt("wiki_functions"));
38 $this->allow_moving = false;
39
40 $this->ref_id = (int) $_GET["ref_id"];
41
42 $this->setPresentation(self::PRES_SEC_LEG);
43 }
user()
Definition: user.php:4
$_GET["client_id"]
setPresentation(int $type)
Set presentation.
setTitle($a_title)
Set Title.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$DIC
Definition: xapitoken.php:46

References $_GET, $DIC, ilBlockGUI\$lng, ILIAS\GlobalScreen\Provider\__construct(), ilBlockGUI\setEnableNumInfo(), ilBlockGUI\setPresentation(), ilBlockGUI\setTitle(), and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilWikiFunctionsBlockGUI::executeCommand ( )

execute command

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

73 {
75
76 $next_class = $ilCtrl->getNextClass();
77 $cmd = $ilCtrl->getCmd("getHTML");
78
79 switch ($next_class) {
80 default:
81 return $this->$cmd();
82 }
83 }
global $ilCtrl
Definition: ilias.php:18

References ilBlockGUI\$ctrl, and $ilCtrl.

◆ fillDataSection()

ilWikiFunctionsBlockGUI::fillDataSection ( )

Fill data section.

Reimplemented from ilBlockGUI.

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

121 {
122 $this->setDataSection($this->getLegacyContent());
123 }
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
getLegacyContent()
Get legacy content.string

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

+ Here is the call graph for this function:

◆ getBlockType()

ilWikiFunctionsBlockGUI::getBlockType ( )

Returns
string

Reimplemented from ilBlockGUI.

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

48 : string
49 {
50 return self::$block_type;
51 }

References $block_type.

◆ getHTML()

ilWikiFunctionsBlockGUI::getHTML ( )

Get bloch HTML code.

Reimplemented from ilBlockGUI.

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

109 {
113
114 return parent::getHTML();
115 }
$ilUser
Definition: imgupload.php:18

References ilBlockGUI\$ctrl, $ilCtrl, $ilUser, ilBlockGUI\$lng, and ilBlockGUI\$user.

◆ getLegacyContent()

ilWikiFunctionsBlockGUI::getLegacyContent ( )
protected

Get legacy content.

Returns
string

Reimplemented from ilBlockGUI.

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

135 : string
136 {
139 $ilAccess = $this->access;
140
141 $tpl = new ilTemplate("tpl.wiki_side_block_content.html", true, true, "Modules/Wiki");
142
143 $wp = $this->getPageObject();
144
145 // info
146 $actions[] = array(
147 "txt" => $lng->txt("info_short"),
148 "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "infoScreen")
149 );
150
151 // recent changes
152 $actions[] = array(
153 "txt" => $lng->txt("wiki_recent_changes"),
154 "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "recentChanges")
155 );
156
157 foreach ($actions as $a) {
158 $tpl->setCurrentBlock("action");
159 $tpl->setVariable("HREF", $a["href"]);
160 $tpl->setVariable("TXT", $a["txt"]);
161 $tpl->parseCurrentBlock();
162
163 $tpl->touchBlock("item");
164 }
165
166
167 $actions = array();
168
169 // all pages
170 $actions[] = array(
171 "txt" => $lng->txt("wiki_all_pages"),
172 "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "allPages")
173 );
174
175 // new pages
176 $actions[] = array(
177 "txt" => $lng->txt("wiki_new_pages"),
178 "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "newPages")
179 );
180
181 // popular pages
182 $actions[] = array(
183 "txt" => $lng->txt("wiki_popular_pages"),
184 "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "popularPages")
185 );
186
187 // orphaned pages
188 $actions[] = array(
189 "txt" => $lng->txt("wiki_orphaned_pages"),
190 "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "orphanedPages")
191 );
192
193
194 // page lists
195 include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
196 $list = new ilAdvancedSelectionListGUI();
197 $list->setListTitle($lng->txt("wiki_page_lists"));
199 $list->setId("wiki_pglists");
200
201 foreach ($actions as $a) {
202 $list->addItem(
203 $a["txt"],
204 "",
205 $a["href"]
206 );
207 }
208 $tpl->setCurrentBlock("plain");
209 $tpl->setVariable("PLAIN", $list->getHTML());
210 $tpl->parseCurrentBlock();
211 $tpl->touchBlock("item");
212
213
214 // page actions
215 $list = new ilAdvancedSelectionListGUI();
217 $list->setListTitle($lng->txt("wiki_page_actions"));
218 $list->setId("wiki_pgactions");
219
220 if ($ilAccess->checkAccess("write", "", $this->ref_id)) {
221 // rating
222 if (ilObjWiki::_lookupRating($this->getPageObject()->getWikiId())) {
223 if (!$this->getPageObject()->getRating()) {
224 $list->addItem(
225 $lng->txt("wiki_activate_page_rating"),
226 "",
227 $ilCtrl->getLinkTargetByClass("ilwikipagegui", "activateWikiPageRating")
228 );
229 } else {
230 $list->addItem(
231 $lng->txt("wiki_deactivate_page_rating"),
232 "",
233 $ilCtrl->getLinkTargetByClass("ilwikipagegui", "deactivateWikiPageRating")
234 );
235 }
236 }
237 }
238
239 if ($ilAccess->checkAccess("write", "", $this->ref_id) ||
240 $ilAccess->checkAccess("edit_page_meta", "", $this->ref_id)) {
241 // unhide advmd?
242 include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php';
243 if ((bool) sizeof(ilAdvancedMDRecord::_getSelectedRecordsByObject("wiki", $this->ref_id, "wpg")) &&
245 $list->addItem(
246 $lng->txt("wiki_unhide_meta_adv_records"),
247 "",
248 $ilCtrl->getLinkTargetByClass("ilwikipagegui", "unhideAdvancedMetaData")
249 );
250 }
251 }
252
253 if (($ilAccess->checkAccess("edit_content", "", $this->ref_id) && !$this->getPageObject()->getBlocked())
254 || $ilAccess->checkAccess("write", "", $this->ref_id)) {
255 // rename
256 $list->addItem(
257 $lng->txt("wiki_rename_page"),
258 "",
259 $ilCtrl->getLinkTargetByClass("ilwikipagegui", "renameWikiPage")
260 );
261 }
262
263 include_once("./Modules/Wiki/classes/class.ilWikiPerm.php");
264 if (ilWikiPerm::check("activate_wiki_protection", $this->ref_id)) {
265 // block/unblock
266 if ($this->getPageObject()->getBlocked()) {
267 $list->addItem(
268 $lng->txt("wiki_unblock_page"),
269 "",
270 $ilCtrl->getLinkTargetByClass("ilwikipagegui", "unblockWikiPage")
271 );
272 } else {
273 $list->addItem(
274 $lng->txt("wiki_block_page"),
275 "",
276 $ilCtrl->getLinkTargetByClass("ilwikipagegui", "blockWikiPage")
277 );
278 }
279 }
280
281 include_once("./Modules/Wiki/classes/class.ilWikiPerm.php");
282 if (ilWikiPerm::check("delete_wiki_pages", $this->ref_id)) {
283 // delete page
284 $st_page = ilObjWiki::_lookupStartPage($this->getPageObject()->getParentId());
285 if ($st_page != $this->getPageObject()->getTitle()) {
286 $list->addItem(
287 $lng->txt("wiki_delete_page"),
288 "",
289 $ilCtrl->getLinkTargetByClass("ilwikipagegui", "deleteWikiPageConfirmationScreen")
290 );
291 }
292 }
293
294 if ($ilAccess->checkAccess("write", "", $this->ref_id)) {
295 include_once "Modules/Wiki/classes/class.ilWikiPageTemplate.php";
296 $wpt = new ilWikiPageTemplate($this->getPageObject()->getParentId());
297 if (!$wpt->isPageTemplate($this->getPageObject()->getId())) {
298 $list->addItem(
299 $lng->txt("wiki_add_template"),
300 "",
301 $ilCtrl->getLinkTargetByClass("ilwikipagetemplategui", "addPageTemplateFromPageAction")
302 );
303 } else {
304 $list->addItem(
305 $lng->txt("wiki_remove_template_status"),
306 "",
307 $ilCtrl->getLinkTargetByClass("ilwikipagetemplategui", "removePageTemplateFromPageAction")
308 );
309 }
310 }
311
312 if ($ilAccess->checkAccess("write", "", $this->ref_id) ||
313 $ilAccess->checkAccess("read", "", $this->ref_id)) {
314 $tpl->setCurrentBlock("plain");
315 $tpl->setVariable("PLAIN", $list->getHTML());
316 $tpl->parseCurrentBlock();
317 $tpl->touchBlock("item");
318 }
319
320 // permissions
321 // if ($ilAccess->checkAccess('edit_permission', "", $this->ref_id))
322 // {
323 // $actions[] = array(
324 // "txt" => $lng->txt("perm_settings"),
325 // "href" => $ilCtrl->getLinkTargetByClass(array("ilobjwikigui", "ilpermissiongui"), "perm")
326 // );
327 // }
328
329 $actions = array();
330
331 // settings
332 if ($ilAccess->checkAccess('write', "", $this->ref_id)) {
333 $actions[] = array(
334 "txt" => $lng->txt("wiki_contributors"),
335 "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "listContributors")
336 );
337 }
338
339 // manage
340 if (ilWikiPerm::check("wiki_html_export", $this->ref_id)) {
341 $actions[] = array(
342 "txt" => $lng->txt("wiki_html_export"),
343 "id" => "il_wiki_user_export",
344 "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "initUserHTMLExport")
345 );
346 }
347
348 // manage
349 if ($ilAccess->checkAccess('write', "", $this->ref_id)) {
350 $actions[] = array(
351 "txt" => $lng->txt("settings"),
352 "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "editSettings")
353 );
354 } elseif ($ilAccess->checkAccess('statistics_read', "", $this->ref_id)) {
355 $actions[] = array(
356 "txt" => $lng->txt("statistics"),
357 "href" => $ilCtrl->getLinkTargetByClass(array("ilobjwikigui", "ilwikistatgui"), "initial")
358 );
359 }
360
361 foreach ($actions as $a) {
362 $tpl->setCurrentBlock("action");
363 $tpl->setVariable("HREF", $a["href"]);
364 $tpl->setVariable("TXT", $a["txt"]);
365 if ($a["id"] != "") {
366 $tpl->setVariable("ACT_ID", "id='" . $a["id"] . "'");
367 }
368 $tpl->parseCurrentBlock();
369
370 $tpl->touchBlock("item");
371 }
372
373 return $tpl->get();
374 }
static _getSelectedRecordsByObject($a_obj_type, $a_ref_id, $a_sub_type="")
Get selected records by object.
User interface class for advanced drop-down selection lists.
getTitle()
Get Title.
static _lookupStartPage($a_wiki_id)
Lookup start page.
static _lookupRating($a_wiki_id)
Lookup whether rating is activated.
special template class to simplify handling of ITX/PEAR
static lookupAdvancedMetadataHidden($a_page_id)
static check($a_perm, $a_ref_id, $a_cmd="")
Check permission.
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples

References Vendor\Package\$a, ilBlockGUI\$access, ilBlockGUI\$ctrl, $ilCtrl, ilBlockGUI\$lng, ilBlockGUI\$tpl, ilAdvancedMDRecord\_getSelectedRecordsByObject(), ilObjWiki\_lookupRating(), ilObjWiki\_lookupStartPage(), ilWikiPerm\check(), getPageObject(), ilBlockGUI\getTitle(), ilWikiPage\lookupAdvancedMetadataHidden(), and ilAdvancedSelectionListGUI\STYLE_LINK.

Referenced by fillDataSection().

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

◆ getPageObject()

ilWikiFunctionsBlockGUI::getPageObject ( )

Get Page Object.

Returns
int Page Object

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

101 {
102 return $this->pageob;
103 }

Referenced by getLegacyContent().

+ Here is the caller graph for this function:

◆ getScreenMode()

static ilWikiFunctionsBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

Reimplemented from ilBlockGUI.

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

65 {
66 return IL_SCREEN_SIDE;
67 }
const IL_SCREEN_SIDE

References IL_SCREEN_SIDE.

◆ isRepositoryObject()

ilWikiFunctionsBlockGUI::isRepositoryObject ( )
protected

Returns whether block has a corresponding repository object.

Returns
bool

Reimplemented from ilBlockGUI.

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

56 : bool
57 {
58 return false;
59 }

◆ setPageObject()

ilWikiFunctionsBlockGUI::setPageObject (   $a_pageob)

Set Page Object.

Parameters
int$a_pageobPage Object

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

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

Field Documentation

◆ $block_type

ilWikiFunctionsBlockGUI::$block_type = "wikiside"
static

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

Referenced by getBlockType().

◆ $new_rendering

ilWikiFunctionsBlockGUI::$new_rendering = true
protected

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

◆ $st_data

ilWikiFunctionsBlockGUI::$st_data
static

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


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