@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | * @return bool |
| 43 | 43 | * @package Attachments |
| 44 | 44 | */ |
| 45 | -function processAttachments($id_msg = 0) |
|
| 45 | +function processAttachments ($id_msg = 0) |
|
| 46 | 46 | { |
| 47 | 47 | global $context, $modSettings, $txt, $topic, $board; |
| 48 | 48 | |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | * @return array |
| 240 | 240 | * @package Attachments |
| 241 | 241 | */ |
| 242 | -function attachmentUploadChecks($attachID) |
|
| 242 | +function attachmentUploadChecks ($attachID) |
|
| 243 | 243 | { |
| 244 | 244 | global $modSettings, $txt; |
| 245 | 245 | |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | * @return bool |
| 296 | 296 | * @package Attachments |
| 297 | 297 | */ |
| 298 | -function createAttachment(&$attachmentOptions) |
|
| 298 | +function createAttachment (&$attachmentOptions) |
|
| 299 | 299 | { |
| 300 | 300 | global $modSettings; |
| 301 | 301 | |
@@ -470,7 +470,7 @@ discard block |
||
| 470 | 470 | * @return array |
| 471 | 471 | * @package Attachments |
| 472 | 472 | */ |
| 473 | -function getAttachmentFromTopic($id_attach, $id_topic) |
|
| 473 | +function getAttachmentFromTopic ($id_attach, $id_topic) |
|
| 474 | 474 | { |
| 475 | 475 | $db = database(); |
| 476 | 476 | |
@@ -515,7 +515,7 @@ discard block |
||
| 515 | 515 | * @return array |
| 516 | 516 | * @package Attachments |
| 517 | 517 | */ |
| 518 | -function getAttachmentThumbFromTopic($id_attach, $id_topic) |
|
| 518 | +function getAttachmentThumbFromTopic ($id_attach, $id_topic) |
|
| 519 | 519 | { |
| 520 | 520 | $db = database(); |
| 521 | 521 | |
@@ -596,7 +596,7 @@ discard block |
||
| 596 | 596 | * @return array|bool |
| 597 | 597 | * @package Attachments |
| 598 | 598 | */ |
| 599 | -function isAttachmentImage($id_attach) |
|
| 599 | +function isAttachmentImage ($id_attach) |
|
| 600 | 600 | { |
| 601 | 601 | $db = database(); |
| 602 | 602 | |
@@ -619,7 +619,7 @@ discard block |
||
| 619 | 619 | 'type' => 0, |
| 620 | 620 | ) |
| 621 | 621 | )->fetch_callback( |
| 622 | - function ($row) use (&$attachmentData) { |
|
| 622 | + function($row) use (&$attachmentData) { |
|
| 623 | 623 | $attachmentData = $row; |
| 624 | 624 | $attachmentData['is_image'] = substr($attachmentData['mime_type'], 0, 5) === 'image'; |
| 625 | 625 | $attachmentData['size'] = byte_format($attachmentData['size']); |
@@ -639,7 +639,7 @@ discard block |
||
| 639 | 639 | * @param int $id_attach |
| 640 | 640 | * @package Attachments |
| 641 | 641 | */ |
| 642 | -function increaseDownloadCounter($id_attach) |
|
| 642 | +function increaseDownloadCounter ($id_attach) |
|
| 643 | 643 | { |
| 644 | 644 | $db = database(); |
| 645 | 645 | |
@@ -670,7 +670,7 @@ discard block |
||
| 670 | 670 | * @return bool whether the download and resize was successful. |
| 671 | 671 | * @package Attachments |
| 672 | 672 | */ |
| 673 | -function saveAvatar($temporary_path, $memID, $max_width, $max_height) |
|
| 673 | +function saveAvatar ($temporary_path, $memID, $max_width, $max_height) |
|
| 674 | 674 | { |
| 675 | 675 | global $modSettings; |
| 676 | 676 | |
@@ -784,7 +784,7 @@ discard block |
||
| 784 | 784 | * @return mixed[]|bool the image size as array(width, height), or false on failure |
| 785 | 785 | * @package Attachments |
| 786 | 786 | */ |
| 787 | -function url_image_size($url) |
|
| 787 | +function url_image_size ($url) |
|
| 788 | 788 | { |
| 789 | 789 | // Can we pull this from the cache... please please? |
| 790 | 790 | $temp = array(); |
@@ -856,7 +856,7 @@ discard block |
||
| 856 | 856 | * @return array |
| 857 | 857 | * @package Attachments |
| 858 | 858 | */ |
| 859 | -function getServerStoredAvatars($directory) |
|
| 859 | +function getServerStoredAvatars ($directory) |
|
| 860 | 860 | { |
| 861 | 861 | global $context, $txt, $modSettings; |
| 862 | 862 | |
@@ -945,7 +945,7 @@ discard block |
||
| 945 | 945 | * @return array The updated information |
| 946 | 946 | * @package Attachments |
| 947 | 947 | */ |
| 948 | -function updateAttachmentThumbnail($filename, $id_attach, $id_msg, $old_id_thumb = 0, $real_filename = '') |
|
| 948 | +function updateAttachmentThumbnail ($filename, $id_attach, $id_msg, $old_id_thumb = 0, $real_filename = '') |
|
| 949 | 949 | { |
| 950 | 950 | global $modSettings; |
| 951 | 951 | |
@@ -1022,7 +1022,7 @@ discard block |
||
| 1022 | 1022 | * @package Attachments |
| 1023 | 1023 | * @return mixed |
| 1024 | 1024 | */ |
| 1025 | -function attachmentsSizeForMessage($id_msg, $include_count = true) |
|
| 1025 | +function attachmentsSizeForMessage ($id_msg, $include_count = true) |
|
| 1026 | 1026 | { |
| 1027 | 1027 | $db = database(); |
| 1028 | 1028 | |
@@ -1069,7 +1069,7 @@ discard block |
||
| 1069 | 1069 | * @return null|string|string[] |
| 1070 | 1070 | * @package Attachments |
| 1071 | 1071 | */ |
| 1072 | -function getLegacyAttachmentFilename($filename, $attachment_id, $dir = null, $new = false) |
|
| 1072 | +function getLegacyAttachmentFilename ($filename, $attachment_id, $dir = null, $new = false) |
|
| 1073 | 1073 | { |
| 1074 | 1074 | global $modSettings; |
| 1075 | 1075 | |
@@ -1103,7 +1103,7 @@ discard block |
||
| 1103 | 1103 | * @param int[] $attachment_ids |
| 1104 | 1104 | * @package Attachments |
| 1105 | 1105 | */ |
| 1106 | -function bindMessageAttachments($id_msg, $attachment_ids) |
|
| 1106 | +function bindMessageAttachments ($id_msg, $attachment_ids) |
|
| 1107 | 1107 | { |
| 1108 | 1108 | $db = database(); |
| 1109 | 1109 | |
@@ -1137,7 +1137,7 @@ discard block |
||
| 1137 | 1137 | * @todo and of course everything relies on this behavior and work around it. :P. |
| 1138 | 1138 | * Converters included. |
| 1139 | 1139 | */ |
| 1140 | -function getAttachmentFilename($filename, $attachment_id, $dir = null, $new = false, $file_hash = '') |
|
| 1140 | +function getAttachmentFilename ($filename, $attachment_id, $dir = null, $new = false, $file_hash = '') |
|
| 1141 | 1141 | { |
| 1142 | 1142 | global $modSettings; |
| 1143 | 1143 | |
@@ -1170,7 +1170,7 @@ discard block |
||
| 1170 | 1170 | * @return int[]|bool on fail else an array of id_board, id_topic |
| 1171 | 1171 | * @package Attachments |
| 1172 | 1172 | */ |
| 1173 | -function getAttachmentPosition($id_attach) |
|
| 1173 | +function getAttachmentPosition ($id_attach) |
|
| 1174 | 1174 | { |
| 1175 | 1175 | $db = database(); |
| 1176 | 1176 | |
@@ -1207,7 +1207,7 @@ discard block |
||
| 1207 | 1207 | * |
| 1208 | 1208 | * @return array|bool |
| 1209 | 1209 | */ |
| 1210 | -function elk_getimagesize($file, $error = 'array') |
|
| 1210 | +function elk_getimagesize ($file, $error = 'array') |
|
| 1211 | 1211 | { |
| 1212 | 1212 | $sizes = @getimagesize($file); |
| 1213 | 1213 | |
@@ -1228,7 +1228,7 @@ discard block |
||
| 1228 | 1228 | * |
| 1229 | 1229 | * @return bool|string |
| 1230 | 1230 | */ |
| 1231 | -function returnMimeThumb($file_ext, $url = false) |
|
| 1231 | +function returnMimeThumb ($file_ext, $url = false) |
|
| 1232 | 1232 | { |
| 1233 | 1233 | global $settings; |
| 1234 | 1234 | |
@@ -1279,7 +1279,7 @@ discard block |
||
| 1279 | 1279 | * |
| 1280 | 1280 | * @return string |
| 1281 | 1281 | */ |
| 1282 | -function getValidMimeImageType($mime) |
|
| 1282 | +function getValidMimeImageType ($mime) |
|
| 1283 | 1283 | { |
| 1284 | 1284 | // These are the only valid image types. |
| 1285 | 1285 | $validImageTypes = array( |
@@ -1313,7 +1313,7 @@ discard block |
||
| 1313 | 1313 | * @param string $filename |
| 1314 | 1314 | * @return string |
| 1315 | 1315 | */ |
| 1316 | -function getMimeType($filename) |
|
| 1316 | +function getMimeType ($filename) |
|
| 1317 | 1317 | { |
| 1318 | 1318 | $mimeType = ''; |
| 1319 | 1319 | |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | * @param int[] $posters |
| 30 | 30 | * @param bool $includeUnapproved |
| 31 | 31 | */ |
| 32 | - public function __construct($messages, $posters, $includeUnapproved) |
|
| 32 | + public function __construct ($messages, $posters, $includeUnapproved) |
|
| 33 | 33 | { |
| 34 | 34 | $this->messages = $messages; |
| 35 | 35 | $this->includeUnapproved = $includeUnapproved; |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | // The filter returns false when: |
| 47 | 47 | // - the attachment is unapproved, and |
| 48 | 48 | // - the viewer is not the poster of the message where the attachment is |
| 49 | - $this->getAttachments($this->messages, $this->includeUnapproved, static function ($attachment_info, $all_posters) { |
|
| 49 | + $this->getAttachments($this->messages, $this->includeUnapproved, static function($attachment_info, $all_posters) { |
|
| 50 | 50 | return !(!$attachment_info['approved'] && (!isset($all_posters[$attachment_info['id_msg']]) || $all_posters[$attachment_info['id_msg']] != User::$info->id)); |
| 51 | 51 | }, $posters); |
| 52 | 52 | } |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | * @return array |
| 67 | 67 | * @package Attachments |
| 68 | 68 | */ |
| 69 | - protected function getAttachments($messages, $includeUnapproved = false, $filter = null, $all_posters = array()) |
|
| 69 | + protected function getAttachments ($messages, $includeUnapproved = false, $filter = null, $all_posters = array()) |
|
| 70 | 70 | { |
| 71 | 71 | global $modSettings; |
| 72 | 72 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | 'attachment_type' => 0, |
| 89 | 89 | ) |
| 90 | 90 | )->fetch_callback( |
| 91 | - function ($row) use ($includeUnapproved, $filter, $all_posters, &$attachments, &$temp) { |
|
| 91 | + function($row) use ($includeUnapproved, $filter, $all_posters, &$attachments, &$temp) { |
|
| 92 | 92 | if (!$row['approved'] && !$includeUnapproved |
| 93 | 93 | && (empty($filter) || !call_user_func($filter, $row, $all_posters))) |
| 94 | 94 | { |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | * |
| 132 | 132 | * @package Attachments |
| 133 | 133 | */ |
| 134 | - public function loadAttachmentContext($id_msg) |
|
| 134 | + public function loadAttachmentContext ($id_msg) |
|
| 135 | 135 | { |
| 136 | 136 | global $context, $modSettings, $scripturl, $topic; |
| 137 | 137 | |
@@ -185,9 +185,11 @@ |
||
| 185 | 185 | if (empty($attachment['id_thumb']) |
| 186 | 186 | || $attachment['thumb_width'] > $modSettings['attachmentThumbWidth'] |
| 187 | 187 | || $attachment['thumb_height'] > $modSettings['attachmentThumbHeight']) |
| 188 | - //|| ($attachment['thumb_width'] < $modSettings['attachmentThumbWidth'] && $attachment['thumb_height'] < $modSettings['attachmentThumbHeight'])) |
|
| 188 | + { |
|
| 189 | + //|| ($attachment['thumb_width'] < $modSettings['attachmentThumbWidth'] && $attachment['thumb_height'] < $modSettings['attachmentThumbHeight'])) |
|
| 189 | 190 | { |
| 190 | 191 | $filename = getAttachmentFilename($attachment['filename'], $attachment['id_attach'], $attachment['id_folder'], false, $attachment['file_hash']); |
| 192 | + } |
|
| 191 | 193 | $attachment = array_merge($attachment, updateAttachmentThumbnail($filename, $attachment['id_attach'], $id_msg, $attachment['id_thumb'], $attachment['filename'])); |
| 192 | 194 | } |
| 193 | 195 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | /** |
| 61 | 61 | * Default action handler for this controller, if its called directly |
| 62 | 62 | */ |
| 63 | - public function action_index() |
|
| 63 | + public function action_index () |
|
| 64 | 64 | { |
| 65 | 65 | // what to do... display things! |
| 66 | 66 | $this->action_display(); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | * |
| 80 | 80 | * @uses the main sub template of the Display template. |
| 81 | 81 | */ |
| 82 | - public function action_display() |
|
| 82 | + public function action_display () |
|
| 83 | 83 | { |
| 84 | 84 | global $txt, $modSettings, $context, $settings, $options, $topic, $board; |
| 85 | 85 | global $messages_request; |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | /** |
| 320 | 320 | * Sets the message per page |
| 321 | 321 | */ |
| 322 | - public function setMessagesPerPage() |
|
| 322 | + public function setMessagesPerPage () |
|
| 323 | 323 | { |
| 324 | 324 | global $modSettings, $options; |
| 325 | 325 | |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | * |
| 332 | 332 | * @return bool |
| 333 | 333 | */ |
| 334 | - public function getIncludeUnapproved() |
|
| 334 | + public function getIncludeUnapproved () |
|
| 335 | 335 | { |
| 336 | 336 | global $modSettings; |
| 337 | 337 | |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | * @param int $total_visible_posts |
| 345 | 345 | * @return bool |
| 346 | 346 | */ |
| 347 | - public function getCanShowAll($total_visible_posts) |
|
| 347 | + public function getCanShowAll ($total_visible_posts) |
|
| 348 | 348 | { |
| 349 | 349 | global $modSettings; |
| 350 | 350 | |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | * @param int $total_visible_posts |
| 361 | 361 | * @return void |
| 362 | 362 | */ |
| 363 | - public function setupShowAll($can_show_all, $total_visible_posts) |
|
| 363 | + public function setupShowAll ($can_show_all, $total_visible_posts) |
|
| 364 | 364 | { |
| 365 | 365 | global $scripturl, $topic, $context; |
| 366 | 366 | |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | * Returns the previous or next topic based on the get/query value |
| 405 | 405 | * @return void |
| 406 | 406 | */ |
| 407 | - public function getPreviousNextTopic() |
|
| 407 | + public function getPreviousNextTopic () |
|
| 408 | 408 | { |
| 409 | 409 | global $board_info, $topic, $board, $context; |
| 410 | 410 | |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | * Add one for the stats |
| 433 | 433 | * @param $topic |
| 434 | 434 | */ |
| 435 | - public function increaseTopicViews($topic) |
|
| 435 | + public function increaseTopicViews ($topic) |
|
| 436 | 436 | { |
| 437 | 437 | if ($this->user->possibly_robot === false |
| 438 | 438 | && (empty($_SESSION['last_read_topic']) || $_SESSION['last_read_topic'] !== $topic)) |
@@ -449,7 +449,7 @@ discard block |
||
| 449 | 449 | * @param int $board |
| 450 | 450 | * @throws \ElkArte\Exceptions\Exception on invalid topic value |
| 451 | 451 | */ |
| 452 | - public function loadTopicInfo($topic, $board) |
|
| 452 | + public function loadTopicInfo ($topic, $board) |
|
| 453 | 453 | { |
| 454 | 454 | $topic_selects = []; |
| 455 | 455 | $topic_tables = []; |
@@ -475,7 +475,7 @@ discard block |
||
| 475 | 475 | /** |
| 476 | 476 | * Sometimes topics have been moved, this will direct the user to the right spot |
| 477 | 477 | */ |
| 478 | - public function handleRedirection() |
|
| 478 | + public function handleRedirection () |
|
| 479 | 479 | { |
| 480 | 480 | global $context; |
| 481 | 481 | |
@@ -505,7 +505,7 @@ discard block |
||
| 505 | 505 | * @param int $num_replies |
| 506 | 506 | * @return int |
| 507 | 507 | */ |
| 508 | - public function getVisiblePosts($num_replies) |
|
| 508 | + public function getVisiblePosts ($num_replies) |
|
| 509 | 509 | { |
| 510 | 510 | if (!$this->includeUnapproved && $this->topicinfo['unapproved_posts'] && $this->user->is_guest === false) |
| 511 | 511 | { |
@@ -528,7 +528,7 @@ discard block |
||
| 528 | 528 | * |
| 529 | 529 | * @param int $total_visible_posts |
| 530 | 530 | */ |
| 531 | - public function makeStartAdjustments($total_visible_posts) |
|
| 531 | + public function makeStartAdjustments ($total_visible_posts) |
|
| 532 | 532 | { |
| 533 | 533 | global $modSettings; |
| 534 | 534 | |
@@ -596,7 +596,7 @@ discard block |
||
| 596 | 596 | * @param int $total_visible_posts How many are in this topic |
| 597 | 597 | * @param bool $can_show_all If they can show all or need to follow pagination |
| 598 | 598 | */ |
| 599 | - public function setMessageContext($topic, $total_visible_posts, $can_show_all) |
|
| 599 | + public function setMessageContext ($topic, $total_visible_posts, $can_show_all) |
|
| 600 | 600 | { |
| 601 | 601 | global $context, $modSettings, $txt, $board_info; |
| 602 | 602 | |
@@ -687,7 +687,7 @@ discard block |
||
| 687 | 687 | * |
| 688 | 688 | * @return bool |
| 689 | 689 | */ |
| 690 | - public function setRobotNoIndex() |
|
| 690 | + public function setRobotNoIndex () |
|
| 691 | 691 | { |
| 692 | 692 | // Let's do some work on what to search index. |
| 693 | 693 | if (count((array) $this->_req->query) > 2) |
@@ -710,7 +710,7 @@ discard block |
||
| 710 | 710 | * |
| 711 | 711 | * @return bool |
| 712 | 712 | */ |
| 713 | - public function didThisUserStart() |
|
| 713 | + public function didThisUserStart () |
|
| 714 | 714 | { |
| 715 | 715 | return ((int) $this->user->id === (int) $this->topicinfo['id_member_started']) && !$this->user->is_guest; |
| 716 | 716 | } |
@@ -720,7 +720,7 @@ discard block |
||
| 720 | 720 | * |
| 721 | 721 | * @return bool |
| 722 | 722 | */ |
| 723 | - public function warnOldTopic() |
|
| 723 | + public function warnOldTopic () |
|
| 724 | 724 | { |
| 725 | 725 | global $modSettings; |
| 726 | 726 | |
@@ -741,7 +741,7 @@ discard block |
||
| 741 | 741 | * @param array $messages |
| 742 | 742 | * @param int $board |
| 743 | 743 | */ |
| 744 | - private function markRead($messages, $board) |
|
| 744 | + private function markRead ($messages, $board) |
|
| 745 | 745 | { |
| 746 | 746 | global $modSettings; |
| 747 | 747 | |
@@ -782,7 +782,7 @@ discard block |
||
| 782 | 782 | * If the QR is on, we need to load the user information into $context, so we |
| 783 | 783 | * can show the new improved 2.0 QR area |
| 784 | 784 | */ |
| 785 | - public function prepareQuickReply() |
|
| 785 | + public function prepareQuickReply () |
|
| 786 | 786 | { |
| 787 | 787 | global $options, $context; |
| 788 | 788 | |
@@ -802,7 +802,7 @@ discard block |
||
| 802 | 802 | /** |
| 803 | 803 | * Sets if we are showing signatures or not |
| 804 | 804 | */ |
| 805 | - public function setSignatureShowStatus() |
|
| 805 | + public function setSignatureShowStatus () |
|
| 806 | 806 | { |
| 807 | 807 | global $modSettings; |
| 808 | 808 | |
@@ -822,7 +822,7 @@ discard block |
||
| 822 | 822 | * Loads into context the various message/topic permissions so the template |
| 823 | 823 | * knows what buttons etc. to show |
| 824 | 824 | */ |
| 825 | - public function setTopicCanPermissions() |
|
| 825 | + public function setTopicCanPermissions () |
|
| 826 | 826 | { |
| 827 | 827 | global $modSettings, $context, $settings, $board; |
| 828 | 828 | |
@@ -895,7 +895,7 @@ discard block |
||
| 895 | 895 | * Loads into $context the normal button array for template use. |
| 896 | 896 | * Calls integrate_display_buttons hook |
| 897 | 897 | */ |
| 898 | - public function buildNormalButtons() |
|
| 898 | + public function buildNormalButtons () |
|
| 899 | 899 | { |
| 900 | 900 | global $context, $txt; |
| 901 | 901 | |
@@ -953,7 +953,7 @@ discard block |
||
| 953 | 953 | * Loads into $context the moderation button array for template use. |
| 954 | 954 | * Call integrate_mod_buttons hook |
| 955 | 955 | */ |
| 956 | - public function buildModerationButtons() |
|
| 956 | + public function buildModerationButtons () |
|
| 957 | 957 | { |
| 958 | 958 | global $context, $txt; |
| 959 | 959 | |
@@ -1015,7 +1015,7 @@ discard block |
||
| 1015 | 1015 | * @return bool |
| 1016 | 1016 | * @throws \ElkArte\Exceptions\Exception not_a_topic |
| 1017 | 1017 | */ |
| 1018 | - public function trackStats($action = '') |
|
| 1018 | + public function trackStats ($action = '') |
|
| 1019 | 1019 | { |
| 1020 | 1020 | global $topic, $board_info; |
| 1021 | 1021 | |
@@ -1035,7 +1035,7 @@ discard block |
||
| 1035 | 1035 | * |
| 1036 | 1036 | * Accessed by ?action=quickmod2 |
| 1037 | 1037 | */ |
| 1038 | - public function action_quickmod2() |
|
| 1038 | + public function action_quickmod2 () |
|
| 1039 | 1039 | { |
| 1040 | 1040 | global $topic, $board, $context, $modSettings; |
| 1041 | 1041 | |
@@ -1114,7 +1114,7 @@ discard block |
||
| 1114 | 1114 | * @param array $topic_info |
| 1115 | 1115 | * @return bool |
| 1116 | 1116 | */ |
| 1117 | - public function canDeleteAll($topic_info) |
|
| 1117 | + public function canDeleteAll ($topic_info) |
|
| 1118 | 1118 | { |
| 1119 | 1119 | if (allowedTo('delete_any')) |
| 1120 | 1120 | { |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | /** |
| 86 | 86 | * {@inheritdoc} |
| 87 | 87 | */ |
| 88 | - public static function frontPageHook(&$default_action) |
|
| 88 | + public static function frontPageHook (&$default_action) |
|
| 89 | 89 | { |
| 90 | 90 | add_integration_function('integrate_menu_buttons', 'MessageIndex_Controller::addForumButton', '', false); |
| 91 | 91 | add_integration_function('integrate_current_action', 'MessageIndex_Controller::fixCurrentAction', '', false); |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | /** |
| 100 | 100 | * {@inheritdoc} |
| 101 | 101 | */ |
| 102 | - public static function frontPageOptions() |
|
| 102 | + public static function frontPageOptions () |
|
| 103 | 103 | { |
| 104 | 104 | parent::frontPageOptions(); |
| 105 | 105 | |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | * - Allows for initializations, such as default values or |
| 128 | 128 | * loading templates or language files. |
| 129 | 129 | */ |
| 130 | - public function pre_dispatch() |
|
| 130 | + public function pre_dispatch () |
|
| 131 | 131 | { |
| 132 | 132 | // Prefetching + lots of MySQL work = bad mojo. |
| 133 | 133 | stop_prefetching(); |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | * |
| 157 | 157 | * @see \ElkArte\AbstractController::action_index() |
| 158 | 158 | */ |
| 159 | - public function action_index() |
|
| 159 | + public function action_index () |
|
| 160 | 160 | { |
| 161 | 161 | // Figure out what action to do, thinking, thinking ... |
| 162 | 162 | $this->action_recent(); |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | * |
| 168 | 168 | * Accessed by action=recent. |
| 169 | 169 | */ |
| 170 | - public function action_recent() |
|
| 170 | + public function action_recent () |
|
| 171 | 171 | { |
| 172 | 172 | global $txt, $context, $modSettings, $board; |
| 173 | 173 | |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | /** |
| 259 | 259 | * Set up for getting recent posts on a category basis |
| 260 | 260 | */ |
| 261 | - private function _recentPostsCategory() |
|
| 261 | + private function _recentPostsCategory () |
|
| 262 | 262 | { |
| 263 | 263 | global $modSettings, $context; |
| 264 | 264 | |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | /** |
| 308 | 308 | * Setup for finding recent posts based on a list of boards |
| 309 | 309 | */ |
| 310 | - private function _recentPostsBoards() |
|
| 310 | + private function _recentPostsBoards () |
|
| 311 | 311 | { |
| 312 | 312 | global $modSettings; |
| 313 | 313 | |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | /** |
| 340 | 340 | * Setup for finding recent posts for a single board |
| 341 | 341 | */ |
| 342 | - private function _recentPostsBoard() |
|
| 342 | + private function _recentPostsBoard () |
|
| 343 | 343 | { |
| 344 | 344 | global $modSettings, $board; |
| 345 | 345 | |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | /** |
| 362 | 362 | * Setup to find all the recent posts across all boards and categories |
| 363 | 363 | */ |
| 364 | - private function _recentPostsAll() |
|
| 364 | + private function _recentPostsAll () |
|
| 365 | 365 | { |
| 366 | 366 | global $modSettings; |
| 367 | 367 | |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | * @return array|int[] |
| 382 | 382 | * @throws \Exception |
| 383 | 383 | */ |
| 384 | - private function _getLikes($messages) |
|
| 384 | + private function _getLikes ($messages) |
|
| 385 | 385 | { |
| 386 | 386 | global $modSettings; |
| 387 | 387 | |
@@ -408,7 +408,7 @@ discard block |
||
| 408 | 408 | * @param $post |
| 409 | 409 | * @return array |
| 410 | 410 | */ |
| 411 | - private function _addButtons($post) |
|
| 411 | + private function _addButtons ($post) |
|
| 412 | 412 | { |
| 413 | 413 | global $context, $txt; |
| 414 | 414 | |
@@ -474,7 +474,7 @@ discard block |
||
| 474 | 474 | * |
| 475 | 475 | * @see Action_Controller::action_index() |
| 476 | 476 | */ |
| 477 | - public function action_recent_front() |
|
| 477 | + public function action_recent_front () |
|
| 478 | 478 | { |
| 479 | 479 | global $modSettings; |
| 480 | 480 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | * |
| 29 | 29 | * @return array |
| 30 | 30 | */ |
| 31 | - public static function register() |
|
| 31 | + public static function register () |
|
| 32 | 32 | { |
| 33 | 33 | global $modSettings; |
| 34 | 34 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | * |
| 50 | 50 | * @return array |
| 51 | 51 | */ |
| 52 | - public static function settingsRegister() |
|
| 52 | + public static function settingsRegister () |
|
| 53 | 53 | { |
| 54 | 54 | // $hook, $function, $file |
| 55 | 55 | return array( |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | * |
| 63 | 63 | * @param string $message |
| 64 | 64 | */ |
| 65 | - public static function integrate_post_parser(&$message) |
|
| 65 | + public static function integrate_post_parser (&$message) |
|
| 66 | 66 | { |
| 67 | 67 | global $context; |
| 68 | 68 | |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | * |
| 76 | 76 | * @param mixed[] $additional_bbc |
| 77 | 77 | */ |
| 78 | - public static function integrate_additional_bbc(&$additional_bbc) |
|
| 78 | + public static function integrate_additional_bbc (&$additional_bbc) |
|
| 79 | 79 | { |
| 80 | 80 | global $modSettings; |
| 81 | 81 | |
@@ -215,11 +215,11 @@ discard block |
||
| 215 | 215 | * |
| 216 | 216 | * @return callable function which will return a string |
| 217 | 217 | */ |
| 218 | - public static function validate_width() |
|
| 218 | + public static function validate_width () |
|
| 219 | 219 | { |
| 220 | 220 | global $modSettings; |
| 221 | 221 | |
| 222 | - return function ($data) use ($modSettings) { |
|
| 222 | + return function($data) use ($modSettings) { |
|
| 223 | 223 | // These may look odd, and they are, but its a way to set or not ;thumb to the url |
| 224 | 224 | if (!empty($modSettings['attachmentThumbWidth']) && $data <= $modSettings['attachmentThumbWidth']) |
| 225 | 225 | { |
@@ -237,11 +237,11 @@ discard block |
||
| 237 | 237 | * |
| 238 | 238 | * @return callable |
| 239 | 239 | */ |
| 240 | - public static function validate_options() |
|
| 240 | + public static function validate_options () |
|
| 241 | 241 | { |
| 242 | 242 | global $context; |
| 243 | 243 | |
| 244 | - return function (&$data) use (&$context) { |
|
| 244 | + return function(&$data) use (&$context) { |
|
| 245 | 245 | // Not a preview, then sanitize the attach id |
| 246 | 246 | if (strpos($data, 'post_tmp_' . User::$info->id . '_') === false) |
| 247 | 247 | { |
@@ -261,11 +261,11 @@ discard block |
||
| 261 | 261 | * |
| 262 | 262 | * @return callable which will return a string |
| 263 | 263 | */ |
| 264 | - public static function validate_height() |
|
| 264 | + public static function validate_height () |
|
| 265 | 265 | { |
| 266 | 266 | global $modSettings; |
| 267 | 267 | |
| 268 | - return function ($data) use ($modSettings) { |
|
| 268 | + return function($data) use ($modSettings) { |
|
| 269 | 269 | // These may look odd, and they are, but its a way to set or not ;thumb to the url |
| 270 | 270 | if (!empty($modSettings['attachmentThumbHeight']) && $data <= $modSettings['attachmentThumbHeight']) |
| 271 | 271 | { |
@@ -285,11 +285,11 @@ discard block |
||
| 285 | 285 | * |
| 286 | 286 | * @return callable |
| 287 | 287 | */ |
| 288 | - public static function validate_plain() |
|
| 288 | + public static function validate_plain () |
|
| 289 | 289 | { |
| 290 | 290 | global $context, $modSettings; |
| 291 | 291 | |
| 292 | - return function (&$data, $disabled) use (&$context, $modSettings) { |
|
| 292 | + return function(&$data, $disabled) use (&$context, $modSettings) { |
|
| 293 | 293 | if (isset($disabled['attach'])) |
| 294 | 294 | { |
| 295 | 295 | return $data; |
@@ -342,11 +342,11 @@ discard block |
||
| 342 | 342 | * |
| 343 | 343 | * @return callable |
| 344 | 344 | */ |
| 345 | - public static function validate_url() |
|
| 345 | + public static function validate_url () |
|
| 346 | 346 | { |
| 347 | 347 | global $context; |
| 348 | 348 | |
| 349 | - return function (&$data, $disabled) use (&$context) { |
|
| 349 | + return function(&$data, $disabled) use (&$context) { |
|
| 350 | 350 | if (isset($disabled['attach'])) |
| 351 | 351 | { |
| 352 | 352 | return $data; |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | * |
| 393 | 393 | * @param array $config_vars |
| 394 | 394 | */ |
| 395 | - public static function integrate_modify_attachment_settings(&$config_vars) |
|
| 395 | + public static function integrate_modify_attachment_settings (&$config_vars) |
|
| 396 | 396 | { |
| 397 | 397 | $config_vars[] = array('title', 'attachment_inline_title'); |
| 398 | 398 | $config_vars[] = array('check', 'attachment_inline_enabled'); |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | /** |
| 38 | 38 | * {@inheritdoc } |
| 39 | 39 | */ |
| 40 | - public static function hooks(EventManager $eventsManager) |
|
| 40 | + public static function hooks (EventManager $eventsManager) |
|
| 41 | 41 | { |
| 42 | 42 | global $modSettings; |
| 43 | 43 | |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | /** |
| 62 | 62 | * Loads up all the attachments |
| 63 | 63 | */ |
| 64 | - public static function integrate_display_message_list(&$messages, &$posters) |
|
| 64 | + public static function integrate_display_message_list (&$messages, &$posters) |
|
| 65 | 65 | { |
| 66 | 66 | self::$attachments = new AttachmentsDisplay($messages, $posters, self::$includeUnapproved); |
| 67 | 67 | } |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | /** |
| 70 | 70 | * Shows the attachments for the current message |
| 71 | 71 | */ |
| 72 | - public static function integrate_prepare_display_context(&$output, &$this_message, $counter) |
|
| 72 | + public static function integrate_prepare_display_context (&$output, &$this_message, $counter) |
|
| 73 | 73 | { |
| 74 | 74 | $output['attachment'] = self::$attachments->loadAttachmentContext($this_message['id_msg']); |
| 75 | 75 | } |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | /** |
| 31 | 31 | * {@inheritdoc } |
| 32 | 32 | */ |
| 33 | - public static function hooks(EventManager $eventsManager) |
|
| 33 | + public static function hooks (EventManager $eventsManager) |
|
| 34 | 34 | { |
| 35 | 35 | global $modSettings; |
| 36 | 36 | |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | * @param string[] $topic_selects |
| 58 | 58 | * @param string[] $topic_tables |
| 59 | 59 | */ |
| 60 | - public static function followup_topic_query(&$topic_selects, &$topic_tables) |
|
| 60 | + public static function followup_topic_query (&$topic_selects, &$topic_tables) |
|
| 61 | 61 | { |
| 62 | 62 | $topic_selects[] = 'fu.derived_from'; |
| 63 | 63 | $topic_tables[] = 'LEFT JOIN {db_prefix}follow_ups AS fu ON (fu.follow_up = t.id_topic)'; |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | * |
| 69 | 69 | * @param int[] $messages |
| 70 | 70 | */ |
| 71 | - public static function followup_message_list($messages) |
|
| 71 | + public static function followup_message_list ($messages) |
|
| 72 | 72 | { |
| 73 | 73 | global $context; |
| 74 | 74 | |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | * |
| 82 | 82 | * @param int[] $messages |
| 83 | 83 | */ |
| 84 | - public static function load_likes($messages) |
|
| 84 | + public static function load_likes ($messages) |
|
| 85 | 85 | { |
| 86 | 86 | global $modSettings, $context, $txt; |
| 87 | 87 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | * @param int $topic |
| 101 | 101 | * @param bool $includeUnapproved |
| 102 | 102 | */ |
| 103 | - public function topicinfo($topicinfo, $topic, $includeUnapproved) |
|
| 103 | + public function topicinfo ($topicinfo, $topic, $includeUnapproved) |
|
| 104 | 104 | { |
| 105 | 105 | global $context, $scripturl; |
| 106 | 106 | |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | /** |
| 124 | 124 | * Can we show the button? |
| 125 | 125 | */ |
| 126 | - public function prepare_context() |
|
| 126 | + public function prepare_context () |
|
| 127 | 127 | { |
| 128 | 128 | global $context; |
| 129 | 129 | |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | /** |
| 18 | 18 | * Loads the template of the poster area |
| 19 | 19 | */ |
| 20 | -function template_Display_init() |
|
| 20 | +function template_Display_init () |
|
| 21 | 21 | { |
| 22 | 22 | theme()->getTemplates()->load('GenericMessages'); |
| 23 | 23 | if (!empty($context['likes'])) |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | /** |
| 30 | 30 | * Show a status block above the report to staff page |
| 31 | 31 | */ |
| 32 | -function template_report_sent_above() |
|
| 32 | +function template_report_sent_above () |
|
| 33 | 33 | { |
| 34 | 34 | global $txt; |
| 35 | 35 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | /** |
| 44 | 44 | * Topic information, descriptions, etc. |
| 45 | 45 | */ |
| 46 | -function template_messages_informations_above() |
|
| 46 | +function template_messages_informations_above () |
|
| 47 | 47 | { |
| 48 | 48 | global $context, $settings, $txt, $scripturl, $modSettings; |
| 49 | 49 | |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | /** |
| 106 | 106 | * The main template for displaying a topic, does it all, its the king, the bomb, the real deal |
| 107 | 107 | */ |
| 108 | -function template_messages() |
|
| 108 | +function template_messages () |
|
| 109 | 109 | { |
| 110 | 110 | global $context, $settings, $options, $txt, $scripturl; |
| 111 | 111 | |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | /** |
| 470 | 470 | * Closes the topic information, descriptions, etc. divs and forms |
| 471 | 471 | */ |
| 472 | -function template_messages_informations_below() |
|
| 472 | +function template_messages_informations_below () |
|
| 473 | 473 | { |
| 474 | 474 | echo ' |
| 475 | 475 | </form> |
@@ -480,7 +480,7 @@ discard block |
||
| 480 | 480 | /** |
| 481 | 481 | * This is quick reply area below all the message body's |
| 482 | 482 | */ |
| 483 | -function template_quickreply_below() |
|
| 483 | +function template_quickreply_below () |
|
| 484 | 484 | { |
| 485 | 485 | global $context, $options, $settings, $txt, $modSettings, $scripturl; |
| 486 | 486 | |
@@ -749,7 +749,7 @@ discard block |
||
| 749 | 749 | /** |
| 750 | 750 | * Used to display a polls / poll results |
| 751 | 751 | */ |
| 752 | -function template_display_poll_above() |
|
| 752 | +function template_display_poll_above () |
|
| 753 | 753 | { |
| 754 | 754 | global $context, $txt; |
| 755 | 755 | |
@@ -853,7 +853,7 @@ discard block |
||
| 853 | 853 | /** |
| 854 | 854 | * Used to display an attached calendar event. |
| 855 | 855 | */ |
| 856 | -function template_display_calendar_above() |
|
| 856 | +function template_display_calendar_above () |
|
| 857 | 857 | { |
| 858 | 858 | global $context, $txt; |
| 859 | 859 | |
@@ -880,7 +880,7 @@ discard block |
||
| 880 | 880 | /** |
| 881 | 881 | * Used to display items above the page, like page navigation |
| 882 | 882 | */ |
| 883 | -function template_pages_and_buttons_above() |
|
| 883 | +function template_pages_and_buttons_above () |
|
| 884 | 884 | { |
| 885 | 885 | global $context; |
| 886 | 886 | |
@@ -895,7 +895,7 @@ discard block |
||
| 895 | 895 | /** |
| 896 | 896 | * Used to display items below the page, like page navigation |
| 897 | 897 | */ |
| 898 | -function template_pages_and_buttons_below() |
|
| 898 | +function template_pages_and_buttons_below () |
|
| 899 | 899 | { |
| 900 | 900 | global $context, $txt; |
| 901 | 901 | |
@@ -942,7 +942,7 @@ discard block |
||
| 942 | 942 | * @param array $message |
| 943 | 943 | * @param bool $ignoring |
| 944 | 944 | */ |
| 945 | -function template_display_attachments($message, $ignoring) |
|
| 945 | +function template_display_attachments ($message, $ignoring) |
|
| 946 | 946 | { |
| 947 | 947 | global $context, $txt, $scripturl, $modSettings; |
| 948 | 948 | |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | * |
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | -function template_mailcheck_javascript() |
|
| 15 | +function template_mailcheck_javascript () |
|
| 16 | 16 | { |
| 17 | 17 | global $txt; |
| 18 | 18 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | /** |
| 35 | 35 | * Before showing users a registration form, show them the registration agreement. |
| 36 | 36 | */ |
| 37 | -function template_registration_agreement() |
|
| 37 | +function template_registration_agreement () |
|
| 38 | 38 | { |
| 39 | 39 | global $context, $txt; |
| 40 | 40 | |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | * |
| 135 | 135 | * @uses ParseError |
| 136 | 136 | */ |
| 137 | -function template_registration_form() |
|
| 137 | +function template_registration_form () |
|
| 138 | 138 | { |
| 139 | 139 | global $context, $txt, $modSettings; |
| 140 | 140 | |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | if ($field['show_reg'] > 1) |
| 237 | 237 | { |
| 238 | 238 | echo ' |
| 239 | - <div class="form_field">', preg_replace_callback('~<(input|select|textarea) ~', function ($matches) { |
|
| 239 | + <div class="form_field">', preg_replace_callback('~<(input|select|textarea) ~', function($matches) { |
|
| 240 | 240 | global $context; |
| 241 | 241 | |
| 242 | 242 | return '<' . $matches[1] . ' tabindex="' . ($context['tabindex']++) . '"'; |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | /** |
| 378 | 378 | * After registration... all done ;). |
| 379 | 379 | */ |
| 380 | -function template_after() |
|
| 380 | +function template_after () |
|
| 381 | 381 | { |
| 382 | 382 | global $context; |
| 383 | 383 | |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | /** |
| 395 | 395 | * Template for giving instructions about COPPA activation. |
| 396 | 396 | */ |
| 397 | -function template_coppa() |
|
| 397 | +function template_coppa () |
|
| 398 | 398 | { |
| 399 | 399 | global $context, $txt; |
| 400 | 400 | |
@@ -446,7 +446,7 @@ discard block |
||
| 446 | 446 | /** |
| 447 | 447 | * An easily printable form for giving permission to access the forum for a minor. |
| 448 | 448 | */ |
| 449 | -function template_coppa_form() |
|
| 449 | +function template_coppa_form () |
|
| 450 | 450 | { |
| 451 | 451 | global $context, $txt; |
| 452 | 452 | |
@@ -481,7 +481,7 @@ discard block |
||
| 481 | 481 | /** |
| 482 | 482 | * Show a window containing the spoken verification code. |
| 483 | 483 | */ |
| 484 | -function template_verification_sound() |
|
| 484 | +function template_verification_sound () |
|
| 485 | 485 | { |
| 486 | 486 | global $context, $settings, $txt, $db_show_debug; |
| 487 | 487 | |
@@ -524,7 +524,7 @@ discard block |
||
| 524 | 524 | /** |
| 525 | 525 | * Show a page for admins to register new members. |
| 526 | 526 | */ |
| 527 | -function template_admin_register() |
|
| 527 | +function template_admin_register () |
|
| 528 | 528 | { |
| 529 | 529 | global $context, $txt, $modSettings; |
| 530 | 530 | |
@@ -607,7 +607,7 @@ discard block |
||
| 607 | 607 | /** |
| 608 | 608 | * Form for editing the agreement shown for people registering to the forum. |
| 609 | 609 | */ |
| 610 | -function template_edit_agreement() |
|
| 610 | +function template_edit_agreement () |
|
| 611 | 611 | { |
| 612 | 612 | global $context, $txt; |
| 613 | 613 | |
@@ -686,7 +686,7 @@ discard block |
||
| 686 | 686 | /** |
| 687 | 687 | * Interface to edit reserved words in admin panel. |
| 688 | 688 | */ |
| 689 | -function template_edit_reserved_words() |
|
| 689 | +function template_edit_reserved_words () |
|
| 690 | 690 | { |
| 691 | 691 | global $context, $txt; |
| 692 | 692 | |
@@ -737,7 +737,7 @@ discard block |
||
| 737 | 737 | /** |
| 738 | 738 | * Interface for contact form. |
| 739 | 739 | */ |
| 740 | -function template_contact_form() |
|
| 740 | +function template_contact_form () |
|
| 741 | 741 | { |
| 742 | 742 | global $context, $txt; |
| 743 | 743 | |
@@ -797,7 +797,7 @@ discard block |
||
| 797 | 797 | /** |
| 798 | 798 | * Show a success page when contact form is submitted. |
| 799 | 799 | */ |
| 800 | -function template_contact_form_done() |
|
| 800 | +function template_contact_form_done () |
|
| 801 | 801 | { |
| 802 | 802 | global $txt; |
| 803 | 803 | |