merge bundled libs with 1.7.8
fixing idents spaces tabs and version numbers for .current_version file
This commit is contained in:
parent
c61cf9d10a
commit
f4ec48675b
@ -1,12 +1,14 @@
|
||||
Cache_Lite 1.5.1
|
||||
HTTP_Request 1.2.4
|
||||
HTTP_Request2 2.2.1
|
||||
Net_CheckIP 1.1
|
||||
Net_Socket 1.0.6
|
||||
Net_URL 1.0.14
|
||||
PEAR 1.9.4
|
||||
Text_Wiki 0.25.0
|
||||
XML_RPC 1.4.0
|
||||
Onyx 1.0 (customized)
|
||||
Smarty 2.6.9
|
||||
Net_DNSBL 1.0.0
|
||||
Cache_Lite 1.54
|
||||
HTTP_Request 1.43
|
||||
HTTP_Request2 2.2.1
|
||||
Net_CheckIP 1.5
|
||||
Net_DNSBL 1.4
|
||||
Net_Socket 1.24
|
||||
Net_URL 1.36
|
||||
Net_SURBL 1.4
|
||||
Onyx (customized) 1.0
|
||||
PEAR 1.83
|
||||
SimplePie 1.2.1
|
||||
Smarty 3.1.18
|
||||
Text_Wiki 1.27
|
||||
XML_RPC 1.5.5
|
||||
|
@ -376,8 +376,8 @@ class Cache_Lite
|
||||
}
|
||||
}
|
||||
if ($this->_automaticCleaningFactor>0 && ($this->_automaticCleaningFactor==1 || mt_rand(1, $this->_automaticCleaningFactor)==1)) {
|
||||
$this->clean(false, 'old');
|
||||
}
|
||||
$this->clean(false, 'old');
|
||||
}
|
||||
if ($this->_writeControl) {
|
||||
$res = $this->_writeAndControl($data);
|
||||
if (is_bool($res)) {
|
||||
@ -599,7 +599,7 @@ class Cache_Lite
|
||||
$motif = ($group) ? 'cache_'.$group.'_' : 'cache_';
|
||||
}
|
||||
if ($this->_memoryCaching) {
|
||||
foreach($this->_memoryCachingArray as $key => $v) {
|
||||
foreach($this->_memoryCachingArray as $key => $v) {
|
||||
if (strpos($key, $motif) !== false) {
|
||||
unset($this->_memoryCachingArray[$key]);
|
||||
$this->_memoryCachingCounter = $this->_memoryCachingCounter - 1;
|
||||
|
@ -60,15 +60,15 @@ class Text_Wiki_Parse_Code extends Text_Wiki_Parse {
|
||||
'attr' => array('type' => '')
|
||||
);
|
||||
} else {
|
||||
// get the attributes...
|
||||
$attr = $this->getAttrs($args);
|
||||
// get the attributes...
|
||||
$attr = $this->getAttrs($args);
|
||||
|
||||
// ... and make sure we have a 'type'
|
||||
if (! isset($attr['type'])) {
|
||||
$attr['type'] = '';
|
||||
}
|
||||
// ... and make sure we have a 'type'
|
||||
if (! isset($attr['type'])) {
|
||||
$attr['type'] = '';
|
||||
}
|
||||
|
||||
// retain the options
|
||||
// retain the options
|
||||
$options = array(
|
||||
'text' => $matches[3],
|
||||
'attr' => $attr
|
||||
|
@ -5,7 +5,7 @@
|
||||
class Text_Wiki_Render_Xhtml_Function extends Text_Wiki_Render {
|
||||
|
||||
var $conf = array(
|
||||
// list separator for params and throws
|
||||
// list separator for params and throws
|
||||
'list_sep' => ', ',
|
||||
|
||||
// the "main" format string
|
||||
|
@ -39,7 +39,7 @@ class Text_Wiki_Render_Xhtml_Wikilink extends Text_Wiki_Render {
|
||||
if (isset($this->conf['exists_callback'])) {
|
||||
$callback =& $this->conf['exists_callback'];
|
||||
} else {
|
||||
$callback = false;
|
||||
$callback = false;
|
||||
}
|
||||
|
||||
if ($callback) {
|
||||
|
@ -292,53 +292,53 @@ class Text_Wiki_Rule {
|
||||
|
||||
/**
|
||||
*
|
||||
* Simple method to extract 'option="value"' portions of wiki markup,
|
||||
* typically used only in macros.
|
||||
*
|
||||
* The syntax is pretty strict; there can be no spaces between the
|
||||
* option name, the equals, and the first double-quote; the value
|
||||
* must be surrounded by double-quotes. You can escape characters in
|
||||
* the value with a backslash, and the backslash will be stripped for
|
||||
* you.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @param string $text The "macro options" portion of macro markup.
|
||||
*
|
||||
* @return array An associative array of key-value pairs where the
|
||||
* key is the option name and the value is the option value.
|
||||
* Simple method to extract 'option="value"' portions of wiki markup,
|
||||
* typically used only in macros.
|
||||
*
|
||||
* The syntax is pretty strict; there can be no spaces between the
|
||||
* option name, the equals, and the first double-quote; the value
|
||||
* must be surrounded by double-quotes. You can escape characters in
|
||||
* the value with a backslash, and the backslash will be stripped for
|
||||
* you.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @param string $text The "macro options" portion of macro markup.
|
||||
*
|
||||
* @return array An associative array of key-value pairs where the
|
||||
* key is the option name and the value is the option value.
|
||||
*
|
||||
*/
|
||||
|
||||
function getMacroArgs($text)
|
||||
{
|
||||
// find the =" sections;
|
||||
$tmp = explode('="', trim($text));
|
||||
// find the =" sections;
|
||||
$tmp = explode('="', trim($text));
|
||||
|
||||
// basic setup
|
||||
$k = count($tmp) - 1;
|
||||
$arg = array();
|
||||
$key = null;
|
||||
// basic setup
|
||||
$k = count($tmp) - 1;
|
||||
$arg = array();
|
||||
$key = null;
|
||||
|
||||
// loop through the sections
|
||||
foreach ($tmp as $i => $val) {
|
||||
// loop through the sections
|
||||
foreach ($tmp as $i => $val) {
|
||||
|
||||
// first element is always the first key
|
||||
if ($i == 0) {
|
||||
$key = trim($val);
|
||||
continue;
|
||||
}
|
||||
// first element is always the first key
|
||||
if ($i == 0) {
|
||||
$key = trim($val);
|
||||
continue;
|
||||
}
|
||||
|
||||
// find the last double-quote in the value.
|
||||
// the part to the left is the value for the last key,
|
||||
// the part to the right is the next key name
|
||||
$pos = strrpos($val, '"');
|
||||
$arg[$key] = stripslashes(substr($val, 0, $pos));
|
||||
$key = trim(substr($val, $pos+1));
|
||||
// find the last double-quote in the value.
|
||||
// the part to the left is the value for the last key,
|
||||
// the part to the right is the next key name
|
||||
$pos = strrpos($val, '"');
|
||||
$arg[$key] = stripslashes(substr($val, 0, $pos));
|
||||
$key = trim(substr($val, $pos+1));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return $arg;
|
||||
return $arg;
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -190,20 +190,20 @@ class Text_Wiki_Rule_blockquote extends Text_Wiki_Rule {
|
||||
$type = $options['type'];
|
||||
$level = $options['level'];
|
||||
|
||||
// set up indenting so that the results look nice; we do this
|
||||
// in two steps to avoid str_pad mathematics. ;-)
|
||||
$pad = str_pad('', $level, "\t");
|
||||
$pad = str_replace("\t", ' ', $pad);
|
||||
// set up indenting so that the results look nice; we do this
|
||||
// in two steps to avoid str_pad mathematics. ;-)
|
||||
$pad = str_pad('', $level, "\t");
|
||||
$pad = str_replace("\t", ' ', $pad);
|
||||
|
||||
// starting
|
||||
if ($type == 'start') {
|
||||
return "$pad<blockquote>";
|
||||
}
|
||||
// starting
|
||||
if ($type == 'start') {
|
||||
return "$pad<blockquote>";
|
||||
}
|
||||
|
||||
// ending
|
||||
if ($type == 'end') {
|
||||
return $pad . "</blockquote>\n";
|
||||
}
|
||||
// ending
|
||||
if ($type == 'end') {
|
||||
return $pad . "</blockquote>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -84,15 +84,15 @@ class Text_Wiki_Rule_center extends Text_Wiki_Rule {
|
||||
|
||||
function renderXhtml($options)
|
||||
{
|
||||
if ($options['type'] == 'start') {
|
||||
//return "\n<center>\n";
|
||||
return '<div style="text-align: center;">';
|
||||
}
|
||||
if ($options['type'] == 'start') {
|
||||
//return "\n<center>\n";
|
||||
return '<div style="text-align: center;">';
|
||||
}
|
||||
|
||||
if ($options['type'] == 'end') {
|
||||
//return "</center>\n";
|
||||
return '</div>';
|
||||
}
|
||||
if ($options['type'] == 'end') {
|
||||
//return "</center>\n";
|
||||
return '</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -108,7 +108,7 @@ class Text_Wiki_Rule_code extends Text_Wiki_Rule {
|
||||
|
||||
if (strtolower($args['type']) == 'php') {
|
||||
|
||||
// PHP code example
|
||||
// PHP code example
|
||||
|
||||
// add the PHP tags
|
||||
$text = "<?php\n" . $options['text'] . "\n?>"; // <?php
|
||||
|
@ -88,17 +88,17 @@ class Text_Wiki_Rule_colortext extends Text_Wiki_Rule {
|
||||
function process(&$matches)
|
||||
{
|
||||
$start = $this->addToken(
|
||||
array(
|
||||
'type' => 'start',
|
||||
'color' => $matches[1]
|
||||
)
|
||||
array(
|
||||
'type' => 'start',
|
||||
'color' => $matches[1]
|
||||
)
|
||||
);
|
||||
|
||||
$end = $this->addToken(
|
||||
array(
|
||||
'type' => 'end',
|
||||
'color' => $matches[1]
|
||||
)
|
||||
array(
|
||||
'type' => 'end',
|
||||
'color' => $matches[1]
|
||||
)
|
||||
);
|
||||
|
||||
return $start . $matches[2] . $end;
|
||||
|
@ -91,12 +91,12 @@ class Text_Wiki_Rule_embed extends Text_Wiki_Rule {
|
||||
|
||||
function renderXhtml($options)
|
||||
{
|
||||
$file = $this->_conf['base'] . $options['path'];
|
||||
ob_start();
|
||||
include($file);
|
||||
$output = ob_get_contents();
|
||||
ob_end_clean();
|
||||
return $output;
|
||||
}
|
||||
$file = $this->_conf['base'] . $options['path'];
|
||||
ob_start();
|
||||
include($file);
|
||||
$output = ob_get_contents();
|
||||
ob_end_clean();
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -91,13 +91,13 @@ class Text_Wiki_Rule_emphasis extends Text_Wiki_Rule {
|
||||
|
||||
function renderXhtml($options)
|
||||
{
|
||||
if ($options['type'] == 'start') {
|
||||
return '<em>';
|
||||
}
|
||||
if ($options['type'] == 'start') {
|
||||
return '<em>';
|
||||
}
|
||||
|
||||
if ($options['type'] == 'end') {
|
||||
return '</em>';
|
||||
}
|
||||
if ($options['type'] == 'end') {
|
||||
return '</em>';
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -151,12 +151,12 @@ class Text_Wiki_Rule_freelink extends Text_Wiki_Rule {
|
||||
// the page exists, show a link to the page
|
||||
$href = $this->_conf['view_url'];
|
||||
if (strpos($href, '%s') === false) {
|
||||
// use the old form
|
||||
$href = $href . $page . '#' . $anchor;
|
||||
} else {
|
||||
// use the new form
|
||||
$href = sprintf($href, $page . '#' . $anchor);
|
||||
}
|
||||
// use the old form
|
||||
$href = $href . $page . '#' . $anchor;
|
||||
} else {
|
||||
// use the new form
|
||||
$href = sprintf($href, $page . '#' . $anchor);
|
||||
}
|
||||
return "<a href=\"$href\">$text</a>";
|
||||
|
||||
} else {
|
||||
@ -165,12 +165,12 @@ class Text_Wiki_Rule_freelink extends Text_Wiki_Rule {
|
||||
// the "new page" text
|
||||
$href = $this->_conf['new_url'];
|
||||
if (strpos($href, '%s') === false) {
|
||||
// use the old form
|
||||
$href = $href . $page;
|
||||
} else {
|
||||
// use the new form
|
||||
$href = sprintf($href, $page);
|
||||
}
|
||||
// use the old form
|
||||
$href = $href . $page;
|
||||
} else {
|
||||
// use the new form
|
||||
$href = sprintf($href, $page);
|
||||
}
|
||||
return $text . "<a href=\"$href\">{$this->_conf['new_text']}</a>";
|
||||
|
||||
}
|
||||
|
@ -73,19 +73,19 @@ class Text_Wiki_Rule_image extends Text_Wiki_Rule {
|
||||
|
||||
function process(&$matches)
|
||||
{
|
||||
$pos = strpos($matches[2], ' ');
|
||||
$pos = strpos($matches[2], ' ');
|
||||
|
||||
if ($pos === false) {
|
||||
$options = array(
|
||||
'src' => $matches[2],
|
||||
'args' => array());
|
||||
} else {
|
||||
// everything after the space is macro options
|
||||
$options = array(
|
||||
'src' => substr($matches[2], 0, $pos),
|
||||
'args' => $this->getMacroArgs(substr($matches[2], $pos+1))
|
||||
);
|
||||
}
|
||||
if ($pos === false) {
|
||||
$options = array(
|
||||
'src' => $matches[2],
|
||||
'args' => array());
|
||||
} else {
|
||||
// everything after the space is macro options
|
||||
$options = array(
|
||||
'src' => substr($matches[2], 0, $pos),
|
||||
'args' => $this->getMacroArgs(substr($matches[2], $pos+1))
|
||||
);
|
||||
}
|
||||
|
||||
return $this->addToken($options);
|
||||
}
|
||||
@ -106,31 +106,31 @@ class Text_Wiki_Rule_image extends Text_Wiki_Rule {
|
||||
|
||||
function renderXhtml($options)
|
||||
{
|
||||
$src = '"' . $this->_conf['base'] . $options['src'] . '"';
|
||||
$src = '"' . $this->_conf['base'] . $options['src'] . '"';
|
||||
|
||||
if (isset($options['args']['link'])) {
|
||||
// this image has a wikilink
|
||||
$href = $this->_wiki->getRuleConf('wikilink', 'view_url') .
|
||||
$options['args']['link'];
|
||||
} else {
|
||||
// image is not linked
|
||||
$href = null;
|
||||
}
|
||||
if (isset($options['args']['link'])) {
|
||||
// this image has a wikilink
|
||||
$href = $this->_wiki->getRuleConf('wikilink', 'view_url') .
|
||||
$options['args']['link'];
|
||||
} else {
|
||||
// image is not linked
|
||||
$href = null;
|
||||
}
|
||||
|
||||
// unset these so they don't show up as attributes
|
||||
unset($options['args']['src']);
|
||||
unset($options['args']['link']);
|
||||
// unset these so they don't show up as attributes
|
||||
unset($options['args']['src']);
|
||||
unset($options['args']['link']);
|
||||
|
||||
$attr = '';
|
||||
foreach ($options['args'] as $key => $val) {
|
||||
$attr .= "$key=\"$val\" ";
|
||||
}
|
||||
$attr = '';
|
||||
foreach ($options['args'] as $key => $val) {
|
||||
$attr .= "$key=\"$val\" ";
|
||||
}
|
||||
|
||||
if ($href) {
|
||||
return "<a href=\"$href\"><img src=$src $attr/></a>";
|
||||
} else {
|
||||
return "<img src=$src $attr/>";
|
||||
}
|
||||
}
|
||||
if ($href) {
|
||||
return "<a href=\"$href\"><img src=$src $attr/></a>";
|
||||
} else {
|
||||
return "<img src=$src $attr/>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -69,12 +69,12 @@ class Text_Wiki_Rule_include extends Text_Wiki_Rule {
|
||||
|
||||
function process(&$matches)
|
||||
{
|
||||
$file = $this->_conf['base'] . $matches[2];
|
||||
ob_start();
|
||||
include($file);
|
||||
$output = ob_get_contents();
|
||||
ob_end_clean();
|
||||
return $output;
|
||||
$file = $this->_conf['base'] . $matches[2];
|
||||
ob_start();
|
||||
include($file);
|
||||
$output = ob_get_contents();
|
||||
ob_end_clean();
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -50,15 +50,15 @@ class Text_Wiki_Rule_interwiki extends Text_Wiki_Rule {
|
||||
|
||||
function parse()
|
||||
{
|
||||
// described interwiki links
|
||||
$tmp_regex = '/\[' . $this->regex . ' (.+?)\]/';
|
||||
// described interwiki links
|
||||
$tmp_regex = '/\[' . $this->regex . ' (.+?)\]/';
|
||||
$this->_wiki->_source = preg_replace_callback(
|
||||
$tmp_regex,
|
||||
array(&$this, 'processDescr'),
|
||||
$this->_wiki->_source
|
||||
);
|
||||
|
||||
// standalone interwiki links
|
||||
// standalone interwiki links
|
||||
$tmp_regex = '/' . $this->regex . '/';
|
||||
$this->_wiki->_source = preg_replace_callback(
|
||||
$tmp_regex,
|
||||
@ -71,15 +71,15 @@ class Text_Wiki_Rule_interwiki extends Text_Wiki_Rule {
|
||||
|
||||
/**
|
||||
*
|
||||
* Generates a replacement for the matched standalone interwiki text.
|
||||
* Token options are:
|
||||
*
|
||||
* 'site' => The key name for the Text_Wiki interwiki array map,
|
||||
* usually the name of the interwiki site.
|
||||
*
|
||||
* 'page' => The page on the target interwiki to link to.
|
||||
*
|
||||
* 'text' => The text to display as the link.
|
||||
* Generates a replacement for the matched standalone interwiki text.
|
||||
* Token options are:
|
||||
*
|
||||
* 'site' => The key name for the Text_Wiki interwiki array map,
|
||||
* usually the name of the interwiki site.
|
||||
*
|
||||
* 'page' => The page on the target interwiki to link to.
|
||||
*
|
||||
* 'text' => The text to display as the link.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
@ -100,24 +100,24 @@ class Text_Wiki_Rule_interwiki extends Text_Wiki_Rule {
|
||||
|
||||
// if not in the interwiki map, don't make it an interwiki link
|
||||
if (isset($this->_conf['sites'][$options['site']])) {
|
||||
return $this->addToken($options);
|
||||
} else {
|
||||
return $matches[0];
|
||||
}
|
||||
return $this->addToken($options);
|
||||
} else {
|
||||
return $matches[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Generates a replacement for described interwiki links. Token
|
||||
* options are:
|
||||
*
|
||||
* 'site' => The key name for the Text_Wiki interwiki array map,
|
||||
* usually the name of the interwiki site.
|
||||
*
|
||||
* 'page' => The page on the target interwiki to link to.
|
||||
*
|
||||
* 'text' => The text to display as the link.
|
||||
* Generates a replacement for described interwiki links. Token
|
||||
* options are:
|
||||
*
|
||||
* 'site' => The key name for the Text_Wiki interwiki array map,
|
||||
* usually the name of the interwiki site.
|
||||
*
|
||||
* 'page' => The page on the target interwiki to link to.
|
||||
*
|
||||
* 'text' => The text to display as the link.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
@ -138,10 +138,10 @@ class Text_Wiki_Rule_interwiki extends Text_Wiki_Rule {
|
||||
|
||||
// if not in the interwiki map, don't make it an interwiki link
|
||||
if (isset($this->_conf['sites'][$options['site']])) {
|
||||
return $this->addToken($options);
|
||||
} else {
|
||||
return $matches[0];
|
||||
}
|
||||
return $this->addToken($options);
|
||||
} else {
|
||||
return $matches[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -170,24 +170,23 @@ class Text_Wiki_Rule_interwiki extends Text_Wiki_Rule {
|
||||
return $text;
|
||||
}
|
||||
|
||||
// old form where page is at end,
|
||||
// or new form with %s placeholder for sprintf()?
|
||||
if (strpos($href, '%s') === false) {
|
||||
// use the old form
|
||||
$href = $href . $page;
|
||||
} else {
|
||||
// use the new form
|
||||
$href = sprintf($href, $page);
|
||||
}
|
||||
|
||||
// allow for alternative targets
|
||||
if (isset($this->_conf['target']) &&
|
||||
trim($this->_conf['target']) != '') {
|
||||
$target = 'target="' . $this->_conf['target'] . '"';
|
||||
} else {
|
||||
$target = '';
|
||||
}
|
||||
// old form where page is at end,
|
||||
// or new form with %s placeholder for sprintf()?
|
||||
if (strpos($href, '%s') === false) {
|
||||
// use the old form
|
||||
$href = $href . $page;
|
||||
} else {
|
||||
// use the new form
|
||||
$href = sprintf($href, $page);
|
||||
}
|
||||
|
||||
// allow for alternative targets
|
||||
if (isset($this->_conf['target']) &&
|
||||
trim($this->_conf['target']) != '') {
|
||||
$target = 'target="' . $this->_conf['target'] . '"';
|
||||
} else {
|
||||
$target = '';
|
||||
}
|
||||
|
||||
return "<a $target href=\"$href\">$text</a>";
|
||||
}
|
||||
|
@ -91,13 +91,13 @@ class Text_Wiki_Rule_italic extends Text_Wiki_Rule {
|
||||
|
||||
function renderXhtml($options)
|
||||
{
|
||||
if ($options['type'] == 'start') {
|
||||
return '<i>';
|
||||
}
|
||||
if ($options['type'] == 'start') {
|
||||
return '<i>';
|
||||
}
|
||||
|
||||
if ($options['type'] == 'end') {
|
||||
return '</i>';
|
||||
}
|
||||
if ($options['type'] == 'end') {
|
||||
return '</i>';
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -253,11 +253,11 @@ class Text_Wiki_Rule_list extends Text_Wiki_Rule {
|
||||
// attempt XHTML compliance so that sub-lists are part
|
||||
// of a list item, not between list items
|
||||
if ($level > 0) {
|
||||
$pre = '<li style="list-style: none;">';
|
||||
$post = '</li>';
|
||||
$pre = '<li style="list-style: none;">';
|
||||
$post = '</li>';
|
||||
} else {
|
||||
$pre = '';
|
||||
$post = '';
|
||||
$pre = '';
|
||||
$post = '';
|
||||
}
|
||||
|
||||
switch ($type) {
|
||||
|
@ -66,16 +66,16 @@ class Text_Wiki_Rule_paragraph extends Text_Wiki_Rule {
|
||||
|
||||
function process(&$matches)
|
||||
{
|
||||
$delim = $this->_wiki->delim;
|
||||
$delim = $this->_wiki->delim;
|
||||
|
||||
// was anything there?
|
||||
if (trim($matches[0]) == '') {
|
||||
return '';
|
||||
}
|
||||
// was anything there?
|
||||
if (trim($matches[0]) == '') {
|
||||
return '';
|
||||
}
|
||||
|
||||
// does the match start with a delimiter?
|
||||
if (substr($matches[0], 0, 1) != $delim) {
|
||||
// no.
|
||||
// does the match start with a delimiter?
|
||||
if (substr($matches[0], 0, 1) != $delim) {
|
||||
// no.
|
||||
$start = $this->addToken(array('type' => 'start'));
|
||||
$end = $this->addToken(array('type' => 'end'));
|
||||
return $start . trim($matches[0]) . $end;
|
||||
@ -89,21 +89,21 @@ class Text_Wiki_Rule_paragraph extends Text_Wiki_Rule {
|
||||
// the first is a delimiter) until we find another
|
||||
// delimiter; the text between them is a token key number.
|
||||
$key = '';
|
||||
$len = strlen($matches[0]);
|
||||
for ($i = 1; $i < $len; $i++) {
|
||||
$char = $matches[0]{$i};
|
||||
if ($char == $delim) {
|
||||
break;
|
||||
} else {
|
||||
$key .= $char;
|
||||
}
|
||||
$len = strlen($matches[0]);
|
||||
for ($i = 1; $i < $len; $i++) {
|
||||
$char = $matches[0]{$i};
|
||||
if ($char == $delim) {
|
||||
break;
|
||||
} else {
|
||||
$key .= $char;
|
||||
}
|
||||
}
|
||||
|
||||
// look at the token and see if it's skippable (if we skip,
|
||||
// it will not be marked as a paragraph)
|
||||
$token_type = $this->_wiki->_tokens[$key][0];
|
||||
if (in_array($token_type, $this->_conf['skip'])) {
|
||||
return $matches[0];
|
||||
return $matches[0];
|
||||
} else {
|
||||
$start = $this->addToken(array('type' => 'start'));
|
||||
$end = $this->addToken(array('type' => 'end'));
|
||||
|
@ -88,46 +88,46 @@ class Text_Wiki_Rule_phpcode extends Text_Wiki_Rule {
|
||||
|
||||
function renderXhtml($options)
|
||||
{
|
||||
// add the PHP tags
|
||||
$text = "<?php\n" . $options['text'] . "\n?>"; // <?php
|
||||
// add the PHP tags
|
||||
$text = "<?php\n" . $options['text'] . "\n?>"; // <?php
|
||||
|
||||
// convert tabs to four spaces
|
||||
$text = str_replace("\t", " ", $text);
|
||||
// convert tabs to four spaces
|
||||
$text = str_replace("\t", " ", $text);
|
||||
|
||||
// colorize the code block (also converts HTML entities and adds
|
||||
// <code>...</code> tags)
|
||||
ob_start();
|
||||
highlight_string($text);
|
||||
$text = ob_get_contents();
|
||||
ob_end_clean();
|
||||
// colorize the code block (also converts HTML entities and adds
|
||||
// <code>...</code> tags)
|
||||
ob_start();
|
||||
highlight_string($text);
|
||||
$text = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
// replace <br /> tags with simple newlines
|
||||
//$text = str_replace("<br />", "\n", $text);
|
||||
// replace <br /> tags with simple newlines
|
||||
//$text = str_replace("<br />", "\n", $text);
|
||||
|
||||
// replace non-breaking space with simple spaces
|
||||
//$text = str_replace(" ", " ", $text);
|
||||
// replace non-breaking space with simple spaces
|
||||
//$text = str_replace(" ", " ", $text);
|
||||
|
||||
// replace <br /> tags with simple newlines
|
||||
// replace non-breaking space with simple spaces
|
||||
// translate old HTML to new XHTML
|
||||
// courtesy of research by A. Kalin :-)
|
||||
$map = array(
|
||||
'<br />' => "\n",
|
||||
' ' => ' ',
|
||||
'<font' => '<span',
|
||||
'</font>' => '</span>',
|
||||
'color="' => 'style="color:'
|
||||
);
|
||||
$text = strtr($text, $map);
|
||||
// replace <br /> tags with simple newlines
|
||||
// replace non-breaking space with simple spaces
|
||||
// translate old HTML to new XHTML
|
||||
// courtesy of research by A. Kalin :-)
|
||||
$map = array(
|
||||
'<br />' => "\n",
|
||||
' ' => ' ',
|
||||
'<font' => '<span',
|
||||
'</font>' => '</span>',
|
||||
'color="' => 'style="color:'
|
||||
);
|
||||
$text = strtr($text, $map);
|
||||
|
||||
// get rid of the last newline inside the code block
|
||||
// (becuase higlight_string puts one there)
|
||||
if (substr($text, -8) == "\n</code>") {
|
||||
$text = substr($text, 0, -8) . "</code>";
|
||||
}
|
||||
// get rid of the last newline inside the code block
|
||||
// (becuase higlight_string puts one there)
|
||||
if (substr($text, -8) == "\n</code>") {
|
||||
$text = substr($text, 0, -8) . "</code>";
|
||||
}
|
||||
|
||||
// done
|
||||
return "\n<pre>$text</pre>\n";
|
||||
// done
|
||||
return "\n<pre>$text</pre>\n";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -86,7 +86,7 @@ class Text_Wiki_Rule_phplookup extends Text_Wiki_Rule {
|
||||
|
||||
function renderXhtml($options)
|
||||
{
|
||||
$text = trim($options['text']);
|
||||
$text = trim($options['text']);
|
||||
return "<a href=\"http://php.net/$text\">$text</a>";
|
||||
}
|
||||
}
|
||||
|
@ -67,10 +67,10 @@ class Text_Wiki_Rule_prefilter extends Text_Wiki_Rule {
|
||||
|
||||
// finally, compress all instances of 3 or more newlines
|
||||
// down to two newlines.
|
||||
$find = "/\n{3,}/m";
|
||||
$replace = "\n\n";
|
||||
$this->_wiki->_source = preg_replace($find, $replace,
|
||||
$this->_wiki->_source);
|
||||
$find = "/\n{3,}/m";
|
||||
$replace = "\n\n";
|
||||
$this->_wiki->_source = preg_replace($find, $replace,
|
||||
$this->_wiki->_source);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -121,19 +121,19 @@ class Text_Wiki_Rule_table extends Text_Wiki_Rule {
|
||||
|
||||
// find the alignment, if any.
|
||||
if (substr($cell[$i], 0, 2) == '> ') {
|
||||
// set to right-align and strip the tag
|
||||
$align = 'right';
|
||||
$cell[$i] = substr($cell[$i], 2);
|
||||
// set to right-align and strip the tag
|
||||
$align = 'right';
|
||||
$cell[$i] = substr($cell[$i], 2);
|
||||
} elseif (substr($cell[$i], 0, 2) == '= ') {
|
||||
// set to center-align and strip the tag
|
||||
$align = 'center';
|
||||
$cell[$i] = substr($cell[$i], 2);
|
||||
// set to center-align and strip the tag
|
||||
$align = 'center';
|
||||
$cell[$i] = substr($cell[$i], 2);
|
||||
} elseif (substr($cell[$i], 0, 2) == '< ') {
|
||||
// set to left-align and strip the tag
|
||||
$align = 'left';
|
||||
$cell[$i] = substr($cell[$i], 2);
|
||||
// set to left-align and strip the tag
|
||||
$align = 'left';
|
||||
$cell[$i] = substr($cell[$i], 2);
|
||||
} else {
|
||||
$align = null;
|
||||
$align = null;
|
||||
}
|
||||
|
||||
// start a new cell...
|
||||
@ -197,20 +197,20 @@ class Text_Wiki_Rule_table extends Text_Wiki_Rule {
|
||||
$pad = ' ';
|
||||
|
||||
$border = (isset($this->_conf['border']))
|
||||
? $this->_conf['border'] : '1';
|
||||
? $this->_conf['border'] : '1';
|
||||
|
||||
$spacing = (isset($this->_conf['spacing']))
|
||||
? $this->_conf['spacing'] : '0';
|
||||
? $this->_conf['spacing'] : '0';
|
||||
|
||||
$padding = (isset($this->_conf['padding']))
|
||||
? $this->_conf['padding'] : '4';
|
||||
? $this->_conf['padding'] : '4';
|
||||
|
||||
switch ($type) {
|
||||
|
||||
case 'table_start':
|
||||
return "<table border=\"$border\" " .
|
||||
"cellspacing=\"$spacing\" " .
|
||||
"cellpadding=\"$padding\">\n";
|
||||
"cellspacing=\"$spacing\" " .
|
||||
"cellpadding=\"$padding\">\n";
|
||||
break;
|
||||
|
||||
case 'table_end':
|
||||
@ -226,12 +226,12 @@ class Text_Wiki_Rule_table extends Text_Wiki_Rule {
|
||||
break;
|
||||
|
||||
case 'cell_start':
|
||||
$tmp = $pad . $pad . '<td';
|
||||
$tmp = $pad . $pad . '<td';
|
||||
if ($colspan > 1) {
|
||||
$tmp .= " colspan=\"$colspan\"";
|
||||
}
|
||||
if ($align) {
|
||||
$tmp .= " align=\"$align\"";
|
||||
$tmp .= " align=\"$align\"";
|
||||
}
|
||||
return $tmp . '>';
|
||||
break;
|
||||
|
@ -43,8 +43,8 @@ class Text_Wiki_Rule_tighten extends Text_Wiki_Rule {
|
||||
|
||||
function parse()
|
||||
{
|
||||
$this->_wiki->_source = str_replace("\n", '',
|
||||
$this->_wiki->_source);
|
||||
$this->_wiki->_source = str_replace("\n", '',
|
||||
$this->_wiki->_source);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -72,15 +72,15 @@ class Text_Wiki_Rule_url extends Text_Wiki_Rule {
|
||||
|
||||
function Text_Wiki_Rule_url(&$obj, $name)
|
||||
{
|
||||
parent::Text_Wiki_Rule($obj, $name);
|
||||
parent::Text_Wiki_Rule($obj, $name);
|
||||
|
||||
$this->regex =
|
||||
"(http:\/\/|https:\/\/|ftp:\/\/|gopher:\/\/|news:\/\/|mailto:)" . // protocols
|
||||
"(" .
|
||||
"[^ \\/\"\'{$this->_wiki->delim}]*\\/" . // no spaces, \, /, ", or single quotes;
|
||||
")*" .
|
||||
"[^ \\t\\n\\/\"\'{$this->_wiki->delim}]*" .
|
||||
"[A-Za-z0-9\\/?=&~_]";
|
||||
"(http:\/\/|https:\/\/|ftp:\/\/|gopher:\/\/|news:\/\/|mailto:)" . // protocols
|
||||
"(" .
|
||||
"[^ \\/\"\'{$this->_wiki->delim}]*\\/" . // no spaces, \, /, ", or single quotes;
|
||||
")*" .
|
||||
"[^ \\t\\n\\/\"\'{$this->_wiki->delim}]*" .
|
||||
"[A-Za-z0-9\\/?=&~_]";
|
||||
|
||||
}
|
||||
|
||||
@ -137,7 +137,7 @@ class Text_Wiki_Rule_url extends Text_Wiki_Rule {
|
||||
|
||||
// the regular expression for this kind of URL
|
||||
|
||||
$tmp_regex = '/(^|[^A-Za-z])(' . $this->regex . ')(.*?)/';
|
||||
$tmp_regex = '/(^|[^A-Za-z])(' . $this->regex . ')(.*?)/';
|
||||
|
||||
// use the standard callback for inline URLs
|
||||
$this->_wiki->_source = preg_replace_callback(
|
||||
@ -293,13 +293,13 @@ class Text_Wiki_Rule_url extends Text_Wiki_Rule {
|
||||
|
||||
} else {
|
||||
|
||||
// allow for alternative targets
|
||||
if (isset($this->_conf['target']) &&
|
||||
trim($this->_conf['target']) != '') {
|
||||
$target = 'target="' . $this->_conf['target'] . '"';
|
||||
} else {
|
||||
$target = '';
|
||||
}
|
||||
// allow for alternative targets
|
||||
if (isset($this->_conf['target']) &&
|
||||
trim($this->_conf['target']) != '') {
|
||||
$target = 'target="' . $this->_conf['target'] . '"';
|
||||
} else {
|
||||
$target = '';
|
||||
}
|
||||
|
||||
// generate a regular link (not an image)
|
||||
$output = "<a $target href=\"$href\">$text</a>";
|
||||
|
@ -85,8 +85,8 @@ class Text_Wiki_Rule_wikilink extends Text_Wiki_Rule {
|
||||
|
||||
function parse()
|
||||
{
|
||||
// described wiki links
|
||||
$tmp_regex = '/\[' . $this->regex . ' (.+?)\]/';
|
||||
// described wiki links
|
||||
$tmp_regex = '/\[' . $this->regex . ' (.+?)\]/';
|
||||
$this->_wiki->_source = preg_replace_callback(
|
||||
$tmp_regex,
|
||||
array(&$this, 'processDescr'),
|
||||
@ -203,22 +203,22 @@ class Text_Wiki_Rule_wikilink extends Text_Wiki_Rule {
|
||||
$href = $this->_conf['view_url'];
|
||||
|
||||
if (strpos($href, '%s') === false) {
|
||||
// use the old form
|
||||
$href = $href . $page . $anchor;
|
||||
} else {
|
||||
// use the new form
|
||||
$href = sprintf($href, $page . $anchor);
|
||||
}
|
||||
// use the old form
|
||||
$href = $href . $page . $anchor;
|
||||
} else {
|
||||
// use the new form
|
||||
$href = sprintf($href, $page . $anchor);
|
||||
}
|
||||
|
||||
return "<a href=\"$href\">$text</a>";
|
||||
|
||||
}
|
||||
|
||||
// no, link to a create-page url, but only if new_url is set
|
||||
if (! isset($this->_conf['new_url']) ||
|
||||
trim($this->_conf['new_url']) == '') {
|
||||
return $text;
|
||||
} else {
|
||||
// no, link to a create-page url, but only if new_url is set
|
||||
if (! isset($this->_conf['new_url']) ||
|
||||
trim($this->_conf['new_url']) == '') {
|
||||
return $text;
|
||||
} else {
|
||||
|
||||
// yes, link to the page view, but we have to build
|
||||
// the HREF. we support both the old form where
|
||||
@ -227,15 +227,15 @@ class Text_Wiki_Rule_wikilink extends Text_Wiki_Rule {
|
||||
$href = $this->_conf['new_url'];
|
||||
|
||||
if (strpos($href, '%s') === false) {
|
||||
// use the old form
|
||||
$href = $href . $page;
|
||||
} else {
|
||||
// use the new form
|
||||
$href = sprintf($href, $page);
|
||||
}
|
||||
// use the old form
|
||||
$href = $href . $page;
|
||||
} else {
|
||||
// use the new form
|
||||
$href = sprintf($href, $page);
|
||||
}
|
||||
|
||||
return $text . "<a href=\"$href\">{$this->_conf['new_text']}</a>";
|
||||
}
|
||||
return $text . "<a href=\"$href\">{$this->_conf['new_text']}</a>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -132,4 +132,4 @@ else
|
||||
echo ""
|
||||
fi
|
||||
|
||||
echo "REMEMBER TO UPDATE docs/RELEASE and commit SVN branch"
|
||||
echo "REMEMBER TO UPDATE docs/RELEASE and commit github branch: git tag -a X.Y ; git push --tags"
|
||||
|
@ -32,10 +32,10 @@ will be printed.)
|
||||
|| {{```''italic text''```}} || ''italic text'' ||
|
||||
|| {{```'''bold text'''```}} || '''bold text''' ||
|
||||
|| {{```'''''italic and bold'''''```}} || '''''italic and bold''''' ||
|
||||
|| {{```//emphasis//```}} || //emphasis// ||
|
||||
|| {{```**strong**```}} || **strong** ||
|
||||
|| {{```//**emphasis and strong**//```}} || //**emphasis and strong**// ||
|
||||
|| {{```**//strong and emphasis//**```}} || **//strong and emphasis//** ||
|
||||
|| {{```//emphasis//```}} || //emphasis// ||
|
||||
|| {{```**strong**```}} || **strong** ||
|
||||
|| {{```//**emphasis and strong**//```}} || //**emphasis and strong**// ||
|
||||
|| {{```**//strong and emphasis//**```}} || **//strong and emphasis//** ||
|
||||
|| {{```{{teletype text}}```}} || {{teletype text}} ||
|
||||
|| {{<```php:function()```>}} || <php:function()> ||
|
||||
|| {{```@@--- delete text +++ insert text @@```}} || @@--- delete text +++ insert text @@ ||
|
||||
|
@ -21,7 +21,7 @@
|
||||
|| {{strong}} || Strong (usually bold) text. || {{type:[start|end]}} ||
|
||||
|| {{superscript}} || Superscript text. || {{type:[start|end]}} ||
|
||||
|| {{table}} || Table elements. || {{type:[table|row|cell]_[start|end], colspan}} ||
|
||||
|| {{tt}} || Teletype (monospaced) text. || {{type:[start|end]}} ||
|
||||
|| {{tt}} || Teletype (monospaced) text. || {{type:[start|end]}} ||
|
||||
|| {{url}} || A page URL. || {{type:[inline|footnote|descr]}}, {{href}}, {{text}} ||
|
||||
|| {{wikilink}} || A local !WikiPage reference. || {{page}}, {{anchor}} ||
|
||||
|| {{toc}} || Table of contents. || {{type:[list_start|list_end|item_start|item_end|target], level, count}} ||
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user