/** * Converts the wiki [[page]] and [[text|page]] to HTML links. * * @param string $text * * @return string */ public static function wikiLinks($text) { return preg_replace_callback("|\\[\\[(?P<page>[\\w\\d\\-_]+)(\\|(?P<text>[\\s\\w\\d\\-_]+))?\\]\\]|", function ($matches) { $project = current_project(); if (!$project) { return $matches[0]; } if (!isset($matches['text'])) { $matches['text'] = $matches['page']; } return HTML::link($matches['text'], routePath('wiki_page', ['slug' => $matches['page']])); }, $text); }
print ' <a href="' . path("cpanel/feedback") . '" title="' . __(_("Messages")) . '"> <img src="' . $this->themePath . '/images/icons/feedback.png" alt="' . __(_("Feedback")) . '" class="no-border" /> <sup>' . $feedbackNotifications . '</sup> </a>'; } if ($galleryNotifications > 0) { print ' <a href="' . path("cpanel/comments/gallery") . '" title="' . __(_("Gallery Comments")) . '"> <img src="' . $this->themePath . '/images/icons/gallery.png" alt="' . __(_("Gallery")) . '" class="no-border" /> <sup>' . $galleryNotifications . '</sup> </a>'; } ?> </div> </div> <div id="route"> <strong><?php print __(_("You are in")); ?> :</strong> <?php print routePath(); ?> </div> <?php } else { ?> <br /> <?php } ?> </div>
/** * Get a profile link with the users gravatar. * * @param string $userEmail * @param string $userName * @param integer $userId * @param integer $size * * @return string */ function gravatar_profile_link($userEmail, $userName, $userId, $size = null) { return HTML::link(Gravatar::withString($userEmail, $userName, $size), routePath('user', ['id' => $userId])); }