Added Fontawesome links on event
This commit is contained in:
parent
09f56866c8
commit
a9c6ce408b
|
@ -4,6 +4,3 @@ User HomePage
|
|||
Dokuwiki plugin to automatically create user's homepage and/or namespace.
|
||||
Previous authors stopped developing it in 2009.
|
||||
I started to work on it in 2014-08.
|
||||
|
||||
TODO
|
||||
Add options to select what to include in the string on event and possibly send a FontAwesome string if it is enabled.
|
||||
|
|
22
action.php
22
action.php
|
@ -328,6 +328,10 @@ class action_plugin_userhomepage extends DokuWiki_Action_Plugin{
|
|||
|
||||
if (($conf['showuseras'] == "username_link") and ($this->getConf('userlink_replace'))) {
|
||||
$classes = $this->getConf('userlink_classes');
|
||||
$classes = str_replace(',', ' ', $classes);
|
||||
if ($this->getConf('userlink_fa')) {
|
||||
$classes = str_replace('interwiki', '', $classes);
|
||||
}
|
||||
$this->username = $event->data['username'];
|
||||
$this->name = $event->data['name'];
|
||||
$this->link = $event->data['link'];
|
||||
|
@ -338,11 +342,23 @@ class action_plugin_userhomepage extends DokuWiki_Action_Plugin{
|
|||
$privateId = $this->helper->getPrivateID();
|
||||
$publicId = $this->helper->getPublicID();
|
||||
if ((page_exists($privateId)) && (page_exists($publicId))) {
|
||||
$return = '<a href="'.wl($privateId).'" class="'.$classes.' uhp_private" rel="nofollow" title="'.$this->getLang('privatenamespace').' ('.$privateId.')'.'"><bdi>'.$INFO['userinfo']['name'].'</bdi></a> (<a href="'.wl($publicId).'" class="'.$classes.' uhp_public" rel="nofollow" title="'.$this->getLang('publicpage').' ('.$publicId.')'.'"><bdi>'.$_SERVER['REMOTE_USER'].'</bdi></a>)';
|
||||
if ($this->getConf('userlink_fa')) {
|
||||
$return = '<a href="'.wl($privateId).'" class="'.$classes.' uhp_fa" rel="nofollow" title="'.$this->getLang('privatenamespace').' ('.$privateId.')'.'"><bdi><i class="fa fa-user-secret"></i>'.$INFO['userinfo']['name'].'</bdi></a> (<a href="'.wl($publicId).'" class="'.$classes.' uhp_fa" rel="nofollow" title="'.$this->getLang('publicpage').'('.$publicId.')'.'"><bdi><i class="fa fa-user"></i> '.$_SERVER['REMOTE_USER'].'</bdi></a>)';
|
||||
} else {
|
||||
$return = '<a href="'.wl($privateId).'" class="'.$classes.' uhp_private" rel="nofollow" title="'.$this->getLang('privatenamespace').' ('.$privateId.')'.'"><bdi>'.$INFO['userinfo']['name'].'</bdi></a> (<a href="'.wl($publicId).'" class="'.$classes.' uhp_public" rel="nofollow" title="'.$this->getLang('publicpage').' ('.$publicId.')'.'"><bdi>'.$_SERVER['REMOTE_USER'].'</bdi></a>)';
|
||||
}
|
||||
} elseif (page_exists($publicId)) {
|
||||
$return = '<bdi>'.$INFO['userinfo']['name'].'</bdi> (<a href="'.wl($publicId).'" class="'.$classes.' uhp_public" rel="nofollow" title="'.$this->getLang('publicpage').' ('.$publicId.')'.'"><bdi>'.$_SERVER['REMOTE_USER'].'</bdi></a>)';
|
||||
if ($this->getConf('userlink_fa')) {
|
||||
$return = '</a> (<a href="'.wl($publicId).'" class="'.$classes.' uhp_fa" rel="nofollow" title="'.$this->getLang('publicpage').'('.$publicId.')'.'"><bdi><i class="fa fa-user"></i> '.$_SERVER['REMOTE_USER'].'</bdi></a>)';
|
||||
} else {
|
||||
$return = '<bdi>'.$INFO['userinfo']['name'].'</bdi> (<a href="'.wl($publicId).'" class="'.$classes.' uhp_public" rel="nofollow" title="'.$this->getLang('publicpage').' ('.$publicId.')'.'"><bdi>'.$_SERVER['REMOTE_USER'].'</bdi></a>)';
|
||||
}
|
||||
} elseif (page_exists($privateId)) {
|
||||
$return = '<a href="'.wl($privateId).'" class="'.$classes.' uhp_private" rel="nofollow" title="'.$this->getLang('privatenamespace').' ('.$privateId.')'.'"><bdi>'.$INFO['userinfo']['name'].'</bdi></a> (<bdi>'.$_SERVER['REMOTE_USER'].'</bdi>)';
|
||||
if ($this->getConf('userlink_fa')) {
|
||||
$return = '<a href="'.wl($privateId).'" class="'.$classes.' uhp_fa" rel="nofollow" title="'.$this->getLang('privatenamespace').' ('.$privateId.')'.'"><bdi><i class="fa fa-user-secret"></i>'.$INFO['userinfo']['name'].'</bdi></a>';
|
||||
} else {
|
||||
$return = '<a href="'.wl($privateId).'" class="'.$classes.' uhp_private" rel="nofollow" title="'.$this->getLang('privatenamespace').' ('.$privateId.')'.'"><bdi>'.$INFO['userinfo']['name'].'</bdi></a> (<bdi>'.$_SERVER['REMOTE_USER'].'</bdi>)';
|
||||
}
|
||||
} else {
|
||||
$return = null;
|
||||
}
|
||||
|
|
|
@ -26,3 +26,4 @@
|
|||
$conf['action'] = 'edit';
|
||||
$conf['userlink_replace'] = 1;
|
||||
$conf['userlink_classes'] = 'interwiki wikilink1';
|
||||
$conf['userlink_fa'] = 0;
|
||||
|
|
|
@ -26,3 +26,4 @@
|
|||
$meta['action'] = array('multichoice','_choices'=>array('edit','show'));
|
||||
$meta['userlink_replace'] = array('onoff');
|
||||
$meta['userlink_classes'] = array('string');
|
||||
$meta['userlink_fa'] = array('onoff');
|
||||
|
|
|
@ -58,3 +58,4 @@
|
|||
$lang['action_o_show'] = 'Show';
|
||||
$lang['userlink_replace'] = 'Enable replacement of [<code>Logged in as</code>] interwiki link, depending on pages created by Userhomepage (only works if <code>showuseras</code> option is set to interwiki link).';
|
||||
$lang['userlink_classes'] = 'Space separated list of CSS classes to apply to [<code>Logged in as</code>] interwiki links (default: <code>interwiki wikilink1</code>).';
|
||||
$lang['userlink_fa'] = 'Use Fontawesome icons instead of images (Fontawesome has to be installed by template or a plugin) ?';
|
||||
|
|
|
@ -58,3 +58,4 @@
|
|||
$lang['action_o_show'] = 'Afficher';
|
||||
$lang['userlink_replace'] = 'Activer le remplacement du lien interwiki [<code>Connecté en tant que</code>], selon les pages créées par Userhomepage (ne fonctionne que si l\'option <code>showuseras</code> est configurée pour le lien interwiki).';
|
||||
$lang['userlink_classes'] = 'Liste séparée par des espaces de classes CSS à appliquer aux liens de la chaîne [<code>Connecté en tant que</code>] (défaut: <code>interwiki wikilink1</code>).';
|
||||
$lang['userlink_fa'] = 'Utiliser des icônes Fontawesome au lieu d\'images (Fontawesome doit être installé par le thème ou un plugin) ?';
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
base userhomepage
|
||||
author Simon Delage
|
||||
email simon.geekitude@gmail.com
|
||||
date 2015-06-27
|
||||
date 2015-07-11
|
||||
name User Homepage
|
||||
desc Automatically create user's private namespace and/or public page and redirects users to private namespace on login.
|
||||
url https://www.dokuwiki.org/plugin:userhomepage
|
||||
|
|
|
@ -5,3 +5,5 @@ Screen Styles for the Userhomepage Plugin (additional to all.css)
|
|||
a.uhp_private,a.uhp_public { padding-left:19px; }
|
||||
a.uhp_private { background:url(images/ns.png) no-repeat left; }
|
||||
a.uhp_public { background:url(images/user.png) no-repeat left; }
|
||||
a.uhp_fa i.fa-user-secret,
|
||||
a.uhp_fa i.fa-user { padding: 0 5px 0 2px !important; }
|
||||
|
|
Loading…
Reference in New Issue