[Fusionforge-commits] r20315 - trunk/src/plugins/wiki/www/lib

Marc-Etienne VARGENAU vargenau at fusionforge.org
Fri Jun 6 14:44:48 CEST 2014


Author: vargenau
Date: 2014-06-06 14:44:48 +0200 (Fri, 06 Jun 2014)
New Revision: 20315

Modified:
   trunk/src/plugins/wiki/www/lib/Template.php
Log:
wiki: fix PHP Doc and methods visibility

Modified: trunk/src/plugins/wiki/www/lib/Template.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/Template.php	2014-06-06 12:22:55 UTC (rev 20314)
+++ trunk/src/plugins/wiki/www/lib/Template.php	2014-06-06 12:44:48 UTC (rev 20315)
@@ -9,7 +9,7 @@
     /**
      * name optionally of form "theme/template" to include parent templates in children
      */
-    function Template($name, &$request, $args = false)
+    function Template($name, &$request, $args = array())
     {
         global $WikiTheme;
 
@@ -49,7 +49,7 @@
             $this->_locals = array();
     }
 
-    function _munge_input($template)
+    private function _munge_input($template)
     {
 
         // Convert < ?plugin expr ? > to < ?php $this->_printPluginPI("expr"); ? >
@@ -67,7 +67,7 @@
         return preg_replace($orig, $repl, $template);
     }
 
-    function _mungePlugin($pi)
+    private function _mungePlugin($pi)
     {
         // HACK ALERT: PHP's preg_replace, with the /e option seems to
         // escape both single and double quotes with backslashes.
@@ -78,7 +78,7 @@
             "'" . str_replace("'", "\'", $pi) . "'");
     }
 
-    function _printPlugin($pi)
+    private function _printPlugin($pi)
     {
         include_once 'lib/WikiPlugin.php';
         static $loader;
@@ -89,7 +89,7 @@
         $this->_print($loader->expandPI($pi, $this->_request, $this, $this->_basepage));
     }
 
-    function _print($val)
+    private function _print($val)
     {
         if (isa($val, 'Template')) {
             $this->_expandSubtemplate($val);
@@ -98,7 +98,7 @@
         }
     }
 
-    function _expandSubtemplate(&$template)
+    private function _expandSubtemplate(&$template)
     {
         // FIXME: big hack!
         //if (!$template->_request)
@@ -117,19 +117,16 @@
      * Substitute HTML replacement text for tokens in template.
      *
      * Constructs a new WikiTemplate based upon the named template.
-     *
      * @access public
-     *
-     * @param $token string Name of token to substitute for.
-     *
-     * @param $replacement string Replacement HTML text.
+     * @param string $varname Name of token to substitute for.
+     * @param string $value Replacement HTML text.
      */
-    function replace($varname, $value)
+    public function replace($varname, $value)
     {
         $this->_locals[$varname] = $value;
     }
 
-    function printExpansion($defaults = false)
+    public function printExpansion($defaults = false)
     {
         if (!is_array($defaults)) // HTML object or template object
             $defaults = array('CONTENT' => $defaults);
@@ -161,7 +158,7 @@
     // Find a way to do template expansion less memory intensive and faster.
     // 1.3.4 needed no memory at all for dumphtml, now it needs +15MB.
     // Smarty? As before?
-    function getExpansion($defaults = false)
+    public function getExpansion($defaults = false)
     {
         ob_start();
         $this->printExpansion($defaults);
@@ -170,18 +167,18 @@
         return $xml;
     }
 
-    function printXML()
+    public function printXML()
     {
         $this->printExpansion();
     }
 
-    function asXML()
+    public function asXML()
     {
         return $this->getExpansion();
     }
 
     // Debugging:
-    function _dump_template()
+    private function _dump_template()
     {
         $lines = explode("\n", $this->_munge_input($this->_tmpl));
         $pre = HTML::pre();
@@ -191,7 +188,7 @@
         $pre->printXML();
     }
 
-    function _errorHandler($error)
+    private function _errorHandler($error)
     {
         //if (!preg_match('/: eval\(\)\'d code$/', $error->errfile))
         //    return false;
@@ -230,7 +227,7 @@
  *   new Template(...)
  * </pre>
  */
-function Template($name, $args = false)
+function Template($name, $args = array())
 {
     global $request;
     return new Template($name, $request, $args);
@@ -246,14 +243,14 @@
  * Make and expand the top-level template.
  *
  *
- * @param $content mixed html content to put into the page
- * @param $title string page title
- * @param $page_revision object A WikiDB_PageRevision object or false
- * @param $args hash Extract args for top-level template
+ * @param mixed $content html content to put into the page
+ * @param string $title page title
+ * @param object|bool $page_revision A WikiDB_PageRevision object or false
+ * @param array $args hash Extract args for top-level template
  *
  * @return string HTML expansion of template.
  */
-function GeneratePage($content, $title, $page_revision = false, $args = false)
+function GeneratePage($content, $title, $page_revision = false, $args = array())
 {
     global $request;
 
@@ -274,7 +271,7 @@
  * For dumping pages as html to a file.
  * Used for action=dumphtml,action=ziphtml,format=pdf,format=xml
  */
-function GeneratePageasXML($content, $title, $page_revision = false, $args = false)
+function GeneratePageasXML($content, $title, $page_revision = false, $args = array())
 {
     global $request;
 




More information about the Fusionforge-commits mailing list