@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | $path = '/'; |
| 4 | -$url = array('plugin' => 'install' ,'controller' => 'install'); |
|
| 5 | -if (file_exists(APP . 'Config' . DS.'settings.yml')) { |
|
| 4 | +$url = array('plugin' => 'install', 'controller' => 'install'); |
|
| 5 | +if (file_exists(APP.'Config'.DS.'settings.yml')) { |
|
| 6 | 6 | $request = Router::getRequest(); |
| 7 | 7 | if (!Configure::read('Install.secured') && |
| 8 | 8 | strpos($request->url, 'finish') == false |
@@ -65,17 +65,17 @@ discard block |
||
| 65 | 65 | $recordString .= implode(",\n", $values); |
| 66 | 66 | $recordString .= "\n\t\t),\n"; |
| 67 | 67 | } |
| 68 | - $className = $modelAlias . 'Data'; |
|
| 68 | + $className = $modelAlias.'Data'; |
|
| 69 | 69 | $content = "<?php\n"; |
| 70 | - $content .= "class " . $modelAlias . "Data" . " {\n\n"; |
|
| 71 | - $content .= "\tpublic \$table = '" . $table . "';\n\n"; |
|
| 70 | + $content .= "class ".$modelAlias."Data"." {\n\n"; |
|
| 71 | + $content .= "\tpublic \$table = '".$table."';\n\n"; |
|
| 72 | 72 | $content .= "\tpublic \$records = array(\n"; |
| 73 | 73 | $content .= $recordString; |
| 74 | 74 | $content .= "\t);\n\n"; |
| 75 | 75 | $content .= "}\n"; |
| 76 | 76 | |
| 77 | 77 | // write file |
| 78 | - $filePath = APP . 'Plugin' .DS. 'Install'. DS. 'Config' .DS. 'Data' .DS. $modelAlias . 'Data.php'; |
|
| 78 | + $filePath = APP.'Plugin'.DS.'Install'.DS.'Config'.DS.'Data'.DS.$modelAlias.'Data.php'; |
|
| 79 | 79 | if (!file_exists($filePath)) { |
| 80 | 80 | touch($filePath); |
| 81 | 81 | } |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | $file = new File($filePath, true); |
| 84 | 84 | $file->write($content); |
| 85 | 85 | |
| 86 | - $this->out('New file generated: ' . $filePath); |
|
| 86 | + $this->out('New file generated: '.$filePath); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | } |
@@ -30,20 +30,20 @@ discard block |
||
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | protected function _markInstalled() { |
| 33 | - touch(APP . 'Config' . DS . 'installed.txt'); |
|
| 33 | + touch(APP.'Config'.DS.'installed.txt'); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | protected function _createSecurity() { |
| 37 | - $File = new File(APP . 'Config' . DS . 'core.php'); |
|
| 37 | + $File = new File(APP.'Config'.DS.'core.php'); |
|
| 38 | 38 | |
| 39 | 39 | // save previous core file |
| 40 | 40 | // copy(APP . 'Config' . DS.'settings.yml.install', APP . 'Config' . DS.'settings.yml'); |
| 41 | - $File->copy(APP . 'Config' . DS . 'core.' . date('YmdHis', |
|
| 42 | - time()) . '.php'); |
|
| 41 | + $File->copy(APP.'Config'.DS.'core.'.date('YmdHis', |
|
| 42 | + time()).'.php'); |
|
| 43 | 43 | |
| 44 | 44 | // set new salt and seed value |
| 45 | 45 | $salt = Security::generateAuthKey(); |
| 46 | - $seed = mt_rand() . mt_rand(); |
|
| 46 | + $seed = mt_rand().mt_rand(); |
|
| 47 | 47 | $contents = $File->read(); |
| 48 | 48 | $contents = preg_replace('/(?<=Configure::write\(\'Security.salt\', \')([^\' ]+)(?=\'\))/', |
| 49 | 49 | $salt, |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | $this->log($User->validationErrors); |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | - return (bool)$saved; |
|
| 95 | + return (bool) $saved; |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | } |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | * @return void |
| 84 | 84 | */ |
| 85 | 85 | protected function _check() { |
| 86 | - if (file_exists(APP . 'Config' . DS . 'installed.txt')) { |
|
| 86 | + if (file_exists(APP.'Config'.DS.'installed.txt')) { |
|
| 87 | 87 | // if (Configure::read('Install.installed') && Configure::read('Install.secured')) { |
| 88 | 88 | $this->Session->setFlash('Already Installed'); |
| 89 | 89 | $this->redirect('/'); |
@@ -142,16 +142,16 @@ discard block |
||
| 142 | 142 | return; |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - copy(APP . 'Config' . DS.'database.php.install', APP . 'Config' . DS.'database.php'); |
|
| 145 | + copy(APP.'Config'.DS.'database.php.install', APP.'Config'.DS.'database.php'); |
|
| 146 | 146 | App::uses('File', 'Utility'); |
| 147 | - $file = new File(APP . 'Config' . DS.'database.php', true); |
|
| 147 | + $file = new File(APP.'Config'.DS.'database.php', true); |
|
| 148 | 148 | $content = $file->read(); |
| 149 | 149 | |
| 150 | 150 | foreach ($config AS $configKey => $configValue) { |
| 151 | - $content = str_replace('{default_' . $configKey . '}', $configValue, $content); |
|
| 151 | + $content = str_replace('{default_'.$configKey.'}', $configValue, $content); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | - if($file->write($content) ) { |
|
| 154 | + if ($file->write($content)) { |
|
| 155 | 155 | return $this->redirect(array('action' => 'data')); |
| 156 | 156 | } else { |
| 157 | 157 | $this->Session->setFlash(__('Could not write database.php file.'), 'default', array('class' => 'error')); |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | $nextValue = $model->find('first', array( |
| 167 | 167 | 'fields' => sprintf('MAX(%s.%s) as max', $model->alias, $model->primaryKey), |
| 168 | 168 | )); |
| 169 | - $nextValue = empty($nextValue[0]['max']) ? 1 : $nextValue[0]['max'] + 1; |
|
| 169 | + $nextValue = empty($nextValue[0]['max']) ? 1 : $nextValue[0]['max'] + 1; |
|
| 170 | 170 | $sql = sprintf('alter sequence %s restart with %d', $db->getSequence($model), $nextValue); |
| 171 | 171 | $db->execute($sql); |
| 172 | 172 | } |
@@ -187,12 +187,12 @@ discard block |
||
| 187 | 187 | |
| 188 | 188 | $db = ConnectionManager::getDataSource('default'); |
| 189 | 189 | $brokenSequence = $db instanceof Postgres; |
| 190 | - if(!$db->isConnected()) { |
|
| 190 | + if (!$db->isConnected()) { |
|
| 191 | 191 | $this->Session->setFlash(__('Could not connect to database.'), 'default', array('class' => 'error')); |
| 192 | 192 | } else { |
| 193 | 193 | $schema = new CakeSchema(array('name'=>'app')); |
| 194 | 194 | $schema = $schema->load(); |
| 195 | - foreach($schema->tables as $table => $fields) { |
|
| 195 | + foreach ($schema->tables as $table => $fields) { |
|
| 196 | 196 | $create = $db->createSchema($schema, $table); |
| 197 | 197 | try { |
| 198 | 198 | $db->execute($create); |
@@ -203,10 +203,10 @@ discard block |
||
| 203 | 203 | } |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | - $path = CakePlugin::path('Install') .DS. 'Config' .DS. 'Data' .DS; |
|
| 206 | + $path = CakePlugin::path('Install').DS.'Config'.DS.'Data'.DS; |
|
| 207 | 207 | $dataObjects = App::objects('class', $path); |
| 208 | 208 | foreach ($dataObjects as $data) { |
| 209 | - include($path . $data . '.php'); |
|
| 209 | + include($path.$data.'.php'); |
|
| 210 | 210 | $classVars = get_class_vars($data); |
| 211 | 211 | $modelAlias = substr($data, 0, -4); |
| 212 | 212 | $table = $classVars['table']; |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | )); |
| 220 | 220 | if (is_array($records) && count($records) > 0) { |
| 221 | 221 | $i = 1; |
| 222 | - foreach($records as $record) { |
|
| 222 | + foreach ($records as $record) { |
|
| 223 | 223 | if (!isset($record['id'])) { |
| 224 | 224 | $record['id'] = $i++; |
| 225 | 225 | } |
@@ -12,8 +12,8 @@ discard block |
||
| 12 | 12 | # |
| 13 | 13 | |
| 14 | 14 | |
| 15 | -define( 'MARKDOWN_VERSION', "1.0.1n" ); # Sat 10 Oct 2009 |
|
| 16 | -define( 'MARKDOWNEXTRA_VERSION', "1.2.4" ); # Sat 10 Oct 2009 |
|
| 15 | +define('MARKDOWN_VERSION', "1.0.1n"); # Sat 10 Oct 2009 |
|
| 16 | +define('MARKDOWNEXTRA_VERSION', "1.2.4"); # Sat 10 Oct 2009 |
|
| 17 | 17 | |
| 18 | 18 | |
| 19 | 19 | # |
@@ -21,18 +21,18 @@ discard block |
||
| 21 | 21 | # |
| 22 | 22 | |
| 23 | 23 | # Change to ">" for HTML output |
| 24 | -@define( 'MARKDOWN_EMPTY_ELEMENT_SUFFIX', " />"); |
|
| 24 | +@define('MARKDOWN_EMPTY_ELEMENT_SUFFIX', " />"); |
|
| 25 | 25 | |
| 26 | 26 | # Define the width of a tab for code blocks. |
| 27 | -@define( 'MARKDOWN_TAB_WIDTH', 4 ); |
|
| 27 | +@define('MARKDOWN_TAB_WIDTH', 4); |
|
| 28 | 28 | |
| 29 | 29 | # Optional title attribute for footnote links and backlinks. |
| 30 | -@define( 'MARKDOWN_FN_LINK_TITLE', "" ); |
|
| 31 | -@define( 'MARKDOWN_FN_BACKLINK_TITLE', "" ); |
|
| 30 | +@define('MARKDOWN_FN_LINK_TITLE', ""); |
|
| 31 | +@define('MARKDOWN_FN_BACKLINK_TITLE', ""); |
|
| 32 | 32 | |
| 33 | 33 | # Optional class attribute for footnote links and backlinks. |
| 34 | -@define( 'MARKDOWN_FN_LINK_CLASS', "" ); |
|
| 35 | -@define( 'MARKDOWN_FN_BACKLINK_CLASS', "" ); |
|
| 34 | +@define('MARKDOWN_FN_LINK_CLASS', ""); |
|
| 35 | +@define('MARKDOWN_FN_BACKLINK_CLASS', ""); |
|
| 36 | 36 | |
| 37 | 37 | |
| 38 | 38 | # |
@@ -40,14 +40,14 @@ discard block |
||
| 40 | 40 | # |
| 41 | 41 | |
| 42 | 42 | # Change to false to remove Markdown from posts and/or comments. |
| 43 | -@define( 'MARKDOWN_WP_POSTS', true ); |
|
| 44 | -@define( 'MARKDOWN_WP_COMMENTS', true ); |
|
| 43 | +@define('MARKDOWN_WP_POSTS', true); |
|
| 44 | +@define('MARKDOWN_WP_COMMENTS', true); |
|
| 45 | 45 | |
| 46 | 46 | |
| 47 | 47 | |
| 48 | 48 | ### Standard Function Interface ### |
| 49 | 49 | |
| 50 | -@define( 'MARKDOWN_PARSER_CLASS', 'MarkdownExtra_Parser' ); |
|
| 50 | +@define('MARKDOWN_PARSER_CLASS', 'MarkdownExtra_Parser'); |
|
| 51 | 51 | |
| 52 | 52 | function Markdown($text) { |
| 53 | 53 | # |
@@ -85,19 +85,19 @@ discard block |
||
| 85 | 85 | # - Run Markdown on excerpt, then remove all tags. |
| 86 | 86 | # - Add paragraph tag around the excerpt, but remove it for the excerpt rss. |
| 87 | 87 | if (MARKDOWN_WP_POSTS) { |
| 88 | - remove_filter('the_content', 'wpautop'); |
|
| 88 | + remove_filter('the_content', 'wpautop'); |
|
| 89 | 89 | remove_filter('the_content_rss', 'wpautop'); |
| 90 | - remove_filter('the_excerpt', 'wpautop'); |
|
| 91 | - add_filter('the_content', 'mdwp_MarkdownPost', 6); |
|
| 90 | + remove_filter('the_excerpt', 'wpautop'); |
|
| 91 | + add_filter('the_content', 'mdwp_MarkdownPost', 6); |
|
| 92 | 92 | add_filter('the_content_rss', 'mdwp_MarkdownPost', 6); |
| 93 | 93 | add_filter('get_the_excerpt', 'mdwp_MarkdownPost', 6); |
| 94 | 94 | add_filter('get_the_excerpt', 'trim', 7); |
| 95 | - add_filter('the_excerpt', 'mdwp_add_p'); |
|
| 95 | + add_filter('the_excerpt', 'mdwp_add_p'); |
|
| 96 | 96 | add_filter('the_excerpt_rss', 'mdwp_strip_p'); |
| 97 | 97 | |
| 98 | - remove_filter('content_save_pre', 'balanceTags', 50); |
|
| 99 | - remove_filter('excerpt_save_pre', 'balanceTags', 50); |
|
| 100 | - add_filter('the_content', 'balanceTags', 50); |
|
| 98 | + remove_filter('content_save_pre', 'balanceTags', 50); |
|
| 99 | + remove_filter('excerpt_save_pre', 'balanceTags', 50); |
|
| 100 | + add_filter('the_content', 'balanceTags', 50); |
|
| 101 | 101 | add_filter('get_the_excerpt', 'balanceTags', 9); |
| 102 | 102 | } |
| 103 | 103 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | if (is_single() || is_page() || is_feed()) { |
| 112 | 112 | $parser->fn_id_prefix = ""; |
| 113 | 113 | } else { |
| 114 | - $parser->fn_id_prefix = get_the_ID() . "."; |
|
| 114 | + $parser->fn_id_prefix = get_the_ID()."."; |
|
| 115 | 115 | } |
| 116 | 116 | return $parser->transform($text); |
| 117 | 117 | } |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | add_filter('pre_comment_content', 'Markdown', 6); |
| 128 | 128 | add_filter('pre_comment_content', 'mdwp_hide_tags', 8); |
| 129 | 129 | add_filter('pre_comment_content', 'mdwp_show_tags', 12); |
| 130 | - add_filter('get_comment_text', 'Markdown', 6); |
|
| 130 | + add_filter('get_comment_text', 'Markdown', 6); |
|
| 131 | 131 | add_filter('get_comment_excerpt', 'Markdown', 6); |
| 132 | 132 | add_filter('get_comment_excerpt', 'mdwp_strip_p', 7); |
| 133 | 133 | |
@@ -192,13 +192,13 @@ discard block |
||
| 192 | 192 | @include_once 'smartypants.php'; |
| 193 | 193 | # Fake Textile class. It calls Markdown instead. |
| 194 | 194 | class Textile { |
| 195 | - function TextileThis($text, $lite='', $encode='') { |
|
| 195 | + function TextileThis($text, $lite = '', $encode = '') { |
|
| 196 | 196 | if ($lite == '' && $encode == '') $text = Markdown($text); |
| 197 | 197 | if (function_exists('SmartyPants')) $text = SmartyPants($text); |
| 198 | 198 | return $text; |
| 199 | 199 | } |
| 200 | 200 | # Fake restricted version: restrictions are not supported for now. |
| 201 | - function TextileRestricted($text, $lite='', $noimage='') { |
|
| 201 | + function TextileRestricted($text, $lite = '', $noimage = '') { |
|
| 202 | 202 | return $this->TextileThis($text, $lite); |
| 203 | 203 | } |
| 204 | 204 | # Workaround to ensure compatibility with TextPattern 4.0.3. |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | |
| 333 | 333 | $this->teardown(); |
| 334 | 334 | |
| 335 | - return $text . "\n"; |
|
| 335 | + return $text."\n"; |
|
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | var $document_gamut = array( |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | $link_id = strtolower($matches[1]); |
| 382 | 382 | $url = $matches[2] == '' ? $matches[3] : $matches[2]; |
| 383 | 383 | $this->urls[$link_id] = $url; |
| 384 | - $this->titles[$link_id] =& $matches[4]; |
|
| 384 | + $this->titles[$link_id] = & $matches[4]; |
|
| 385 | 385 | return ''; # String that will replace the block |
| 386 | 386 | } |
| 387 | 387 | |
@@ -434,8 +434,8 @@ discard block |
||
| 434 | 434 | (?> |
| 435 | 435 | /> |
| 436 | 436 | | |
| 437 | - >', $nested_tags_level). # end of opening tag |
|
| 438 | - '.*?'. # last level nested tag content |
|
| 437 | + >', $nested_tags_level).# end of opening tag |
|
| 438 | + '.*?'.# last level nested tag content |
|
| 439 | 439 | str_repeat(' |
| 440 | 440 | </\2\s*> # closing nested tag |
| 441 | 441 | ) |
@@ -547,7 +547,7 @@ discard block |
||
| 547 | 547 | |
| 548 | 548 | # Then hash the block. |
| 549 | 549 | static $i = 0; |
| 550 | - $key = "$boundary\x1A" . ++$i . $boundary; |
|
| 550 | + $key = "$boundary\x1A".++$i.$boundary; |
|
| 551 | 551 | $this->html_hashes[$key] = $text; |
| 552 | 552 | return $key; # String that will replace the tag. |
| 553 | 553 | } |
@@ -740,9 +740,9 @@ discard block |
||
| 740 | 740 | return $text; |
| 741 | 741 | } |
| 742 | 742 | function _doAnchors_reference_callback($matches) { |
| 743 | - $whole_match = $matches[1]; |
|
| 744 | - $link_text = $matches[2]; |
|
| 745 | - $link_id =& $matches[3]; |
|
| 743 | + $whole_match = $matches[1]; |
|
| 744 | + $link_text = $matches[2]; |
|
| 745 | + $link_id = & $matches[3]; |
|
| 746 | 746 | |
| 747 | 747 | if ($link_id == "") { |
| 748 | 748 | # for shortcut links like [this][] or [this]. |
@@ -758,10 +758,10 @@ discard block |
||
| 758 | 758 | $url = $this->encodeAttribute($url); |
| 759 | 759 | |
| 760 | 760 | $result = "<a href=\"$url\""; |
| 761 | - if ( isset( $this->titles[$link_id] ) ) { |
|
| 761 | + if (isset($this->titles[$link_id])) { |
|
| 762 | 762 | $title = $this->titles[$link_id]; |
| 763 | 763 | $title = $this->encodeAttribute($title); |
| 764 | - $result .= " title=\"$title\""; |
|
| 764 | + $result .= " title=\"$title\""; |
|
| 765 | 765 | } |
| 766 | 766 | |
| 767 | 767 | $link_text = $this->runSpanGamut($link_text); |
@@ -774,17 +774,17 @@ discard block |
||
| 774 | 774 | return $result; |
| 775 | 775 | } |
| 776 | 776 | function _doAnchors_inline_callback($matches) { |
| 777 | - $whole_match = $matches[1]; |
|
| 778 | - $link_text = $this->runSpanGamut($matches[2]); |
|
| 779 | - $url = $matches[3] == '' ? $matches[4] : $matches[3]; |
|
| 780 | - $title =& $matches[7]; |
|
| 777 | + $whole_match = $matches[1]; |
|
| 778 | + $link_text = $this->runSpanGamut($matches[2]); |
|
| 779 | + $url = $matches[3] == '' ? $matches[4] : $matches[3]; |
|
| 780 | + $title = & $matches[7]; |
|
| 781 | 781 | |
| 782 | 782 | $url = $this->encodeAttribute($url); |
| 783 | 783 | |
| 784 | 784 | $result = "<a href=\"$url\""; |
| 785 | 785 | if (isset($title)) { |
| 786 | 786 | $title = $this->encodeAttribute($title); |
| 787 | - $result .= " title=\"$title\""; |
|
| 787 | + $result .= " title=\"$title\""; |
|
| 788 | 788 | } |
| 789 | 789 | |
| 790 | 790 | $link_text = $this->runSpanGamut($link_text); |
@@ -865,7 +865,7 @@ discard block |
||
| 865 | 865 | if (isset($this->titles[$link_id])) { |
| 866 | 866 | $title = $this->titles[$link_id]; |
| 867 | 867 | $title = $this->encodeAttribute($title); |
| 868 | - $result .= " title=\"$title\""; |
|
| 868 | + $result .= " title=\"$title\""; |
|
| 869 | 869 | } |
| 870 | 870 | $result .= $this->empty_element_suffix; |
| 871 | 871 | $result = $this->hashPart($result); |
@@ -878,17 +878,17 @@ discard block |
||
| 878 | 878 | return $result; |
| 879 | 879 | } |
| 880 | 880 | function _doImages_inline_callback($matches) { |
| 881 | - $whole_match = $matches[1]; |
|
| 882 | - $alt_text = $matches[2]; |
|
| 883 | - $url = $matches[3] == '' ? $matches[4] : $matches[3]; |
|
| 884 | - $title =& $matches[7]; |
|
| 881 | + $whole_match = $matches[1]; |
|
| 882 | + $alt_text = $matches[2]; |
|
| 883 | + $url = $matches[3] == '' ? $matches[4] : $matches[3]; |
|
| 884 | + $title = & $matches[7]; |
|
| 885 | 885 | |
| 886 | 886 | $alt_text = $this->encodeAttribute($alt_text); |
| 887 | 887 | $url = $this->encodeAttribute($url); |
| 888 | 888 | $result = "<img src=\"$url\" alt=\"$alt_text\""; |
| 889 | 889 | if (isset($title)) { |
| 890 | 890 | $title = $this->encodeAttribute($title); |
| 891 | - $result .= " title=\"$title\""; # $title already quoted |
|
| 891 | + $result .= " title=\"$title\""; # $title already quoted |
|
| 892 | 892 | } |
| 893 | 893 | $result .= $this->empty_element_suffix; |
| 894 | 894 | |
@@ -933,12 +933,12 @@ discard block |
||
| 933 | 933 | |
| 934 | 934 | $level = $matches[2]{0} == '=' ? 1 : 2; |
| 935 | 935 | $block = "<h$level>".$this->runSpanGamut($matches[1])."</h$level>"; |
| 936 | - return "\n" . $this->hashBlock($block) . "\n\n"; |
|
| 936 | + return "\n".$this->hashBlock($block)."\n\n"; |
|
| 937 | 937 | } |
| 938 | 938 | function _doHeaders_callback_atx($matches) { |
| 939 | 939 | $level = strlen($matches[1]); |
| 940 | 940 | $block = "<h$level>".$this->runSpanGamut($matches[2])."</h$level>"; |
| 941 | - return "\n" . $this->hashBlock($block) . "\n\n"; |
|
| 941 | + return "\n".$this->hashBlock($block)."\n\n"; |
|
| 942 | 942 | } |
| 943 | 943 | |
| 944 | 944 | |
@@ -1017,13 +1017,13 @@ discard block |
||
| 1017 | 1017 | $list = $matches[1]; |
| 1018 | 1018 | $list_type = preg_match("/$marker_ul_re/", $matches[4]) ? "ul" : "ol"; |
| 1019 | 1019 | |
| 1020 | - $marker_any_re = ( $list_type == "ul" ? $marker_ul_re : $marker_ol_re ); |
|
| 1020 | + $marker_any_re = ($list_type == "ul" ? $marker_ul_re : $marker_ol_re); |
|
| 1021 | 1021 | |
| 1022 | 1022 | $list .= "\n"; |
| 1023 | 1023 | $result = $this->processListItems($list, $marker_any_re); |
| 1024 | 1024 | |
| 1025 | - $result = $this->hashBlock("<$list_type>\n" . $result . "</$list_type>"); |
|
| 1026 | - return "\n". $result ."\n\n"; |
|
| 1025 | + $result = $this->hashBlock("<$list_type>\n".$result."</$list_type>"); |
|
| 1026 | + return "\n".$result."\n\n"; |
|
| 1027 | 1027 | } |
| 1028 | 1028 | |
| 1029 | 1029 | var $list_level = 0; |
@@ -1076,16 +1076,16 @@ discard block |
||
| 1076 | 1076 | } |
| 1077 | 1077 | function _processListItems_callback($matches) { |
| 1078 | 1078 | $item = $matches[4]; |
| 1079 | - $leading_line =& $matches[1]; |
|
| 1080 | - $leading_space =& $matches[2]; |
|
| 1079 | + $leading_line = & $matches[1]; |
|
| 1080 | + $leading_space = & $matches[2]; |
|
| 1081 | 1081 | $marker_space = $matches[3]; |
| 1082 | - $tailing_blank_line =& $matches[5]; |
|
| 1082 | + $tailing_blank_line = & $matches[5]; |
|
| 1083 | 1083 | |
| 1084 | 1084 | if ($leading_line || $tailing_blank_line || |
| 1085 | 1085 | preg_match('/\n{2,}/', $item)) |
| 1086 | 1086 | { |
| 1087 | 1087 | # Replace marker with the appropriate whitespace indentation |
| 1088 | - $item = $leading_space . str_repeat(' ', strlen($marker_space)) . $item; |
|
| 1088 | + $item = $leading_space.str_repeat(' ', strlen($marker_space)).$item; |
|
| 1089 | 1089 | $item = $this->runBlockGamut($this->outdent($item)."\n"); |
| 1090 | 1090 | } |
| 1091 | 1091 | else { |
@@ -1095,7 +1095,7 @@ discard block |
||
| 1095 | 1095 | $item = $this->runSpanGamut($item); |
| 1096 | 1096 | } |
| 1097 | 1097 | |
| 1098 | - return "<li>" . $item . "</li>\n"; |
|
| 1098 | + return "<li>".$item."</li>\n"; |
|
| 1099 | 1099 | } |
| 1100 | 1100 | |
| 1101 | 1101 | |
@@ -1173,7 +1173,7 @@ discard block |
||
| 1173 | 1173 | $token_relist[] = $strong_re; |
| 1174 | 1174 | |
| 1175 | 1175 | # Construct master expression from list. |
| 1176 | - $token_re = '{('. implode('|', $token_relist) .')}'; |
|
| 1176 | + $token_re = '{('.implode('|', $token_relist).')}'; |
|
| 1177 | 1177 | $this->em_strong_prepared_relist["$em$strong"] = $token_re; |
| 1178 | 1178 | } |
| 1179 | 1179 | } |
@@ -1199,8 +1199,8 @@ discard block |
||
| 1199 | 1199 | # |
| 1200 | 1200 | $parts = preg_split($token_re, $text, 2, PREG_SPLIT_DELIM_CAPTURE); |
| 1201 | 1201 | $text_stack[0] .= $parts[0]; |
| 1202 | - $token =& $parts[1]; |
|
| 1203 | - $text =& $parts[2]; |
|
| 1202 | + $token = & $parts[1]; |
|
| 1203 | + $text = & $parts[2]; |
|
| 1204 | 1204 | |
| 1205 | 1205 | if (empty($token)) { |
| 1206 | 1206 | # Reached end of text span: empty stack without emitting. |
@@ -1227,7 +1227,7 @@ discard block |
||
| 1227 | 1227 | } else { |
| 1228 | 1228 | # Other closing marker: close one em or strong and |
| 1229 | 1229 | # change current token state to match the other |
| 1230 | - $token_stack[0] = str_repeat($token{0}, 3-$token_len); |
|
| 1230 | + $token_stack[0] = str_repeat($token{0}, 3 - $token_len); |
|
| 1231 | 1231 | $tag = $token_len == 2 ? "strong" : "em"; |
| 1232 | 1232 | $span = $text_stack[0]; |
| 1233 | 1233 | $span = $this->runSpanGamut($span); |
@@ -1321,7 +1321,7 @@ discard block |
||
| 1321 | 1321 | $bq = $matches[1]; |
| 1322 | 1322 | # trim one level of quoting - trim whitespace-only lines |
| 1323 | 1323 | $bq = preg_replace('/^[ ]*>[ ]?|^[ ]+$/m', '', $bq); |
| 1324 | - $bq = $this->runBlockGamut($bq); # recurse |
|
| 1324 | + $bq = $this->runBlockGamut($bq); # recurse |
|
| 1325 | 1325 | |
| 1326 | 1326 | $bq = preg_replace('/^/m', " ", $bq); |
| 1327 | 1327 | # These leading spaces cause problem with <pre> content, |
@@ -1329,7 +1329,7 @@ discard block |
||
| 1329 | 1329 | $bq = preg_replace_callback('{(\s*<pre>.+?</pre>)}sx', |
| 1330 | 1330 | array(&$this, '_doBlockQuotes_callback2'), $bq); |
| 1331 | 1331 | |
| 1332 | - return "\n". $this->hashBlock("<blockquote>\n$bq\n</blockquote>")."\n\n"; |
|
| 1332 | + return "\n".$this->hashBlock("<blockquote>\n$bq\n</blockquote>")."\n\n"; |
|
| 1333 | 1333 | } |
| 1334 | 1334 | function _doBlockQuotes_callback2($matches) { |
| 1335 | 1335 | $pre = $matches[1]; |
@@ -1431,7 +1431,7 @@ discard block |
||
| 1431 | 1431 | # Ampersand-encoding based entirely on Nat Irons's Amputator |
| 1432 | 1432 | # MT plugin: <http://bumppo.net/projects/amputator/> |
| 1433 | 1433 | $text = preg_replace('/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/', |
| 1434 | - '&', $text);; |
|
| 1434 | + '&', $text); ; |
|
| 1435 | 1435 | } |
| 1436 | 1436 | # Encode remaining <'s |
| 1437 | 1437 | $text = str_replace('<', '<', $text); |
@@ -1495,9 +1495,9 @@ discard block |
||
| 1495 | 1495 | # Based by a filter by Matthew Wickline, posted to BBEdit-Talk. |
| 1496 | 1496 | # With some optimizations by Milian Wolff. |
| 1497 | 1497 | # |
| 1498 | - $addr = "mailto:" . $addr; |
|
| 1498 | + $addr = "mailto:".$addr; |
|
| 1499 | 1499 | $chars = preg_split('/(?<!^)(?!$)/', $addr); |
| 1500 | - $seed = (int)abs(crc32($addr) / strlen($addr)); # Deterministic seed. |
|
| 1500 | + $seed = (int) abs(crc32($addr) / strlen($addr)); # Deterministic seed. |
|
| 1501 | 1501 | |
| 1502 | 1502 | foreach ($chars as $key => $char) { |
| 1503 | 1503 | $ord = ord($char); |
@@ -1533,7 +1533,7 @@ discard block |
||
| 1533 | 1533 | | |
| 1534 | 1534 | (?<![`\\\\]) |
| 1535 | 1535 | `+ # code span marker |
| 1536 | - '.( $this->no_markup ? '' : ' |
|
| 1536 | + '.($this->no_markup ? '' : ' |
|
| 1537 | 1537 | | |
| 1538 | 1538 | <!-- .*? --> # comment |
| 1539 | 1539 | | |
@@ -1583,7 +1583,7 @@ discard block |
||
| 1583 | 1583 | # |
| 1584 | 1584 | switch ($token{0}) { |
| 1585 | 1585 | case "\\": |
| 1586 | - return $this->hashPart("&#". ord($token{1}). ";"); |
|
| 1586 | + return $this->hashPart("&#".ord($token{1}).";"); |
|
| 1587 | 1587 | case "`": |
| 1588 | 1588 | # Search for end marker in remaining text. |
| 1589 | 1589 | if (preg_match('/^(.*?[^`])'.preg_quote($token).'(?!`)(.*)$/sm', |
@@ -1638,7 +1638,7 @@ discard block |
||
| 1638 | 1638 | # Calculate amount of space, insert spaces, insert block. |
| 1639 | 1639 | $amount = $this->tab_width - |
| 1640 | 1640 | $strlen($line, 'UTF-8') % $this->tab_width; |
| 1641 | - $line .= str_repeat(" ", $amount) . $block; |
|
| 1641 | + $line .= str_repeat(" ", $amount).$block; |
|
| 1642 | 1642 | } |
| 1643 | 1643 | return $line; |
| 1644 | 1644 | } |
@@ -1802,7 +1802,7 @@ discard block |
||
| 1802 | 1802 | # |
| 1803 | 1803 | # Call the HTML-in-Markdown hasher. |
| 1804 | 1804 | # |
| 1805 | - list($text, ) = $this->_hashHTMLBlocks_inMarkdown($text); |
|
| 1805 | + list($text,) = $this->_hashHTMLBlocks_inMarkdown($text); |
|
| 1806 | 1806 | |
| 1807 | 1807 | return $text; |
| 1808 | 1808 | } |
@@ -1874,25 +1874,25 @@ discard block |
||
| 1874 | 1874 | | |
| 1875 | 1875 | # Code span marker |
| 1876 | 1876 | `+ |
| 1877 | - '. ( !$span ? ' # If not in span. |
|
| 1877 | + '. (!$span ? ' # If not in span. |
|
| 1878 | 1878 | | |
| 1879 | 1879 | # Indented code block |
| 1880 | 1880 | (?: ^[ ]*\n | ^ | \n[ ]*\n ) |
| 1881 | - [ ]{'.($indent+4).'}[^\n]* \n |
|
| 1881 | + [ ]{'.($indent + 4).'}[^\n]* \n |
|
| 1882 | 1882 | (?> |
| 1883 | - (?: [ ]{'.($indent+4).'}[^\n]* | [ ]* ) \n |
|
| 1883 | + (?: [ ]{'.($indent + 4).'}[^\n]* | [ ]* ) \n |
|
| 1884 | 1884 | )* |
| 1885 | 1885 | | |
| 1886 | 1886 | # Fenced code block marker |
| 1887 | 1887 | (?> ^ | \n ) |
| 1888 | 1888 | [ ]{'.($indent).'}~~~+[ ]*\n |
| 1889 | - ' : '' ). ' # End (if not is span). |
|
| 1889 | + ' : '').' # End (if not is span). |
|
| 1890 | 1890 | ) |
| 1891 | 1891 | }xs'; |
| 1892 | 1892 | |
| 1893 | 1893 | |
| 1894 | - $depth = 0; # Current depth inside the tag tree. |
|
| 1895 | - $parsed = ""; # Parsed text that will be returned. |
|
| 1894 | + $depth = 0; # Current depth inside the tag tree. |
|
| 1895 | + $parsed = ""; # Parsed text that will be returned. |
|
| 1896 | 1896 | |
| 1897 | 1897 | # |
| 1898 | 1898 | # Loop through every tag until we find the closing tag of the parent |
@@ -1913,7 +1913,7 @@ discard block |
||
| 1913 | 1913 | if ($span) { |
| 1914 | 1914 | $void = $this->hashPart("", ':'); |
| 1915 | 1915 | $newline = "$void\n"; |
| 1916 | - $parts[0] = $void . str_replace("\n", $newline, $parts[0]) . $void; |
|
| 1916 | + $parts[0] = $void.str_replace("\n", $newline, $parts[0]).$void; |
|
| 1917 | 1917 | } |
| 1918 | 1918 | |
| 1919 | 1919 | $parsed .= $parts[0]; # Text before current tag. |
@@ -1938,7 +1938,7 @@ discard block |
||
| 1938 | 1938 | $text, $matches)) |
| 1939 | 1939 | { |
| 1940 | 1940 | # End marker found: pass text unchanged until marker. |
| 1941 | - $parsed .= $tag . $matches[0]; |
|
| 1941 | + $parsed .= $tag.$matches[0]; |
|
| 1942 | 1942 | $text = substr($text, strlen($matches[0])); |
| 1943 | 1943 | } |
| 1944 | 1944 | else { |
@@ -1964,7 +1964,7 @@ discard block |
||
| 1964 | 1964 | $matches)) |
| 1965 | 1965 | { |
| 1966 | 1966 | # End marker found: pass text unchanged until marker. |
| 1967 | - $parsed .= $tag . $matches[0]; |
|
| 1967 | + $parsed .= $tag.$matches[0]; |
|
| 1968 | 1968 | $text = substr($text, strlen($matches[0])); |
| 1969 | 1969 | } |
| 1970 | 1970 | else { |
@@ -1978,14 +1978,14 @@ discard block |
||
| 1978 | 1978 | # used as a block tag (tag is alone on it's line). |
| 1979 | 1979 | # |
| 1980 | 1980 | else if (preg_match('{^<(?:'.$this->block_tags_re.')\b}', $tag) || |
| 1981 | - ( preg_match('{^<(?:'.$this->context_block_tags_re.')\b}', $tag) && |
|
| 1981 | + (preg_match('{^<(?:'.$this->context_block_tags_re.')\b}', $tag) && |
|
| 1982 | 1982 | preg_match($newline_before_re, $parsed) && |
| 1983 | - preg_match($newline_after_re, $text) ) |
|
| 1983 | + preg_match($newline_after_re, $text)) |
|
| 1984 | 1984 | ) |
| 1985 | 1985 | { |
| 1986 | 1986 | # Need to parse tag and following text using the HTML parser. |
| 1987 | 1987 | list($block_text, $text) = |
| 1988 | - $this->_hashHTMLBlocks_inHTML($tag . $text, "hashBlock", true); |
|
| 1988 | + $this->_hashHTMLBlocks_inHTML($tag.$text, "hashBlock", true); |
|
| 1989 | 1989 | |
| 1990 | 1990 | # Make sure it stays outside of any paragraph by adding newlines. |
| 1991 | 1991 | $parsed .= "\n\n$block_text\n\n"; |
@@ -2000,7 +2000,7 @@ discard block |
||
| 2000 | 2000 | # Need to parse tag and following text using the HTML parser. |
| 2001 | 2001 | # (don't check for markdown attribute) |
| 2002 | 2002 | list($block_text, $text) = |
| 2003 | - $this->_hashHTMLBlocks_inHTML($tag . $text, "hashClean", false); |
|
| 2003 | + $this->_hashHTMLBlocks_inHTML($tag.$text, "hashClean", false); |
|
| 2004 | 2004 | |
| 2005 | 2005 | $parsed .= $block_text; |
| 2006 | 2006 | } |
@@ -2015,14 +2015,14 @@ discard block |
||
| 2015 | 2015 | # Increase/decrease nested tag count. |
| 2016 | 2016 | # |
| 2017 | 2017 | if ($tag{1} == '/') $depth--; |
| 2018 | - else if ($tag{strlen($tag)-2} != '/') $depth++; |
|
| 2018 | + else if ($tag{strlen($tag) - 2} != '/') $depth++; |
|
| 2019 | 2019 | |
| 2020 | 2020 | if ($depth < 0) { |
| 2021 | 2021 | # |
| 2022 | 2022 | # Going out of parent element. Clean up and break so we |
| 2023 | 2023 | # return to the calling function. |
| 2024 | 2024 | # |
| 2025 | - $text = $tag . $text; |
|
| 2025 | + $text = $tag.$text; |
|
| 2026 | 2026 | break; |
| 2027 | 2027 | } |
| 2028 | 2028 | |
@@ -2087,11 +2087,11 @@ discard block |
||
| 2087 | 2087 | ) |
| 2088 | 2088 | }xs'; |
| 2089 | 2089 | |
| 2090 | - $original_text = $text; # Save original text in case of faliure. |
|
| 2090 | + $original_text = $text; # Save original text in case of faliure. |
|
| 2091 | 2091 | |
| 2092 | - $depth = 0; # Current depth inside the tag tree. |
|
| 2093 | - $block_text = ""; # Temporary text holder for current text. |
|
| 2094 | - $parsed = ""; # Parsed text that will be returned. |
|
| 2092 | + $depth = 0; # Current depth inside the tag tree. |
|
| 2093 | + $block_text = ""; # Temporary text holder for current text. |
|
| 2094 | + $parsed = ""; # Parsed text that will be returned. |
|
| 2095 | 2095 | |
| 2096 | 2096 | # |
| 2097 | 2097 | # Get the name of the starting tag. |
@@ -2143,7 +2143,7 @@ discard block |
||
| 2143 | 2143 | # |
| 2144 | 2144 | if (preg_match('{^</?'.$base_tag_name_re.'\b}', $tag)) { |
| 2145 | 2145 | if ($tag{1} == '/') $depth--; |
| 2146 | - else if ($tag{strlen($tag)-2} != '/') $depth++; |
|
| 2146 | + else if ($tag{strlen($tag) - 2} != '/') $depth++; |
|
| 2147 | 2147 | } |
| 2148 | 2148 | |
| 2149 | 2149 | # |
@@ -2151,13 +2151,13 @@ discard block |
||
| 2151 | 2151 | # |
| 2152 | 2152 | if ($md_attr && |
| 2153 | 2153 | preg_match($markdown_attr_re, $tag, $attr_m) && |
| 2154 | - preg_match('/^1|block|span$/', $attr_m[2] . $attr_m[3])) |
|
| 2154 | + preg_match('/^1|block|span$/', $attr_m[2].$attr_m[3])) |
|
| 2155 | 2155 | { |
| 2156 | 2156 | # Remove `markdown` attribute from opening tag. |
| 2157 | 2157 | $tag = preg_replace($markdown_attr_re, '', $tag); |
| 2158 | 2158 | |
| 2159 | 2159 | # Check if text inside this tag must be parsed in span mode. |
| 2160 | - $this->mode = $attr_m[2] . $attr_m[3]; |
|
| 2160 | + $this->mode = $attr_m[2].$attr_m[3]; |
|
| 2161 | 2161 | $span_mode = $this->mode == 'span' || $this->mode != 'block' && |
| 2162 | 2162 | preg_match('{^<(?:'.$this->contain_span_tags_re.')\b}', $tag); |
| 2163 | 2163 | |
@@ -2268,15 +2268,15 @@ discard block |
||
| 2268 | 2268 | if ($matches[3] == '-' && preg_match('{^- }', $matches[1])) |
| 2269 | 2269 | return $matches[0]; |
| 2270 | 2270 | $level = $matches[3]{0} == '=' ? 1 : 2; |
| 2271 | - $attr = $this->_doHeaders_attr($id =& $matches[2]); |
|
| 2271 | + $attr = $this->_doHeaders_attr($id = & $matches[2]); |
|
| 2272 | 2272 | $block = "<h$level$attr>".$this->runSpanGamut($matches[1])."</h$level>"; |
| 2273 | - return "\n" . $this->hashBlock($block) . "\n\n"; |
|
| 2273 | + return "\n".$this->hashBlock($block)."\n\n"; |
|
| 2274 | 2274 | } |
| 2275 | 2275 | function _doHeaders_callback_atx($matches) { |
| 2276 | 2276 | $level = strlen($matches[1]); |
| 2277 | - $attr = $this->_doHeaders_attr($id =& $matches[3]); |
|
| 2277 | + $attr = $this->_doHeaders_attr($id = & $matches[3]); |
|
| 2278 | 2278 | $block = "<h$level$attr>".$this->runSpanGamut($matches[2])."</h$level>"; |
| 2279 | - return "\n" . $this->hashBlock($block) . "\n\n"; |
|
| 2279 | + return "\n".$this->hashBlock($block)."\n\n"; |
|
| 2280 | 2280 | } |
| 2281 | 2281 | |
| 2282 | 2282 | |
@@ -2342,8 +2342,8 @@ discard block |
||
| 2342 | 2342 | return $text; |
| 2343 | 2343 | } |
| 2344 | 2344 | function _doTable_leadingPipe_callback($matches) { |
| 2345 | - $head = $matches[1]; |
|
| 2346 | - $underline = $matches[2]; |
|
| 2345 | + $head = $matches[1]; |
|
| 2346 | + $underline = $matches[2]; |
|
| 2347 | 2347 | $content = $matches[3]; |
| 2348 | 2348 | |
| 2349 | 2349 | # Remove leading pipe for each row. |
@@ -2352,17 +2352,17 @@ discard block |
||
| 2352 | 2352 | return $this->_doTable_callback(array($matches[0], $head, $underline, $content)); |
| 2353 | 2353 | } |
| 2354 | 2354 | function _doTable_callback($matches) { |
| 2355 | - $head = $matches[1]; |
|
| 2356 | - $underline = $matches[2]; |
|
| 2357 | - $content = $matches[3]; |
|
| 2355 | + $head = $matches[1]; |
|
| 2356 | + $underline = $matches[2]; |
|
| 2357 | + $content = $matches[3]; |
|
| 2358 | 2358 | |
| 2359 | 2359 | # Remove any tailing pipes for each line. |
| 2360 | - $head = preg_replace('/[|] *$/m', '', $head); |
|
| 2361 | - $underline = preg_replace('/[|] *$/m', '', $underline); |
|
| 2362 | - $content = preg_replace('/[|] *$/m', '', $content); |
|
| 2360 | + $head = preg_replace('/[|] *$/m', '', $head); |
|
| 2361 | + $underline = preg_replace('/[|] *$/m', '', $underline); |
|
| 2362 | + $content = preg_replace('/[|] *$/m', '', $content); |
|
| 2363 | 2363 | |
| 2364 | 2364 | # Reading alignement from header underline. |
| 2365 | - $separators = preg_split('/ *[|] */', $underline); |
|
| 2365 | + $separators = preg_split('/ *[|] */', $underline); |
|
| 2366 | 2366 | foreach ($separators as $n => $s) { |
| 2367 | 2367 | if (preg_match('/^ *-+: *$/', $s)) $attr[$n] = ' align="right"'; |
| 2368 | 2368 | else if (preg_match('/^ *:-+: *$/', $s))$attr[$n] = ' align="center"'; |
@@ -2372,9 +2372,9 @@ discard block |
||
| 2372 | 2372 | |
| 2373 | 2373 | # Parsing span elements, including code spans, character escapes, |
| 2374 | 2374 | # and inline HTML tags, so that pipes inside those gets ignored. |
| 2375 | - $head = $this->parseSpan($head); |
|
| 2376 | - $headers = preg_split('/ *[|] */', $head); |
|
| 2377 | - $col_count = count($headers); |
|
| 2375 | + $head = $this->parseSpan($head); |
|
| 2376 | + $headers = preg_split('/ *[|] */', $head); |
|
| 2377 | + $col_count = count($headers); |
|
| 2378 | 2378 | |
| 2379 | 2379 | # Write column headers. |
| 2380 | 2380 | $text = "<table>\n"; |
@@ -2406,7 +2406,7 @@ discard block |
||
| 2406 | 2406 | $text .= "</tbody>\n"; |
| 2407 | 2407 | $text .= "</table>"; |
| 2408 | 2408 | |
| 2409 | - return $this->hashBlock($text) . "\n"; |
|
| 2409 | + return $this->hashBlock($text)."\n"; |
|
| 2410 | 2410 | } |
| 2411 | 2411 | |
| 2412 | 2412 | |
@@ -2459,8 +2459,8 @@ discard block |
||
| 2459 | 2459 | # Turn double returns into triple returns, so that we can make a |
| 2460 | 2460 | # paragraph for the last item in a list, if necessary: |
| 2461 | 2461 | $result = trim($this->processDefListItems($list)); |
| 2462 | - $result = "<dl>\n" . $result . "\n</dl>"; |
|
| 2463 | - return $this->hashBlock($result) . "\n\n"; |
|
| 2462 | + $result = "<dl>\n".$result."\n</dl>"; |
|
| 2463 | + return $this->hashBlock($result)."\n\n"; |
|
| 2464 | 2464 | } |
| 2465 | 2465 | |
| 2466 | 2466 | |
@@ -2512,27 +2512,27 @@ discard block |
||
| 2512 | 2512 | $text = ''; |
| 2513 | 2513 | foreach ($terms as $term) { |
| 2514 | 2514 | $term = $this->runSpanGamut(trim($term)); |
| 2515 | - $text .= "\n<dt>" . $term . "</dt>"; |
|
| 2515 | + $text .= "\n<dt>".$term."</dt>"; |
|
| 2516 | 2516 | } |
| 2517 | - return $text . "\n"; |
|
| 2517 | + return $text."\n"; |
|
| 2518 | 2518 | } |
| 2519 | 2519 | function _processDefListItems_callback_dd($matches) { |
| 2520 | 2520 | $leading_line = $matches[1]; |
| 2521 | 2521 | $marker_space = $matches[2]; |
| 2522 | - $def = $matches[3]; |
|
| 2522 | + $def = $matches[3]; |
|
| 2523 | 2523 | |
| 2524 | 2524 | if ($leading_line || preg_match('/\n{2,}/', $def)) { |
| 2525 | 2525 | # Replace marker with the appropriate whitespace indentation |
| 2526 | - $def = str_repeat(' ', strlen($marker_space)) . $def; |
|
| 2527 | - $def = $this->runBlockGamut($this->outdent($def . "\n\n")); |
|
| 2528 | - $def = "\n". $def ."\n"; |
|
| 2526 | + $def = str_repeat(' ', strlen($marker_space)).$def; |
|
| 2527 | + $def = $this->runBlockGamut($this->outdent($def."\n\n")); |
|
| 2528 | + $def = "\n".$def."\n"; |
|
| 2529 | 2529 | } |
| 2530 | 2530 | else { |
| 2531 | 2531 | $def = rtrim($def); |
| 2532 | 2532 | $def = $this->runSpanGamut($this->outdent($def)); |
| 2533 | 2533 | } |
| 2534 | 2534 | |
| 2535 | - return "\n<dd>" . $def . "</dd>\n"; |
|
| 2535 | + return "\n<dd>".$def."</dd>\n"; |
|
| 2536 | 2536 | } |
| 2537 | 2537 | |
| 2538 | 2538 | |
@@ -2670,7 +2670,7 @@ discard block |
||
| 2670 | 2670 | return $text; |
| 2671 | 2671 | } |
| 2672 | 2672 | function _stripFootnotes_callback($matches) { |
| 2673 | - $note_id = $this->fn_id_prefix . $matches[1]; |
|
| 2673 | + $note_id = $this->fn_id_prefix.$matches[1]; |
|
| 2674 | 2674 | $this->footnotes[$note_id] = $this->outdent($matches[2]); |
| 2675 | 2675 | return ''; # String that will replace the block |
| 2676 | 2676 | } |
@@ -2698,7 +2698,7 @@ discard block |
||
| 2698 | 2698 | if (!empty($this->footnotes_ordered)) { |
| 2699 | 2699 | $text .= "\n\n"; |
| 2700 | 2700 | $text .= "<div class=\"footnotes\">\n"; |
| 2701 | - $text .= "<hr". $this->empty_element_suffix ."\n"; |
|
| 2701 | + $text .= "<hr".$this->empty_element_suffix."\n"; |
|
| 2702 | 2702 | $text .= "<ol>\n\n"; |
| 2703 | 2703 | |
| 2704 | 2704 | $attr = " rev=\"footnote\""; |
@@ -2730,13 +2730,13 @@ discard block |
||
| 2730 | 2730 | # Add backlink to last paragraph; create new paragraph if needed. |
| 2731 | 2731 | $backlink = "<a href=\"#fnref:$note_id\"$attr>↩</a>"; |
| 2732 | 2732 | if (preg_match('{</p>$}', $footnote)) { |
| 2733 | - $footnote = substr($footnote, 0, -4) . " $backlink</p>"; |
|
| 2733 | + $footnote = substr($footnote, 0, -4)." $backlink</p>"; |
|
| 2734 | 2734 | } else { |
| 2735 | 2735 | $footnote .= "\n\n<p>$backlink</p>"; |
| 2736 | 2736 | } |
| 2737 | 2737 | |
| 2738 | 2738 | $text .= "<li id=\"fn:$note_id\">\n"; |
| 2739 | - $text .= $footnote . "\n"; |
|
| 2739 | + $text .= $footnote."\n"; |
|
| 2740 | 2740 | $text .= "</li>\n\n"; |
| 2741 | 2741 | } |
| 2742 | 2742 | |
@@ -2746,7 +2746,7 @@ discard block |
||
| 2746 | 2746 | return $text; |
| 2747 | 2747 | } |
| 2748 | 2748 | function _appendFootnotes_callback($matches) { |
| 2749 | - $node_id = $this->fn_id_prefix . $matches[1]; |
|
| 2749 | + $node_id = $this->fn_id_prefix.$matches[1]; |
|
| 2750 | 2750 | |
| 2751 | 2751 | # Create footnote marker only if it has a corresponding footnote *and* |
| 2752 | 2752 | # the footnote hasn't been used by another marker. |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * @return string An <textarea /> element. |
| 36 | 36 | */ |
| 37 | 37 | public function editor($name, $settings = array()) { |
| 38 | - echo $this->Html->script($this->paths['js'] . 'jquery.markitup', |
|
| 38 | + echo $this->Html->script($this->paths['js'].'jquery.markitup', |
|
| 39 | 39 | ['inline' => true]); |
| 40 | 40 | $config = $this->_build($settings); |
| 41 | 41 | $settings = $config['settings']; |
@@ -48,20 +48,20 @@ discard block |
||
| 48 | 48 | $class = $textarea['class']; |
| 49 | 49 | } |
| 50 | 50 | $markItUpInstance = uniqid('markItUp'); |
| 51 | - $textarea['class'] = $class . ' ' . $markItUpInstance; |
|
| 51 | + $textarea['class'] = $class.' '.$markItUpInstance; |
|
| 52 | 52 | |
| 53 | - $id = '.' . $markItUpInstance; |
|
| 53 | + $id = '.'.$markItUpInstance; |
|
| 54 | 54 | |
| 55 | 55 | // $out[] = 'jQuery.noConflict();'; |
| 56 | 56 | $out[] = 'jQuery(function() {'; |
| 57 | - $out[] = ' jQuery("' . $id . '").markItUp('; |
|
| 58 | - $out[] = ' ' . $settings['settings'] . ','; |
|
| 57 | + $out[] = ' jQuery("'.$id.'").markItUp('; |
|
| 58 | + $out[] = ' '.$settings['settings'].','; |
|
| 59 | 59 | $out[] = ' {'; |
| 60 | - $out[] = ' previewParserPath:"' . $settings['parser'] . '"'; |
|
| 60 | + $out[] = ' previewParserPath:"'.$settings['parser'].'"'; |
|
| 61 | 61 | $out[] = ' }'; |
| 62 | 62 | $out[] = ' );'; |
| 63 | 63 | $out[] = '});'; |
| 64 | - return $this->Form->input($name, $textarea) . $this->Html->scriptBlock(join("\n", $out)); |
|
| 64 | + return $this->Form->input($name, $textarea).$this->Html->scriptBlock(join("\n", $out)); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | /** |
@@ -75,12 +75,12 @@ discard block |
||
| 75 | 75 | * @return string An <a /> element. |
| 76 | 76 | */ |
| 77 | 77 | public function create($title, $fieldName = "", $settings = array(), $htmlAttributes = array(), $confirmMessage = false) { |
| 78 | - $id = ($fieldName{0} === '#') ? $fieldName : '#' . parent::domId($fieldName); |
|
| 78 | + $id = ($fieldName{0} === '#') ? $fieldName : '#'.parent::domId($fieldName); |
|
| 79 | 79 | |
| 80 | 80 | $config = $this->_build($settings); |
| 81 | 81 | $settings = $config['settings']; |
| 82 | 82 | $htmlAttributes = array_merge($htmlAttributes, |
| 83 | - array('onclick' => 'jQuery("' . $id . '").markItUpRemove(); jQuery("' . $id . '").markItUp(' . $settings['settings'] . ', { previewParserPath:"' . $settings['parser'] . '" }); return false;')); |
|
| 83 | + array('onclick' => 'jQuery("'.$id.'").markItUpRemove(); jQuery("'.$id.'").markItUp('.$settings['settings'].', { previewParserPath:"'.$settings['parser'].'" }); return false;')); |
|
| 84 | 84 | return $this->Html->link($title, "#", $htmlAttributes, $confirmMessage, false); |
| 85 | 85 | } |
| 86 | 86 | |
@@ -94,9 +94,9 @@ discard block |
||
| 94 | 94 | * @return string An <a /> element. |
| 95 | 95 | */ |
| 96 | 96 | public function destroy($title, $fieldName = "", $htmlAttributes = array(), $confirmMessage = false) { |
| 97 | - $id = ($fieldName{0} === '#') ? $fieldName : '#' . parent::domId($fieldName); |
|
| 97 | + $id = ($fieldName{0} === '#') ? $fieldName : '#'.parent::domId($fieldName); |
|
| 98 | 98 | $htmlAttributes = array_merge($htmlAttributes, |
| 99 | - array('onclick' => 'jQuery("' . $id . '").markItUpRemove(); return false;')); |
|
| 99 | + array('onclick' => 'jQuery("'.$id.'").markItUpRemove(); return false;')); |
|
| 100 | 100 | return $this->Html->link($title, "#", $htmlAttributes, $confirmMessage, false); |
| 101 | 101 | } |
| 102 | 102 | |
@@ -111,19 +111,19 @@ discard block |
||
| 111 | 111 | */ |
| 112 | 112 | public function insert($title, $fieldName = null, $content = array(), $htmlAttributes = array(), $confirmMessage = false) { |
| 113 | 113 | if (isset($fieldName)) { |
| 114 | - $content['target'] = ($fieldName{0} === '#') ? $fieldName : '#' . parent::domId($fieldName); |
|
| 114 | + $content['target'] = ($fieldName{0} === '#') ? $fieldName : '#'.parent::domId($fieldName); |
|
| 115 | 115 | } |
| 116 | 116 | if (!is_array($content)) { |
| 117 | 117 | $content['replaceWith'] = $content; |
| 118 | 118 | } |
| 119 | 119 | $properties = ''; |
| 120 | 120 | foreach ($content as $k => $v) { |
| 121 | - $properties .= $k . ':"' . addslashes($v) . '",'; |
|
| 121 | + $properties .= $k.':"'.addslashes($v).'",'; |
|
| 122 | 122 | } |
| 123 | 123 | $properties = substr($properties, 0, -1); |
| 124 | 124 | |
| 125 | 125 | $htmlAttributes = array_merge($htmlAttributes, |
| 126 | - array('onclick' => '$.markItUp( { ' . $properties . ' } ); return false;')); |
|
| 126 | + array('onclick' => '$.markItUp( { '.$properties.' } ); return false;')); |
|
| 127 | 127 | return $this->Html->link($title, "#", $htmlAttributes, $confirmMessage, false); |
| 128 | 128 | } |
| 129 | 129 | |
@@ -146,11 +146,11 @@ discard block |
||
| 146 | 146 | if (!isset($file)) { |
| 147 | 147 | $file = null; |
| 148 | 148 | } |
| 149 | - App::import('Vendor', $plugin . '.' . $class, null, null, $file); |
|
| 149 | + App::import('Vendor', $plugin.'.'.$class, null, null, $file); |
|
| 150 | 150 | $content = $class($content); |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | - echo $this->Html->css($this->paths['css'] . 'templates' . DS . 'preview', null, array('inline' => false)); |
|
| 153 | + echo $this->Html->css($this->paths['css'].'templates'.DS.'preview', null, array('inline' => false)); |
|
| 154 | 154 | |
| 155 | 155 | return $content; |
| 156 | 156 | } |
@@ -173,11 +173,11 @@ discard block |
||
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | echo $this->Html->css(array( |
| 176 | - $this->paths['css'] . 'skins' . DS . $settings['skin'] . DS . 'style', |
|
| 177 | - $this->paths['css'] . 'sets' . DS . $settings['set'] . DS . 'style', |
|
| 176 | + $this->paths['css'].'skins'.DS.$settings['skin'].DS.'style', |
|
| 177 | + $this->paths['css'].'sets'.DS.$settings['set'].DS.'style', |
|
| 178 | 178 | ), null, array('inline' => true)); |
| 179 | 179 | |
| 180 | - echo $this->Html->script($this->paths['js'] . 'sets' . DS . $settings['set'] . DS . 'set', true); |
|
| 180 | + echo $this->Html->script($this->paths['js'].'sets'.DS.$settings['set'].DS.'set', true); |
|
| 181 | 181 | |
| 182 | 182 | return array('settings' => $settings, 'default' => $default); |
| 183 | 183 | } |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | if (!$match) { |
| 203 | 203 | //print("rejecting $url"); |
| 204 | 204 | unset($params['urls'][$i]); |
| 205 | - $rejects[$i] = (object)array( |
|
| 205 | + $rejects[$i] = (object) array( |
|
| 206 | 206 | 'error_code' => '401', |
| 207 | 207 | 'error_message' => 'This service requires an Embedly key', |
| 208 | 208 | 'type' => 'error' |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | array_push($merged_result, $obj); |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | - if($justone) { |
|
| 246 | + if ($justone) { |
|
| 247 | 247 | return array_shift($merged_result); |
| 248 | 248 | } |
| 249 | 249 | |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | */ |
| 366 | 366 | public static function paramify($input) |
| 367 | 367 | { |
| 368 | - if(is_string($input)) { |
|
| 368 | + if (is_string($input)) { |
|
| 369 | 369 | return array('urls' => $input); |
| 370 | 370 | } |
| 371 | 371 | |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | $request = ['urls' => [$string]]; |
| 32 | 32 | $obj = current($api->oembed($request)); |
| 33 | 33 | } catch (Exception $e) { |
| 34 | - return 'Embedding failded: ' . $e->getMessage(); |
|
| 34 | + return 'Embedding failded: '.$e->getMessage(); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | if (isset($obj->html) && $obj->type !== 'link') { |
@@ -4,7 +4,7 @@ |
||
| 4 | 4 | |
| 5 | 5 | public static function suite() { |
| 6 | 6 | $suite = new CakeTestSuite('All controller and component tests.'); |
| 7 | - $suite->addTestDirectory(TESTS . 'Case' . DS . 'Controller'); |
|
| 7 | + $suite->addTestDirectory(TESTS.'Case'.DS.'Controller'); |
|
| 8 | 8 | return $suite; |
| 9 | 9 | } |
| 10 | 10 | |