This is an automated email from the ASF dual-hosted git repository.

cmarcum pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/openoffice-mwiki.git


The following commit(s) were added to refs/heads/main by this push:
     new 54edb91  add updated OOoIDLtags.php
     new d02c457  Merge pull request #1 from cbmarcum/fix-idl-tags
54edb91 is described below

commit 54edb917ddd551c35b88e440f469c378101b5c09
Author: cbmarcum <carl.mar...@codebuilders.net>
AuthorDate: Tue Dec 15 18:17:30 2020 -0500

    add updated OOoIDLtags.php
---
 OOoIDLtags.php | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 81 insertions(+)

diff --git a/OOoIDLtags.php b/OOoIDLtags.php
new file mode 100755
index 0000000..71415ed
--- /dev/null
+++ b/OOoIDLtags.php
@@ -0,0 +1,81 @@
+<?php
+/**
+ * IDL Tag extension
+ * The IDLTagExtension was written to manage the IDL links in the 
OpenOffice.org Developer's Guide. 
+ * The extension converts Java paths to links back to the online IDL 
documentation.
+ * @version 1.1.0
+ * @link http://wiki.openoffice.org/wiki/Wiki_maintenance/IDLTagExtension
+ */
+
+if ( !defined( 'MEDIAWIKI' ) ) {
+       die( 'This file is a MediaWiki extension, it is not a valid entry 
point' );
+}
+
+// Extension credits that will show up on Special:Version
+$wgExtensionCredits['parserhook'][] = array(
+       'name' => 'IDL Tags',
+       'version' => '1.1.0',
+       'author' => array( 'Clayton Cornell', 'Terry Ellison' ),
+       'description' => 'Manage the IDL links in the OOo Dev Guide ',
+       'url' => 
'http://wiki.openoffice.org/wiki/Wiki_maintenance/IDLTagExtension',
+);
+
+global $wgExtIDLtags;
+$wgExtIDLtags           = new RenderIDLtags;
+$wgExtensionFunctions[] = array( &$wgExtIDLtags, 'oooIDLTags' );
+
+class RenderIDLtags { 
+
+       function oooIDLTags() {
+               global $wgParser;
+               $wgParser->setHook( 'idl', array( &$this, 'renderIDL' ) );
+               $wgParser->setHook( 'idlm', array( &$this, 'renderIDLM' ) );
+               $wgParser->setHook( 'idls', array( &$this, 'renderIDLS' ) );
+               $wgParser->setHook( 'idlmodule', array( &$this, 
'renderIDLMODULE' ) );
+               $wgParser->setHook( 'idltopic', array( &$this, 'renderIDLTOPIC' 
) );
+       }
+
+       function renderIDL( $input, $args, $parser ) {
+               $parser->disableCache();
+               $output = $parser->recursiveTagParse( $input );
+               $output = '<a href="http://api.openoffice.org/docs/common/ref/' 
. 
+                       str_replace ('.','/',$output).'.html" class="external 
text">'.$output.'</a>';
+               return $output;
+       }
+        
+       function renderIDLM( $input, $args, $parser ) {
+               $parser->disableCache();
+               $output = $parser->recursiveTagParse( $input );
+               $page = preg_replace ('/\./','/',$output);
+               $anchor = preg_replace ('/:/','.html#',$page);
+               $function = preg_replace ('/^.*:/','',$page);
+               $output = '<a href="http://api.openoffice.org/docs/common/ref/' 
. 
+                       $anchor.'" class="external text">'.$function.'</a>';
+               return $output;
+       }
+        
+       function renderIDLS( $input, $args, $parser ) {
+               $parser->disableCache();
+               $output = $parser->recursiveTagParse( $input );
+               $function = preg_replace ('/^.*\./','',$output);
+               $output = '<a href="http://api.openoffice.org/docs/common/ref/' 
. 
+                       preg_replace ('/\./','/',$output).'.html" 
class="external text">'.$function.'</a>';
+               return $output;
+       }
+        
+       function renderIDLMODULE( $input, $args, $parser ) {
+               $parser->disableCache();
+               $output = $parser->recursiveTagParse( $input );
+               $function = preg_replace ('/^.*\./','',$output);
+               $output = '<a href="http://api.openoffice.org/docs/common/ref/' 
. 
+                       preg_replace ('/\./','/',$output).'/module-ix.html" 
class="external text">'.$output.'</a>';
+               return $output;
+       }
+        
+       function renderIDLTOPIC( $input, $args, $parser ) {
+               $parser->disableCache();
+               return '';
+       }
+}
+
+

Reply via email to