@@ -67,7 +67,7 @@ |
||
| 67 | 67 | $node->setAttribute('id', $identifierFormatted); |
| 68 | 68 | |
| 69 | 69 | if ($thisDepth > $curDepth) { |
| 70 | - $toc .= "\n".str_repeat(' ', $thisDepth - 1)."<ul>\n"; |
|
| 70 | + $toc .= "\n" . str_repeat(' ', $thisDepth - 1) . "<ul>\n"; |
|
| 71 | 71 | } elseif ($i > 0) { |
| 72 | 72 | $toc .= "</li>\n"; |
| 73 | 73 | } |
@@ -107,7 +107,7 @@ |
||
| 107 | 107 | $newList = array(); |
| 108 | 108 | |
| 109 | 109 | // Traverse the tree |
| 110 | - $rec = function ($node) use (&$rec, &$newList, &$arrayList) { |
|
| 110 | + $rec = function($node) use (&$rec, &$newList, &$arrayList) { |
|
| 111 | 111 | /* @var $node DOMElement */ |
| 112 | 112 | |
| 113 | 113 | foreach ($arrayList as $index => $compareNode) { |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | $caption = (string) $node->getAttribute('caption'); |
| 48 | 48 | |
| 49 | 49 | $file = (string) $node->getAttribute('file'); |
| 50 | - $from = $node->getAttribute('from'); |
|
| 50 | + $from = $node->getAttribute('from'); |
|
| 51 | 51 | $length = $node->getAttribute('length'); |
| 52 | 52 | |
| 53 | 53 | if ($from === '') { |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | $class = 'line'; |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | - $code[$i] = '<span class="'.$class.'" id="hic-svnt-dracones">' |
|
| 180 | + $code[$i] = '<span class="' . $class . '" id="hic-svnt-dracones">' |
|
| 181 | 181 | . $code[$i] |
| 182 | 182 | . '</span>'; |
| 183 | 183 | |
@@ -175,7 +175,7 @@ |
||
| 175 | 175 | |
| 176 | 176 | $xml .= '<li id="' . $id . '">'; |
| 177 | 177 | $xml .= $text; |
| 178 | - $xml .= ' <a href="#'.$idRef.'">'."\xE2\x86\x91".'</a>'; |
|
| 178 | + $xml .= ' <a href="#' . $idRef . '">' . "\xE2\x86\x91" . '</a>'; |
|
| 179 | 179 | $xml .= '</li>'; |
| 180 | 180 | |
| 181 | 181 | $i++; |
@@ -32,12 +32,12 @@ |
||
| 32 | 32 | . '.01._SCMZZZZZZZ_V65020934_.jpg'; |
| 33 | 33 | |
| 34 | 34 | $ret = '<div class="amazon clear">' |
| 35 | - . '<div class="img-border">' |
|
| 36 | - . '<div class="img" style="background-image: url(' . $this->e($img) . ');"></div>' |
|
| 37 | - . '</div>' |
|
| 38 | - . '<p class="title"><strong>' . $this->e($title) . '</strong></p>' |
|
| 39 | - . '<p class="author">' . $this->e($author) . '</p>' |
|
| 40 | - . '</div>'; |
|
| 35 | + . '<div class="img-border">' |
|
| 36 | + . '<div class="img" style="background-image: url(' . $this->e($img) . ');"></div>' |
|
| 37 | + . '</div>' |
|
| 38 | + . '<p class="title"><strong>' . $this->e($title) . '</strong></p>' |
|
| 39 | + . '<p class="author">' . $this->e($author) . '</p>' |
|
| 40 | + . '</div>'; |
|
| 41 | 41 | |
| 42 | 42 | return $ret; |
| 43 | 43 | } |
@@ -64,29 +64,29 @@ |
||
| 64 | 64 | |
| 65 | 65 | if ($align == Parser::PC_IMG_ALIGN_RIGHT) { |
| 66 | 66 | $ret .= '<div class="img">' . "\n" |
| 67 | - . ' <div class="img_right" style="' . $style . '">' . "\n" |
|
| 68 | - . ' <div class="img_border">' . "\n" |
|
| 69 | - . ' <img src="' . $this->e($path) . '" alt="Bild: ' . $this->e($alt) . '" title="' |
|
| 70 | - . $this->e($alt) . '" ' . $attr . ' />' . "\n" |
|
| 71 | - . ' </div>' . "\n" |
|
| 72 | - . ' <div class="img_content">'; |
|
| 67 | + . ' <div class="img_right" style="' . $style . '">' . "\n" |
|
| 68 | + . ' <div class="img_border">' . "\n" |
|
| 69 | + . ' <img src="' . $this->e($path) . '" alt="Bild: ' . $this->e($alt) . '" title="' |
|
| 70 | + . $this->e($alt) . '" ' . $attr . ' />' . "\n" |
|
| 71 | + . ' </div>' . "\n" |
|
| 72 | + . ' <div class="img_content">'; |
|
| 73 | 73 | } elseif ($align == Parser::PC_IMG_ALIGN_CENTER) { |
| 74 | 74 | $ret .= '<div class="center">' . "\n" |
| 75 | - . ' <div class="img">' . "\n" |
|
| 76 | - . ' <div class="img_center" style="' . $style . '">' . "\n" |
|
| 77 | - . ' <div class="img_border">' . "\n" |
|
| 78 | - . ' <img src="' . $this->e($path) . '" alt="Bild: ' . $this->e($alt) . '" title="' |
|
| 79 | - . $this->e($alt) . '" ' . $attr . ' />' . "\n" |
|
| 80 | - . ' </div>' . "\n" |
|
| 81 | - . ' <div class="img_content">'; |
|
| 75 | + . ' <div class="img">' . "\n" |
|
| 76 | + . ' <div class="img_center" style="' . $style . '">' . "\n" |
|
| 77 | + . ' <div class="img_border">' . "\n" |
|
| 78 | + . ' <img src="' . $this->e($path) . '" alt="Bild: ' . $this->e($alt) . '" title="' |
|
| 79 | + . $this->e($alt) . '" ' . $attr . ' />' . "\n" |
|
| 80 | + . ' </div>' . "\n" |
|
| 81 | + . ' <div class="img_content">'; |
|
| 82 | 82 | } elseif ($align == Parser::PC_IMG_ALIGN_LEFT) { |
| 83 | 83 | $ret .= '<div class="img">' . "\n" |
| 84 | - . ' <div class="img_left" style="' . $style . '">' . "\n" |
|
| 85 | - . ' <div class="img_border">' . "\n" |
|
| 86 | - . ' <img src="' . $this->e($path) . '" alt="Bild: ' . $this->e($alt) . '" title="' |
|
| 87 | - . $this->e($alt) . '" ' . $attr . ' />' . "\n" |
|
| 88 | - . ' </div>' . "\n" |
|
| 89 | - . ' <div class="img_content">'; |
|
| 84 | + . ' <div class="img_left" style="' . $style . '">' . "\n" |
|
| 85 | + . ' <div class="img_border">' . "\n" |
|
| 86 | + . ' <img src="' . $this->e($path) . '" alt="Bild: ' . $this->e($alt) . '" title="' |
|
| 87 | + . $this->e($alt) . '" ' . $attr . ' />' . "\n" |
|
| 88 | + . ' </div>' . "\n" |
|
| 89 | + . ' <div class="img_content">'; |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | return $ret; |
@@ -454,7 +454,7 @@ |
||
| 454 | 454 | $last_tag = null; |
| 455 | 455 | } |
| 456 | 456 | |
| 457 | - $e = function ($s) { return htmlspecialchars($s, ENT_QUOTES, 'UTF-8'); }; |
|
| 457 | + $e = function($s) { return htmlspecialchars($s, ENT_QUOTES, 'UTF-8'); }; |
|
| 458 | 458 | |
| 459 | 459 | return $e($s); |
| 460 | 460 | } |
@@ -149,6 +149,7 @@ discard block |
||
| 149 | 149 | |
| 150 | 150 | /** |
| 151 | 151 | * |
| 152 | + * @param string $name |
|
| 152 | 153 | */ |
| 153 | 154 | public function addSetting($name, $value = '') |
| 154 | 155 | { |
@@ -226,6 +227,7 @@ discard block |
||
| 226 | 227 | |
| 227 | 228 | /** |
| 228 | 229 | * |
| 230 | + * @param string $s |
|
| 229 | 231 | */ |
| 230 | 232 | public function parse($s) |
| 231 | 233 | { |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | public function highlight($source, $language = '') |
| 18 | 18 | { |
| 19 | - $e = function ($s) { |
|
| 19 | + $e = function($s) { |
|
| 20 | 20 | return htmlspecialchars($s, ENT_QUOTES, 'UTF-8'); |
| 21 | 21 | }; |
| 22 | 22 | |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | */ |
| 51 | 51 | private function xml2xhtml($xml) |
| 52 | 52 | { |
| 53 | - return preg_replace_callback('#<(\w+)([^>]*)\s*/>#s', function ($m) { |
|
| 53 | + return preg_replace_callback('#<(\w+)([^>]*)\s*/>#s', function($m) { |
|
| 54 | 54 | $xhtml_tags = array( |
| 55 | 55 | 'br', 'hr', 'input', 'frame', 'img', 'area', 'link', 'col', |
| 56 | 56 | 'base', 'basefont', 'param' |