]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/action.php
Merge branch '0.9.x' into 1.0.x
[quix0rs-gnu-social.git] / lib / action.php
index c8f77f79bd2e690ae06e6169bec5de9ab3238aa7..3ef9ffa3c86aa6b5c2a09fef127e3dfcc75bf03d 100644 (file)
@@ -111,6 +111,19 @@ class Action extends HTMLOutputter // lawsuit
         }
     }
 
+    function endHTML()
+    {
+        global $_startTime;
+
+        if (isset($_startTime)) {
+            $endTime = microtime(true);
+            $diff = round(($endTime - $_startTime) * 1000);
+            $this->raw("<!-- ${diff}ms -->");
+        }
+
+        return parent::endHTML();
+    }
+
     /**
      * Show head, a template method.
      *
@@ -300,11 +313,11 @@ class Action extends HTMLOutputter // lawsuit
      * events and appending to the array. Try to avoid adding strings that won't be used, as
      * they'll be added to HTML output.
      */
-    
+
     function showScriptMessages()
     {
         $messages = array();
-       
+
         if (Event::handle('StartScriptMessages', array($this, &$messages))) {
             // Common messages needed for timeline views etc...
 
@@ -312,14 +325,14 @@ class Action extends HTMLOutputter // lawsuit
             $messages['showmore_tooltip'] = _m('TOOLTIP', 'Show more');
 
             $messages = array_merge($messages, $this->getScriptMessages());
-           
+
            Event::handle('EndScriptMessages', array($this, &$messages));
         }
-       
+
         if (!empty($messages)) {
             $this->inlineScript('SN.messages=' . json_encode($messages));
         }
-       
+
         return $messages;
     }
 
@@ -518,7 +531,7 @@ class Action extends HTMLOutputter // lawsuit
             $this->element('span', array('class' => 'fn org'), common_config('site', 'name'));
             $this->elementEnd('a');
 
-            Event::handle('EndAddressData', array($action));
+            Event::handle('EndAddressData', array($this));
         }
         $this->elementEnd('address');
     }
@@ -822,8 +835,11 @@ class Action extends HTMLOutputter // lawsuit
     function showFooter()
     {
         $this->elementStart('div', array('id' => 'footer'));
-        $this->showSecondaryNav();
-        $this->showLicenses();
+        if (Event::handle('StartShowInsideFooter', array($this))) {
+            $this->showSecondaryNav();
+            $this->showLicenses();
+            Event::handle('EndShowInsideFooter', array($this));
+        }
         $this->elementEnd('div');
     }