@@ -40,11 +40,11 @@ discard block |
||
40 | 40 | * Try to load classes from different places. If not found in one place - try in another. |
41 | 41 | */ |
42 | 42 | if ( |
43 | - _require_once($file = DIR."/core/classes/$namespace/$class_name.php", false) || //Core classes |
|
43 | + _require_once($file = DIR."/core/classes/$namespace/$class_name.php", false) || //Core classes |
|
44 | 44 | _require_once($file = DIR."/core/thirdparty/$namespace/$class_name.php", false) || //Third party classes |
45 | - _require_once($file = DIR."/core/traits/$namespace/$class_name.php", false) || //Core traits |
|
46 | - _require_once($file = ENGINES."/$namespace/$class_name.php", false) || //Core engines |
|
47 | - _require_once($file = MODULES."/../$namespace/$class_name.php", false) || //Classes in modules |
|
45 | + _require_once($file = DIR."/core/traits/$namespace/$class_name.php", false) || //Core traits |
|
46 | + _require_once($file = ENGINES."/$namespace/$class_name.php", false) || //Core engines |
|
47 | + _require_once($file = MODULES."/../$namespace/$class_name.php", false) || //Classes in modules |
|
48 | 48 | _require_once($file = PLUGINS."/../$namespace/$class_name.php", false) //Classes in plugins |
49 | 49 | ) { |
50 | 50 | $cache[$class] = realpath($file); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * @return false|string |
118 | 118 | */ |
119 | 119 | function url_by_source ($source) { |
120 | - $Config = Config::instance(true); |
|
120 | + $Config = Config::instance(true); |
|
121 | 121 | if (!$Config) { |
122 | 122 | return false; |
123 | 123 | } |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | * @return false|string |
136 | 136 | */ |
137 | 137 | function source_by_url ($url) { |
138 | - $Config = Config::instance(true); |
|
138 | + $Config = Config::instance(true); |
|
139 | 139 | if (!$Config) { |
140 | 140 | return false; |
141 | 141 | } |
@@ -173,8 +173,8 @@ discard block |
||
173 | 173 | if (!is_numeric($time)) { |
174 | 174 | return $time; |
175 | 175 | } |
176 | - $L = Language::instance(); |
|
177 | - $res = []; |
|
176 | + $L = Language::instance(); |
|
177 | + $res = []; |
|
178 | 178 | if ($time >= 31536000) { |
179 | 179 | $time_x = round($time / 31536000); |
180 | 180 | $time -= $time_x * 31536000; |
@@ -185,12 +185,12 @@ discard block |
||
185 | 185 | $time -= $time_x * 2592000; |
186 | 186 | $res[] = $L->time($time_x, 'M'); |
187 | 187 | } |
188 | - if($time >= 86400) { |
|
188 | + if ($time >= 86400) { |
|
189 | 189 | $time_x = round($time / 86400); |
190 | 190 | $time -= $time_x * 86400; |
191 | 191 | $res[] = $L->time($time_x, 'd'); |
192 | 192 | } |
193 | - if($time >= 3600) { |
|
193 | + if ($time >= 3600) { |
|
194 | 194 | $time_x = round($time / 3600); |
195 | 195 | $time -= $time_x * 3600; |
196 | 196 | $res[] = $L->time($time_x, 'h'); |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | $timezones_ = $timezones = []; |
252 | 252 | foreach ($tzs as $tz) { |
253 | 253 | $offset = (new DateTimeZone($tz))->getOffset(new DateTime); |
254 | - $offset_ = ($offset < 0 ? '-' : '+'). |
|
254 | + $offset_ = ($offset < 0 ? '-' : '+'). |
|
255 | 255 | str_pad(floor(abs($offset / 3600)), 2, 0, STR_PAD_LEFT).':'. |
256 | 256 | str_pad(abs(($offset % 3600) / 60), 2, 0, STR_PAD_LEFT); |
257 | 257 | $timezones_[(39600 + $offset).$tz] = [ |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | * @return false|string |
284 | 284 | */ |
285 | 285 | function get_core_ml_text ($item) { |
286 | - $Config = Config::instance(true); |
|
286 | + $Config = Config::instance(true); |
|
287 | 287 | if (!$Config) { |
288 | 288 | return false; |
289 | 289 | } |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | ] |
425 | 425 | ); |
426 | 426 | }; |
427 | - $render_page_item = function ($i) use ($page, $url, $head_links, $render_head_links) { |
|
427 | + $render_page_item = function ($i) use ($page, $url, $head_links, $render_head_links) { |
|
428 | 428 | if ($head_links) { |
429 | 429 | $render_head_links($i); |
430 | 430 | } |
@@ -517,14 +517,14 @@ discard block |
||
517 | 517 | } |
518 | 518 | $output = []; |
519 | 519 | if (!is_callable($url)) { |
520 | - $original_url = $url; |
|
520 | + $original_url = $url; |
|
521 | 521 | $url = function ($page) use ($original_url) { |
522 | 522 | return sprintf($original_url, $page); |
523 | 523 | }; |
524 | 524 | } |
525 | 525 | if ($total <= 11) { |
526 | 526 | for ($i = 1; $i <= $total; ++$i) { |
527 | - $output[] = [ |
|
527 | + $output[] = [ |
|
528 | 528 | $i, |
529 | 529 | [ |
530 | 530 | 'is' => 'cs-button', |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | } else { |
539 | 539 | if ($page <= 6) { |
540 | 540 | for ($i = 1; $i <= 7; ++$i) { |
541 | - $output[] = [ |
|
541 | + $output[] = [ |
|
542 | 542 | $i, |
543 | 543 | [ |
544 | 544 | 'is' => 'cs-button', |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | ] |
550 | 550 | ]; |
551 | 551 | } |
552 | - $output[] = [ |
|
552 | + $output[] = [ |
|
553 | 553 | '...', |
554 | 554 | [ |
555 | 555 | 'is' => 'cs-button', |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | ] |
559 | 559 | ]; |
560 | 560 | for ($i = $total - 2; $i <= $total; ++$i) { |
561 | - $output[] = [ |
|
561 | + $output[] = [ |
|
562 | 562 | $i, |
563 | 563 | [ |
564 | 564 | 'is' => 'cs-button', |
@@ -570,7 +570,7 @@ discard block |
||
570 | 570 | } |
571 | 571 | } elseif ($page >= $total - 5) { |
572 | 572 | for ($i = 1; $i <= 3; ++$i) { |
573 | - $output[] = [ |
|
573 | + $output[] = [ |
|
574 | 574 | $i, |
575 | 575 | [ |
576 | 576 | 'is' => 'cs-button', |
@@ -580,7 +580,7 @@ discard block |
||
580 | 580 | ] |
581 | 581 | ]; |
582 | 582 | } |
583 | - $output[] = [ |
|
583 | + $output[] = [ |
|
584 | 584 | '...', |
585 | 585 | [ |
586 | 586 | 'is' => 'cs-button', |
@@ -589,7 +589,7 @@ discard block |
||
589 | 589 | ] |
590 | 590 | ]; |
591 | 591 | for ($i = $total - 6; $i <= $total; ++$i) { |
592 | - $output[] = [ |
|
592 | + $output[] = [ |
|
593 | 593 | $i, |
594 | 594 | [ |
595 | 595 | 'is' => 'cs-button', |
@@ -602,7 +602,7 @@ discard block |
||
602 | 602 | } |
603 | 603 | } else { |
604 | 604 | for ($i = 1; $i <= 2; ++$i) { |
605 | - $output[] = [ |
|
605 | + $output[] = [ |
|
606 | 606 | $i, |
607 | 607 | [ |
608 | 608 | 'is' => 'cs-button', |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | ] |
613 | 613 | ]; |
614 | 614 | } |
615 | - $output[] = [ |
|
615 | + $output[] = [ |
|
616 | 616 | '...', |
617 | 617 | [ |
618 | 618 | 'is' => 'cs-button', |
@@ -621,7 +621,7 @@ discard block |
||
621 | 621 | ] |
622 | 622 | ]; |
623 | 623 | for ($i = $page - 2; $i <= $page + 2; ++$i) { |
624 | - $output[] = [ |
|
624 | + $output[] = [ |
|
625 | 625 | $i, |
626 | 626 | [ |
627 | 627 | 'is' => 'cs-button', |
@@ -632,7 +632,7 @@ discard block |
||
632 | 632 | ] |
633 | 633 | ]; |
634 | 634 | } |
635 | - $output[] = [ |
|
635 | + $output[] = [ |
|
636 | 636 | '...', |
637 | 637 | [ |
638 | 638 | 'is' => 'cs-button', |
@@ -641,7 +641,7 @@ discard block |
||
641 | 641 | ] |
642 | 642 | ]; |
643 | 643 | for ($i = $total - 1; $i <= $total; ++$i) { |
644 | - $output[] = [ |
|
644 | + $output[] = [ |
|
645 | 645 | $i, |
646 | 646 | [ |
647 | 647 | 'is' => 'cs-button', |