root/documentation/trunk/packages/dokuwiki-2011-05-25a/data/pages/wiki/development.txt @ 25027

Revision 25027, 29.1 KB (checked in by jmt12, 9 years ago)

Adding the packages directory, and within it a configured version of dokuwiki all ready to run

Line 
1====== Development ======
2
3===== Installation =====
4
5  - Checkout the ''gsdl-docs'' package out of SVN
6  - 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]])
7  - 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>
8  - Copy all of the archive files in ''<gsdl-docs>/lib/dokuwiki/plugins/'' into ''<gsdl-docs>/dokuwiki/lib/plugins/'', then unpack
9    * **note** you may need to rename the plugin folders---you'll find Dokuwiki will complain about incorrectly named folders at startup
10  - Similarly, copy the ''monobook'' template archive from ''<gsdl-docs>/lib/dokuwiki/templates'' to ''<gsdl-docs>/dokuwiki/lib/tpl/'' and unpack
11  - Setup your webserver (as needed) so you can access this dokuwiki directory and run the PHP scripts therein
12  - 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>
13  - Follow the setup instructions, and then follow the recommended [[http://www.dokuwiki.org/security|security settings]] for Dokuwiki, including renaming the ''install.php'' file
14  - Overwrite the default configuration by copying the file ''<gsdl-docs>/lib/dokuwiki/conf/local.php'' to ''<gsdl-docs>/dokuwiki/conf/'' overwriting the existing file
15  - 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>
16    * **note** there is a copy of these instructions in the starting files, located at [[wiki:development]]
17  - Enter ''<gsdl-docs>/lib/php/''
18  - Run each of these commands in order to transform the manual's XML files into Dokuwiki pages:<code>php gs-manuals-import.php -m user
19php gs-manuals-import.php -m install
20php gs-manuals-import.php -m develop
21php gs-manuals-import.php -m paper</code>
22    * **note** these require a command line version of PHP to be available on the path
23  - 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
24===== Required Plugins =====
25
26  * [[http://www.dokuwiki.org/plugin:captcha|Captcha]] - Use a CAPTCHA challenge to protect DokuWiki against automated spam
27  * [[http://wiki.splitbrain.org/plugin:code2|Code2]] - Enhanced code syntax highlighting with line numbering
28  * [[http://wiki.splitbrain.org/plugin:htmlcomment|HTMLComment]] - allows HTML comments to be retained in the output
29  * [[http://wiki.splitbrain.org/plugin:ifauth|IFAuth]] - so content only for specific groups and/or users
30  * [[http://wiki.splitbrain.org/plugin:imagereference|ImageReference]] - create image references like latex is doing with figures
31  * [[http://dokuwiki.org/plugin:orphanswanted|OrphansWanted]] - provide macros to list orphan pages and wanted pages
32  * [[http://www.dokuwiki.org/plugin:publish|Publish]] - integrate a publishing process into DokuWiki (differentiating between draft and approved copies of pages)
33  * [[http://www.dokuwiki.org/plugin:tablewidth|TableWidth]] - allows the width of tables and table cells to be defined
34
35
36===== Customizations =====
37
38==== Dokuwiki ====
39
40^ File  ^ Changes  ^
41^ 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]])  |
42| <code diff u>
43--- dokuwiki-2011-05-25a/inc/common.php 2011-06-15 07:58:53.000000000 +1200
44+++ dokuwiki/inc/common.php 2012-01-17 13:53:12.860063701 +1300
45@@ -973,7 +973,8 @@
46     global $lang;
47     global $REV;
48     // ignore if no changes were made
49-    if($text == rawWiki($id,'')){
50+    // - [jmt12] unless the approved checkbox is set
51+    if(!$_POST['approved'] && $text == rawWiki($id,'')){
52         return;
53     }
54</code> ||
55^ inc/parser/handler.php  | Hide HTML comments (namely text ids) in headings  |
56| <code diff u>
57--- dokuwiki-2011-05-25a/inc/parser/handler.php 2011-06-15 07:58:54.000000000 +1200
58+++ dokuwiki/inc/parser/handler.php 2011-12-16 11:37:45.036066485 +1300
59@@ -97,6 +97,9 @@
60         $title = trim($title,'=');
61         $title = trim($title);
62 
63+        // Hide HTML comments [jmt12]
64+        $title = preg_replace('/<\!--[^>]*-->/','',$title);
65+
66         if ($this->status['section']) $this->_addCall('section_close',array(),$pos);
67 
68         $this->_addCall('header',array($title,$level,$pos), $pos);
69</code> ||
70^ 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.  |
71| <code diff u>
72--- dokuwiki-2011-05-25a/inc/parser/xhtml.php   2011-06-15 07:58:54.000000000 +1200
73+++ dokuwiki/inc/parser/xhtml.php   2012-01-23 13:16:49.317187175 +1300
74@@ -449,19 +449,24 @@
75             $text = substr($text, 0, -1);
76         }
77 
78+        // - code HTML is now temporarily stored in a local string so we can
79+        //   restore specific HTML comments [jmt12]
80+        $code_text = '';
81         if ( is_null($language) ) {
82-            $this->doc .= '<pre class="'.$type.'">'.$this->_xmlEntities($text).'</pre>'.DOKU_LF;
83+          $code_text = '<pre class="'.$type.'">'.$this->_xmlEntities($text).'</pre>'.DOKU_LF; // [jmt12]
84         } else {
85             $class = 'code'; //we always need the code class to make the syntax highlighting apply
86             if($type != 'code') $class .= ' '.$type;
87 
88-            $this->doc .= "<pre class=\"$class $language\">".p_xhtml_cached_geshi($text, $language, '').'</pre>'.DOKU_LF;
89+            $code_text = "<pre class=\"$class $language\">".p_xhtml_cached_geshi($text, $language, '').'</pre>'.DOKU_LF; // [jmt12]
90         }
91+        // - restore id comments! [jmt12]
92+        $code_text = preg_replace('/\&lt\;\!\-\-\s+id\:([^\s]+)\s+\-\-\&gt\;/','<!-- id:\1 -->', $code_text);
93+        $this->doc .= $code_text; // [jmt12]
94 
95         if($filename){
96             $this->doc .= '</dd></dl>'.DOKU_LF;
97         }
98
99         $this->_codeblock++;
100     }
101 
102@@ -665,6 +670,16 @@
103             $class='media';
104         }
105 
106+        // [jmt12] Replace the macro ~~localhost~~ with the hostname (and port
107+        //         number if necessary) of the current host
108+        if (preg_match('/^http:\/\/~~baseurl~~(\/.*)$/', $url, $matches))
109+        {
110+          $host = $_SERVER['HTTP_HOST'];
111+          $path = substr($_SERVER['REQUEST_URI'], 0, strrpos($_SERVER['REQUEST_URI'], '/'));
112+          $url = 'http://' . $host . $path . $matches[1];
113+        }
114+        // [jmt12]
115+
116         //prepare for formating
117         $link['target'] = $conf['target']['extern'];
118         $link['style']  = '';
119</code> ||
120
121===== Plugins =====
122
123==== Code ====
124
125^ File  ^ Changes  ^
126^ syntax.php  | Restore the HTML comments containing text fragment ids to be proper hidden comments.  |
127| <code diff u>
128--- dokuwiki-2011-05-25a/lib/plugins/code/syntax.php    2012-01-23 11:16:05.033314469 +1300
129+++ dokuwiki/lib/plugins/code/syntax.php    2012-01-23 11:16:19.122156271 +1300
130@@ -226,6 +226,8 @@
131    function &_entities(&$aString) {
132        $aString = str_replace(array('&', '<', '>'),
133            array('&#38;', '&#60;', '&#62;'), $aString);
134+                // [jmt12] Restore the hidden ids to normal HTML comments
135+                $aString = preg_replace('/&#60;!-- id:(.*?) --&#62;/','<!-- id:\1 -->', $aString);
136        return $aString;
137    } // _entities()
138</code>  ||
139
140==== HTMLComment ====
141
142^ File  ^ Changes  ^
143^ 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).  |
144| <code diff u>
145--- dokuwiki-2011-05-25a/lib/plugins/htmlcomment/syntax.php 2005-10-09 11:31:47.000000000 +1300
146+++ dokuwiki/lib/plugins/htmlcomment/syntax.php 2012-01-20 14:03:27.078084422 +1300
147@@ -41,15 +41,24 @@
148     }
149 
150     function connectTo($mode) {
151-        $this->Lexer->addSpecialPattern("<\!--.*?-->", $mode,
152-          'plugin_htmlcomment');
153+        $this->Lexer->addSpecialPattern("<\!--.*?-->", $mode, 'plugin_htmlcomment');
154+        $this->Lexer->addSpecialPattern("%\!--.*?--%", $mode, 'plugin_htmlcomment');
155+        $this->Lexer->addSpecialPattern("<br/>", $mode, 'plugin_htmlcomment');
156     }
157 
158     function handle($match, $state, $pos, &$handler) {
159         if ($state == DOKU_LEXER_SPECIAL) {
160-             // strip <!-- from start and --> from end
161-            $match = substr($match,4,-3);
162-            return array($state, $match);
163+          if ($match == '<br/>')
164+          {
165+            return array('newline',$match);
166+          }
167+          if (strpos($match, '%!--') !== false)
168+          {
169+            $state = 'displaycomment';
170+          }
171+          // strip <!-- from start and --> from end
172+          $match = substr($match,4,-3);
173+          return array($state, $match);
174         }
175         return array();
176     }
177@@ -57,14 +66,31 @@
178     function render($mode, &$renderer, $data) {
179         if ($mode == 'xhtml') {
180             list($state, $match) = $data;
181-            if ($state == DOKU_LEXER_SPECIAL) {
182-                $renderer->doc .= '<!--';
183-                if (HTMLCOMMENT_SAFE) {
184-                    $renderer->doc .= $renderer->_xmlEntities($match);
185-                } else {
186-                    $renderer->doc .= $match;
187-                }
188-                $renderer->doc .= '-->';
189+            if ($state == 'newline')
190+            {
191+              $renderer->doc .= $match;
192+              return true;
193+            }
194+            if ($state == 'displaycomment')
195+            {
196+              $renderer->doc .= '&lt;!--';
197+            }
198+            else
199+            {
200+              $renderer->doc .= '<!--';
201+            }
202+            if (HTMLCOMMENT_SAFE) {
203+              $renderer->doc .= $renderer->_xmlEntities($match);
204+            } else {
205+              $renderer->doc .= $match;
206+            }
207+            if ($state == 'displaycomment')
208+            {
209+              $renderer->doc .= '--&gt;';
210+            }
211+            else
212+            {
213+              $renderer->doc .= '-->';
214             }
215             return true;
216         }
217</code> ||
218
219==== ImageReference ====
220
221^ File  ^ Changes  ^
222^ script.js  | More tests to prevent trying to access null objects  |
223| <code diff u>
224--- dokuwiki-2011-05-25a/lib/plugins/imagereference/script.js      2009-01-07 21:48:25.000000000 +1300
225+++ dokuwiki/lib/plugins/imagereference/script.js       2011-12-16 11:40:42.128166685 +1300
226@@ -3,7 +3,8 @@
227        var divs=document.getElementsByTagName("DIV");
228 
229       for (var i=0;i<divs.length;i++) {
230-        if (divs[i].className == "imgcaption" || divs[i].className == "imgcaptionleft" || divs[i].className == "imgcaptionright") {
231+        // adding in more checks to ensure elements exist [jmt12]
232+        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")) {
233 
234             var children = divs[i].getElementsByTagName("IMG");
235             // check if there is a link encapsulating the image       
236@@ -13,12 +14,16 @@
237             else {
238                 // we have link and we can build the link image
239                 var innerElements = divs[i];
240-                var iLink = innerElements.childNodes[1].childNodes[2];
241-                var iSpan = iLink.childNodes[0];
242-                // set the href of the link to the image link
243-                iLink.href= innerElements.childNodes[0].href;
244-                // show the link image
245-                iSpan.style.display="inline";
246+                // adding in more checks to ensure elements exist [jmt12]
247+                if (innerElements && innerElements.childNodes[0] && innerElements.childNodes[1])
248+                {
249+                  var iLink = innerElements.childNodes[1].childNodes[2];
250+                  var iSpan = iLink.childNodes[0];
251+                  // set the href of the link to the image link
252+                  iLink.href= innerElements.childNodes[0].href;
253+                  // show the link image
254+                  iSpan.style.display="inline";
255+                }
256             }   
257             //var tmpLink = divs[i].childNodes[0];
258             divs[i].style.width=(tmpImg.width + 8)+"px";
259</code> ||
260^ style.css  | Altering colours to make caption bars fit in better with Monobook template  |
261| <code diff u>
262--- dokuwiki-2011-05-25a/lib/plugins/imagereference/style.css      2008-09-11 02:56:24.000000000 +1200
263+++ dokuwiki/lib/plugins/imagereference/style.css       2012-01-16 10:48:34.558129586 +1300
264@@ -7,15 +7,17 @@
265 
266 
267 div.imgcaption {
268-    border: 1px solid #ccc;
269+    border: 0px solid #000;
270     padding: 3px !important;
271-    background-color: #f9f9f9; 
272-    font-size: 94%;
273+    /*background-color: #113355;*/
274+    background-color: #777777;
275+    /*font-size: 94%;*/
276     text-align: center;
277     width: auto;
278     overflow: hidden;
279     margin: 1px auto;
280     float: none;
281+    font-weight: bold;
282 }
283 
284 div.imgcaptionleft {
285@@ -62,7 +64,8 @@
286 }
287 
288 div.dokuwiki .undercaption a:hover {
289-    text-decoration:none;
290+    color: #002BB8 !important;
291+    text-decoration:underline;
292 }
293 
294 div.dokuwiki .undercaption span {
295</code> ||
296^ 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)  |
297| <code diff u>
298--- dokuwiki-2011-05-25a/lib/plugins/imagereference/syntax.php     2008-09-11 18:29:12.000000000 +1200
299+++ dokuwiki/lib/plugins/imagereference/syntax.php      2012-01-19 11:03:52.285067251 +1300
300@@ -22,6 +22,7 @@
301       
302        var $_figure_name_array = array("");
303        var $_figure_map = array();
304+        var $_captions = array();
305       
306       
307    /**
308@@ -80,13 +81,17 @@
309     * @see render()
310     */
311     function connectTo($mode) {
312+
313       $this->Lexer->addSpecialPattern('<imgref\s[^\r\n]*?>',$mode, 'plugin_imagereference');
314-         $this->Lexer->addEntryPattern('<imgcaption\s[^\r\n\|]*?>(?=.*?</imgcaption.*?>)',$mode,'plugin_imagereference');
315-         $this->Lexer->addEntryPattern('<imgcaption\s[^\r\n\|]*?\|(?=[^\r\n]*>.*?</imgcaption.*>)',$mode,'plugin_imagereference');
316+      $this->Lexer->addSpecialPattern('<tblref\s[^\r\n]*?>',$mode, 'plugin_imagereference');
317+
318+      $this->Lexer->addEntryPattern('<imgcaption\s[^\|]+\|[^>]+(?=>.*?</imgcaption>)',$mode,'plugin_imagereference');
319+      $this->Lexer->addEntryPattern('<tblcaption\s[^\|]+\|[^>]+(?=>.*?</tblcaption>)',$mode,'plugin_imagereference');
320     }
321-
322+
323     function postConnect() {
324       $this->Lexer->addExitPattern('</imgcaption>', 'plugin_imagereference');
325+      $this->Lexer->addExitPattern('</tblcaption>', 'plugin_imagereference');
326     }
327       
328 
329@@ -120,24 +125,39 @@
330     * @static
331     */
332     function handle($match, $state, $pos, &$handler){
333-       
334         switch ($state) {
335         // =========================================================
336            case DOKU_LEXER_ENTER : {
337-               /* --------------------------------------------------- */
338-               $refLabel = trim(substr($match, 11, -1));
339+
340+             /* --------------------------------------------------- */
341+             $refLabel = ''; //trim(substr($match, 11, -1));
342+             $caption = '';
343+             if (preg_match('/<(?:img|tbl)caption\s+([^\|]+)\|([^>]+)/', $match, $matches))
344+             {
345+               $refLabel = $matches[1];
346+               $caption = $matches[2];
347+             }
348                // -----------------------------------------------------
349                $parsedInput = $this->_parseParam($refLabel);
350-               
351+
352                // ------------------------------------------------------
353                //$data = $this->_imgstart($parsedInput);
354                // store the figure name from imgcaption
355                array_push($this->_figure_name_array, $parsedInput[0]);
356-               
357-               $this->_figure_map[$parsedInput[0]] = "";
358-               
359+
360+               $this->_figure_map[$parsedInput[0]] = '';
361+
362+                $this->_captions[$parsedInput[0]] = $caption;
363+
364+                ///cho '<p>refLabel:' . $refLabel . '</p>';
365+                ///cho '<p>parsedInput:' . print_r($parsedInput, true) . '</p>';
366+                ///cho '<p>figure_name_array: ' . print_r($this->_figure_name_array, true) . '</p>';
367+                ///cho '<p>figure_map: ' . print_r($this->_figure_map, true) . '</p>';
368+                ///cho '<p>captions: ' . print_r($this->_captions, true). '</p>';
369+
370                return array('caption_open', $parsedInput);  // image anchor label
371                /* --------------------------------------------------- */
372+                //}
373            }
374         // =========================================================
375           case DOKU_LEXER_UNMATCHED : {
376@@ -191,7 +211,6 @@
377     * @see handle()
378     */
379     function render($mode, &$renderer, $indata) {
380-       
381         list($case, $data) = $indata;
382         if($mode == 'xhtml'){
383                // ---------------------------------------------
384@@ -200,8 +219,14 @@
385                        /* --------------------------------------- */
386                        $refNumber = array_search($data, $this->_figure_name_array);
387                        if ($refNumber == null || $refNumber == "")
388-                               $refNumber = "##";
389-                       $str = "<a href=\"#".$data."\">".$this->getLang('figure').$refNumber." </a>";
390+                        {
391+                          $refNumber = "##";
392+                        }
393+                        if (strpos($data,'#') === false)
394+                        {
395+                          $data = "#" . $data;
396+                        }
397+                       $str = "<a class=\"wikilink1\" href=\"".$data."\">".$this->getLang('figure').$refNumber."</a>";
398                        $renderer->doc .= $str; break;
399 //                      $renderer->_xmlEntities($str);break;
400                        /* --------------------------------------- */
401@@ -210,10 +235,26 @@
402                case 'caption_close' :  {
403                        // -------------------------------------------------------
404                                list($name, $number, $caption) = $data;
405-                               $layout = "<div class=\"undercaption\">".$this->getLang('fig').$number.":
406-                                       <a name=\"".$name."\">".$caption."</a><a href=\" \"><span></span></a>
407-                                       </div></div>";
408-                                       $renderer->doc .= $layout; break;
409+                        // - retrieve the caption separately
410+                        $caption = $this->_captions[$name];
411+                        // - special case for 'hidden' tables
412+                        $layout = '';
413+                        if ($caption != '##HIDDEN##')
414+                        {
415+                          // - manual do any formatting (as leaving it to the
416+                          //   parser (to foobar) is why we had to do this in
417+                          //   the first place
418+                          $caption = preg_replace('/\/\/%%(.+?)%%\/\//','<i>\1</i>',$caption);
419+                          $caption = preg_replace('/\/\/(.+?)\/\//','<i>\1</i>',$caption);
420+                          $caption = preg_replace('/\*\*(.+?)\*\*/','<b>\1</b>',$caption);
421+                          $caption = str_replace('%!--', '<!--', $caption);
422+                          $caption = str_replace('--%', '-->', $caption);
423+                          // - special case: nested image ref (we can't really resolve these)
424+                          $caption = preg_replace('/<imgref\s+([^>]+)><\/imgref>/','\1',$caption);
425+                          $layout = "<div class=\"undercaption\">".$this->getLang('fig').$number.": <a name=\"".$name."\"></a>".$caption."</div>";
426+                          }
427+                        $layout .= "</div>";
428+                        $renderer->doc .= $layout; break;
429                }
430                                // -------------------------------------------------------     
431                                // data is mostly empty!!!
432@@ -284,7 +325,7 @@
433     
434     function _imgstart($str) {
435        // ============================================ //
436-       if (!strlen($str)) return array();
437+      if (empty($str)) return '';
438       
439                $layout = "<div class=\"imgcaption";
440                //$layout = "<div><div class=\"imgcaption";
441@@ -304,6 +345,8 @@
442      * @return array(imagename, image number, image caption)
443      */
444     function _imgend($str) {
445+      // [jmt12] I think this function is unused!
446+
447        // ===================================================== //
448        $figureName = end($this->_figure_name_array);
449        // get the position of the figure in the array
450@@ -311,8 +354,9 @@
451               
452                return array($figureName, $refNumber, $str);
453               
454+
455                $layout = "<div class=\"undercaption\">".$this->getLang('fig').$refNumber.":
456-               <a name=\"".end($this->_figure_name_array)."\">".$str."</a></div>";
457+               <a name=\"".end($this->_figure_name_array)."\"></a>".$str."</div>";
458               
459                //$layout = "<div id=\"undercaption\">Fig. ".$refNumber.":
460                //<a name=\"".end($this->_figure_name_array)."\">".$str."</a></div></div></div>";
461</code> ||
462^ lang/en/lang.php  | Changed the strings  |
463| <code diff u>
464--- /dokuwiki-2011-05-25a/lib/plugins/imagereference/lang/en/lang.php       2008-09-11 02:56:24.000000000 +1200
465+++ dokuwiki/lib/plugins/imagereference/lang/en/lang.php        2011-12-12 11:24:57.668503137 +1300
466@@ -3,5 +3,5 @@
467  * english language file
468  */
469 
470-$lang['fig']           = 'Fig. ';
471-$lang['figure']        = 'figure';
472\ No newline at end of file
473+$lang['fig']           = 'Figure ';
474+$lang['figure']        = 'figure';
475</code> ||
476==== Publish ====
477
478^ File  ^ Changes  ^
479^ 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)  |
480| <code diff u>
481--- dokuwiki-2011-05-25a/lib/plugins/publish/action.php    2011-10-16 03:55:40.000000000 +1300
482+++ dokuwiki/lib/plugins/publish/action.php     2012-01-24 10:34:18.115128733 +1300
483@@ -147,10 +147,14 @@
484         if($approver && !$most_recent_approved) { $strings[] = 'yes'; } else { $strings[] = 'no'; }
485         $strings[] = '">';
486 
487+        # [jmt12] We may not display the message at all
488+        $display_message = false;
489+
490         if($most_recent_draft) {
491             $strings[] = '<span class="approval_latest_draft">';
492             $strings[] = sprintf($this->getLang('apr_recent_draft'), wl($ID, 'force_rev=1'));
493             $strings[] = $this->difflink($ID, null, $REV) . '</span>';
494+            $display_message = true;
495         }
496 
497         if($most_recent_approved) {
498@@ -160,6 +164,7 @@
499             $strings[] = '<span class="approval_outdated">';
500             $strings[] = sprintf($this->getLang('apr_outdated'), wl($ID, 'rev=' . $userrev));
501             $strings[] = $this->difflink($ID, $userrev, $REV) . '</span>';
502+            $display_message = true;
503         }
504 
505         if(!$approver) {
506@@ -168,28 +173,27 @@
507             $strings[] = sprintf($this->getLang('apr_draft'),
508                             '<span class="approval_date">' . $longdate . '</span>');
509             $strings[] = '</span>';
510+            $display_message = true;
511         }
512 
513-        if($approver) {
514+        // [jmt12] Only display this notice to editors
515+        if($approver &&  $INFO['perm'] >= AUTH_EDIT) {
516             # Approved
517             $strings[] = '<span class="approval_approved">';
518             $strings[] = sprintf($this->getLang('apr_approved'),
519                             '<span class="approval_date">' . $longdate . '</span>',
520                             editorinfo($approver));
521             $strings[] = '</span>';
522-        }
523-
524-        if($previous_approved) {
525-            $strings[] = '<span class="approval_previous">';
526-            $strings[] = sprintf($this->getLang('apr_previous'),
527-                            wl($ID, 'rev=' . $previous_approved),
528-                            dformat($previous_approved));
529-            $strings[] = $this->difflink($ID, $previous_approved, $REV) . '</span>';
530+            $display_message = true;
531         }
532 
533         $strings[] = '</div>';
534 
535-        ptln(implode($strings));
536+        // [jmt12] if there is no message content, hide empty div
537+        if ($display_message)
538+        {
539+          ptln(implode($strings));
540+        }
541         return true;
542     }
543 
544</code> ||
545^ 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)  |
546| <code diff u>
547--- dokuwiki-2011-05-25a/lib/plugins/publish/style.css     2011-10-16 03:55:40.000000000 +1300
548+++ dokuwiki/lib/plugins/publish/style.css      2012-01-17 13:47:35.324065886 +1300
549@@ -3,7 +3,7 @@
550   margin-left: auto;
551   margin-right: auto;
552   width: 70% !important;
553-  min-height: 40px;
554+  min-height: 20px;
555   clear: both;
556   text-align: justify;
557   vertical-align: middle;
558</code> || 
559===== Templates =====
560
561==== Monobook ====
562
563^ File  ^ Changes  ^
564^ 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)  |
565|  <code diff u>
566--- dokuwiki-2011-05-25a/lib/tpl/monobook/main.php  2012-01-23 13:37:25.353131918 +1300
567+++ dokuwiki/lib/tpl/monobook/main.php  2012-01-16 12:30:35.131067643 +1300
568@@ -613,8 +613,8 @@
569               $ACT !== "media" && //var comes from DokuWiki
570               (empty($conf["useacl"]) || //are there any users?
571                $loginname !== "" || //user is logged in?
572-               !tpl_getConf("monobook_closedwiki")) &&
573-              tpl_getConf("monobook_youarehere_position") === "top"){
574+               !tpl_getConf("monobook_closedwiki"))){// &&
575+                //              tpl_getConf("monobook_youarehere_position") === "top"){
576               echo "\n          <div class=\"catlinks noprint\"><p>\n            ";
577               tpl_youarehere();
578               echo "\n          </p></div>\n";
579@@ -665,8 +665,8 @@
580               $ACT !== "media" && //var comes from DokuWiki
581               (empty($conf["useacl"]) || //are there any users?
582                $loginname !== "" || //user is logged in?
583-               !tpl_getConf("monobook_closedwiki")) &&
584-              tpl_getConf("monobook_youarehere_position") === "bottom"){
585+               !tpl_getConf("monobook_closedwiki"))){ // &&
586+                //              tpl_getConf("monobook_youarehere_position") === "bottom"){
587               echo "\n          <div class=\"catlinks noprint\"><p>\n            ";
588               tpl_youarehere();
589               echo "\n          </p></div>\n";
590</code>  ||
591^ 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.  |
592| <code diff u>
593--- dokuwiki-2011-05-25a/lib/tpl/monobook/static/css/screen.css 2012-01-23 13:44:38.685377461 +1300
594+++ dokuwiki/lib/tpl/monobook/static/css/screen.css 2012-01-23 11:43:23.188315618 +1300
595@@ -678,6 +678,8 @@
596   line-height: 1.2em;
597   padding: 0.5em;
598   border-style: dashed;
599+  overflow: scroll;
600+  width: 800px;
601 }
602 div#content .dokuwiki dl.file,
603 div#content .dokuwiki dl.file dd {
604</code> ||
605^ static/3rd/monobook/main.css  | Reduce the text area to around 1000px by centring main div and other absolute divs (logo and top navigation).  |
606| <code diff u>
607--- dokuwiki-2011-05-25a/lib/tpl/monobook/static/3rd/monobook/main.css  2012-01-23 13:41:54.253064506 +1300
608+++ dokuwiki/lib/tpl/monobook/static/3rd/monobook/main.css  2012-01-23 11:45:42.674067707 +1300
609@@ -27,7 +27,7 @@
610    background: white;
611    color: black;
612    border: 1px solid #aaa;
613-   border-right: none;
614+   /*border-right: none;*/
615    line-height: 1.5em;
616    position: relative;
617    z-index: 2;
618@@ -54,6 +54,8 @@
619 /* scale back up to a sane default */
620 #globalWrapper {
621    font-size: 127%;
622+   width: 1024px;
623+   margin: 0 auto;
624    padding: 0;
625 }
626 .visualClear {
627@@ -702,7 +704,7 @@
628    z-index: 3;
629    position: absolute; /*needed to use z-index */
630    top: 0;
631-   left: 0;
632+   /*left: 0;*/
633    height: 155px;
634    width: 12em;
635    overflow: visible;
636@@ -858,9 +860,10 @@
637 #p-cactions {
638    position: absolute;
639    top: 1.3em;
640-   left: 11.5em;
641+   /*left: 11.5em;*/
642    margin: 0;
643    white-space: nowrap;
644+   width: 1024px;
645    line-height: 1.1em;
646    overflow: visible;
647    background: none;
648@@ -869,7 +872,7 @@
649         margin: 0 auto;
650    list-style: none;
651    font-size: 95%;
652-        font-weight: normal;
653+font-weight: normal;
654 }
655 #p-cactions .hiddenStructure {
656    display: none;
657</code> ||
Note: See TracBrowser for help on using the browser.