wez             Wed May  5 14:52:03 2004 EDT

  Modified files:              
    /livedocs   style_mapping.php 
    /livedocs/themes/default    livedoc.css 
  Log:
  Hyperlink enable function names in highlighted code.
  Patch by Nuno, slightly modified.
  
  
http://cvs.php.net/diff.php/livedocs/style_mapping.php?r1=1.11&r2=1.12&ty=u
Index: livedocs/style_mapping.php
diff -u livedocs/style_mapping.php:1.11 livedocs/style_mapping.php:1.12
--- livedocs/style_mapping.php:1.11     Sat May  1 07:34:50 2004
+++ livedocs/style_mapping.php  Wed May  5 14:52:03 2004
@@ -18,7 +18,7 @@
 // | Helper functions for formatting elements                             |
 // +----------------------------------------------------------------------+
 //
-// $Id: style_mapping.php,v 1.11 2004/05/01 11:34:50 derick Exp $
+// $Id: style_mapping.php,v 1.12 2004/05/05 18:52:03 wez Exp $
 
 // almost XPATH.. ;-)
 $map = array(
@@ -270,6 +270,15 @@
                );
 }
 
+function format_listing_hyperlink_function($matches)
+{
+       global $lang;
+
+       $link = strtr($matches[1], array('_' => '-'));
+       $link = WEBBASE . (FORCE_DYNAMIC ? "?l=$lang&q=function.$link" : 
"$lang/function.$link.html");
+       return '<a class="phpfunc" href="' . $link . '">' . $matches[1] . '</a>(';
+}
+
 function format_listing($node) 
 {
        $content = trim($node->content);
@@ -310,6 +319,7 @@
                                        ),
                                        highlight_string($content, 1));
                        }
+                       $content = 
preg_replace_callback('{([\w_]+)(\s*</span>)(\s*<span\s+class="keyword">\s*\()}m', 
'format_listing_hyperlink_function', $content);
                        break;
                case 'shell':
                case 'html':
http://cvs.php.net/diff.php/livedocs/themes/default/livedoc.css?r1=1.4&r2=1.5&ty=u
Index: livedocs/themes/default/livedoc.css
diff -u livedocs/themes/default/livedoc.css:1.4 livedocs/themes/default/livedoc.css:1.5
--- livedocs/themes/default/livedoc.css:1.4     Tue May  4 21:37:13 2004
+++ livedocs/themes/default/livedoc.css Wed May  5 14:52:03 2004
@@ -1,4 +1,4 @@
-/* $Id: livedoc.css,v 1.4 2004/05/05 01:37:13 wez Exp $ */
+/* $Id: livedoc.css,v 1.5 2004/05/05 18:52:03 wez Exp $ */
 body {
     font-family: verdana;
     font-size: 11pt;
@@ -157,6 +157,14 @@
     font-size: 10pt;
 }
 
+div.phpcode a.phpfunc {
+       text-decoration: none;
+}
+
+div.phpcode a.phpfunc:hover {
+       text-decoration: underline;
+}
+
 div.shellcode, div.xmlcode, div.inicode, 
 div.htmlcode, div.screen, div.apache-confcode, 
 div.code, div.synopsis {

Reply via email to