Index: /other-projects/gs2-manuals-dokuwiki/trunk/conf/local.php
===================================================================
--- /other-projects/gs2-manuals-dokuwiki/trunk/conf/local.php	(revision 25081)
+++ /other-projects/gs2-manuals-dokuwiki/trunk/conf/local.php	(revision 25081)
@@ -0,0 +1,25 @@
+<?php
+/*
+ * Dokuwiki's Main Configuration File - Local Settings
+ * Auto-generated by config plugin
+ * Run for user: jmt12
+ * Date: Tue, 24 Jan 2012 09:41:07 +1300
+ */
+
+$conf['title'] = 'Greenstone Manual Wiki';
+$conf['template'] = 'monobook';
+$conf['license'] = 'gnufdl';
+$conf['breadcrumbs'] = 0;
+$conf['youarehere'] = 1;
+$conf['typography'] = '0';
+$conf['maxseclevel'] = '5';
+$conf['useacl'] = 1;
+$conf['superuser'] = '@admin';
+$conf['plugin']['publish']['apr_namespaces'] = 'en';
+$conf['plugin']['discussion']['wikisyntaxok'] = 0;
+$conf['tpl']['monobook']['monobook_sitenotice'] = 0;
+$conf['tpl']['monobook']['monobook_copyright_default'] = 0;
+$conf['tpl']['monobook']['monobook_donate'] = 0;
+$conf['tpl']['monobook']['monobook_donate_default'] = 0;
+
+// end auto-generated content
Index: /other-projects/gs2-manuals-dokuwiki/trunk/dokuwiki-readme.txt
===================================================================
--- /other-projects/gs2-manuals-dokuwiki/trunk/dokuwiki-readme.txt	(revision 25081)
+++ /other-projects/gs2-manuals-dokuwiki/trunk/dokuwiki-readme.txt	(revision 25081)
@@ -0,0 +1,44 @@
+Installation
+
+   1. Checkout the gsdl-docs package out of SVN
+
+   2. Go to <gsdl-docs>/lib/dokuwiki/ and untar the dokuwiki tarball (currently the stable version Ricewind)
+
+   3. Go back up to <gsdl-docs>/ and create a symlink to the folder you just unpacked called just dokuwiki:
+
+      ln -s ./lib/dokuwiki/dokuwiki-<version> ./dokuwiki
+
+   4. Copy all of the archive files in <gsdl-docs>/lib/dokuwiki/plugins/ into <gsdl-docs>/dokuwiki/lib/plugins/, then unpack
+     * note you may need to rename the plugin foldersâyou'll find Dokuwiki will complain about incorrectly named folders at startup
+
+   5. Similarly, copy the monobook template archive from <gsdl-docs>/lib/dokuwiki/templates to <gsdl-docs>/dokuwiki/lib/tpl/ and unpack
+
+   6. Setup your webserver (as needed) so you can access this dokuwiki directory and run the PHP scripts therein
+
+   7. Visit the dokuwiki installer page in a web browser. For example, if you're webserver is running on localhost, at port 8080, and the path to <gsdl-docs>/ is /gsdl-docs, then visit:
+
+      http://localhost:8080/gsdl-docs/dokuwiki/install.php
+
+   8. Follow the setup instructions, and then follow the recommended security settings for Dokuwiki, including renaming the install.php file
+
+   9. Overwrite the default configuration by copying the file <gsdl-docs>/lib/dokuwiki/conf/local.php to <gsdl-docs>/dokuwiki/conf/ overwriting the existing file
+
+  10. Recursively copy the starting pages file into place, overwriting existing files if prompted
+
+      cp -r <gsdl-docs>/lib/dokuwiki/pages/ <gsdl-docs>/dokuwiki/data/pages/
+
+    * note there is a copy of these instructions in the starting files, located at development
+
+  11. Enter <gsdl-docs>/lib/php/
+
+  12. Run each of these commands in order to transform the manual's XML files into Dokuwiki pages:
+
+      php gs-manuals-import.php -m user
+      php gs-manuals-import.php -m install
+      php gs-manuals-import.php -m develop
+      php gs-manuals-import.php -m paper
+
+    * note these require a command line version of PHP to be available on the path
+
+  13. Enter the wiki again, log in using the administrator account you created when installing, and then visit each manual wiki page, 'edit' it and click approve
+
Index: /other-projects/gs2-manuals-dokuwiki/trunk/pages/wiki/copyright.txt
===================================================================
--- /other-projects/gs2-manuals-dokuwiki/trunk/pages/wiki/copyright.txt	(revision 25081)
+++ /other-projects/gs2-manuals-dokuwiki/trunk/pages/wiki/copyright.txt	(revision 25081)
@@ -0,0 +1,1 @@
+Except where otherwise noted, content on this wiki is licensed under the following license: [[http://www.gnu.org/licenses/fdl-1.3.html|GNU Free Documentation License 1.3]]
Index: /other-projects/gs2-manuals-dokuwiki/trunk/pages/wiki/development.txt
===================================================================
--- /other-projects/gs2-manuals-dokuwiki/trunk/pages/wiki/development.txt	(revision 25081)
+++ /other-projects/gs2-manuals-dokuwiki/trunk/pages/wiki/development.txt	(revision 25081)
@@ -0,0 +1,657 @@
+====== Development ======
+
+===== Installation =====
+
+  - Checkout the ''gsdl-docs'' package out of SVN
+  - Go to ''<gsdl-docs>/lib/dokuwiki/'' and untar the [[http://www.dokuwiki.org/dokuwiki|dokuwiki]] tarball (currently the stable version [[http://www.splitbrain.org/_media/projects/dokuwiki/dokuwiki-2011-05-25a.tgz|Ricewind]])
+  - Go back up to ''<gsdl-docs>/'' and create a symlink to the folder you just unpacked called just ''dokuwiki'':<code>ln -s ./lib/dokuwiki/dokuwiki-<version> ./dokuwiki</code> 
+  - Copy all of the archive files in ''<gsdl-docs>/lib/dokuwiki/plugins/'' into ''<gsdl-docs>/dokuwiki/lib/plugins/'', then unpack
+    * **note** you may need to rename the plugin folders---you'll find Dokuwiki will complain about incorrectly named folders at startup
+  - Similarly, copy the ''monobook'' template archive from ''<gsdl-docs>/lib/dokuwiki/templates'' to ''<gsdl-docs>/dokuwiki/lib/tpl/'' and unpack
+  - Setup your webserver (as needed) so you can access this dokuwiki directory and run the PHP scripts therein
+  - Visit the dokuwiki installer page in a web browser. For example, if you're webserver is running on ''localhost'', at port ''8080'', and the path to ''<gsdl-docs>/'' //is// ''/gsdl-docs'', then visit:<code>http://localhost:8080/gsdl-docs/dokuwiki/install.php</code>
+  - Follow the setup instructions, and then follow the recommended [[http://www.dokuwiki.org/security|security settings]] for Dokuwiki, including renaming the ''install.php'' file
+  - Overwrite the default configuration by copying the file ''<gsdl-docs>/lib/dokuwiki/conf/local.php'' to ''<gsdl-docs>/dokuwiki/conf/'' overwriting the existing file
+  - Recursively copy the starting pages file into place, overwriting existing files if prompted<code>cp -r <gsdl-docs>/lib/dokuwiki/pages/ <gsdl-docs>/dokuwiki/data/pages/</code> 
+    * **note** there is a copy of these instructions in the starting files, located at [[wiki:development]]
+  - Enter ''<gsdl-docs>/lib/php/''
+  - Run each of these scripts in order to transform the manual's XML files into Dokuwiki pages:<code>gs-manuals-import-user.sh
+gs-manuals-import-install.sh
+gs-manuals-import-develop.sh
+gs-manuals-import-paper.sh</code>
+    * **note** these scripts require a command line version of PHP to be available on the path
+  - Enter the wiki again, log in using the administrator account you created when installing, and then visit each manual wiki page, 'edit' it and click approve
+===== Required Plugins =====
+
+  * [[http://www.dokuwiki.org/plugin:captcha|Captcha]] - Use a CAPTCHA challenge to protect DokuWiki against automated spam 
+  * [[http://wiki.splitbrain.org/plugin:code2|Code2]] - Enhanced code syntax highlighting with line numbering
+  * [[http://wiki.splitbrain.org/plugin:htmlcomment|HTMLComment]] - allows HTML comments to be retained in the output
+  * [[http://wiki.splitbrain.org/plugin:ifauth|IFAuth]] - so content only for specific groups and/or users
+  * [[http://wiki.splitbrain.org/plugin:imagereference|ImageReference]] - create image references like latex is doing with figures
+  * [[http://dokuwiki.org/plugin:orphanswanted|OrphansWanted]] - provide macros to list orphan pages and wanted pages
+  * [[http://www.dokuwiki.org/plugin:publish|Publish]] - integrate a publishing process into DokuWiki (differentiating between draft and approved copies of pages)
+  * [[http://www.dokuwiki.org/plugin:tablewidth|TableWidth]] - allows the width of tables and table cells to be defined
+
+
+===== Customizations =====
+
+==== Dokuwiki ====
+
+^ File  ^ Changes  ^
+^ inc/common.php  | Allow for 'no change' submissions as long as the Approve flag is ticked (see documentation for [[http://www.dokuwiki.org/plugin:publish|plugin:publish]])  |
+| <code diff u>
+--- dokuwiki-2011-05-25a/inc/common.php	2011-06-15 07:58:53.000000000 +1200
++++ dokuwiki/inc/common.php	2012-01-17 13:53:12.860063701 +1300
+@@ -973,7 +973,8 @@
+     global $lang;
+     global $REV;
+     // ignore if no changes were made
+-    if($text == rawWiki($id,'')){
++    // - [jmt12] unless the approved checkbox is set
++    if(!$_POST['approved'] && $text == rawWiki($id,'')){
+         return;
+     }
+</code> ||
+^ inc/parser/handler.php  | Hide HTML comments (namely text ids) in headings  |
+| <code diff u>
+--- dokuwiki-2011-05-25a/inc/parser/handler.php	2011-06-15 07:58:54.000000000 +1200
++++ dokuwiki/inc/parser/handler.php	2011-12-16 11:37:45.036066485 +1300
+@@ -97,6 +97,9 @@
+         $title = trim($title,'=');
+         $title = trim($title);
+ 
++        // Hide HTML comments [jmt12]
++        $title = preg_replace('/<\!--[^>]*-->/','',$title);
++
+         if ($this->status['section']) $this->_addCall('section_close',array(),$pos);
+ 
+         $this->_addCall('header',array($title,$level,$pos), $pos);
+</code> ||
+^ inc/parser/xhtml.php  | Heavily altered //_highlight()// in order to allow the id specifying HTML comments to remain hidden. Added macro to external urls to allow for links to pages on the same host.  |
+| <code diff u>
+--- dokuwiki-2011-05-25a/inc/parser/xhtml.php	2011-06-15 07:58:54.000000000 +1200
++++ dokuwiki/inc/parser/xhtml.php	2012-01-23 13:16:49.317187175 +1300
+@@ -449,19 +449,24 @@
+             $text = substr($text, 0, -1);
+         }
+ 
++        // - code HTML is now temporarily stored in a local string so we can
++        //   restore specific HTML comments [jmt12]
++        $code_text = '';
+         if ( is_null($language) ) {
+-            $this->doc .= '<pre class="'.$type.'">'.$this->_xmlEntities($text).'</pre>'.DOKU_LF;
++          $code_text = '<pre class="'.$type.'">'.$this->_xmlEntities($text).'</pre>'.DOKU_LF; // [jmt12]
+         } else {
+             $class = 'code'; //we always need the code class to make the syntax highlighting apply
+             if($type != 'code') $class .= ' '.$type;
+ 
+-            $this->doc .= "<pre class=\"$class $language\">".p_xhtml_cached_geshi($text, $language, '').'</pre>'.DOKU_LF;
++            $code_text = "<pre class=\"$class $language\">".p_xhtml_cached_geshi($text, $language, '').'</pre>'.DOKU_LF; // [jmt12]
+         }
++        // - restore id comments! [jmt12]
++        $code_text = preg_replace('/\&lt\;\!\-\-\s+id\:([^\s]+)\s+\-\-\&gt\;/','<!-- id:\1 -->', $code_text);
++        $this->doc .= $code_text; // [jmt12]
+ 
+         if($filename){
+             $this->doc .= '</dd></dl>'.DOKU_LF;
+         }
+
+         $this->_codeblock++;
+     }
+ 
+@@ -665,6 +670,16 @@
+             $class='media';
+         }
+ 
++        // [jmt12] Replace the macro ~~localhost~~ with the hostname (and port
++        //         number if necessary) of the current host
++        if (preg_match('/^http:\/\/~~baseurl~~(\/.*)$/', $url, $matches))
++        {
++          $host = $_SERVER['HTTP_HOST'];
++          $path = substr($_SERVER['REQUEST_URI'], 0, strrpos($_SERVER['REQUEST_URI'], '/'));
++          $url = 'http://' . $host . $path . $matches[1];
++        }
++        // [jmt12]
++
+         //prepare for formating
+         $link['target'] = $conf['target']['extern'];
+         $link['style']  = '';
+</code> ||
+
+===== Plugins =====
+
+==== Code ====
+
+^ File  ^ Changes  ^
+^ syntax.php  | Restore the HTML comments containing text fragment ids to be proper hidden comments.  |
+| <code diff u>
+--- dokuwiki-2011-05-25a/lib/plugins/code/syntax.php	2012-01-23 11:16:05.033314469 +1300
++++ dokuwiki/lib/plugins/code/syntax.php	2012-01-23 11:16:19.122156271 +1300
+@@ -226,6 +226,8 @@
+ 	function &_entities(&$aString) {
+ 		$aString = str_replace(array('&', '<', '>'),
+ 			array('&#38;', '&#60;', '&#62;'), $aString);
++                // [jmt12] Restore the hidden ids to normal HTML comments
++                $aString = preg_replace('/&#60;!-- id:(.*?) --&#62;/','<!-- id:\1 -->', $aString);
+ 		return $aString;
+ 	} // _entities()
+</code>  ||
+
+==== HTMLComment ====
+
+^ File  ^ Changes  ^
+^ syntax.php  | Added code to allow the use of an alternate HTML comment block (prefix %!--, suffix --%) that is automagically rendered using entities to appear verbatim in text (so appears as <!-- ... --> rather than being hidden).  |
+| <code diff u>
+--- dokuwiki-2011-05-25a/lib/plugins/htmlcomment/syntax.php	2005-10-09 11:31:47.000000000 +1300
++++ dokuwiki/lib/plugins/htmlcomment/syntax.php	2012-01-20 14:03:27.078084422 +1300
+@@ -41,15 +41,24 @@
+     }
+ 
+     function connectTo($mode) {
+-        $this->Lexer->addSpecialPattern("<\!--.*?-->", $mode,
+-          'plugin_htmlcomment');
++        $this->Lexer->addSpecialPattern("<\!--.*?-->", $mode, 'plugin_htmlcomment');
++        $this->Lexer->addSpecialPattern("%\!--.*?--%", $mode, 'plugin_htmlcomment');
++        $this->Lexer->addSpecialPattern("<br/>", $mode, 'plugin_htmlcomment');
+     }
+ 
+     function handle($match, $state, $pos, &$handler) {
+         if ($state == DOKU_LEXER_SPECIAL) {
+-             // strip <!-- from start and --> from end
+-            $match = substr($match,4,-3);
+-            return array($state, $match);
++          if ($match == '<br/>')
++          {
++            return array('newline',$match);
++          }
++          if (strpos($match, '%!--') !== false)
++          {
++            $state = 'displaycomment';
++          }
++          // strip <!-- from start and --> from end
++          $match = substr($match,4,-3);
++          return array($state, $match);
+         }
+         return array();
+     }
+@@ -57,14 +66,31 @@
+     function render($mode, &$renderer, $data) {
+         if ($mode == 'xhtml') {
+             list($state, $match) = $data;
+-            if ($state == DOKU_LEXER_SPECIAL) {
+-                $renderer->doc .= '<!--';
+-                if (HTMLCOMMENT_SAFE) {
+-                    $renderer->doc .= $renderer->_xmlEntities($match);
+-                } else {
+-                    $renderer->doc .= $match;
+-                }
+-                $renderer->doc .= '-->';
++            if ($state == 'newline')
++            {
++              $renderer->doc .= $match;
++              return true;
++            }
++            if ($state == 'displaycomment')
++            {
++              $renderer->doc .= '&lt;!--';
++            }
++            else
++            {
++              $renderer->doc .= '<!--';
++            }
++            if (HTMLCOMMENT_SAFE) {
++              $renderer->doc .= $renderer->_xmlEntities($match);
++            } else {
++              $renderer->doc .= $match;
++            }
++            if ($state == 'displaycomment')
++            {
++              $renderer->doc .= '--&gt;';
++            }
++            else
++            {
++              $renderer->doc .= '-->';
+             }
+             return true;
+         }
+</code> ||
+
+==== ImageReference ====
+
+^ File  ^ Changes  ^
+^ script.js  | More tests to prevent trying to access null objects  |
+| <code diff u>
+--- dokuwiki-2011-05-25a/lib/plugins/imagereference/script.js      2009-01-07 21:48:25.000000000 +1300
++++ dokuwiki/lib/plugins/imagereference/script.js       2011-12-16 11:40:42.128166685 +1300
+@@ -3,7 +3,8 @@
+        var divs=document.getElementsByTagName("DIV");
+  
+       for (var i=0;i<divs.length;i++) {
+-        if (divs[i].className == "imgcaption" || divs[i].className == "imgcaptionleft" || divs[i].className == "imgcaptionright") {
++        // adding in more checks to ensure elements exist [jmt12]
++        if (divs[i] && divs[i].childNodes[0] && divs[i].childNodes[0].childNodes[0] && (divs[i].className == "imgcaption" || divs[i].className == "imgcaptionleft" || divs[i].className == "imgcaptionright")) {
+  
+             var children = divs[i].getElementsByTagName("IMG");
+             // check if there is a link encapsulating the image        
+@@ -13,12 +14,16 @@
+             else {
+                 // we have link and we can build the link image
+                 var innerElements = divs[i];
+-                var iLink = innerElements.childNodes[1].childNodes[2];
+-                var iSpan = iLink.childNodes[0];
+-                // set the href of the link to the image link
+-                iLink.href= innerElements.childNodes[0].href;
+-                // show the link image
+-                iSpan.style.display="inline";
++                // adding in more checks to ensure elements exist [jmt12]
++                if (innerElements && innerElements.childNodes[0] && innerElements.childNodes[1])
++                {
++                  var iLink = innerElements.childNodes[1].childNodes[2];
++                  var iSpan = iLink.childNodes[0];
++                  // set the href of the link to the image link
++                  iLink.href= innerElements.childNodes[0].href;
++                  // show the link image
++                  iSpan.style.display="inline";
++                }
+             }    
+             //var tmpLink = divs[i].childNodes[0];
+             divs[i].style.width=(tmpImg.width + 8)+"px";
+</code> ||
+^ style.css  | Altering colours to make caption bars fit in better with Monobook template  |
+| <code diff u>
+--- dokuwiki-2011-05-25a/lib/plugins/imagereference/style.css      2008-09-11 02:56:24.000000000 +1200
++++ dokuwiki/lib/plugins/imagereference/style.css       2012-01-16 10:48:34.558129586 +1300
+@@ -7,15 +7,17 @@
+ 
+ 
+ div.imgcaption {
+-    border: 1px solid #ccc;
++    border: 0px solid #000;
+     padding: 3px !important;
+-    background-color: #f9f9f9;  
+-    font-size: 94%;
++    /*background-color: #113355;*/
++    background-color: #777777;
++    /*font-size: 94%;*/
+     text-align: center;
+     width: auto;
+     overflow: hidden;
+     margin: 1px auto;
+     float: none;
++    font-weight: bold;
+ }
+ 
+ div.imgcaptionleft {
+@@ -62,7 +64,8 @@
+ }
+ 
+ div.dokuwiki .undercaption a:hover {
+-    text-decoration:none;
++    color: #002BB8 !important;
++    text-decoration:underline;
+ }
+ 
+ div.dokuwiki .undercaption span {
+</code> ||
+^ syntax.php  | Rewrote large chunks of this code to; a) allow for table captions too, b) preserve formatting (italics) in the captions, c) allow specially formatted 'HTML comments' to be inserted but not display (to allow capture and retention of explicit text ids) and d) fix minor bugs (looks like some things were in a state of change from strings to arrays - some bits of the code were expecting the other)  |
+| <code diff u>
+--- dokuwiki-2011-05-25a/lib/plugins/imagereference/syntax.php     2008-09-11 18:29:12.000000000 +1200
++++ dokuwiki/lib/plugins/imagereference/syntax.php      2012-01-19 11:03:52.285067251 +1300
+@@ -22,6 +22,7 @@
+        
+        var $_figure_name_array = array("");
+        var $_figure_map = array();
++        var $_captions = array();
+        
+        
+    /**
+@@ -80,13 +81,17 @@
+     * @see render()
+     */
+     function connectTo($mode) {
++
+       $this->Lexer->addSpecialPattern('<imgref\s[^\r\n]*?>',$mode, 'plugin_imagereference');
+-         $this->Lexer->addEntryPattern('<imgcaption\s[^\r\n\|]*?>(?=.*?</imgcaption.*?>)',$mode,'plugin_imagereference');
+-         $this->Lexer->addEntryPattern('<imgcaption\s[^\r\n\|]*?\|(?=[^\r\n]*>.*?</imgcaption.*>)',$mode,'plugin_imagereference');
++      $this->Lexer->addSpecialPattern('<tblref\s[^\r\n]*?>',$mode, 'plugin_imagereference');
++
++      $this->Lexer->addEntryPattern('<imgcaption\s[^\|]+\|[^>]+(?=>.*?</imgcaption>)',$mode,'plugin_imagereference');
++      $this->Lexer->addEntryPattern('<tblcaption\s[^\|]+\|[^>]+(?=>.*?</tblcaption>)',$mode,'plugin_imagereference');
+     }
+- 
++
+     function postConnect() {
+       $this->Lexer->addExitPattern('</imgcaption>', 'plugin_imagereference');
++      $this->Lexer->addExitPattern('</tblcaption>', 'plugin_imagereference');
+     }
+        
+  
+@@ -120,24 +125,39 @@
+     * @static
+     */
+     function handle($match, $state, $pos, &$handler){
+-       
+         switch ($state) {
+         // =========================================================
+            case DOKU_LEXER_ENTER : {
+-               /* --------------------------------------------------- */
+-               $refLabel = trim(substr($match, 11, -1));
++
++             /* --------------------------------------------------- */
++             $refLabel = ''; //trim(substr($match, 11, -1));
++             $caption = '';
++             if (preg_match('/<(?:img|tbl)caption\s+([^\|]+)\|([^>]+)/', $match, $matches))
++             {
++               $refLabel = $matches[1];
++               $caption = $matches[2];
++             }
+                // -----------------------------------------------------
+                $parsedInput = $this->_parseParam($refLabel);
+-               
++
+                // ------------------------------------------------------
+                //$data = $this->_imgstart($parsedInput);
+                // store the figure name from imgcaption
+                array_push($this->_figure_name_array, $parsedInput[0]);
+-               
+-               $this->_figure_map[$parsedInput[0]] = "";
+-               
++
++               $this->_figure_map[$parsedInput[0]] = '';
++
++                $this->_captions[$parsedInput[0]] = $caption;
++
++                ///cho '<p>refLabel:' . $refLabel . '</p>';
++                ///cho '<p>parsedInput:' . print_r($parsedInput, true) . '</p>';
++                ///cho '<p>figure_name_array: ' . print_r($this->_figure_name_array, true) . '</p>';
++                ///cho '<p>figure_map: ' . print_r($this->_figure_map, true) . '</p>';
++                ///cho '<p>captions: ' . print_r($this->_captions, true). '</p>';
++
+                return array('caption_open', $parsedInput);  // image anchor label
+                /* --------------------------------------------------- */
++                //}
+            }
+         // =========================================================
+           case DOKU_LEXER_UNMATCHED : {
+@@ -191,7 +211,6 @@
+     * @see handle()
+     */
+     function render($mode, &$renderer, $indata) {
+-       
+         list($case, $data) = $indata;
+         if($mode == 'xhtml'){
+                // ---------------------------------------------
+@@ -200,8 +219,14 @@
+                        /* --------------------------------------- */
+                        $refNumber = array_search($data, $this->_figure_name_array);
+                        if ($refNumber == null || $refNumber == "")
+-                               $refNumber = "##";
+-                       $str = "<a href=\"#".$data."\">".$this->getLang('figure').$refNumber." </a>";
++                        {
++                          $refNumber = "##";
++                        }
++                        if (strpos($data,'#') === false)
++                        {
++                          $data = "#" . $data;
++                        }
++                       $str = "<a class=\"wikilink1\" href=\"".$data."\">".$this->getLang('figure').$refNumber."</a>";
+                        $renderer->doc .= $str; break;
+ //                      $renderer->_xmlEntities($str);break;
+                        /* --------------------------------------- */
+@@ -210,10 +235,26 @@
+                case 'caption_close' :  {
+                        // -------------------------------------------------------
+                                list($name, $number, $caption) = $data;
+-                               $layout = "<div class=\"undercaption\">".$this->getLang('fig').$number.": 
+-                                       <a name=\"".$name."\">".$caption."</a><a href=\" \"><span></span></a>
+-                                       </div></div>";
+-                                       $renderer->doc .= $layout; break;
++                        // - retrieve the caption separately
++                        $caption = $this->_captions[$name];
++                        // - special case for 'hidden' tables
++                        $layout = '';
++                        if ($caption != '##HIDDEN##')
++                        {
++                          // - manual do any formatting (as leaving it to the
++                          //   parser (to foobar) is why we had to do this in
++                          //   the first place
++                          $caption = preg_replace('/\/\/%%(.+?)%%\/\//','<i>\1</i>',$caption);
++                          $caption = preg_replace('/\/\/(.+?)\/\//','<i>\1</i>',$caption);
++                          $caption = preg_replace('/\*\*(.+?)\*\*/','<b>\1</b>',$caption);
++                          $caption = str_replace('%!--', '<!--', $caption);
++                          $caption = str_replace('--%', '-->', $caption);
++                          // - special case: nested image ref (we can't really resolve these)
++                          $caption = preg_replace('/<imgref\s+([^>]+)><\/imgref>/','\1',$caption);
++                          $layout = "<div class=\"undercaption\">".$this->getLang('fig').$number.": <a name=\"".$name."\"></a>".$caption."</div>";
++                          }
++                        $layout .= "</div>";
++                        $renderer->doc .= $layout; break;
+                }
+                                // -------------------------------------------------------      
+                                // data is mostly empty!!!
+@@ -284,7 +325,7 @@
+     
+     function _imgstart($str) {
+        // ============================================ //
+-       if (!strlen($str)) return array();
++      if (empty($str)) return '';
+        
+                $layout = "<div class=\"imgcaption";
+                //$layout = "<div><div class=\"imgcaption";
+@@ -304,6 +345,8 @@
+      * @return array(imagename, image number, image caption)
+      */
+     function _imgend($str) {
++      // [jmt12] I think this function is unused!
++
+        // ===================================================== //
+        $figureName = end($this->_figure_name_array);
+        // get the position of the figure in the array
+@@ -311,8 +354,9 @@
+                
+                return array($figureName, $refNumber, $str);
+                
++
+                $layout = "<div class=\"undercaption\">".$this->getLang('fig').$refNumber.": 
+-               <a name=\"".end($this->_figure_name_array)."\">".$str."</a></div>";
++               <a name=\"".end($this->_figure_name_array)."\"></a>".$str."</div>";
+                
+                //$layout = "<div id=\"undercaption\">Fig. ".$refNumber.": 
+                //<a name=\"".end($this->_figure_name_array)."\">".$str."</a></div></div></div>";
+</code> ||
+^ lang/en/lang.php  | Changed the strings  |
+| <code diff u>
+--- /dokuwiki-2011-05-25a/lib/plugins/imagereference/lang/en/lang.php       2008-09-11 02:56:24.000000000 +1200
++++ dokuwiki/lib/plugins/imagereference/lang/en/lang.php        2011-12-12 11:24:57.668503137 +1300
+@@ -3,5 +3,5 @@
+  * english language file
+  */
+ 
+-$lang['fig']           = 'Fig. ';
+-$lang['figure']        = 'figure';
+\ No newline at end of file
++$lang['fig']           = 'Figure ';
++$lang['figure']        = 'figure';
+</code> ||
+==== Publish ====
+
+^ File  ^ Changes  ^
+^ action.php  | Never display "previous version" span - you can always look under old revisions anyway. In fact, try to hide the 'publish state' message unless the user is looking at a draft or if they are an editor (whereupon they may be interested in when a page was last approved etc)  |
+| <code diff u>
+--- dokuwiki-2011-05-25a/lib/plugins/publish/action.php    2011-10-16 03:55:40.000000000 +1300
++++ dokuwiki/lib/plugins/publish/action.php     2012-01-24 10:34:18.115128733 +1300
+@@ -147,10 +147,14 @@
+         if($approver && !$most_recent_approved) { $strings[] = 'yes'; } else { $strings[] = 'no'; }
+         $strings[] = '">';
+ 
++        # [jmt12] We may not display the message at all
++        $display_message = false;
++
+         if($most_recent_draft) {
+             $strings[] = '<span class="approval_latest_draft">';
+             $strings[] = sprintf($this->getLang('apr_recent_draft'), wl($ID, 'force_rev=1'));
+             $strings[] = $this->difflink($ID, null, $REV) . '</span>';
++            $display_message = true;
+         }
+ 
+         if($most_recent_approved) {
+@@ -160,6 +164,7 @@
+             $strings[] = '<span class="approval_outdated">';
+             $strings[] = sprintf($this->getLang('apr_outdated'), wl($ID, 'rev=' . $userrev));
+             $strings[] = $this->difflink($ID, $userrev, $REV) . '</span>';
++            $display_message = true;
+         }
+ 
+         if(!$approver) {
+@@ -168,28 +173,27 @@
+             $strings[] = sprintf($this->getLang('apr_draft'),
+                             '<span class="approval_date">' . $longdate . '</span>');
+             $strings[] = '</span>';
++            $display_message = true;
+         }
+ 
+-        if($approver) {
++        // [jmt12] Only display this notice to editors
++        if($approver &&  $INFO['perm'] >= AUTH_EDIT) {
+             # Approved
+             $strings[] = '<span class="approval_approved">';
+             $strings[] = sprintf($this->getLang('apr_approved'),
+                             '<span class="approval_date">' . $longdate . '</span>',
+                             editorinfo($approver));
+             $strings[] = '</span>';
+-        }
+-
+-        if($previous_approved) {
+-            $strings[] = '<span class="approval_previous">';
+-            $strings[] = sprintf($this->getLang('apr_previous'),
+-                            wl($ID, 'rev=' . $previous_approved),
+-                            dformat($previous_approved));
+-            $strings[] = $this->difflink($ID, $previous_approved, $REV) . '</span>';
++            $display_message = true;
+         }
+ 
+         $strings[] = '</div>';
+ 
+-        ptln(implode($strings));
++        // [jmt12] if there is no message content, hide empty div
++        if ($display_message)
++        {
++          ptln(implode($strings));
++        }
+         return true;
+     }
+ 
+</code> ||
+^ style.css  | Making the message bubbles at the top of pages a little smaller (it was taking up about 2 inches of vertical real-estate, which was expensive even on my wide screen---small screen users would have suffered greatly)  |
+| <code diff u>
+--- dokuwiki-2011-05-25a/lib/plugins/publish/style.css     2011-10-16 03:55:40.000000000 +1300
++++ dokuwiki/lib/plugins/publish/style.css      2012-01-17 13:47:35.324065886 +1300
+@@ -3,7 +3,7 @@
+   margin-left: auto;
+   margin-right: auto;
+   width: 70% !important;
+-  min-height: 40px;
++  min-height: 20px;
+   clear: both;
+   text-align: justify;
+   vertical-align: middle;
+</code> ||  
+===== Templates =====
+
+==== Monobook ====
+
+^ File  ^ Changes  ^
+^ main.php  | Removed positioning test so that the hierarchy navigation appears at both the top and bottom of pages (rather than one or the other)  |
+|  <code diff u>
+--- dokuwiki-2011-05-25a/lib/tpl/monobook/main.php	2012-01-23 13:37:25.353131918 +1300
++++ dokuwiki/lib/tpl/monobook/main.php	2012-01-16 12:30:35.131067643 +1300
+@@ -613,8 +613,8 @@
+               $ACT !== "media" && //var comes from DokuWiki
+               (empty($conf["useacl"]) || //are there any users?
+                $loginname !== "" || //user is logged in?
+-               !tpl_getConf("monobook_closedwiki")) &&
+-              tpl_getConf("monobook_youarehere_position") === "top"){
++               !tpl_getConf("monobook_closedwiki"))){// &&
++                //              tpl_getConf("monobook_youarehere_position") === "top"){
+               echo "\n          <div class=\"catlinks noprint\"><p>\n            ";
+               tpl_youarehere();
+               echo "\n          </p></div>\n";
+@@ -665,8 +665,8 @@
+               $ACT !== "media" && //var comes from DokuWiki
+               (empty($conf["useacl"]) || //are there any users?
+                $loginname !== "" || //user is logged in?
+-               !tpl_getConf("monobook_closedwiki")) &&
+-              tpl_getConf("monobook_youarehere_position") === "bottom"){
++               !tpl_getConf("monobook_closedwiki"))){ // &&
++                //              tpl_getConf("monobook_youarehere_position") === "bottom"){
+               echo "\n          <div class=\"catlinks noprint\"><p>\n            ";
+               tpl_youarehere();
+               echo "\n          </p></div>\n";
+</code>  ||
+^ static/css/screen.css  | Restrict the width of code blocks - otherwise they'll push out past the 1000px limit anyway - and set them to use scrollbars for any overflow.  |
+| <code diff u>
+--- dokuwiki-2011-05-25a/lib/tpl/monobook/static/css/screen.css	2012-01-23 13:44:38.685377461 +1300
++++ dokuwiki/lib/tpl/monobook/static/css/screen.css	2012-01-23 11:43:23.188315618 +1300
+@@ -678,6 +678,8 @@
+   line-height: 1.2em;
+   padding: 0.5em;
+   border-style: dashed;
++  overflow: scroll;
++  width: 800px;
+ }
+ div#content .dokuwiki dl.file,
+ div#content .dokuwiki dl.file dd {
+</code> ||
+^ static/3rd/monobook/main.css  | Reduce the text area to around 1000px by centring main div and other absolute divs (logo and top navigation).  |
+| <code diff u>
+--- dokuwiki-2011-05-25a/lib/tpl/monobook/static/3rd/monobook/main.css	2012-01-23 13:41:54.253064506 +1300
++++ dokuwiki/lib/tpl/monobook/static/3rd/monobook/main.css	2012-01-23 11:45:42.674067707 +1300
+@@ -27,7 +27,7 @@
+ 	background: white;
+ 	color: black;
+ 	border: 1px solid #aaa;
+-	border-right: none;
++	/*border-right: none;*/
+ 	line-height: 1.5em;
+ 	position: relative;
+ 	z-index: 2;
+@@ -54,6 +54,8 @@
+ /* scale back up to a sane default */
+ #globalWrapper {
+ 	font-size: 127%;
++	width: 1024px;
++	margin: 0 auto;
+ 	padding: 0;
+ }
+ .visualClear {
+@@ -702,7 +704,7 @@
+ 	z-index: 3;
+ 	position: absolute; /*needed to use z-index */
+ 	top: 0;
+-	left: 0;
++	/*left: 0;*/
+ 	height: 155px;
+ 	width: 12em;
+ 	overflow: visible;
+@@ -858,9 +860,10 @@
+ #p-cactions {
+ 	position: absolute;
+ 	top: 1.3em;
+-	left: 11.5em;
++	/*left: 11.5em;*/
+ 	margin: 0;
+ 	white-space: nowrap;
++	width: 1024px;
+ 	line-height: 1.1em;
+ 	overflow: visible;
+ 	background: none;
+@@ -869,7 +872,7 @@
+         margin: 0 auto;
+ 	list-style: none;
+ 	font-size: 95%;
+-        font-weight: normal;
++font-weight: normal;
+ }
+ #p-cactions .hiddenStructure {
+ 	display: none;
+</code> ||
Index: /other-projects/gs2-manuals-dokuwiki/trunk/pages/wiki/drafts.txt
===================================================================
--- /other-projects/gs2-manuals-dokuwiki/trunk/pages/wiki/drafts.txt	(revision 25081)
+++ /other-projects/gs2-manuals-dokuwiki/trunk/pages/wiki/drafts.txt	(revision 25081)
@@ -0,0 +1,5 @@
+~~NOCACHE~~ 
+
+====== Drafts Pending Approval ======
+
+[APPROVALS]
Index: /other-projects/gs2-manuals-dokuwiki/trunk/pages/wiki/manuals.txt
===================================================================
--- /other-projects/gs2-manuals-dokuwiki/trunk/pages/wiki/manuals.txt	(revision 25081)
+++ /other-projects/gs2-manuals-dokuwiki/trunk/pages/wiki/manuals.txt	(revision 25081)
@@ -0,0 +1,14 @@
+====== Greenstone Manuals ======
+
+===== Editing The Manuals =====
+
+  * You need to be registered and login
+  * You can only edit English versions of manuals - due to limitation of translation process software
+  * Feel free to 'discuss' any non-English change requests
+  * In general use the [[wiki:syntax|Dokuwiki syntax]]
+  * There are a number of rules that must be followed when editing
+    * All text strings that require translation should be preceded by a unique identifier, of the form:<code><!-- id:uniqueidentifier -->Text string</code>If not provided the export system will do its best to generate one, and will also ensure that any identifier given is indeed unique (by adding a numeric suffix as necessary)
+    * If you want HTML comment markers to appear verbatim in the displayed text you have to use a special notation to prevent them being confused with actual HTML comments (that are hidden in the text), like so:<code>%!-- The comment uses percents instead of angle brackets --%</code>
+    * Special notation for figure captions:<code><imgcaption figure_x|The caption></code>The caption may also include subcaptions, which are assumed to start with (a), (b), (c) etc:<code><imgcaption figure_y|Another caption (a) with subcaption></code>Finally, you can include unique identifiers for caption strings using the same notation as for HTML comments:<code><imgcaption figure_z|%!-- id:cap8 --%Last caption %!-- id:cap8sub1 --%(z) and its subcaption></code>
+    * Table captions have a special notation similar to figures:<code><tblcaption table_x|The caption></code>
+    * To reference a figure you link to its caption using the notation:<code><imgref figure_x></code>The reference to a table caption is once again similar:<code><tblref table_x></code>Please note that references to figures and tables only work within the same page
Index: /other-projects/gs2-manuals-dokuwiki/trunk/pages/wiki/navigation.txt
===================================================================
--- /other-projects/gs2-manuals-dokuwiki/trunk/pages/wiki/navigation.txt	(revision 25081)
+++ /other-projects/gs2-manuals-dokuwiki/trunk/pages/wiki/navigation.txt	(revision 25081)
@@ -0,0 +1,7 @@
+  * [[http://wiki.greenstone.org/wiki/index.php/GreenstoneWiki|Main Wiki]]
+  * [[manuals|Manuals]] 
+    * [[en:manuals:user|User]] ([[es:manuals:user|es]]) ([[fr:manuals:user|fr]]) ([[ru:manuals:user|ru]]) ([[ar:manuals:user|ar]]) ([[pt-br:manuals:user|pt-br]])
+    * [[en:manuals:install|Installer]] ([[es:manuals:install|es]]) ([[fr:manuals:install|fr]]) ([[ru:manuals:install|ru]])
+    * [[en:manuals:develop|Developer]] ([[es:manuals:develop|es]]) ([[fr:manuals:develop|fr]]) ([[ru:manuals:develop|ru]])
+    * [[en:manuals:paper|Paper]] ([[es:manuals:paper|es]]) ([[fr:manuals:paper|fr]]) ([[ru:manuals:paper|ru]])
+
Index: /other-projects/gs2-manuals-dokuwiki/trunk/pages/wiki/pagestate.txt
===================================================================
--- /other-projects/gs2-manuals-dokuwiki/trunk/pages/wiki/pagestate.txt	(revision 25081)
+++ /other-projects/gs2-manuals-dokuwiki/trunk/pages/wiki/pagestate.txt	(revision 25081)
@@ -0,0 +1,18 @@
+====== Page Status ======
+
+===== Orphans =====
+
+These pages have no links to them.
+
+~~ORPHANSWANTED:orphans~~
+
+===== Wanted =====
+
+These pages are referred to in links but don't exist.
+
+~~ORPHANSWANTED:wanted~~
+
+===== Valid =====
+
+~~ORPHANSWANTED:valid~~
+
Index: /other-projects/gs2-manuals-dokuwiki/trunk/pages/wiki/site_notice.txt
===================================================================
--- /other-projects/gs2-manuals-dokuwiki/trunk/pages/wiki/site_notice.txt	(revision 25081)
+++ /other-projects/gs2-manuals-dokuwiki/trunk/pages/wiki/site_notice.txt	(revision 25081)
@@ -0,0 +1,1 @@
+<!-- No current site notice -->
Index: /other-projects/gs2-manuals-dokuwiki/trunk/pages/wiki/special.txt
===================================================================
--- /other-projects/gs2-manuals-dokuwiki/trunk/pages/wiki/special.txt	(revision 25081)
+++ /other-projects/gs2-manuals-dokuwiki/trunk/pages/wiki/special.txt	(revision 25081)
@@ -0,0 +1,27 @@
+====== Special Pages ======
+
+===== Maintenance Reports =====
+
+  * [[wiki:pagestate|Page Status]] - lists orphans and wanted pages
+  * [[wiki:drafts|Draft Pages]] - pages with unapproved changes
+
+===== System Pages =====
+
+  * [[?do=admin|Admininstration]] - administration only functionality of Dokuwiki include general configuration, plugin management and user/ACL management
+  * [[?do=index|All pages]] - a tree-view of all pages categorised by namespace
+  * [[wiki:copyright|Copyright]] - copyright notice displayed at the bottom of all pages
+  * [[wiki:development|Development notes]] - discussion of implementation and customizations
+  * [[wiki:navigation|Navigation]] - controls navigation controls on the left
+  * [[wiki:site_notice|Site Notice]] - site-wide notice placed at top of all pages
+  * [[wiki:syntax|Dokuwiki syntax]] - syntax used when editing pages in Dokuwiki
+  * [[wiki:toolbox|Toolbox]] - controls links in the toolbox
+  * [[playground:playground|Playground]] - sandbox for experimenting with editing
+
+
+===== Login / sign up =====
+
+  * [[?do=login|Log in]] / [[?do=register|create account]]
+
+===== Recent changes =====
+
+  * [[?do=recent|Recent changes]]
