← Back to team overview

anewt-developers team mailing list archive

[Branch ~uws/anewt/anewt.uws] Rev 1803: [xhtml] Add support for <iframe> elements

 

------------------------------------------------------------
revno: 1803
committer: Wouter Bolsterlee <uws@xxxxxxxxx>
branch nick: anewt
timestamp: Wed 2010-10-27 00:07:53 +0200
message:
  [xhtml] Add support for <iframe> elements
  
  The AnewtXHTMLIFrame class is added, together with two
  convenience functions: ax_iframe() and ax_iframe_src().
modified:
  xhtml/api.lib.php
  xhtml/misc.lib.php


--
lp:anewt
https://code.launchpad.net/~uws/anewt/anewt.uws

Your team Anewt developers is subscribed to branch lp:anewt.
To unsubscribe from this branch go to https://code.launchpad.net/~uws/anewt/anewt.uws/+edit-subscription
=== modified file 'xhtml/api.lib.php'
--- xhtml/api.lib.php	2010-02-15 23:34:23 +0000
+++ xhtml/api.lib.php	2010-10-26 22:07:53 +0000
@@ -1082,4 +1082,26 @@
 	return $element;
 }
 
+/**
+ * Create an AnewtXHTMLIFrame element.
+ * \param $attributes Additional element attributes (optional)
+ */
+function ax_iframe($attributes=null)
+{
+	$element = new AnewtXHTMLIFrame($attributes);
+	return $element;
+}
+
+/**
+ * Create an AnewtXHTMLIFrame element with a \c src attribute.
+ * \param $src Source url of the iframe content
+ * \param $attributes Additional element attributes (optional)
+ */
+function ax_iframe_src($src, $attributes=null)
+{
+	$element = new AnewtXHTMLIFrame();
+	$element->set_attribute('src', $src);
+	return $element;
+}
+
 ?>

=== modified file 'xhtml/misc.lib.php'
--- xhtml/misc.lib.php	2009-07-20 19:47:12 +0000
+++ xhtml/misc.lib.php	2010-10-26 22:07:53 +0000
@@ -222,4 +222,14 @@
 	public $node_name = 'style';
 }
 
+/**
+ * Iframe element.
+ *
+ * \see http://www.w3.org/TR/REC-html40/present/frames.html#h-16.5
+ */
+final class AnewtXHTMLIFrame extends AnewtXHTMLBlockElement
+{
+	public $node_name = 'iframe';
+}
+
 ?>