| @@ -29,48 +29,48 @@ | ||
| 29 | 29 | } | 
| 30 | 30 | |
| 31 | 31 |  switch ($data['function']) { | 
| 32 | - default: | |
| 33 | - return; | |
| 34 | - case 'get_files_list': | |
| 35 | - echo _json_encode(get_files_list($data['dir'], $data['mask'], $data['mode'], $data['prefix_path'], $data['subfolders'], $data['sort'], $data['exclusion'], $data['system_files'], null, $data['limit'])); | |
| 36 | - return; | |
| 37 | - case 'file': | |
| 38 | - echo _json_encode(file($data['filename'], $data['flags'])); | |
| 39 | - return; | |
| 40 | - case 'file_get_contents': | |
| 41 | - echo file_get_contents($data['filename'], $data['flags'], null, $data['offset'], $data['maxlen']); | |
| 42 | - return; | |
| 43 | - case 'file_put_contents': | |
| 44 | - echo file_put_contents($data['filename'], $data['data'], $data['flags']); | |
| 45 | - return; | |
| 46 | - case 'copy': | |
| 47 | - echo copy($data['source'], $data['dest']); | |
| 48 | - return; | |
| 49 | - case 'unlink': | |
| 50 | - echo unlink($data['filename']); | |
| 51 | - return; | |
| 52 | - case 'file_exists': | |
| 53 | - echo file_exists($data['filename']); | |
| 54 | - return; | |
| 55 | - case 'move_uploaded_file': | |
| 56 | - echo copy($data['filename'], $data['destination']); | |
| 57 | - return; | |
| 58 | - case 'rename': | |
| 59 | - echo rename($data['oldname'], $data['newname']); | |
| 60 | - return; | |
| 61 | - case 'mkdir': | |
| 62 | - echo mkdir($data['pathname']); | |
| 63 | - return; | |
| 64 | - case 'rmdir': | |
| 65 | - echo rmdir($data['dirname']); | |
| 66 | - return; | |
| 67 | - case 'is_file': | |
| 68 | - echo is_file($data['filename']); | |
| 69 | - return; | |
| 70 | - case 'is_dir': | |
| 71 | - echo is_dir($data['filename']); | |
| 72 | - return; | |
| 73 | - case 'test': | |
| 74 | - echo 'OK'; | |
| 75 | - return; | |
| 32 | + default: | |
| 33 | + return; | |
| 34 | + case 'get_files_list': | |
| 35 | + echo _json_encode(get_files_list($data['dir'], $data['mask'], $data['mode'], $data['prefix_path'], $data['subfolders'], $data['sort'], $data['exclusion'], $data['system_files'], null, $data['limit'])); | |
| 36 | + return; | |
| 37 | + case 'file': | |
| 38 | + echo _json_encode(file($data['filename'], $data['flags'])); | |
| 39 | + return; | |
| 40 | + case 'file_get_contents': | |
| 41 | + echo file_get_contents($data['filename'], $data['flags'], null, $data['offset'], $data['maxlen']); | |
| 42 | + return; | |
| 43 | + case 'file_put_contents': | |
| 44 | + echo file_put_contents($data['filename'], $data['data'], $data['flags']); | |
| 45 | + return; | |
| 46 | + case 'copy': | |
| 47 | + echo copy($data['source'], $data['dest']); | |
| 48 | + return; | |
| 49 | + case 'unlink': | |
| 50 | + echo unlink($data['filename']); | |
| 51 | + return; | |
| 52 | + case 'file_exists': | |
| 53 | + echo file_exists($data['filename']); | |
| 54 | + return; | |
| 55 | + case 'move_uploaded_file': | |
| 56 | + echo copy($data['filename'], $data['destination']); | |
| 57 | + return; | |
| 58 | + case 'rename': | |
| 59 | + echo rename($data['oldname'], $data['newname']); | |
| 60 | + return; | |
| 61 | + case 'mkdir': | |
| 62 | + echo mkdir($data['pathname']); | |
| 63 | + return; | |
| 64 | + case 'rmdir': | |
| 65 | + echo rmdir($data['dirname']); | |
| 66 | + return; | |
| 67 | + case 'is_file': | |
| 68 | + echo is_file($data['filename']); | |
| 69 | + return; | |
| 70 | + case 'is_dir': | |
| 71 | + echo is_dir($data['filename']); | |
| 72 | + return; | |
| 73 | + case 'test': | |
| 74 | + echo 'OK'; | |
| 75 | + return; | |
| 76 | 76 | } | 
| @@ -1,13 +1,13 @@ | ||
| 1 | 1 | <?php | 
| 2 | 2 | /** | 
| 3 | - * @package CleverStyle CMS | |
| 4 | - * @subpackage HTTP Storage Engine backend | |
| 5 | - * @author Nazar Mokrynskyi <[email protected]> | |
| 6 | - * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi | |
| 7 | - * @license MIT License, see license.txt | |
| 8 | - * | |
| 9 | - * Requires config.php file in current directory with specified global variables $STORAGE_USER and $STORAGE_PASSWORD | |
| 10 | - */ | |
| 3 | + * @package CleverStyle CMS | |
| 4 | + * @subpackage HTTP Storage Engine backend | |
| 5 | + * @author Nazar Mokrynskyi <[email protected]> | |
| 6 | + * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi | |
| 7 | + * @license MIT License, see license.txt | |
| 8 | + * | |
| 9 | + * Requires config.php file in current directory with specified global variables $STORAGE_USER and $STORAGE_PASSWORD | |
| 10 | + */ | |
| 11 | 11 |  header('Content-Type: text/html; charset=utf-8'); | 
| 12 | 12 |  header('Connection: close'); | 
| 13 | 13 | require __DIR__.'/core/thirdparty/upf.php'; | 
| @@ -262,7 +262,7 @@ | ||
| 262 | 262 | "$this->root/license.txt", | 
| 263 | 263 | "$this->root/Storage.php" | 
| 264 | 264 | ]; | 
| 265 | - $files = []; | |
| 265 | + $files = []; | |
| 266 | 266 |  		foreach ($files_to_include as $s) { | 
| 267 | 267 |  			if (is_file($s)) { | 
| 268 | 268 | $files[] = $s; | 
| @@ -1,11 +1,11 @@ | ||
| 1 | 1 | <?php | 
| 2 | 2 | /** | 
| 3 | - * @package CleverStyle CMS | |
| 4 | - * @subpackage Builder | |
| 5 | - * @author Nazar Mokrynskyi <[email protected]> | |
| 6 | - * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi | |
| 7 | - * @license MIT License, see license.txt | |
| 8 | - */ | |
| 3 | + * @package CleverStyle CMS | |
| 4 | + * @subpackage Builder | |
| 5 | + * @author Nazar Mokrynskyi <[email protected]> | |
| 6 | + * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi | |
| 7 | + * @license MIT License, see license.txt | |
| 8 | + */ | |
| 9 | 9 | namespace cs; | 
| 10 | 10 | use | 
| 11 | 11 | h, | 
| @@ -159,7 +159,7 @@ discard block | ||
| 159 | 159 | Phar::webPhar(null, 'install.php'); | 
| 160 | 160 | } | 
| 161 | 161 | __HALT_COMPILER(); | 
| 162 | -STUB | |
| 162 | +stub | |
| 163 | 163 | ); | 
| 164 | 164 | $phar->stopBuffering(); | 
| 165 | 165 | return "Done! CleverStyle CMS $version"; | 
| @@ -299,7 +299,7 @@ discard block | ||
| 299 | 299 | #</Files> | 
| 300 | 300 | |
| 301 | 301 | RewriteRule .* index.php | 
| 302 | -HTACCESS; | |
| 302 | +htaccess; | |
| 303 | 303 | } | 
| 304 | 304 | /** | 
| 305 | 305 | * @param string $module | 
| @@ -22,7 +22,7 @@ | ||
| 22 | 22 | use | 
| 23 | 23 | Singleton; | 
| 24 | 24 | |
| 25 | - protected $data_model = [ | |
| 25 | + protected $data_model = [ | |
| 26 | 26 | 'id' => 'int', | 
| 27 | 27 | 'amount' => 'float:0', | 
| 28 | 28 | 'currency' => 'text', | 
| @@ -1,11 +1,11 @@ | ||
| 1 | 1 | <?php | 
| 2 | 2 | /** | 
| 3 | - * @package Blockchain payment | |
| 4 | - * @category modules | |
| 5 | - * @author Nazar Mokrynskyi <[email protected]> | |
| 6 | - * @copyright Copyright (c) 2015-2016, Nazar Mokrynskyi | |
| 7 | - * @license MIT License, see license.txt | |
| 8 | - */ | |
| 3 | + * @package Blockchain payment | |
| 4 | + * @category modules | |
| 5 | + * @author Nazar Mokrynskyi <[email protected]> | |
| 6 | + * @copyright Copyright (c) 2015-2016, Nazar Mokrynskyi | |
| 7 | + * @license MIT License, see license.txt | |
| 8 | + */ | |
| 9 | 9 | namespace cs\modules\Blockchain_payment; | 
| 10 | 10 | use | 
| 11 | 11 | cs\ExitException, | 
| @@ -106,7 +106,7 @@ | ||
| 106 | 106 | ] | 
| 107 | 107 | ); | 
| 108 | 108 | } | 
| 109 | - $sections = $this->db()->qfa( | |
| 109 | + $sections = $this->db()->qfa( | |
| 110 | 110 | [ | 
| 111 | 111 | "SELECT | 
| 112 | 112 | `id`, | 
| @@ -1,11 +1,11 @@ | ||
| 1 | 1 | <?php | 
| 2 | 2 | /** | 
| 3 | - * @package Blogs | |
| 4 | - * @category modules | |
| 5 | - * @author Nazar Mokrynskyi <[email protected]> | |
| 6 | - * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi | |
| 7 | - * @license MIT License, see license.txt | |
| 8 | - */ | |
| 3 | + * @package Blogs | |
| 4 | + * @category modules | |
| 5 | + * @author Nazar Mokrynskyi <[email protected]> | |
| 6 | + * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi | |
| 7 | + * @license MIT License, see license.txt | |
| 8 | + */ | |
| 9 | 9 | namespace cs\modules\Blogs; | 
| 10 | 10 | use | 
| 11 | 11 | cs\Language; | 
| @@ -264,7 +264,7 @@ | ||
| 264 | 264 |  	function count ($item) { | 
| 265 | 265 | $item = (int)$item; | 
| 266 | 266 | $L = Language::instance(); | 
| 267 | -		return $this->cache->get("$item/count/$L->clang", function () use ($item)  { | |
| 267 | +		return $this->cache->get("$item/count/$L->clang", function () use ($item) { | |
| 268 | 268 | return $this->count_internal($this->tree_data($item)) ?: 0; | 
| 269 | 269 | }); | 
| 270 | 270 | } | 
| @@ -1,11 +1,11 @@ | ||
| 1 | 1 | <?php | 
| 2 | 2 | /** | 
| 3 | - * @package Comments | |
| 4 | - * @category modules | |
| 5 | - * @author Nazar Mokrynskyi <[email protected]> | |
| 6 | - * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi | |
| 7 | - * @license MIT License, see license.txt | |
| 8 | - */ | |
| 3 | + * @package Comments | |
| 4 | + * @category modules | |
| 5 | + * @author Nazar Mokrynskyi <[email protected]> | |
| 6 | + * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi | |
| 7 | + * @license MIT License, see license.txt | |
| 8 | + */ | |
| 9 | 9 | namespace cs; | 
| 10 | 10 | Event::instance()->on( | 
| 11 | 11 | 'System/Index/construct', | 
| @@ -36,11 +36,11 @@ discard block | ||
| 36 | 36 | /** | 
| 37 | 37 | * @var int Avatar size in px, can be redefined | 
| 38 | 38 | */ | 
| 39 | - public $avatar_size = 36; | |
| 39 | + public $avatar_size = 36; | |
| 40 | 40 | |
| 41 | 41 |  	protected function construct () { | 
| 42 | - $this->module = current_module(); | |
| 43 | -		$this->cache	= new Cache_prefix("Comments/$this->module"); | |
| 42 | + $this->module = current_module(); | |
| 43 | +		$this->cache = new Cache_prefix("Comments/$this->module"); | |
| 44 | 44 | } | 
| 45 | 45 | /** | 
| 46 | 46 | * Set module (current module assumed by default) | 
| @@ -48,8 +48,8 @@ discard block | ||
| 48 | 48 | * @param string $module Module name | 
| 49 | 49 | */ | 
| 50 | 50 |  	function set_module ($module) { | 
| 51 | - $this->module = $module; | |
| 52 | -		$this->cache	= new Cache_prefix("Comments/$this->module"); | |
| 51 | + $this->module = $module; | |
| 52 | +		$this->cache = new Cache_prefix("Comments/$this->module"); | |
| 53 | 53 | } | 
| 54 | 54 | /** | 
| 55 | 55 | * Returns database index | 
| @@ -67,7 +67,7 @@ discard block | ||
| 67 | 67 | * @return array|false Array of comment data on success or <b>false</b> on failure | 
| 68 | 68 | */ | 
| 69 | 69 |  	function get ($id) { | 
| 70 | - $id = (int)$id; | |
| 70 | + $id = (int)$id; | |
| 71 | 71 | return $this->db()->qf([ | 
| 72 | 72 | "SELECT | 
| 73 | 73 | `id`, | 
| @@ -96,14 +96,14 @@ discard block | ||
| 96 | 96 | * @return array|bool Array of comment data on success or <b>false</b> on failure | 
| 97 | 97 | */ | 
| 98 | 98 |  	function add ($item, $text, $parent = 0) { | 
| 99 | - $L = Language::instance(); | |
| 99 | + $L = Language::instance(); | |
| 100 | 100 | $User = User::instance(); | 
| 101 | 101 | $text = xap($text, true); | 
| 102 | 102 |  		if (!$text) { | 
| 103 | 103 | return false; | 
| 104 | 104 | } | 
| 105 | - $item = (int)$item; | |
| 106 | - $parent = (int)$parent; | |
| 105 | + $item = (int)$item; | |
| 106 | + $parent = (int)$parent; | |
| 107 | 107 | if ( | 
| 108 | 108 | $parent != 0 && | 
| 109 | 109 | $this->db_prime()->qfs([ | 
| @@ -171,12 +171,12 @@ discard block | ||
| 171 | 171 | * @return array|false Array of comment data on success or <b>false</b> on failure | 
| 172 | 172 | */ | 
| 173 | 173 |  	function set ($id, $text) { | 
| 174 | - $text = xap($text, true); | |
| 174 | + $text = xap($text, true); | |
| 175 | 175 |  		if (!$text) { | 
| 176 | 176 | return false; | 
| 177 | 177 | } | 
| 178 | - $id = (int)$id; | |
| 179 | - $comment = $this->get($id); | |
| 178 | + $id = (int)$id; | |
| 179 | + $comment = $this->get($id); | |
| 180 | 180 |  		if (!$comment) { | 
| 181 | 181 | return false; | 
| 182 | 182 | } | 
| @@ -192,7 +192,7 @@ discard block | ||
| 192 | 192 | $this->module | 
| 193 | 193 |  		)) { | 
| 194 | 194 |  			unset($this->cache->{$comment['item']}); | 
| 195 | - $comment['text'] = $text; | |
| 195 | + $comment['text'] = $text; | |
| 196 | 196 | return $comment; | 
| 197 | 197 | } | 
| 198 | 198 | return false; | 
| @@ -205,8 +205,8 @@ discard block | ||
| 205 | 205 | * @return bool | 
| 206 | 206 | */ | 
| 207 | 207 |  	function del ($id) { | 
| 208 | - $id = (int)$id; | |
| 209 | - $comment = $this->db_prime()->qf([ | |
| 208 | + $id = (int)$id; | |
| 209 | + $comment = $this->db_prime()->qf([ | |
| 210 | 210 | "SELECT `p`.`item`, COUNT(`c`.`id`) AS `count` | 
| 211 | 211 | FROM `[prefix]comments` AS `p` | 
| 212 | 212 | LEFT JOIN `[prefix]comments` AS `c` | 
| @@ -243,7 +243,7 @@ discard block | ||
| 243 | 243 | * @return bool | 
| 244 | 244 | */ | 
| 245 | 245 |  	function del_all ($item) { | 
| 246 | - $item = (int)$item; | |
| 246 | + $item = (int)$item; | |
| 247 | 247 | if ($this->db_prime()->q( | 
| 248 | 248 | "DELETE FROM `[prefix]comments` | 
| 249 | 249 | WHERE | 
| @@ -275,9 +275,9 @@ discard block | ||
| 275 | 275 |  		if (!is_array($data)) { | 
| 276 | 276 | return 0; | 
| 277 | 277 | } | 
| 278 | - $count = 0; | |
| 278 | + $count = 0; | |
| 279 | 279 |  		foreach ($data as &$d) { | 
| 280 | - $count += $this->count_internal($d['comments']) + 1; | |
| 280 | + $count += $this->count_internal($d['comments']) + 1; | |
| 281 | 281 | } | 
| 282 | 282 | return $count; | 
| 283 | 283 | } | 
| @@ -300,12 +300,12 @@ discard block | ||
| 300 | 300 | * @return false|array | 
| 301 | 301 | */ | 
| 302 | 302 |  	function tree_data ($item, $parent = 0) { | 
| 303 | - $Cache = $this->cache; | |
| 304 | - $L = Language::instance(); | |
| 303 | + $Cache = $this->cache; | |
| 304 | + $L = Language::instance(); | |
| 305 | 305 |  		if (($comments = $Cache->{"$item/$L->clang"}) === false) { | 
| 306 | - $item = (int)$item; | |
| 307 | - $parent = (int)$parent; | |
| 308 | - $comments = $this->db()->qfa([ | |
| 306 | + $item = (int)$item; | |
| 307 | + $parent = (int)$parent; | |
| 308 | + $comments = $this->db()->qfa([ | |
| 309 | 309 | "SELECT | 
| 310 | 310 | `id`, | 
| 311 | 311 | `parent`, | 
| @@ -330,7 +330,7 @@ discard block | ||
| 330 | 330 | * Cache only root tree data | 
| 331 | 331 | */ | 
| 332 | 332 |  			if ($parent == 0) { | 
| 333 | -				$Cache->{"$item/$L->clang"}	= $comments; | |
| 333 | +				$Cache->{"$item/$L->clang"} = $comments; | |
| 334 | 334 | } | 
| 335 | 335 | } | 
| 336 | 336 | return $comments; | 
| @@ -343,15 +343,15 @@ discard block | ||
| 343 | 343 | * @return string | 
| 344 | 344 | */ | 
| 345 | 345 |  	function tree_html ($comments) { | 
| 346 | - $L = Language::instance(); | |
| 347 | - $User = User::instance(); | |
| 346 | + $L = Language::instance(); | |
| 347 | + $User = User::instance(); | |
| 348 | 348 |  		if (!is_array($comments) || !$comments) { | 
| 349 | 349 | return ''; | 
| 350 | 350 | } | 
| 351 | - $content = ''; | |
| 351 | + $content = ''; | |
| 352 | 352 |  		foreach ($comments as $comment) { | 
| 353 | -			$uniqid		= uniqid('comment_', true); | |
| 354 | -			$content	.= str_replace($uniqid, $comment['text'], h::{'article.cs-comments-comment'}( | |
| 353 | +			$uniqid = uniqid('comment_', true); | |
| 354 | +			$content .= str_replace($uniqid, $comment['text'], h::{'article.cs-comments-comment'}( | |
| 355 | 355 |  				h::{'img.cs-comments-comment-avatar'}([ | 
| 356 | 356 | 'src' => $User->avatar($this->avatar_size, $comment['user']), | 
| 357 | 357 | 'alt' => $User->username($comment['user']), | 
| @@ -407,7 +407,7 @@ discard block | ||
| 407 | 407 | * @return string | 
| 408 | 408 | */ | 
| 409 | 409 |  	function block ($item) { | 
| 410 | -		$L	= new Language_prefix('comments_'); | |
| 410 | +		$L = new Language_prefix('comments_'); | |
| 411 | 411 |  		return h::{'section#comments.cs-comments-comments'}( | 
| 412 | 412 | $L->comments.':'. | 
| 413 | 413 | ( | 
| @@ -19,7 +19,7 @@ | ||
| 19 | 19 | Event::instance()->on( | 
| 20 | 20 | 'Comments/instance', | 
| 21 | 21 |  	function ($data) { | 
| 22 | - $data['Comments'] = Comments::instance(); | |
| 22 | + $data['Comments'] = Comments::instance(); | |
| 23 | 23 | return false; | 
| 24 | 24 | } | 
| 25 | 25 | ); | 
| @@ -1,18 +1,18 @@ | ||
| 1 | 1 | <?php | 
| 2 | 2 | /** | 
| 3 | - * @package Comments | |
| 4 | - * @category modules | |
| 5 | - * @author Nazar Mokrynskyi <[email protected]> | |
| 6 | - * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi | |
| 7 | - * @license MIT License, see license.txt | |
| 8 | - */ | |
| 3 | + * @package Comments | |
| 4 | + * @category modules | |
| 5 | + * @author Nazar Mokrynskyi <[email protected]> | |
| 6 | + * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi | |
| 7 | + * @license MIT License, see license.txt | |
| 8 | + */ | |
| 9 | 9 | /** | 
| 10 | - * Supports next events: | |
| 11 | - * Comments/instance | |
| 12 | - * [ | |
| 13 | - * 'Comments' => <i>&$Comments</i> | |
| 14 | - * ] | |
| 15 | - */ | |
| 10 | + * Supports next events: | |
| 11 | + * Comments/instance | |
| 12 | + * [ | |
| 13 | + * 'Comments' => <i>&$Comments</i> | |
| 14 | + * ] | |
| 15 | + */ | |
| 16 | 16 | namespace cs\modules\Comments; | 
| 17 | 17 | use | 
| 18 | 18 | cs\Event; | 
| @@ -31,7 +31,7 @@ | ||
| 31 | 31 | 'content' => null, //Is set in constructor | 
| 32 | 32 | 'type' => 'set:text,html' | 
| 33 | 33 | ]; | 
| 34 | - protected $table = '[prefix]content'; | |
| 34 | + protected $table = '[prefix]content'; | |
| 35 | 35 | /** | 
| 36 | 36 | * @var Prefix | 
| 37 | 37 | */ | 
| @@ -1,11 +1,11 @@ | ||
| 1 | 1 | <?php | 
| 2 | 2 | /** | 
| 3 | - * @package Content | |
| 4 | - * @category modules | |
| 5 | - * @author Nazar Mokrynskyi <[email protected]> | |
| 6 | - * @copyright Copyright (c) 2014-2016, Nazar Mokrynskyi | |
| 7 | - * @license MIT License, see license.txt | |
| 8 | - */ | |
| 3 | + * @package Content | |
| 4 | + * @category modules | |
| 5 | + * @author Nazar Mokrynskyi <[email protected]> | |
| 6 | + * @copyright Copyright (c) 2014-2016, Nazar Mokrynskyi | |
| 7 | + * @license MIT License, see license.txt | |
| 8 | + */ | |
| 9 | 9 | namespace cs\modules\Content; | 
| 10 | 10 | |
| 11 | 11 | use | 
| @@ -31,7 +31,7 @@ | ||
| 31 | 31 | 'module' => 'text', | 
| 32 | 32 | 'data' => null //Is set in constructor | 
| 33 | 33 | ]; | 
| 34 | - protected $table = '[prefix]deferred_tasks_tasks'; | |
| 34 | + protected $table = '[prefix]deferred_tasks_tasks'; | |
| 35 | 35 | /** | 
| 36 | 36 | * @var int | 
| 37 | 37 | */ | 
| @@ -1,11 +1,11 @@ | ||
| 1 | 1 | <?php | 
| 2 | 2 | /** | 
| 3 | - * @package Deferred tasks | |
| 4 | - * @category modules | |
| 5 | - * @author Nazar Mokrynskyi <[email protected]> | |
| 6 | - * @copyright Copyright (c) 2013-2016, Nazar Mokrynskyi | |
| 7 | - * @license MIT License, see license.txt | |
| 8 | - */ | |
| 3 | + * @package Deferred tasks | |
| 4 | + * @category modules | |
| 5 | + * @author Nazar Mokrynskyi <[email protected]> | |
| 6 | + * @copyright Copyright (c) 2013-2016, Nazar Mokrynskyi | |
| 7 | + * @license MIT License, see license.txt | |
| 8 | + */ | |
| 9 | 9 | namespace cs; | 
| 10 | 10 | Event::instance()->on( | 
| 11 | 11 | 'System/Index/construct', | 
| @@ -28,8 +28,8 @@ discard block | ||
| 28 | 28 | protected $shortname; | 
| 29 | 29 | |
| 30 | 30 |  	protected function construct () { | 
| 31 | - $this->module = current_module(); | |
| 32 | -		$this->shortname	= Config::instance()->module('Disqus')->shortname; | |
| 31 | + $this->module = current_module(); | |
| 32 | +		$this->shortname = Config::instance()->module('Disqus')->shortname; | |
| 33 | 33 | } | 
| 34 | 34 | /** | 
| 35 | 35 | * Set module (current module assumed by default) | 
| @@ -37,7 +37,7 @@ discard block | ||
| 37 | 37 | * @param string $module Module name | 
| 38 | 38 | */ | 
| 39 | 39 |  	function set_module ($module) { | 
| 40 | - $this->module = $module; | |
| 40 | + $this->module = $module; | |
| 41 | 41 | } | 
| 42 | 42 | /** | 
| 43 | 43 | * Count of comments for specified item | 
| @@ -74,11 +74,11 @@ discard block | ||
| 74 | 74 | return '<div id="disqus_thread"></div>'; | 
| 75 | 75 | } | 
| 76 | 76 |  	protected function count_js () { | 
| 77 | - static $added = false; | |
| 77 | + static $added = false; | |
| 78 | 78 |  		if ($added) { | 
| 79 | 79 | return; | 
| 80 | 80 | } | 
| 81 | - $added = true; | |
| 81 | + $added = true; | |
| 82 | 82 | Page::instance()->js( | 
| 83 | 83 | "var disqus_shortname = '$this->shortname'; | 
| 84 | 84 |  if (!window.disqus_count_items) { window.disqus_count_items = []; }", | 
| @@ -86,11 +86,11 @@ discard block | ||
| 86 | 86 | ); | 
| 87 | 87 | } | 
| 88 | 88 |  	protected function block_js ($item) { | 
| 89 | - static $added = false; | |
| 89 | + static $added = false; | |
| 90 | 90 |  		if ($added) { | 
| 91 | 91 | return; | 
| 92 | 92 | } | 
| 93 | - $added = true; | |
| 93 | + $added = true; | |
| 94 | 94 | Page::instance()->js( | 
| 95 | 95 |  			"var disqus_shortname = '$this->shortname', disqus_identifier = '".str_replace("'", "\'", "$this->module/$item")."';", | 
| 96 | 96 | 'code' | 
| @@ -1,11 +1,11 @@ | ||
| 1 | 1 | <?php | 
| 2 | 2 | /** | 
| 3 | - * @package Disqus | |
| 4 | - * @category modules | |
| 5 | - * @author Nazar Mokrynskyi <[email protected]> | |
| 6 | - * @copyright Copyright (c) 2013-2016, Nazar Mokrynskyi | |
| 7 | - * @license MIT License, see license.txt | |
| 8 | - */ | |
| 3 | + * @package Disqus | |
| 4 | + * @category modules | |
| 5 | + * @author Nazar Mokrynskyi <[email protected]> | |
| 6 | + * @copyright Copyright (c) 2013-2016, Nazar Mokrynskyi | |
| 7 | + * @license MIT License, see license.txt | |
| 8 | + */ | |
| 9 | 9 | namespace cs\modules\Disqus; | 
| 10 | 10 | use | 
| 11 | 11 | h, |