Inhaltsverzeichnis

Wiki Dokumentation

Allfällige hacks und spezielle Einstellungen werden hier (hoffentlich) Dokumentiert.

plugin:translation

Language selector

Adding the selector to the theme

The snippet from plugin:translation was added to the dokuwiki theme.

/var/www/wiki/lib/tpl/dokuwiki/tpl_header.php

        <?php if ($conf['useacl']): ?>
            <div id="dokuwiki__usertools">
                <h3 class="a11y"><?php echo $lang['user_tools']; ?></h3>
                <ul>
                        <li>
                                <?php
                                        $translation = plugin_load('helper','translation');
                                        if ($translation) echo $translation->showTranslations();
                                ?>
                        </li>
                    <?php
                        if (!empty($_SERVER['REMOTE_USER'])) {
                            echo '<li class="user">';
                            tpl_userinfo(); /* 'Logged in as ...' */
                            echo '</li>';
                        }
                        tpl_toolsevent('usertools', array(
                            tpl_action('admin', true, 'li', true),
                            tpl_action('profile', true, 'li', true),
                            tpl_action('register', true, 'li', true),
                            tpl_action('login', true, 'li', true)
                        ));
                    ?>
                </ul>
            </div>
        <?php endif ?>

style.css was changed so that the language selector nicely ligns up left of the login section.

/var/www/wiki/lib/plugins/translation/style.css

.dokuwiki div.plugin_translation {
    float: right; 
    font-size: 95%;
    padding-right: 0.1em;
    margin : 0.0em 0 0.3em 0;
    text-align: right;
}

was chaged to:

.dokuwiki div.plugin_translation {
    display: inline-block;
    font-size: 95%;
    padding-right: 0.1em;
    margin : 0.0em 0 0.3em 0;
    text-align: right;
}

Problems with url rewriting

When using the language selector to switch in between de: and en: url-rewriting would not work properly.
We where getting of en:start, start/?id=de:start and de:start, start/?id=en:start\\.

We found the problem to be that script.js expects the base-url to end with / when url-rewriting is active. In our case However, it ends with /start. (which seems to be intentended, see the the wl() function in common.php)

We implemented the following workaround to fix this:

/var/www/wiki/lib/plugins/translation/script.js

        // this should hopefully detect rewriting good enough:
        var action = $frm.attr('action');
        if(action.substr(action.length-1) == '/'){
            var link = action + id;
        }

was replaced with:

        // this should hopefully detect rewriting good enough:
        var action = $frm.attr('action').replace('/start', '/');
        if(action.substr(action.length-1) == '/'){
            var link = action + id;
        }

plugin:doodle

We use a version of the doodle plugin that has been tampered with by the c3voc. Ask andi for details.

Nicer breadcrumbs

Since we're using both You are here: and Trace: breadcrumbs later are being moved to the right to keeping the breadcrumbs bar one line high.

/var/www/wiki/lib/tpl/dokuwiki/css/design.less

/*____________ breadcrumbs ____________*/
 
.dokuwiki div.breadcrumbs {
    border-bottom: 1px solid @ini_background;
    border-bottom: 1px solid @ini_border;
    margin-bottom: .5em;
    font-size: 0.875em;
    clear: both;
 
    div {
        padding: .1em .35em;
        }
 
    div:only-child {
        border-top: 1px solid @ini_background;
        border-bottom: 1px solid @ini_border;
    }
 
    div:first-child {
        border-top: 1px solid @ini_background;
    }
 
    div:last-child {
        border-bottom: 1px solid @ini_border;
    }
 
    .bcsep {
        font-size: 0.75em;
    }
}
 
#IE8 .dokuwiki div.breadcrumbs div {
    border-bottom: 1px solid @ini_border;
}

Was changed to:

/*____________ breadcrumbs ____________*/
 
.dokuwiki div.breadcrumbs {
    border-top: 1px solid @ini_border;
/*    border-bottom: 1px solid @ini_background; */
    border-bottom: 1px solid @ini_border;
    padding: 1px;
/* changed by raven, 09-01-16 in order to move trace to the right */
    margin-bottom: .5em;
    font-size: 0.875em;
    clear: both;
 
    div {
        padding: .1em .35em;
    display: inline-block;
/* changed by raven, 09-01-16 in order to move trace to the right */
        }
 
    div:only-child {
        border-top: 1px solid @ini_background;
        border-bottom: 1px solid @ini_border;
    }
 
    div:first-child {
        border-top: 1px solid @ini_background;
    }
 
    div:last-child {
/*        border-bottom: 1px solid @ini_border; */
        float: right;
/* changed by raven, 09-01-16 in order to move trace to the right */
    }
 
    .bcsep {
        font-size: 0.75em;
    }
}
 
#IE8 .dokuwiki div.breadcrumbs div {
    border-bottom: 1px solid @ini_border;
}

Locked Settings

The following setting have been locked to prevent accidental messup:

/var/www/wiki/conf/local.protected.php

<?php
$conf['start'] = 'start';
$conf['lang'] = 'de';
$conf['useacl'] = 1;
$conf['superuser'] = '@admin';
$conf['userewrite'] = '1';
$conf['plugin']['translation']['translations'] = 'de en';