====== Development ====== **WARNING!** This page is currently out-of-date, and reflects the state of the wiki prior to inclusion in the University-wide system. Here there be dragons. ===== Frequently Asked Questions ===== ==== Q. How do you enable login to wiki using Greenstone registration? ==== The 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: - Copy ''/conf/mysql.conf.php.example'' to ''/conf/mysql.conf.php'' - Edit the ''mysql.conf.php'' file to have the correct details:$conf['auth']['mysql']['server'] = 'localhost'; $conf['auth']['mysql']['user'] = 'greenstonewiki'; $conf['auth']['mysql']['password'] = '********'; $conf['auth']['mysql']['database'] = 'gs_services'; - While still in the conf directory, create a file ''local.protected.php'' with the content: - Edit the file ''local.php'' and ammend/add the line:... $conf['authtype'] = 'mysql'; ... - Ensure the permissions for all three files you've edited are correct as to be readble by the //nzdl// group - Disable Dokuwiki's built-in register and email new password abilities by editing ''/conf/local.php'' and adding (or updating):$conf['disableactions'] = 'register,resendpwd';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. ==== Q. How do I create a page? ==== The 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:faqbut we could have included a path like so:Manuals:User:Section1which would create a ''Manuals'' folder, with a ''User'' folder within it, and finally the ''Section1'' page within that. When 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. ===== Installation ===== - Checkout the ''gsdl-docs'' package out of SVN - Go to ''/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 ''/'' and create a symlink to the folder you just unpacked called just ''dokuwiki'':ln -s ./lib/dokuwiki/dokuwiki- ./dokuwiki - Copy all of the archive files in ''/lib/dokuwiki/plugins/'' into ''/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 ''/lib/dokuwiki/templates'' to ''/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 ''/'' //is// ''/gsdl-docs'', then visit:http://localhost:8080/gsdl-docs/dokuwiki/install.php - 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 ''/lib/dokuwiki/conf/local.php'' to ''/dokuwiki/conf/'' overwriting the existing file - Recursively copy the starting pages file into place, overwriting existing files if promptedcp -r /lib/dokuwiki/pages/ /dokuwiki/data/pages/ * **note** there is a copy of these instructions in the starting files, located at [[wiki:development]] - Enter ''/lib/php/'' - 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 - 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 ===== * Captcha - Use a CAPTCHA challenge to protect DokuWiki against automated spam * [[http://wiki.splitbrain.org/plugin:code2|Code2]] by Matthias Watermann - Enhanced code syntax highlighting with line numbering * [[http://wiki.splitbrain.org/plugin:htmlcomment|HTMLComment]] by Christopher Arndt - allows HTML comments to be retained in the output * [[http://wiki.splitbrain.org/plugin:ifauth|IFAuth]] by Otto Vainio - so content only for specific groups and/or users * [[http://wiki.splitbrain.org/plugin:imagereference|ImageReference]] by Gerrit Uitslag - create image references like latex is doing with figures * [[http://dokuwiki.org/plugin:orphanswanted|OrphansWanted]] by Doug Edmunds //et al// - provide macros to list orphan pages and wanted pages * [[http://www.dokuwiki.org/plugin:publish|Publish]] by Jarrod Lowe //et al// - integrate a publishing process into DokuWiki (differentiating between draft and approved copies of pages) * [[http://www.dokuwiki.org/plugin:tablewidth|TableWidth]] by Mykola Ostrovskyy - allows the width of tables and table cells to be defined * [[:wiki:development#custom_plugins|SimpleTabs]] - as explained below. ===== Customizations ===== **Note:** The diffs regarding the main Dokuwiki code are against the stable release 2011-05-25a "Rincewind". ==== Dokuwiki ==== === inc/common.php === ^ 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]]) | | --- 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; } || === inc/html.php === ^ File ^ Changes ^ ^ 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). | | --- html.original.php 2014-03-13 11:16:37.000000000 +1300 +++ html.php 2014-03-13 11:13:34.000000000 +1300 @@ -758,9 +758,28 @@ function html_li_index($item){ * * @author Andreas Gohr */ +// In order to alter the TOC when a user changes a tab, we +// need some way to uniquely identify what titles lurk in +// what tabs. Dokuwiki automagically labels headers with +// tags - so if I use the same information here +// they should match (and be unique etc) +// - jmt12 +// At some stage the traditional 'link' attribute was (some- +// times) replaced with information in 'hid' +// - jmt12 2014MAR13 function html_li_default($item) { - return '
  • '; + $link = $item['link']; + if (isset($item['hid']) && !empty($item['hid'])) + { + $link = $item['hid']; + } + $hash_pos = strpos($link, '#'); + if ($hash_pos !== false) + { + $link = substr($link, $hash_pos + 1); + } + return '
  • \n"; + while( $level > 0 && $open > 0 ){ + //close higher lists + $ret .= "\n\n"; + $level--; + $open--; + } + // open a dummy item list, although we don't output a list item + $ret .= "
  • \n