summaryrefslogtreecommitdiff
path: root/includes/pear/Text/Wiki/Parse/Creole/Image.php
diff options
context:
space:
mode:
authorspiderr <spiderr@bitweaver.org>2018-07-31 23:49:37 -0400
committerspiderr <spiderr@bitweaver.org>2018-07-31 23:49:37 -0400
commita2f342591712f07923ea53740778724fbe7e2b32 (patch)
tree798bf395b510f45b49226aa816ccd191d48dbc47 /includes/pear/Text/Wiki/Parse/Creole/Image.php
parent4a945905298ba6173c2f53dfac5fe5fcffa3fb84 (diff)
downloadutil-a2f342591712f07923ea53740778724fbe7e2b32.tar.gz
util-a2f342591712f07923ea53740778724fbe7e2b32.tar.bz2
util-a2f342591712f07923ea53740778724fbe7e2b32.zip
major reorg and move everything to includes/ and Deny all in .htaccess
Diffstat (limited to 'includes/pear/Text/Wiki/Parse/Creole/Image.php')
-rw-r--r--includes/pear/Text/Wiki/Parse/Creole/Image.php69
1 files changed, 69 insertions, 0 deletions
diff --git a/includes/pear/Text/Wiki/Parse/Creole/Image.php b/includes/pear/Text/Wiki/Parse/Creole/Image.php
new file mode 100644
index 0000000..09ddb8b
--- /dev/null
+++ b/includes/pear/Text/Wiki/Parse/Creole/Image.php
@@ -0,0 +1,69 @@
+<?php
+
+/**
+ *
+ * Parse for images in the source text.
+ *
+ * @category Text
+ *
+ * @package Text_Wiki
+ *
+ * @author Tomaiuolo Michele <tomamic@yahoo.it>
+ *
+ * @license LGPL
+ *
+ * @version $Id: Image.php 243106 2007-09-28 22:02:50Z mic $
+ *
+ */
+
+
+class Text_Wiki_Parse_Image extends Text_Wiki_Parse {
+
+ /**
+ *
+ * Constructor. Overrides the Text_Wiki_Parse constructor so that we
+ * can set the $regex property dynamically (we need to include the
+ * Text_Wiki $delim character).
+ *
+ * @param object &$obj The calling "parent" Text_Wiki object.
+ *
+ * @param string $name The token name to use for this rule.
+ *
+ */
+
+ function Text_Wiki_Parse_Image(&$obj)
+ {
+ parent::Text_Wiki_Parse($obj);
+ $this->regex = '/{{([^' . $this->wiki->delim . ']*)(\|([^' . $this->wiki->delim . ']*))?}}/U';
+ }
+
+
+ /**
+ *
+ * Generates a replacement token for the matched text.
+ *
+ * @access public
+ *
+ * @param array &$matches The array of matches from parse().
+ *
+ * @return string A token marking the horizontal rule.
+ *
+ */
+
+ function process(&$matches)
+ {
+ $src = trim($matches[1]);
+ $src = ltrim($src, '/');
+ $alt = isset($matches[3]) ? trim($matches[3]) : $src;
+
+ return $this->wiki->addToken(
+ $this->rule,
+ array(
+ 'src' => $src,
+ 'attr' => array('alt' => $alt, 'title' => $alt)
+ )
+ );
+ }
+
+}
+?> \ No newline at end of file