geekitude / dokuwiki-plugin-userhomepage

Dokuwiki plugin to automatically create user's homepage and/or namespace
https://www.dokuwiki.org/plugin:userhomepage
5 stars 9 forks source link

TODO: A link to private user namespace when users are connected #11

Closed sganarel closed 9 years ago

sganarel commented 9 years ago

Is it possible to put an hyperlink behind the name of the connected user (in the top menu bar) to give a quick access for the user's private namespace (to the start page) ?

geekitude commented 9 years ago

Hi

This is not an issue.

You will have to manually change your template to add this, sorry but a plugin can't change that on it's own. Here's for example what you can do with Dokuwiki's default template :

if (!empty($_SERVER['REMOTE_USER'])) {
    echo '<li class="user">';
    tpl_userinfo(); /* 'Logged in as ...' */
    echo '</li>';
}

with :

if ((tpl_getConf('userhomepageplugin')) and (!plugin_isdisabled('userhomepage')) and (!empty($_SERVER['REMOTE_USER']))) {
    $userhomepageHelper = plugin_load('helper','userhomepage');
    echo $userhomepageHelper->getComplexLoggedInAs();
} else {
    echo '<li class="user">';
    tpl_userinfo(); /* 'Logged in as ...' */
    echo '</li>';
}

You can find more helper functions in Helper section of plugin's official webpage.

Hope this helps

geekitude commented 9 years ago

Sorry, the code above was pasted from my own template and will not work. Check this for a working exemple: https://www.dokuwiki.org/plugin:userhomepage#user_links_with_dokuwiki_s_default_template

Klap-in commented 9 years ago

Since the last release usernames can be linked to userprofiles. This link is configurable. I think the event trigger attached to this functionality is useful for this request.

See event: https://www.dokuwiki.org/devel:event:common_user_link The default config setting: https://www.dokuwiki.org/config:showuseras

geekitude commented 9 years ago

Hi

Thanks for pointing to that event, will try to add this soon. Changed that "issue" to enhancement ;)

geekitude commented 9 years ago

Done and successfully tested with quite a few templates Thanks again for talking about that event :)

sganarel commented 9 years ago

Thanks it's perfect :+1:

geekitude commented 9 years ago

Thanks for the feedback. Enjoy ;)