We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit e53edc2b authored by Evan Prodromou's avatar Evan Prodromou

allow user properties in documentation files

parent ef67262a
......@@ -1933,12 +1933,40 @@ function common_confirmation_code($bits)
function common_markup_to_html($c)
$c = preg_replace('/%%user.(\w+)%%/e', "common_user_property('\\1')", $c);
$c = preg_replace('/%%action.(\w+)%%/e', "common_local_url('\\1')", $c);
$c = preg_replace('/%%doc.(\w+)%%/e', "common_local_url('doc', array('title'=>'\\1'))", $c);
$c = preg_replace('/%%(\w+).(\w+)%%/e', 'common_config(\'\\1\', \'\\2\')', $c);
return Markdown($c);
function common_user_property($property)
$profile = Profile::current();
if (empty($profile)) {
return null;
switch ($property) {
case 'profileurl':
case 'nickname':
case 'fullname':
case 'location':
case 'bio':
return $profile->$property;
case 'avatar':
return $profile->getAvatar(AVATAR_STREAM_SIZE);
case 'bestname':
return $profile->getBestName();
return null;
function common_profile_uri($profile)
if (!$profile) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment