Example #1
0
?>
" type="audio/mpeg">
                </audio>
                <? endif ?>
            </li>
            <? endif ?>
            <? if (isset($search_semester_nr)) : ?>
            <li>
                        </li>
            <? endif ?>
            <? if (Navigation::hasItem('/links')) : ?>
            <? foreach (Navigation::getItem('/links') as $nav) : ?>
                <? if ($nav->isVisible()) : ?>
                    <li <? if ($nav->isActive()) echo 'class="active"'; ?>>
                    <a
                    <? if (is_internal_url($url = $nav->getURL())) : ?>
                        href="<?php 
echo URLHelper::getLink($url, $link_params);
?>
"
                    <? else : ?>
                        href="<?php 
echo htmlReady($url);
?>
" target="_blank"
                    <? endif ?>
                    <? if ($nav->getDescription()): ?>
                        title="<?php 
echo htmlReady($nav->getDescription());
?>
"
Example #2
0
 /**
  * Adding Stud.IP formatted code to the current page of the pdf.
  * Remember to call addPage first.
  * @param string $content Stud.IP formatted code
  */
 public function addContent($content)
 {
     preg_match_all("#\\[comment(=.*)?\\](.*)\\[/comment\\]#msU", $content, $matches);
     if (count($matches[0])) {
         $endnote .= "<br><br>" . _("Kommentare") . "<hr>";
         for ($i = 0; $i < count($matches[0]); $i++) {
             $endnote .= $i + 1 . ") " . htmlReady(substr($matches[1][$i], 1)) . ": " . htmlReady($matches[2][$i]) . "<br>";
         }
     }
     $content = preg_replace("#\\[comment(=.*)?\\](.*)\\[/comment\\]#emsU", '$this->addEndnote("//1", "//2")', $content);
     $content = formatReady($content, true, true, true, null);
     $content = str_replace("<table", "<table border=\"1\"", $content);
     // Since TCPDF cannot handle missing images at all, the content needs
     // to be cleaned from those (see tickets #2957, #3329 and #3688)
     $content = preg_replace_callback('/<img[^>]+src="(.*?)"[^>]*>/', function ($match) {
         $url = $match[1];
         // Detect possible html entities in url and remove them
         if (strpos($url, '&amp;') !== false) {
             $url = html_entity_decode($url);
         }
         // Handle optional media proxy
         if (Config::GetInstance()->LOAD_EXTERNAL_MEDIA) {
             $parsed = parse_url($url);
             // Detect media proxy
             if (strpos($parsed['path'], 'media_proxy') !== false && strpos($parsed['query'], 'url=') !== false) {
                 // Remove media proxy
                 parse_str($parsed['query'], $parameters);
                 $url = $parameters['url'];
             }
         }
         // Fetch headers from url, handle possible redirects
         do {
             $headers = get_headers($url, true);
             list(, $status) = explode(' ', $headers[0]);
             $url = $header['Location'] ?: $header['location'] ?: $url;
         } while (in_array($status, array(300, 301, 302, 303, 305, 307)));
         $status = $status ?: 404;
         // Replace image with link on error (and not internal), otherwise return sainitized
         // url
         return (!is_internal_url($url) || $status == 404) && $status >= 400 ? sprintf('[<a href="%s">%s</a>]', $url, basename($url)) : str_replace($match[1], $url, $match[0]);
     }, $content);
     $this->writeHTML($content . $endnote);
 }
Example #3
0
function isInternalLink($url)
{
    return is_internal_url(transformInternalIdnaLink($url));
}
Example #4
0
        <? if (substr($url = $nav->getURL(), 0, 1) == '#') : ?>
            <a href="<?php 
echo $url;
?>
" onclick="STUDIP.SkipLinks.setActiveTarget('<?php 
echo $url;
?>
');"  tabindex="<?php 
echo $i++;
?>
"><?php 
echo htmlReady($nav->getTitle());
?>
</a>
        <? else : ?>
            <? if (is_internal_url($url)) : ?>
                <a href="<?php 
echo URLHelper::getLink($url);
?>
" tabindex="<?php 
echo $i++;
?>
"><?php 
echo htmlReady($nav->getTitle());
?>
</a>
            <? else : ?>
                <a href="<?php 
echo htmlReady($url);
?>
" tabindex="<?php