[pmwiki-users] Here's markup for embedding issue lists from bugzilla in PmWiki

christian.ridderstrom at gmail.com christian.ridderstrom at gmail.com
Sun Apr 15 15:26:38 CDT 2007


At this wiki page
 	http://wiki.lyx.org/Devel/BuglistsForLyX150

I just created a special version of IncludeUrl() that let's me pull in 
several lists of bugs from Bugzilla. An example of the markup:

 	(:buglist keywords_type=nowords&keywords=fixedintrunk :)

And here's the PHP code (all of it, sorry, you'll only need parts of it)

// Enable a restricted version of includeurl for embedding 
// material from the repositor via TRAC 
if(true) {
   include_once("$FarmD/cookbook/includeurl.php");
   DisableMarkup("includeurl");  // Arbitrary URIs may not be included
   Markup('includesvn', 'directives',
          '/\\(:includesvn (.*?) (.*?)\\s*:\\)/ei',
          "IncludeSvn(\$pagename, PSS('$1'), PSS('$2'))");

   Markup('includeobject', 'directives',
          '/\\(:object LyxVCS:(.*?) (.*?)\\s*:\\)/ei',
          "IncludeObject(\$pagename, PSS('$1'), PSS('$2'))");

   Markup('includebugzilla', 'directives',
          '/\\(:buglist (.*?) (.*?)\\s*:\\)/ei',
          "IncludeBuglist(\$pagename, PSS('$1'), PSS('$2'))");

   function GetExternalHttp($uri) {
     return implode('',file(str_replace('&','&',$uri)));
   }

   $WikiStyleCSS[] = 'white-space';
   function IncludeSvn($pagename, $path, $opt) {
     $uri = "http://www.lyx.org/trac/browser/lyx-devel/trunk/"
       . $path . "?format=raw";
     $out = GetExternalHttp($uri);
     return $out;
     //    return IncludeUrl($pagename, $uri, $opt); 
}

   function IncludeObject($pagename, $path, $opt) {
     $uri = "http://www.lyx.org/trac/browser/".$path;
     return IncludeUrl($pagename, $uri, $opt);
   }

   function IncludeBuglist($pagename, $path, $opt) {
     $BugListUri = 'http://bugzilla.lyx.org/'
       . 'buglist.cgi?chfieldto=Now&cmdtype=doit&';
     $uri = $BugListUri.$path;
     return Keep("<a href='$uri'>Link to page embedded below</a><BR />")
       . IncludeUrl($pagename, $uri, $opt);
   }
  }


Cheers,
Christian

-- 
Christian Ridderström, +46-8-768 39 44               http://www.md.kth.se/~chr


More information about the pmwiki-users mailing list