forked from GNUsocial/gnu-social
pass args from Docfile to renderer
This commit is contained in:
parent
213086cc1f
commit
b72788d9ce
@ -90,13 +90,17 @@ class DocFile
|
||||
}
|
||||
}
|
||||
|
||||
function toHTML()
|
||||
function toHTML($args=null)
|
||||
{
|
||||
if (is_null($args)) {
|
||||
$args = array();
|
||||
}
|
||||
|
||||
if (empty($this->contents)) {
|
||||
$this->contents = file_get_contents($this->filename);
|
||||
}
|
||||
|
||||
return common_markup_to_html($this->contents);
|
||||
return common_markup_to_html($this->contents, $args);
|
||||
}
|
||||
|
||||
static function defaultPaths()
|
||||
|
@ -1933,6 +1933,10 @@ function common_confirmation_code($bits)
|
||||
|
||||
function common_markup_to_html($c, $args=null)
|
||||
{
|
||||
if (is_null($args)) {
|
||||
$args = array();
|
||||
}
|
||||
|
||||
$c = preg_replace('/%%arg.(\w+)%%/', "{$args['\\1']}", $c);
|
||||
$c = preg_replace('/%%user.(\w+)%%/e', "common_user_property('\\1')", $c);
|
||||
$c = preg_replace('/%%action.(\w+)%%/e', "common_local_url('\\1')", $c);
|
||||
|
Loading…
Reference in New Issue
Block a user