]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
New Start/EndHtmlElement events. Allows adding namespaces.
authorZach Copley <zach@status.net>
Fri, 29 Oct 2010 23:38:00 +0000 (23:38 +0000)
committerZach Copley <zach@status.net>
Fri, 29 Oct 2010 23:38:00 +0000 (23:38 +0000)
EVENTS.txt
lib/htmloutputter.php

index 8e730945a41b34aa024301c9a057b2dd7fa6de75..7d4fc6c16293266c20e335f6723f4e8e2fa2b3de 100644 (file)
@@ -365,6 +365,14 @@ GetValidDaemons: Just before determining which daemons to run
 HandleQueuedNotice: Handle a queued notice at queue time (or immediately if no queue)
 - &$notice: notice to handle
 
+StartHtmlElement: Reight before outputting the HTML element - allows plugins to add namespaces
+- $action: the current action
+- &$attrs: attributes for the HTML element
+
+EndHtmlElement: Right after outputting the HTML element
+- $action: the current action
+- &$attrs: attributes for the HTML element
+
 StartShowHeadElements: Right after the <head> tag
 - $action: the current action
 
index 42bff44908b797cb78bdf78315a28ebdfd315de1..b341d14958b44c04615924644d36fd73a1513afe 100644 (file)
@@ -119,9 +119,16 @@ class HTMLOutputter extends XMLOutputter
 
         $language = $this->getLanguage();
 
-        $this->elementStart('html', array('xmlns' => 'http://www.w3.org/1999/xhtml',
-                                          'xml:lang' => $language,
-                                          'lang' => $language));
+        $attrs = array(
+            'xmlns' => 'http://www.w3.org/1999/xhtml',
+            'xml:lang' => $language,
+            'lang' => $language
+        );
+
+        if (Event::handle('StartHtmlElement', array($this, &$attrs))) {
+            $this->elementStart('html', $attrs);
+            Event::handle('EndHtmlElement', array($this, &$attrs));
+        }
     }
 
     function getLanguage()