Source for file Image.php
Documentation is available at Image.php
* Parses for image placement.
* @author bertrand Gugger <bertrand@toggg.com>
* @author Justin Patrin <papercrane@reversefold.com>
* @author Paul M. Jones <pmjones@php.net>
* @version $Id: Image.php 191168 2005-07-21 20:56:15Z justinpatrin $
* The regular expression used to find source text matching this
var $regex = '/{img\s+(.+?)\s*}/i';
* Generates a token entry for the matched text. Token options are:
* 'src' => The image source, typically a relative path name.
* 'opts' => Any macro options following the source.
* @param array &$matches The array of matches from parse().
* @return A delimited token number to be used as a placeholder in
$options = array ('src' => '', 'attr' => array ('border' => '0'));
$src = $link = $align = $desc = '';
preg_match_all('/(\w+)\s*=\s*(("|\'|"|'|"|')(.*?)\3|\S*)/',
str_replace(array ('}', '{'), '', $matches[1 ]), $splits, PREG_SET_ORDER );
foreach ($splits as $attr) {
$options['src'] = $attr[2 ];
$options['attr'][$attr[1 ]] = $attr[2 ];
$options['attr'][$attr[1 ]] = $attr[2 ];
$options['attr']['align'] = $attr[2 ];
$options['attr']['usemap'] = '#'. $attr[2 ];
$this->wiki->addToken('Url', $options);
// everything after the space is attribute arguments
'src' => substr($matches[2], 0, $pos),
'attr' => $this->getAttrs(substr($matches[2], $pos+1))
return $this->wiki->addToken ($this->rule, $options);
Documentation generated on Mon, 11 Mar 2019 15:32:44 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|