Changeset 30100


Ignore:
Timestamp:
2015-08-12T11:57:04+12:00 (7 years ago)
Author:
jmt12
Message:

Updating the development page with the lastest changes (which appear to be a fix for a weird problem where the string preference was being replaced with CSS randomly, so I changed the style name to preftitle)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • documentation/trunk/packages/dokuwiki-2011-05-25a/data/pages/wiki/development.txt

    r25027 r30100  
    11====== Development ======
     2
     3===== Frequently Asked Questions =====
     4
     5==== Q. How do you enable login to wiki using Greenstone registration? ====
     6
     7The code changes to allow for Greenstone registration integration should already be present in the dokuwiki retrieved from Greenstone's SVN. To configure the dokuwiki for login follow these instructions:
     8  - Copy ''<dokuwiki>/conf/mysql.conf.php.example'' to ''<dokuwiki>/conf/mysql.conf.php''
     9  - Edit the ''mysql.conf.php'' file to have the correct details:<code>$conf['auth']['mysql']['server']   = 'localhost';
     10$conf['auth']['mysql']['user']     = 'greenstonewiki';
     11$conf['auth']['mysql']['password'] = '********';
     12$conf['auth']['mysql']['database'] = 'gs_services';</code>
     13  - While still in the conf directory, create a file ''local.protected.php'' with the content:<code><?php
     14require_once('mysql.conf.php');
     15?></code>
     16  - Edit the file ''local.php'' and ammend/add the line:<code>...
     17$conf['authtype'] = 'mysql';
     18...</code>
     19  - Ensure the permissions for all three files you've edited are correct as to be readble by the //nzdl// group
     20  - Disable Dokuwiki's built-in register and email new password abilities by editing ''<dokuwiki>/conf/local.php'' and adding (or updating):<code>$conf['disableactions'] = 'register,resendpwd';</code>Alternatively, you can set these in the "Configuration Settings" page within the "Admin" page. **Note** a later customization step will add back in links to the global Greenstone registration system.
     21
     22==== Q. How do I create a page? ====
     23
     24The easiest way is to use the search box in the left navigation to search for a page that isn't already created. Include in the search any path/namespace as required. For instance, we (originally) created this page by searching for:<code>faq</code>but we could have included a path like so:<code>Manuals:User:Section1</code>which would create a ''Manuals'' folder, with a ''User'' folder within it, and finally the ''Section1'' page within that.
     25
     26When you search for a page that isn't there, the result page will helpfully suggest //"If you didn't find what you were looking for, you can create or edit the page named after your query with the appropriate button."// However, instead of a button, in this page template you'll need to click the tab at the top of the search results page labelled ''create this page''.  If it all works you should find yourself in a textarea editor entering content for the page. Click ''Preview'' to review your content for formatting etc, and ''Save'' to commit changes to the page.
    227
    328===== Installation =====
     
    3257  * [[http://www.dokuwiki.org/plugin:publish|Publish]] - integrate a publishing process into DokuWiki (differentiating between draft and approved copies of pages)
    3358  * [[http://www.dokuwiki.org/plugin:tablewidth|TableWidth]] - allows the width of tables and table cells to be defined
    34 
     59  * [[:wiki:development#custom_plugins|SimpleTabs]] - as explained below.
    3560
    3661===== Customizations =====
    3762
     63**Note:** The diffs regarding the main Dokuwiki code are against the stable release 2011-05-25a "Rincewind".
    3864==== Dokuwiki ====
     65
     66=== inc/common.php ===
    3967
    4068^ File  ^ Changes  ^
     
    5381     }
    5482</code> ||
     83
     84=== inc/html.php ===
     85
     86^ File  ^ Changes  ^
     87^ inc/html.php  | Add id attributes to the table of contents list items so we can hide the ones on currently hidden tabs. Allow for a 'reset' header to be specified by the user in order to 'break out of' the current TOC nesting (for instance, at the end of a tabbed area to prevent following headings being grouped under Tab area headings).  |
     88| <code diff u>
     89--- html.original.php   2014-03-13 11:16:37.000000000 +1300
     90+++ html.php    2014-03-13 11:13:34.000000000 +1300
     91@@ -758,9 +758,28 @@ function html_li_index($item){
     92  *
     93  * @author Andreas Gohr <andi@splitbrain.org>
     94  */
     95+// In order to alter the TOC when a user changes a tab, we
     96+// need some way to uniquely identify what titles lurk in
     97+// what tabs. Dokuwiki automagically labels headers with
     98+// <a name=""> tags - so if I use the same information here
     99+// they should match (and be unique etc)
     100+// - jmt12
     101+// At some stage the traditional 'link' attribute was (some-
     102+// times) replaced with information in 'hid'
     103+// - jmt12 2014MAR13
     104 function html_li_default($item)
     105 {
     106-    return '<li class="level' . $item['level'] . '">';
     107+  $link = $item['link'];
     108+  if (isset($item['hid']) && !empty($item['hid']))
     109+    {
     110+      $link = $item['hid'];
     111+    }
     112+  $hash_pos = strpos($link, '#');
     113+  if ($hash_pos !== false)
     114+    {
     115+      $link = substr($link, $hash_pos + 1);
     116+    }
     117+  return '<li id="toc_' . $link . '" class="level' . $item['level'] . '">';
     118 }
     119
     120 /**
     121@@ -784,7 +803,24 @@ function html_buildlist($data,$class,$fu
     122     $ret   = '';
     123 
     124     foreach ($data as $item){
     125-   if( $item['level'] > $level ){
     126+      // A reset closes all TOC items, all the way back to the top
     127+      if ($item['title'] == '#')
     128+   {
     129+     //close last item
     130+     $ret .= "</li>\n";
     131+     while( $level > 0 && $open > 0 ){
     132+       //close higher lists
     133+       $ret .= "</ul>\n</li>\n";
     134+       $level--;
     135+       $open--;
     136+     }
     137+     // open a dummy item list, although we don't output a list item
     138+     $ret .= "<li class=\"clear\">\n<ul class=\"$class\">\n<li class=\"clear\">";
     139+     $level++;
     140+     $open++;
     141+     // skip to next item
     142+     continue;
     143+   }elseif( $item['level'] > $level ){
     144             //open new list
     145             for($i=0; $i<($item['level'] - $level); $i++){
     146                 if ($i) $ret .= "<li class=\"clear\">\n";
     147</code>||
     148
     149
     150=== inc/lang/en/login.txt ===
     151
     152^ File  ^ Changes  ^
     153^ inc/lang/en/login.txt  | Add a link to the global Greenstone registration / password reset page (because we have disabled Dokuwiki's built-in user stuff at the top of this page).  |
     154| <code diff u>
     155--- dokuwiki-2011-05-25a/inc/lang/en/login.txt  2012-02-09 10:17:32.000000000 +1300
     156+++ greenstone-wiki/inc/lang/en/login.txt   2013-10-24 12:12:14.000000000 +1300
     157@@ -2,3 +2,4 @@
     158 
     159 You are currently not logged in! Enter your authentication credentials below to log in. You need to have cookies enabled to log in.
     160 
     161+Don't have an account? [[http://www.greenstone.org/users?&returnto=GreenstoneWiki|Create an account or email new password]].
     162</code>||
     163=== inc/parserutils.php ===
     164
     165^ File  ^ Changes  ^
     166^ inc/parserutils.php  | Add a check to an introspective call to ensure that the function called exists in the class //before// calling it - otherwise the logs fill up with warnings from classes that don't (i.e. ''Doku_Renderer_metadata'') |
     167| <code diff u>
     168--- /greenstone/greenstone-documentation/packages/dokuwiki-2011-05-25a/inc/parserutils.php  2012-02-01 16:03:06.000000000 +1300
     169+++ parserutils.php 2013-09-19 10:46:58.000000000 +1200
     170@@ -522,7 +522,12 @@ function p_render_metadata($id, $orig){
     171         // loop through the instructions
     172         foreach ($instructions as $instruction){
     173             // execute the callback against the renderer
     174-            call_user_func_array(array(&$renderer, $instruction[0]), (array) $instruction[1]);
     175+       // - check we can, first, otherwise logs fill up with warnings
     176+       $handler = array(&$renderer, $instruction[0]);
     177+       if (is_callable($handler))
     178+            {
     179+              call_user_func_array($handler, (array) $instruction[1]);
     180+       }
     181         }
     182 
     183         $evt->result = array('current'=>&$renderer->meta,'persistent'=>&$renderer->persistent);
     184</code>||
     185=== inc/parser/handler.php ===
     186
     187^ File  ^ Changes  ^
    55188^ inc/parser/handler.php  | Hide HTML comments (namely text ids) in headings  |
    56189| <code diff u>
     
    68201         $this->_addCall('header',array($title,$level,$pos), $pos);
    69202</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.  |
     203
     204=== inc/parser/xhtml.php ===
     205
     206^ File  ^ Changes  ^
     207^ inc/parser/xhtml.php  | Hide the reset header (whose content is simply "#"). 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.  |
    71208| <code diff u>
    72209--- dokuwiki-2011-05-25a/inc/parser/xhtml.php   2011-06-15 07:58:54.000000000 +1200
    73210+++ dokuwiki/inc/parser/xhtml.php   2012-01-23 13:16:49.317187175 +1300
     211@@ -170,6 +170,12 @@
     212         }
     213         $this->lastlevel = $level;
     214 
     215+   // Hide the 'reset' header
     216+        if ($text == '#')
     217+   {
     218+     return;
     219+   }
     220+
     221         if ($level <= $conf['maxseclevel'] &&
     222             count($this->sectionedits) > 0 &&
     223             $this->sectionedits[count($this->sectionedits) - 1][2] === 'section') {
     224             
    74225@@ -449,19 +449,24 @@
    75226             $text = substr($text, 0, -1);
     
    118269         $link['style']  = '';
    119270</code> ||
    120 
    121271===== Plugins =====
    122272
     273==== Custom Plugins ====
     274
     275=== SimpleTabs ===
     276
     277Support for simple tabbed areas (as compared to the existing complicated tabbed area plugins ala [[https://www.dokuwiki.org/plugin:tabinclude|TabInclude]]) is provided through a custom-built plugin. To reinstall:
     278  * download {{:wiki:simpletabs-2014dec05.tgz|SimpleTabs}} (5.5K)
     279  * extract to ''<dokuwiki>/lib/plugins/''
     280The syntax looks like this:<code><TABAREA tabs="comma,separated,list">
     281<TAB>content for 'comma' //including// wiki <del>magic</del> formatting</TAB>
     282<TAB>content for 'separated' and a [[:playground|link]]</TAB>
     283<TAB>content for 'list'</TAB>
     284</TABAREA></code>
     285
     286Older versions: {{:wiki:simpletabs-2013sep18.tgz|2013SEP18}} (5.0K) {{:wiki:simpletabs-2013aug02.tgz|2013AUG02}} (4.3K)
    123287==== Code ====
     288
     289Diff against [[http://wiki.splitbrain.org/plugin:code2|code2]] plugin dated 2008-07-22.
    124290
    125291^ File  ^ Changes  ^
     
    137303    } // _entities()
    138304</code>  ||
    139 
    140305==== HTMLComment ====
     306
     307Diff against [[http://wiki.splitbrain.org/plugin:htmlcomment|htmlcomment]] plugin dated 2005-10-08.
    141308
    142309^ File  ^ Changes  ^
     
    216383         }
    217384</code> ||
    218 
    219385==== ImageReference ====
     386
     387Diff against [[http://wiki.splitbrain.org/plugin:imagereference|imagereference]] plugin dated 2008-05-30.
    220388
    221389^ File  ^ Changes  ^
     
    476644==== Publish ====
    477645
     646Diff against [[http://www.dokuwiki.org/plugin:publish|publish]] plugin dated 2011-10-02.
     647
    478648^ File  ^ Changes  ^
    479649^ 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)  |
     
    561731==== Monobook ====
    562732
     733Diff against [[https://www.dokuwiki.org/template:monobook|monobook]] template dated 2011-12-10.
     734
    563735^ File  ^ Changes  ^
    564736^ 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)  |
    565737|  <code diff u>
    566738--- 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
     739+++ dokuwiki/lib/tpl/monobook/main.php  2013-10-24 12:22:48.000000000 +1300
    568740@@ -613,8 +613,8 @@
    569741               $ACT !== "media" && //var comes from DokuWiki
     
    587759               echo "\n          <div class=\"catlinks noprint\"><p>\n            ";
    588760               tpl_youarehere();
    589                echo "\n          </p></div>\n";
     761               echo "\n          </p></div>\n";               
     762@@ -698,7 +698,7 @@
     763           //default
     764           echo "style=\"background-image:url(".DOKU_TPL."static/3rd/dokuwiki/logo.png);\"";
     765       }
     766-      echo " accesskey=\"h\" title=\"[ALT+H]\"></a>\n";
     767+      echo " accesskey=\"h\" title=\"Back to start [ALT+H]\"></a>\n";
     768       ?>
     769     </div>
     770     <?php
     771@@ -733,7 +733,7 @@
     772                 echo "          <li id=\"pt-mytalk\">".html_wikilink(tpl_getConf("monobook_discuss_ns").ltrim(tpl_getConf("monobook_userpage_ns"), ":").$loginname, hsc($lang["monobook_tab_mytalk"]))."</li>";
     773             }
     774             //profile
     775-            echo  "          <li id=\"pt-preferences\"><a href=\"".wl(cleanID(getId()), array("do" => "profile"))."\" rel=\"nofollow\">".hsc($lang["btn_profile"])."</a></li>\n"; //language comes from DokuWiki core
     776+            echo  "          <li id=\"pt-preferences\"><a href=\"http://www.greenstone.org/users/change.php\" rel=\"nofollow\">".hsc($lang["btn_profile"])."</a></li>\n"; //language comes from DokuWiki core
     777             //logout
     778             echo  "          <li id=\"pt-logout\"><a href=\"".wl(cleanID(getId()), array("do" => "logout"))."\" rel=\"nofollow\">".hsc($lang["btn_logout"])."</a></li>\n"; //language comes from DokuWiki core
     779         } 
    590780</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
     781^ 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.  Making h5 different (I can't remember why). Two little fixes for the new simple tabbed area where there are extra pixels sneaking in between the tabs and the tab content areas. |
     782| <code diff u>
     783--- screen.css.original 2012-12-13 12:54:13.000000000 +1300
     784+++ screen.css  2013-08-02 12:00:08.000000000 +1200
     785@@ -535,10 +535,12 @@ div#content .dokuwiki h1 a,
     786 div#content .dokuwiki h2 a,
     787 div#content .dokuwiki h3 a,
     788 div#content .dokuwiki h4 a,
     789-div#content .dokuwiki h5 a,
     790 div#content .dokuwiki h6 a {
     791   color: __text__;
     792 }
     793+div#content .dokuwiki h5 a {
     794+  color: __background__;
     795+}
     796 div#content .dokuwiki h1 a:hover,
     797 div#content .dokuwiki h2 a:hover,
     798 div#content .dokuwiki h3 a:hover,
     799@@ -571,6 +573,7 @@ div#content .dokuwiki h4 {
     800 }
     801 div#content .dokuwiki h5 {
     802   font-size: 100%;
     803+  color: __background__;
     804 }
     805 div#content .dokuwiki h6 {
     806   font-size: 80%;
     807@@ -629,7 +632,7 @@ div.dokuwiki li.closed {
     808 
     809 div#content div.dokuwiki li {
     810   margin-left: 0;
     811-  margin-bottom: 1px;
     812+  margin-bottom: 0;
     813 }
     814 
     815 /* quotes */
    595816@@ -678,6 +678,8 @@
    596817   line-height: 1.2em;
     
    602823 div#content .dokuwiki dl.file,
    603824 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).  |
     825@@ -1338,3 +1343,7 @@ textarea,
     826   #font-weight: bold;
     827   #border-left: 1px dashed __background__; /* invisible border triggers IE to render the stuff */
     828 }
     829+
     830+div.tab {
     831+ margin-top:-1px;
     832+}
     833</code> ||
     834^ static/3rd/dokuwiki/_tabs.css  | Remove the override of foreground and background colours. |
     835| <code diff u>
     836--- _tabs.css.original  2013-08-02 12:07:12.000000000 +1200
     837+++ _tabs.css   2013-08-02 12:07:36.000000000 +1200
     838@@ -19,8 +19,6 @@
     839     float: left;
     840     padding: .3em .8em;
     841     margin: 0 .3em 0 0;
     842-    background-color: __background_neu__;
     843-    color: __text__;
     844     border-radius: .5em .5em 0 0;
     845 }
     846 .dokuwiki ul.tabs li strong {
     847</code> ||
     848^ static/3rd/monobook/main.css  | Reduce the text area to around 1000px by centring main div and other absolute divs (logo and top navigation).  Rename the style "preferences" to "preftitle" to prevent CSS being randomly injected where-ever you end up with an anchor tag that just happens to have the word preferences in it (happens surprisingly often in instruction manuals). I can't actually find where this style is used anyway. |
    606849| <code diff u>
    607850--- dokuwiki-2011-05-25a/lib/tpl/monobook/static/3rd/monobook/main.css  2012-01-23 13:41:54.253064506 +1300
     
    646889    overflow: visible;
    647890    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> ||
     891@@ -1034,7 +1037,7 @@
     892    padding-top: 2em;
     893    clear: both;
     894 }
     895-#preferences {
     896+#preftitle {
     897    margin: 0;
     898    border: 1px solid #aaa;
     899    clear: both;
     900</code> ||
Note: See TracChangeset for help on using the changeset viewer.