Changeset 2963 for trunk/vendor/Text
- Timestamp:
- 10/21/07 07:23:59 (15 months ago)
- Location:
- trunk/vendor/Text
- Files:
-
- 18 modified
-
Wiki.php (modified) (21 diffs)
-
Wiki/Parse/Default/Center.php (modified) (1 diff)
-
Wiki/Parse/Default/Code.php (modified) (2 diffs)
-
Wiki/Parse/Default/Freelink.php (modified) (1 diff)
-
Wiki/Parse/Default/Heading.php (modified) (2 diffs)
-
Wiki/Parse/Default/Image.php (modified) (1 diff)
-
Wiki/Parse/Default/List.php (modified) (2 diffs)
-
Wiki/Parse/Default/Wikilink.php (modified) (1 diff)
-
Wiki/Render/Latex/Blockquote.php (modified) (1 diff)
-
Wiki/Render/Latex/Colortext.php (modified) (1 diff)
-
Wiki/Render/Latex/Font.php (modified) (1 diff)
-
Wiki/Render/Latex/Image.php (modified) (1 diff)
-
Wiki/Render/Latex/Phplookup.php (modified) (1 diff)
-
Wiki/Render/Plain/Phplookup.php (modified) (1 diff)
-
Wiki/Render/Xhtml/Colortext.php (modified) (1 diff)
-
Wiki/Render/Xhtml/Image.php (modified) (3 diffs)
-
Wiki/Render/Xhtml/Url.php (modified) (1 diff)
-
Wiki/Render/Xhtml/Wikilink.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/vendor/Text/Wiki.php
r2308 r2963 445 445 { 446 446 static $only = array(); 447 if ( !isset($only[$parser])) {447 if ( ! isset($only[$parser])) { 448 448 $ret = & Text_Wiki::factory($parser, $rules); 449 449 if (Text_Wiki::isError($ret)) { … … 470 470 $class = 'Text_Wiki_' . $parser; 471 471 $file = str_replace('_', '/', $class).'.php'; 472 if ( !class_exists($class)) {472 if ( ! class_exists($class)) { 473 473 require_once $file; 474 if ( !class_exists($class)) {474 if ( ! class_exists($class)) { 475 475 return Text_Wiki::error( 476 476 'Class ' . $class . ' does not exist after requiring '. $file . … … 504 504 $rule = ucwords(strtolower($rule)); 505 505 506 if ( !isset($this->parseConf[$rule])) {506 if ( ! isset($this->parseConf[$rule])) { 507 507 $this->parseConf[$rule] = array(); 508 508 } … … 540 540 541 541 // the rule does not exist 542 if ( !isset($this->parseConf[$rule])) {542 if ( ! isset($this->parseConf[$rule])) { 543 543 return null; 544 544 } … … 584 584 $rule = ucwords(strtolower($rule)); 585 585 586 if ( !isset($this->renderConf[$format])) {586 if ( ! isset($this->renderConf[$format])) { 587 587 $this->renderConf[$format] = array(); 588 588 } 589 589 590 if ( !isset($this->renderConf[$format][$rule])) {590 if ( ! isset($this->renderConf[$format][$rule])) { 591 591 $this->renderConf[$format][$rule] = array(); 592 592 } … … 626 626 $rule = ucwords(strtolower($rule)); 627 627 628 if ( !isset($this->renderConf[$format]) ||628 if ( ! isset($this->renderConf[$format]) || 629 629 ! isset($this->renderConf[$format][$rule])) { 630 630 return null; … … 665 665 function setFormatConf($format, $arg1, $arg2 = null) 666 666 { 667 if ( !is_array($this->formatConf[$format])) {667 if ( ! is_array($this->formatConf[$format])) { 668 668 $this->formatConf[$format] = array(); 669 669 } … … 700 700 { 701 701 // the format does not exist 702 if ( !isset($this->formatConf[$format])) {702 if ( ! isset($this->formatConf[$format])) { 703 703 return null; 704 704 } … … 740 740 { 741 741 $name = ucwords(strtolower($name)); 742 if ( !is_null($tgt)) {742 if ( ! is_null($tgt)) { 743 743 $tgt = ucwords(strtolower($tgt)); 744 744 } … … 753 753 // in the list of rules. this means we're trying to insert after 754 754 // a target key, but the target key isn't there. 755 if ( !is_null($tgt) && $tgt != '' &&755 if ( ! is_null($tgt) && $tgt != '' && 756 756 ! in_array($tgt, $this->rules)) { 757 757 return false; … … 947 947 foreach ($this->rules as $name) { 948 948 // do not parse the rules listed in $disable 949 if ( !in_array($name, $this->disable)) {949 if ( ! in_array($name, $this->disable)) { 950 950 951 951 // load the parsing object … … 1228 1228 // will not reset to zero. 1229 1229 static $id; 1230 if ( !isset($id)) {1230 if ( ! isset($id)) { 1231 1231 $id = 0; 1232 1232 } else { … … 1242 1242 1 => $options 1243 1243 ); 1244 if ( !isset($this->_countRulesTokens[$rule])) {1244 if ( ! isset($this->_countRulesTokens[$rule])) { 1245 1245 $this->_countRulesTokens[$rule] = 1; 1246 1246 } else { … … 1288 1288 ); 1289 1289 if ($rule != $oldRule) { 1290 if ( !($this->_countRulesTokens[$oldRule]--)) {1290 if ( ! ($this->_countRulesTokens[$oldRule]--)) { 1291 1291 unset($this->_countRulesTokens[$oldRule]); 1292 1292 } 1293 if ( !isset($this->_countRulesTokens[$rule])) {1293 if ( ! isset($this->_countRulesTokens[$rule])) { 1294 1294 $this->_countRulesTokens[$rule] = 1; 1295 1295 } else { … … 1316 1316 $class = "Text_Wiki_Parse_$rule"; 1317 1317 1318 if ( !class_exists($class)) {1318 if ( ! class_exists($class)) { 1319 1319 $loc = $this->findFile('parse', $file); 1320 1320 if ($loc) { … … 1353 1353 $class = "Text_Wiki_Render_$format" . "_$rule"; 1354 1354 1355 if ( !class_exists($class)) {1355 if ( ! class_exists($class)) { 1356 1356 // load the class 1357 1357 $loc = $this->findFile('render', $file); … … 1387 1387 $class = "Text_Wiki_Render_$format"; 1388 1388 1389 if ( !class_exists($class)) {1389 if ( ! class_exists($class)) { 1390 1390 $loc = $this->findFile('render', $file); 1391 1391 if ($loc) { … … 1421 1421 { 1422 1422 $dir = $this->fixPath($dir); 1423 if ( !isset($this->path[$type])) {1423 if ( ! isset($this->path[$type])) { 1424 1424 $this->path[$type] = array($dir); 1425 1425 } else { … … 1446 1446 if (is_null($type)) { 1447 1447 return $this->path; 1448 } elseif ( !isset($this->path[$type])) {1448 } elseif ( ! isset($this->path[$type])) { 1449 1449 return array(); 1450 1450 } else { … … 1502 1502 $len = strlen($this->_dirSep); 1503 1503 1504 if ( !empty($path) &&1504 if ( ! empty($path) && 1505 1505 substr($path, -1 * $len, $len) != $this->_dirSep) { 1506 1506 return $path . $this->_dirSep; … … 1525 1525 function &error($message) 1526 1526 { 1527 if ( !class_exists('PEAR_Error')) {1527 if ( ! class_exists('PEAR_Error')) { 1528 1528 include_once 'PEAR.php'; 1529 1529 } -
trunk/vendor/Text/Wiki/Parse/Default/Center.php
r1125 r2963 47 47 48 48 var $regex = '/\n\= (.*?)\n/'; 49 49 50 50 /** 51 51 * -
trunk/vendor/Text/Wiki/Parse/Default/Code.php
r2015 r2963 52 52 /* var $regex = '/^(\<code( .+)?\>)\n(.+)\n(\<\/code\>)(\s|$)/Umsi';*/ 53 53 var $regex = ';^<code(\s[^>]*)?>((?:(?R)|.*?)*)\n</code>(\s|$);msi'; 54 54 55 55 /** 56 56 * … … 83 83 84 84 // ... and make sure we have a 'type' 85 if ( !isset($attr['type'])) {85 if ( ! isset($attr['type'])) { 86 86 $attr['type'] = ''; 87 87 } -
trunk/vendor/Text/Wiki/Parse/Default/Freelink.php
r2015 r2963 45 45 'utf-8' => false 46 46 ); 47 47 48 48 /** 49 49 * -
trunk/vendor/Text/Wiki/Parse/Default/Heading.php
r1125 r2963 56 56 'id_prefix' => 'toc' 57 57 ); 58 58 59 59 /** 60 60 * … … 78 78 // when constructing TOC entries, etc. 79 79 static $id; 80 if ( !isset($id)) {80 if ( ! isset($id)) { 81 81 $id = 0; 82 82 } -
trunk/vendor/Text/Wiki/Parse/Default/Image.php
r1125 r2963 122 122 // external url ? 123 123 if (($pos = strpos($options['attr']['link'], '://')) !== false) { 124 if ( !preg_match($this->url, $options['attr']['link'])) {124 if ( ! preg_match($this->url, $options['attr']['link'])) { 125 125 return $matches[0]; 126 126 } -
trunk/vendor/Text/Wiki/Parse/Default/List.php
r1125 r2963 187 187 // add to the item count for this list (taking into account 188 188 // which level we are at). 189 if ( !isset($itemcount[$level])) {189 if ( ! isset($itemcount[$level])) { 190 190 // first count 191 191 $itemcount[$level] = 0; … … 196 196 197 197 // is this the very first item in the list? 198 if ( !$pastFirst) {198 if ( ! $pastFirst) { 199 199 $first = true; 200 200 $pastFirst = true; -
trunk/vendor/Text/Wiki/Parse/Default/Wikilink.php
r2015 r2963 88 88 // build the regular expression for finding WikiPage names. 89 89 $this->regex = 90 "( !?" . // START WikiPage pattern (1)90 "( ! ?" . // START WikiPage pattern (1) 91 91 "[$upper]" . // 1 upper 92 92 "[$either]*" . // 0+ alpha or digit -
trunk/vendor/Text/Wiki/Render/Latex/Blockquote.php
r1125 r2963 4 4 5 5 var $conf = array('css' => null); 6 6 7 7 /** 8 8 * -
trunk/vendor/Text/Wiki/Render/Latex/Colortext.php
r1125 r2963 43 43 $color = $options['color']; 44 44 45 if ( !in_array($color, $this->colors)) {45 if ( ! in_array($color, $this->colors)) { 46 46 $color = '#' . $color; 47 47 } -
trunk/vendor/Text/Wiki/Render/Latex/Font.php
r1125 r2963 46 46 'huge' => 22, 47 47 'Huge' => 9999); 48 48 49 49 /** 50 50 * Renders a token into text matching the requested format. -
trunk/vendor/Text/Wiki/Render/Latex/Image.php
r1125 r2963 57 57 58 58 // always add an "alt" attribute per Stephane Solliec 59 if ( !$alt) {59 if ( ! $alt) { 60 60 $attr .= ' alt="' . basename($options['src']) . '"'; 61 61 } -
trunk/vendor/Text/Wiki/Render/Latex/Phplookup.php
r1125 r2963 4 4 5 5 var $conf = array('target' => '_blank'); 6 6 7 7 /** 8 8 * -
trunk/vendor/Text/Wiki/Render/Plain/Phplookup.php
r1125 r2963 4 4 5 5 var $conf = array('target' => '_blank'); 6 6 7 7 /** 8 8 * -
trunk/vendor/Text/Wiki/Render/Xhtml/Colortext.php
r1125 r2963 64 64 $color = $options['color']; 65 65 66 if ( !in_array($color, $this->colors) && $color{0} != '#') {66 if ( ! in_array($color, $this->colors) && $color{0} != '#') { 67 67 $color = '#' . $color; 68 68 } -
trunk/vendor/Text/Wiki/Render/Xhtml/Image.php
r2015 r2963 86 86 if (isset($options['attr']['align'])) { 87 87 // make sure we have a style attribute 88 if ( !isset($options['attr']['style'])) {88 if ( ! isset($options['attr']['style'])) { 89 89 // no style, set up a blank one 90 90 $options['attr']['style'] = ''; … … 110 110 // stephane@metacites.net -- 25/07/2004 111 111 // try to guess width and height 112 if ( !isset($options['attr']['width']) &&112 if ( ! isset($options['attr']['width']) && 113 113 ! isset($options['attr']['height'])) { 114 114 … … 163 163 164 164 // always add an "alt" attribute per Stephane Solliec 165 if ( !$alt) {165 if ( ! $alt) { 166 166 $alt = $this->textEncode(basename($options['src'])); 167 167 $output .= " alt=\"$alt\""; -
trunk/vendor/Text/Wiki/Render/Xhtml/Url.php
r2015 r2963 67 67 68 68 // create alt text for the image 69 if ( !isset($text) || $text == '') {69 if ( ! isset($text) || $text == '') { 70 70 $text = basename($href); 71 71 $text = $this->textEncode($text); -
trunk/vendor/Text/Wiki/Render/Xhtml/Wikilink.php
r2015 r2963 115 115 116 116 // set the proper HREF 117 if ( !$href || trim($href) == '') {117 if ( ! $href || trim($href) == '') { 118 118 119 119 // no useful href, return the text as it is … … 142 142 // what kind of linking are we doing? 143 143 $pos = $this->getConf('new_text_pos'); 144 if ( !$pos || ! $new) {144 if ( ! $pos || ! $new) { 145 145 // no position (or no new_text), use css only on the page name 146 146 … … 157 157 } 158 158 } 159 if ( !strlen($text)) {159 if ( ! strlen($text)) { 160 160 $start .= $this->textEncode($page); 161 161 }