ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilWikiUtil Class Reference

Utility class for wiki. More...

+ Collaboration diagram for ilWikiUtil:

Static Public Member Functions

static replaceInternalLinks (string $s, int $a_wiki_id, bool $a_offline=false)
 This one is based on Mediawiki Parser->replaceInternalLinks since we display images in another way, only text links are processed. More...
 
static collectInternalLinks (string $s, int $a_wiki_id, bool $a_collect_non_ex=false, string $mode=IL_WIKI_MODE_COLLECT)
 Collect internal wiki links of a string. More...
 
static processInternalLinks (string $s, int $a_wiki_id, string $a_mode=IL_WIKI_MODE_REPLACE, bool $a_collect_non_ex=false, bool $a_offline=false)
 Process internal links (internal) More...
 
static removeUnsafeCharacters (string $a_str)
 
static makeLink (object $nt, int $a_wiki_id, string $text='', string $query='', string $trail='', string $prefix='', bool $a_offline=false)
 Make a wiki link, the following formats are supported: More...
 
static wfUrlProtocols ()
 From mediawiki GlobalFunctions.php. More...
 
static wfUrlencode (string $s)
 
static makeDbTitle (string $a_par)
 
static makeUrlTitle (string $a_par)
 
static splitTrail (string $trail)
 
static sendNotification (string $a_action, int $a_type, int $a_wiki_ref_id, int $a_page_id, ?string $a_comment=null)
 

Detailed Description

Utility class for wiki.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 46 of file class.ilWikiUtil.php.

Member Function Documentation

◆ collectInternalLinks()

static ilWikiUtil::collectInternalLinks ( string  $s,
int  $a_wiki_id,
bool  $a_collect_non_ex = false,
string  $mode = IL_WIKI_MODE_COLLECT 
)
static

Collect internal wiki links of a string.

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

References $log, and ilLoggerFactory\getLogger().

Referenced by ilWikiPage\afterUpdate(), WikiUtilTest\processInternalLinksCollect(), WikiUtilTest\processInternalLinksExtCollect(), ilWikiPage\rename(), and ilWikiPage\saveInternalLinks().

74  : array {
76 
77  $log->debug("collect interna links wiki id: " . $a_wiki_id . ", collect nonex: " . $a_collect_non_ex);
78 
79  $result = self::processInternalLinks(
80  $s,
81  $a_wiki_id,
82  $mode,
83  $a_collect_non_ex
84  );
85  $log->debug("content: " . $s);
86  $log->debug("found: " . print_r($result, true));
87  return $result;
88  }
static getLogger(string $a_component_id)
Get component logger.
$log
Definition: result.php:33
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ makeDbTitle()

◆ makeLink()

static ilWikiUtil::makeLink ( object  $nt,
int  $a_wiki_id,
string  $text = '',
string  $query = '',
string  $trail = '',
string  $prefix = '',
bool  $a_offline = false 
)
static

Make a wiki link, the following formats are supported:

