示例#1
0
 function test_emaillink_with_media()
 {
     global $conf;
     $conf['mailguard'] = 'visible';
     $conf['userewrite'] = 2;
     $image = array('type' => 'internalmedia', 'src' => 'img.gif', 'title' => 'Some Image', 'align' => NULL, 'width' => 10, 'height' => 20, 'cache' => 'nocache', 'linking' => 'details');
     $p = new Doku_Renderer_xhtml();
     $p->emaillink('*****@*****.**', $image);
     $expect = '<a href="mailto:foo%20%5Bat%5D%20example%20%5Bdot%5D%20com" class="media" title="foo [at] example [dot] com"><img src="' . DOKU_BASE . 'lib/exe/fetch.php/img.gif?w=10&amp;h=20&amp;cache=nocache" class="media" title="Some Image" alt="Some Image" width="10" height="20" /></a>';
     $this->assertEqual($p->doc, $expect);
 }
示例#2
0
 /**
  * no obfuscation for email addresses
  */
 function emaillink($address, $name = NULL)
 {
     global $conf;
     $old = $conf['mailguard'];
     $conf['mailguard'] = 'none';
     parent::emaillink($address, $name);
     $conf['mailguard'] = $old;
 }
示例#3
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>';
 }