Exemple #1
0
 protected function convertToLink($href, $label, $varspace = array())
 {
     $href = trim($href);
     if ($href === '') {
         return $label;
     }
     if (is_array($varspace) && count($varspace)) {
         $href = $this->replaceMarkup($href, $varspace);
     }
     if (strpos($href, '://') !== false) {
         // embed external link in header
         // externallink() is adding to renderer->doc() ...
         // --> remove from doc afterwards, thus store its length now
         $length = strlen($this->renderer->doc);
         $this->renderer->externallink($href, $label);
         // --> now extract rendered link from doc
         $label = substr($this->renderer->doc, $length);
         $this->renderer->doc = substr_replace($this->renderer->doc, '', $length);
     } else {
         // embed internal link in header
         resolve_pageid(getNS(self::getPageID()), $href, $exists);
         $label = $this->renderer->internallink($href, $label, NULL, true);
     }
     return $label;
 }
Exemple #2
0
 /**
  * list all installed plugins
  *
  * uses some of the original renderer methods
  *
  * @param string $type
  * @param Doku_Renderer_xhtml $renderer
  */
 function _plugins_xhtml($type, Doku_Renderer_xhtml $renderer)
 {
     global $lang;
     $renderer->doc .= '<ul>';
     $plugins = plugin_list($type);
     $plginfo = array();
     // remove subparts
     foreach ($plugins as $p) {
         if (!($po = plugin_load($type, $p))) {
             continue;
         }
         list($name, ) = explode('_', $p, 2);
         $plginfo[$name] = $po->getInfo();
     }
     // list them
     foreach ($plginfo as $info) {
         $renderer->doc .= '<li><div class="li">';
         $renderer->externallink($info['url'], $info['name']);
         $renderer->doc .= ' ';
         $renderer->doc .= '<em>' . $info['date'] . '</em>';
         $renderer->doc .= ' ';
         $renderer->doc .= $lang['by'];
         $renderer->doc .= ' ';
         $renderer->emaillink($info['email'], $info['author']);
         $renderer->doc .= '<br />';
         $renderer->doc .= strtr(hsc($info['desc']), array("\n" => "<br />"));
         $renderer->doc .= '</div></li>';
         unset($po);
     }
     $renderer->doc .= '</ul>';
 }