[[Page Title]] [[Page Title|Presentation Text]] [[Page Title::Anchor]] [[Page Title::Anchor|Presentation Text]] [[#Anchor|Presentation Text]] (link to anchor on same wiki page)

Definition at line 303 of file class.ilWikiUtil.php.

References $DIC, ilWikiPage\_wikiPageExists(), and ilWikiPage\getPageIdForTitle().

Referenced by ilPCAMDPageList\modifyPageContentPostXsl().

311  : string {
312  global $DIC;
313 
314  $request = $DIC
315  ->wiki()
316  ->internal()
317  ->gui()
318  ->editing()
319  ->request();
320 
321  $ilCtrl = $DIC->ctrl();
322 
323  if (!is_object($nt)) {
324  # Fail gracefully
325  $retVal = "<!-- ERROR -->{$prefix}{$text}{$trail}";
326  } else {
327 
328  // remove anchor from text, define anchor
329  $anc = "";
330  if ($nt->mFragment != "") {
331  if (substr($text, strlen($text) - strlen("#" . $nt->mFragment)) === "#" . $nt->mFragment) {
332  $text = substr($text, 0, strlen($text) - strlen("#" . $nt->mFragment));
333  }
334  $anc = "#copganc_" . $nt->mFragment;
335  }
336 
337  # Separate the link trail from the rest of the link
338  // outcommented due to bug #14590
339  // list( $inside, $trail ) = ilWikiUtil::splitTrail( $trail );
340 
341  $retVal = '***' . $text . "***" . $trail;
342  $url_title = self::makeUrlTitle($nt->mTextform);
343  $db_title = self::makeDbTitle($nt->mTextform);
344  if ($db_title != "") {
345  $pg_exists = ilWikiPage::_wikiPageExists($a_wiki_id, $db_title);
346  } else {
347  // links on same page (only anchor used)
348  $pg_exists = true;
349  }
350 
351  //var_dump($nt);
352  //var_dump($inside);
353  //var_dump($trail);
354  $wiki_link_class = (!$pg_exists)
355  ? ' class="ilc_link_IntLink ilWikiPageMissing" '
356  : ' class="ilc_link_IntLink" ';
357 
358  if (!$a_offline) {
359  if ($url_title != "") {
360  $ilCtrl->setParameterByClass("ilobjwikigui", "page", $url_title);
361  $retVal = '<a ' . $wiki_link_class . ' href="' .
362  $ilCtrl->getLinkTargetByClass("ilobjwikigui", "gotoPage") . $anc .
363  '">' . $text . '</a>' . $trail;
364  $ilCtrl->setParameterByClass(
365  "ilobjwikigui",
366  "page",
367  $request->getPage()
368  );
369  } else {
370  $retVal = '<a ' . $wiki_link_class . ' href="' .
371  $anc .
372  '">' . $text . '</a>' . $trail;
373  }
374  } else {
375  if ($pg_exists) {
376  if ($db_title != "") {
377  $pg_id = ilWikiPage::getPageIdForTitle($a_wiki_id, $db_title);
378  $retVal = '<a ' . $wiki_link_class . ' href="' .
379  "wpg_" . $pg_id . ".html" . $anc .
380  '">' . $text . '</a>' . $trail;
381  } else {
382  $retVal = '<a ' . $wiki_link_class . ' href="' .
383  $anc .
384  '">' . $text . '</a>' . $trail;
385  }
386  } else {
387  $retVal = $text . $trail;
388  }
389  }
390  }
391  return $retVal;
392  }
global $DIC
Definition: feed.php:28
static getPageIdForTitle(int $a_wiki_id, string $a_title)
Get wiki page object for id and title.
static _wikiPageExists(int $a_wiki_id, string $a_title)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ makeUrlTitle()

◆ processInternalLinks()

static ilWikiUtil::processInternalLinks ( string  $s,
int  $a_wiki_id,
string  $a_mode = IL_WIKI_MODE_REPLACE,
bool  $a_collect_non_ex = false,
bool  $a_offline = false 
)
static

Process internal links (internal)

Returns
array|false|string

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

References Vendor\Package\$a, $GLOBALS, ilWikiPage\_wikiPageExists(), ILIAS\Repository\form(), IL_WIKI_MODE_COLLECT, IL_WIKI_MODE_EXT_COLLECT, IL_WIKI_MODE_REPLACE, and Title\newFromText().

101  {
102 
103  include_once("./Modules/Wiki/libs/Sanitizer.php");
104  $collect = array();
105  // both from mediawiki DefaulSettings.php
106  $wgLegalTitleChars = " %!\"$&'()*,\\-.\\/0-9:;=?@A-Z\\\\^_`a-z~\\x80-\\xFF+";
107 
108  // dummies for wiki globals
109  $GLOBALS["wgContLang"] = new class () {
110  public function getNsIndex($a_p): bool
111  {
112  return false;
113  }
114  public function lc($a_key): bool
115  {
116  return false;
117  }
118  };
119  $GLOBALS["wgInterWikiCache"] = false;
120 
121  # the % is needed to support urlencoded titles as well
122  //$tc = Title::legalChars().'#%';
123  $tc = $wgLegalTitleChars . '#%';
124 
125  //$sk = $this->mOptions->getSkin();
126 
127  #split the entire text string on occurences of [[
128  $a = explode('[[', ' ' . $s);
129  #get the first element (all text up to first [[), and remove the space we added
130  $s = array_shift($a);
131  $s = substr($s, 1);
132 
133  # Match a link having the form [[namespace:link|alternate]]trail
134  $e1 = "/^([{$tc}]+)(?:\\|(.+?))?]](.*)\$/sD";
135 
136  # Match cases where there is no "]]", which might still be images
137  // static $e1_img = FALSE;
138  // if ( !$e1_img ) { $e1_img = "/^([{$tc}]+)\\|(.*)\$/sD"; }
139 
140  # Match the end of a line for a word that's not followed by whitespace,
141  # e.g. in the case of 'The Arab al[[Razi]]', 'al' will be matched
142  // $e2 = wfMsgForContent( 'linkprefix' );
143 
144  /* $useLinkPrefixExtension = $wgContLang->linkPrefixExtension();
145  if( is_null( $this->mTitle ) ) {
146  throw new MWException( __METHOD__.": \$this->mTitle is null\n" );
147  }
148  $nottalk = !$this->mTitle->isTalkPage();*/
149  $nottalk = true;
150 
151  /* if ( $useLinkPrefixExtension ) {
152  $m = array();
153  if ( preg_match( $e2, $s, $m ) ) {
154  $first_prefix = $m[2];
155  } else {
156  $first_prefix = false;
157  }
158  } else {*/
159  $prefix = '';
160  // }
161 
162  $useSubpages = false;
163 
164  # Loop for each link
165  for ($k = 0; isset($a[$k]); $k++) {
166  $line = $a[$k];
167 
168 
169  $might_be_img = false;
170 
171  //wfProfileIn( "$fname-e1" );
172  if (preg_match($e1, $line, $m)) { # page with normal text or alt
173  $text = $m[2];
174  # If we get a ] at the beginning of $m[3] that means we have a link that's something like:
175  # [[Image:Foo.jpg|[http://example.com desc]]] <- having three ] in a row fucks up,
176  # the real problem is with the $e1 regex
177  # See bug 1300.
178  #
179  # Still some problems for cases where the ] is meant to be outside punctuation,
180  # and no image is in sight. See bug 2095.
181  #
182  if ($text !== '' &&
183  strpos($m[3], ']') === 0 &&
184  strpos($text, '[') !== false
185  ) {
186  $text .= ']'; # so that replaceExternalLinks($text) works later
187  $m[3] = substr($m[3], 1);
188  }
189  # fix up urlencoded title texts
190  if (strpos($m[1], '%') !== false) {
191  # Should anchors '#' also be rejected?
192  $m[1] = str_replace(array('<', '>'), array('&lt;', '&gt;'), urldecode($m[1]));
193  }
194  $trail = $m[3];
195  /* } elseif( preg_match($e1_img, $line, $m) ) { # Invalid, but might be an image with a link in its caption
196  $might_be_img = true;
197  $text = $m[2];
198  if ( strpos( $m[1], '%' ) !== false ) {
199  $m[1] = urldecode($m[1]);
200  }
201  $trail = "";*/
202  } else { # Invalid form; output directly
203  $s .= $prefix . '[[' . $line ;
204  //wfProfileOut( "$fname-e1" );
205  continue;
206  }
207  //wfProfileOut( "$fname-e1" );
208  //wfProfileIn( "$fname-misc" );
209 
210  # Don't allow internal links to pages containing
211  # PROTO: where PROTO is a valid URL protocol; these
212  # should be external links.
213  if (preg_match('/^\b%na' . self::wfUrlProtocols() . 'me/', $m[1])) {
214  $s .= $prefix . '[[' . $line ;
215  continue;
216  }
217 
218  # Make subpage if necessary
219  /* if( $useSubpages ) {
220  $link = $this->maybeDoSubpageLink( $m[1], $text );
221  } else {*/
222  $link = $m[1];
223  // }
224 
225  $noforce = (strpos($m[1], ':') !== 0);
226  if (!$noforce) {
227  # Strip off leading ':'
228  $link = substr($link, 1);
229  }
230 
231  // wfProfileOut( "$fname-misc" );
232  // wfProfileIn( "$fname-title" );
233 
234  $nt = Title::newFromText($link);
235 
236  if (!$nt) {
237  $s .= $prefix . '[[' . $line;
238  continue;
239  }
240 
241  $wasblank = ('' == $text);
242  if ($wasblank) {
243  $text = $link;
244  }
245 
246  // Media wiki performs an intermediate step here (Parser->makeLinkHolder)
247  if ($a_mode === IL_WIKI_MODE_REPLACE) {
248  $s .= self::makeLink(
249  $nt,
250  $a_wiki_id,
251  $text,
252  '',
253  $trail,
254  $prefix,
255  $a_offline
256  );
257  }
258  if ($a_mode === IL_WIKI_MODE_EXT_COLLECT) {
259  if (is_object($nt)) {
260  $url_title = self::makeUrlTitle($nt->mTextform);
261  $db_title = self::makeDbTitle($nt->mTextform);
262  [$inside, $trail] = self::splitTrail($trail);
263  $collect[] = array("nt" => $nt, "text" => $text,
264  "trail" => $trail, "db_title" => $db_title,
265  "url_title" => $url_title);
266  }
267  } else {
268  $db_title = self::makeDbTitle($nt->mTextform);
269 
270  if (($a_collect_non_ex || ilWikiPage::_wikiPageExists($a_wiki_id, $db_title))
271  &&
272  !in_array($db_title, $collect)) {
273  $collect[] = $db_title;
274  }
275  }
276  }
277 
278  //wfProfileOut( $fname );
279 
280  if ($a_mode === IL_WIKI_MODE_COLLECT ||
281  $a_mode === IL_WIKI_MODE_EXT_COLLECT) {
282  return $collect;
283  } else {
284  return $s;
285  }
286  }
static newFromText($text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
Definition: Title.php:114
if(!defined('UTF8_REPLACEMENT')) const IL_WIKI_MODE_REPLACE
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const IL_WIKI_MODE_COLLECT
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
form( $class_path, string $cmd)
const IL_WIKI_MODE_EXT_COLLECT
static _wikiPageExists(int $a_wiki_id, string $a_title)
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
+ Here is the call graph for this function:

◆ removeUnsafeCharacters()

static ilWikiUtil::removeUnsafeCharacters ( string  $a_str)
static

Definition at line 288 of file class.ilWikiUtil.php.

290  : string {
291  return str_replace(array("\x00", "\n", "\r", "\\", "'", '"', "\x1a"), "", $a_str);
292  }

◆ replaceInternalLinks()

static ilWikiUtil::replaceInternalLinks ( string  $s,
int  $a_wiki_id,
bool  $a_offline = false 
)
static

This one is based on Mediawiki Parser->replaceInternalLinks since we display images in another way, only text links are processed.

Definition at line 52 of file class.ilWikiUtil.php.

References IL_WIKI_MODE_REPLACE.

Referenced by ilWikiPageGUI\postOutputProcessing(), and WikiUtilTest\processInternalLinksReplace().

56  : string {
57  return self::processInternalLinks(
58  $s,
59  $a_wiki_id,
61  false,
62  $a_offline
63  );
64  }
if(!defined('UTF8_REPLACEMENT')) const IL_WIKI_MODE_REPLACE
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ sendNotification()

static ilWikiUtil::sendNotification ( string  $a_action,
int  $a_type,
int  $a_wiki_ref_id,
int  $a_page_id,
?string  $a_comment = null 
)
static

Definition at line 463 of file class.ilWikiUtil.php.

References $DIC, $ilUser, $log, $message, ilMail\_getInstallationSignature(), ilLanguageFactory\_getLanguageOfUser(), ilLink\_getLink(), ilObjUser\_lookupFullname(), ilObjUser\_lookupLogin(), ANONYMOUS_USER_ID, ilLoggerFactory\getLogger(), ilUserUtil\getNamePresentation(), ilNotification\getNotificationsForObject(), ilPageObjectGUI\setRawPageContent(), ilPageObject\truncateHTML(), ilNotification\TYPE_WIKI, ilNotification\TYPE_WIKI_PAGE, and ilNotification\updateNotificationTime().

Referenced by ilWikiPage\create(), ilWikiPage\delete(), ilWikiPageGUI\observeNoteAction(), and ilWikiPage\update().

469  : void {
470  global $DIC;
471 
473  $log->debug("start... vvvvvvvvvvvvvvvvvvvvvvvvvvv");
474 
475  $ilUser = $DIC->user();
476  $ilObjDataCache = $DIC["ilObjDataCache"];
477  $ilAccess = $DIC->access();
478 
479  if ($a_wiki_ref_id === 0) {
480  return;
481  }
482 
483  $wiki_id = $ilObjDataCache->lookupObjId($a_wiki_ref_id);
484  $wiki = new ilObjWiki($a_wiki_ref_id, true);
485  $page = new ilWikiPage($a_page_id);
486 
487  // #11138
488  $ignore_threshold = ($a_action === "comment");
489 
490  // 1st update will be converted to new - see below
491  if ($a_action === "new") {
492  return;
493  }
494 
495  $log->debug("-- get notifications");
496  if ($a_type == ilNotification::TYPE_WIKI_PAGE) {
497  $users = ilNotification::getNotificationsForObject($a_type, $a_page_id, null, $ignore_threshold);
498  $wiki_users = ilNotification::getNotificationsForObject(ilNotification::TYPE_WIKI, $wiki_id, $a_page_id, $ignore_threshold);
499  $users = array_merge($users, $wiki_users);
500  if (!count($users)) {
501  $log->debug("no notifications... ^^^^^^^^^^^^^^^^^^");
502  return;
503  }
504  } else {
505  $users = ilNotification::getNotificationsForObject(ilNotification::TYPE_WIKI, $wiki_id, $a_page_id, $ignore_threshold);
506  $log->debug("--->" . print_r($users));
507  if (!count($users)) {
508  $log->debug("no notifications... ^^^^^^^^^^^^^^^^^^");
509  return;
510  }
511  }
514 
515  // #15192 - should always be present
516  if ($a_page_id) {
517  // #18804 - see ilWikiPageGUI::preview()
518  $link = ilLink::_getLink(null, "wiki", [], "wpage_" . $a_page_id . "_" . $a_wiki_ref_id);
519  } else {
520  $link = ilLink::_getLink($a_wiki_ref_id);
521  }
522 
523  $log->debug("-- prepare content");
524  $pgui = new ilWikiPageGUI($page->getId());
525  $pgui->setRawPageContent(true);
526  $pgui->setAbstractOnly(true);
527  $pgui->setFileDownloadLink(".");
528  $pgui->setFullscreenLink(".");
529  $pgui->setSourcecodeDownloadScript(".");
530  $snippet = $pgui->showPage();
531  $snippet = ilPageObject::truncateHTML($snippet, 500, "...");
532 
533  // making things more readable
534  $snippet = str_replace(['<br/>', '<br />', '</p>', '</div>'], "\n", $snippet);
535 
536  $snippet = trim(strip_tags($snippet));
537 
538  // "fake" new (to enable snippet - if any)
539  $hist = $page->getHistoryEntries();
540  $current_version = array_shift($hist);
541  $current_version = $current_version["nr"] ?? 0;
542  if (!$current_version && $a_action !== "comment") {
543  $a_type = ilNotification::TYPE_WIKI;
544  $a_action = "new";
545  }
546 
547  $log->debug("-- sending mails");
548  $mails = [];
549  foreach (array_unique($users) as $idx => $user_id) {
550  if ($user_id != $ilUser->getId() &&
551  $ilAccess->checkAccessOfUser($user_id, 'read', '', $a_wiki_ref_id)) {
552  // use language of recipient to compose message
553  $ulng = ilLanguageFactory::_getLanguageOfUser($user_id);
554  $ulng->loadLanguageModule('wiki');
555 
556  if ($a_action === "comment") {
557  $subject = sprintf($ulng->txt('wiki_notification_comment_subject'), $wiki->getTitle(), $page->getTitle());
558  $message = sprintf($ulng->txt('wiki_change_notification_salutation'), ilObjUser::_lookupFullname($user_id)) . "\n\n";
559 
560  $message .= $ulng->txt('wiki_notification_' . $a_action) . ":\n\n";
561  $message .= $ulng->txt('wiki') . ": " . $wiki->getTitle() . "\n";
562  $message .= $ulng->txt('page') . ": " . $page->getTitle() . "\n";
563  $message .= $ulng->txt('wiki_commented_by') . ": " . ilUserUtil::getNamePresentation($ilUser->getId()) . "\n";
564 
565  // include comment/note text
566  if ($a_comment) {
567  $message .= "\n" . $ulng->txt('comment') . ":\n\"" . trim($a_comment) . "\"\n";
568  }
569 
570  $message .= "\n" . $ulng->txt('wiki_change_notification_page_link') . ": " . $link;
571  } else {
572  $subject = sprintf($ulng->txt('wiki_change_notification_subject'), $wiki->getTitle(), $page->getTitle());
573  $message = sprintf($ulng->txt('wiki_change_notification_salutation'), ilObjUser::_lookupFullname($user_id)) . "\n\n";
574 
575  if ($a_type == ilNotification::TYPE_WIKI_PAGE) {
576  // update/delete
577  $message .= $ulng->txt('wiki_change_notification_page_body_' . $a_action) . ":\n\n";
578  $message .= $ulng->txt('wiki') . ": " . $wiki->getTitle() . "\n";
579  $message .= $ulng->txt('page') . ": " . $page->getTitle() . "\n";
580  $message .= $ulng->txt('wiki_changed_by') . ": " . ilUserUtil::getNamePresentation($ilUser->getId()) . "\n";
581 
582  if ($snippet) {
583  $message .= "\n" . $ulng->txt('content') . "\n" .
584  "----------------------------------------\n" .
585  $snippet . "\n" .
586  "----------------------------------------\n";
587  }
588 
589  // include comment/note text
590  if ($a_comment) {
591  $message .= "\n" . $ulng->txt('comment') . ":\n\"" . trim($a_comment) . "\"\n";
592  }
593 
594  $message .= "\n" . $ulng->txt('wiki_change_notification_page_link') . ": " . $link;
595  } else {
596  // new
597  $message .= $ulng->txt('wiki_change_notification_body_' . $a_action) . ":\n\n";
598  $message .= $ulng->txt('wiki') . ": " . $wiki->getTitle() . "\n";
599  $message .= $ulng->txt('page') . ": " . $page->getTitle() . "\n";
600  $message .= $ulng->txt('wiki_changed_by') . ": " . ilUserUtil::getNamePresentation($ilUser->getId()) . "\n\n";
601 
602  if ($snippet) {
603  $message .= $ulng->txt('content') . "\n" .
604  "----------------------------------------\n" .
605  $snippet . "\n" .
606  "----------------------------------------\n\n";
607  }
608 
609  $message .= $ulng->txt('wiki_change_notification_link') . ": " . $link;
610  }
611  }
612 
613  $mail_obj = new ilMail(ANONYMOUS_USER_ID);
614  $mail_obj->appendInstallationSignature(true);
615  $log->debug("before enqueue ($user_id)");
616  /*
617  $mail_obj->enqueue(
618  ilObjUser::_lookupLogin($user_id),
619  "",
620  "",
621  $subject,
622  $message,
623  array()
624  );*/
625  $message .= ilMail::_getInstallationSignature();
626  $mails[] = new ilMailValueObject(
627  '',
628  ilObjUser::_lookupLogin($user_id),
629  '',
630  '',
631  $subject,
632  $message,
633  [],
634  false,
635  false
636  );
637  $log->debug("after enqueue");
638  } else {
639  unset($users[$idx]);
640  }
641  }
642  if (count($mails) > 0) {
643  $processor = new ilMassMailTaskProcessor();
644  $processor->run(
645  $mails,
647  "",
648  []
649  );
650  }
651  $log->debug("end... ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
652  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
static getLogger(string $a_component_id)
Get component logger.
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link="", bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
static _lookupFullname(int $a_user_id)
static getNotificationsForObject(int $type, int $id, ?int $page_id=null, bool $ignore_threshold=false)
Get all users/recipients for given object.
global $DIC
Definition: feed.php:28
static truncateHTML(string $a_text, int $a_length=100, string $a_ending='...', bool $a_exact=false, bool $a_consider_html=true)
Truncate (html) string.
static _getLanguageOfUser(int $a_usr_id)
Get language object of user.
$log
Definition: result.php:33
setRawPageContent(bool $a_rawpagecontent)
Set Get raw page content only.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static updateNotificationTime(int $type, int $id, array $user_ids, ?int $page_id=null, bool $activate_new_entries=true)
Update the last mail timestamp for given object and users.
$ilUser
Definition: imgupload.php:34
$message
Definition: xapiexit.php:32
static _getInstallationSignature()
static _lookupLogin(int $a_user_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ splitTrail()

static ilWikiUtil::splitTrail ( string  $trail)
static

Definition at line 445 of file class.ilWikiUtil.php.

447  : array {
448  $regex = '/^([a-z]+)(.*)$/sD';
449 
450  $inside = '';
451  if ('' != $trail) {
452  $m = array();
453 
454  if (preg_match($regex, $trail, $m)) {
455  $inside = $m[1];
456  $trail = $m[2];
457  }
458  }
459 
460  return array( $inside, $trail );
461  }

◆ wfUrlencode()

static ilWikiUtil::wfUrlencode ( string  $s)
static

Definition at line 423 of file class.ilWikiUtil.php.

Referenced by Title\secureAndSplit().

425  : string {
426  $s = urlencode($s);
427  return $s;
428  }
+ Here is the caller graph for this function:

◆ wfUrlProtocols()

static ilWikiUtil::wfUrlProtocols ( )
static

From mediawiki GlobalFunctions.php.

Returns
string

Definition at line 398 of file class.ilWikiUtil.php.

398  : string
399  {
400  $wgUrlProtocols = array(
401  'http://',
402  'https://',
403  'ftp://',
404  'irc://',
405  'gopher://',
406  'telnet://', // Well if we're going to support the above.. -ævar
407  'nntp://', // @bug 3808 RFC 1738
408  'worldwind://',
409  'mailto:',
410  'news:'
411  );
412 
413  // Support old-style $wgUrlProtocols strings, for backwards compatibility
414  // with LocalSettings files from 1.5
415  $protocols = array();
416  foreach ($wgUrlProtocols as $protocol) {
417  $protocols[] = preg_quote($protocol, '/');
418  }
419 
420  return implode('|', $protocols);
421  }

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