ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilMWFakery Class Reference
+ Collaboration diagram for ilMWFakery:

Public Member Functions

 getSkin ()
 
 makeExternalLink ( $url, $text, $escape=true, $linktype='', $ns=null)
 
 markNoConversion ($text, $noParse=false)
 
 addExternalLink ()
 
 getNamespace ()
 

Detailed Description

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

Member Function Documentation

◆ addExternalLink()

ilMWFakery::addExternalLink ( )

Definition at line 92 of file class.ilMWParserAdapter.php.

92 {}

◆ getNamespace()

ilMWFakery::getNamespace ( )

Definition at line 94 of file class.ilMWParserAdapter.php.

94 { return null;}

◆ getSkin()

ilMWFakery::getSkin ( )

Definition at line 61 of file class.ilMWParserAdapter.php.

61 { return $this;}

◆ makeExternalLink()

ilMWFakery::makeExternalLink (   $url,
  $text,
  $escape = true,
  $linktype = '',
  $ns = null 
)

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

References $text, $url, and array.

65  {
66  //$style = $this->getExternalLinkAttributes( $url, $text, 'external ' . $linktype );
67  //global $wgNoFollowLinks, $wgNoFollowNsExceptions;
68  //if( $wgNoFollowLinks && !(isset($ns) && in_array($ns, $wgNoFollowNsExceptions)) ) {
69  // $style .= ' rel="nofollow"';
70  //}
71  $url = htmlspecialchars( $url );
72  if( $escape ) {
73  $text = htmlspecialchars( $text );
74  }
75 
76  // handle images
77  $urlpath = parse_url($url, PHP_URL_PATH);
78  $pi = pathinfo($urlpath);
79  if (in_array(strtolower($pi["extension"]), array("jpg", "jpeg", "gif", "png")))
80  {
81  return '<img src="'.$url.'" border="0" />';
82  }
83  else
84  {
85  return '<a href="'.$url.'" target="_blank" rel="noopener">'.$text.'</a>';
86  }
87  //return '<a href="'.$url.'"'.$style.'>'.$text.'</a>';
88  }
$url
Definition: shib_logout.php:72
Create styles array
The data for the language used.
$text

◆ markNoConversion()

ilMWFakery::markNoConversion (   $text,
  $noParse = false 
)

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

References $text.

90 {return $text;}
$text

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