]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
pass args from Docfile to renderer
authorEvan Prodromou <evan@status.net>
Mon, 18 Apr 2011 13:47:08 +0000 (09:47 -0400)
committerEvan Prodromou <evan@status.net>
Mon, 18 Apr 2011 13:47:08 +0000 (09:47 -0400)
lib/docfile.php
lib/util.php

index feba930b4337b39c5e545dd7345f512e89acb29c..982177315a3f9bb0ec139dbc63f3ba74278d0117 100644 (file)
@@ -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()
index 05c5407cdb5b6db216254e8416f875b62ed2be62..be954feb49bcf94ee50fb1b858c0226c75864f3c 100644 (file)
@@ -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);