@@ -124,7 +124,9 @@ |
||
124 | 124 | 'sender_id' => $user_id |
125 | 125 | )); |
126 | 126 | $check_widget = true; |
127 | - if ($user_id == $this->user->data['user_id']) $check_widget = false; |
|
127 | + if ($user_id == $this->user->data['user_id']) { |
|
128 | + $check_widget = false; |
|
129 | + } |
|
128 | 130 | $this->template->assign_vars(array( |
129 | 131 | 'U_USER_ID' => $user_id, |
130 | 132 | 'U_CHECK_FRIEND' => $check_friend, |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | { |
11 | 11 | global $phpbb_root_path; |
12 | 12 | |
13 | - switch($old_state) |
|
13 | + switch ($old_state) |
|
14 | 14 | { |
15 | 15 | case '': |
16 | 16 | $db = new \florinp\messenger\libs\database(); |
@@ -34,11 +34,11 @@ discard block |
||
34 | 34 | ); |
35 | 35 | "); |
36 | 36 | |
37 | - $messengerDir = $phpbb_root_path . 'store/messenger'; |
|
38 | - if(!is_dir($messengerDir)) { |
|
37 | + $messengerDir = $phpbb_root_path.'store/messenger'; |
|
38 | + if (!is_dir($messengerDir)) { |
|
39 | 39 | mkdir($messengerDir, 0777); |
40 | - $filesDir = $messengerDir . '/files'; |
|
41 | - if(!is_dir($filesDir)) { |
|
40 | + $filesDir = $messengerDir.'/files'; |
|
41 | + if (!is_dir($filesDir)) { |
|
42 | 42 | mkdir($filesDir, 0777); |
43 | 43 | } |
44 | 44 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | public function disable_step($old_state) |
62 | 62 | { |
63 | - switch($old_state) |
|
63 | + switch ($old_state) |
|
64 | 64 | { |
65 | 65 | case '': |
66 | 66 | $phpbb_notifications = $this->container->get('notification_manager'); |
@@ -79,16 +79,16 @@ discard block |
||
79 | 79 | { |
80 | 80 | global $phpbb_root_path; |
81 | 81 | |
82 | - $database = $phpbb_root_path . 'store/messenger.db'; |
|
83 | - if(is_file($database)) { |
|
82 | + $database = $phpbb_root_path.'store/messenger.db'; |
|
83 | + if (is_file($database)) { |
|
84 | 84 | unlink($database); |
85 | 85 | } |
86 | 86 | |
87 | - $messengerDir = $phpbb_root_path . 'store/messenger'; |
|
88 | - if(is_dir($messengerDir)) { |
|
87 | + $messengerDir = $phpbb_root_path.'store/messenger'; |
|
88 | + if (is_dir($messengerDir)) { |
|
89 | 89 | $objects = scandir($messengerDir); |
90 | - foreach($objects as $object) { |
|
91 | - if($object != '.' && $object != '..') { |
|
90 | + foreach ($objects as $object) { |
|
91 | + if ($object != '.' && $object != '..') { |
|
92 | 92 | if (filetype($messengerDir."/".$object) == "dir") rmdir($messengerDir."/".$object); else unlink($messengerDir."/".$object); |
93 | 93 | } |
94 | 94 | } |
@@ -89,7 +89,11 @@ |
||
89 | 89 | $objects = scandir($messengerDir); |
90 | 90 | foreach($objects as $object) { |
91 | 91 | if($object != '.' && $object != '..') { |
92 | - if (filetype($messengerDir."/".$object) == "dir") rmdir($messengerDir."/".$object); else unlink($messengerDir."/".$object); |
|
92 | + if (filetype($messengerDir."/".$object) == "dir") { |
|
93 | + rmdir($messengerDir."/".$object); |
|
94 | + } else { |
|
95 | + unlink($messengerDir."/".$object); |
|
96 | + } |
|
93 | 97 | } |
94 | 98 | } |
95 | 99 | reset($objects); |
@@ -2401,7 +2401,7 @@ discard block |
||
2401 | 2401 | // useful for sending emojis back to mobile devices |
2402 | 2402 | static function shortnameToUnicode($string) { |
2403 | 2403 | $string = preg_replace_callback('/'.self::$ignoredRegexp.'|('.self::$shortcodeRegexp.')/Si', 'static::shortnameToUnicodeCallback', $string); |
2404 | - if(self::$ascii) { |
|
2404 | + if (self::$ascii) { |
|
2405 | 2405 | $string = preg_replace_callback('/'.self::$ignoredRegexp.'|((\\s|^)'.self::$asciiRegexp.'(?=\\s|$|[!,\.]))/S', 'static::asciiToUnicodeCallback', $string); |
2406 | 2406 | } |
2407 | 2407 | return $string; |
@@ -2414,7 +2414,7 @@ discard block |
||
2414 | 2414 | } |
2415 | 2415 | static function shortnameToImage($string) { |
2416 | 2416 | $string = preg_replace_callback('/'.self::$ignoredRegexp.'|('.self::$shortcodeRegexp.')/Si', 'static::shortnameToImageCallback', $string); |
2417 | - if(self::$ascii) { |
|
2417 | + if (self::$ascii) { |
|
2418 | 2418 | $string = preg_replace_callback('/'.self::$ignoredRegexp.'|((\\s|^)'.self::$asciiRegexp.'(?=\\s|$|[!,\.]))/S', 'static::asciiToImageCallback', $string); |
2419 | 2419 | } |
2420 | 2420 | return $string; |
@@ -2430,7 +2430,7 @@ discard block |
||
2430 | 2430 | // ######## preg_replace callbacks |
2431 | 2431 | // ########################################## |
2432 | 2432 | static function shortnameToAsciiCallback($m) { |
2433 | - if((!is_array($m)) || (!isset($m[1])) || (empty($m[1]))) { |
|
2433 | + if ((!is_array($m)) || (!isset($m[1])) || (empty($m[1]))) { |
|
2434 | 2434 | return $m[0]; |
2435 | 2435 | } |
2436 | 2436 | else { |
@@ -2438,7 +2438,7 @@ discard block |
||
2438 | 2438 | |
2439 | 2439 | $shortname = $m[0]; |
2440 | 2440 | |
2441 | - if(!isset(self::$shortcode_replace[$shortname])) { |
|
2441 | + if (!isset(self::$shortcode_replace[$shortname])) { |
|
2442 | 2442 | return $m[0]; |
2443 | 2443 | } |
2444 | 2444 | |
@@ -2448,7 +2448,7 @@ discard block |
||
2448 | 2448 | } |
2449 | 2449 | } |
2450 | 2450 | static function shortnameToUnicodeCallback($m) { |
2451 | - if((!is_array($m)) || (!isset($m[1])) || (empty($m[1]))) { |
|
2451 | + if ((!is_array($m)) || (!isset($m[1])) || (empty($m[1]))) { |
|
2452 | 2452 | return $m[0]; |
2453 | 2453 | } |
2454 | 2454 | else { |
@@ -2456,7 +2456,7 @@ discard block |
||
2456 | 2456 | |
2457 | 2457 | $shortname = $m[1]; |
2458 | 2458 | |
2459 | - if(!isset($flipped[$shortname])) { |
|
2459 | + if (!isset($flipped[$shortname])) { |
|
2460 | 2460 | return $m[0]; |
2461 | 2461 | } |
2462 | 2462 | |
@@ -2466,13 +2466,13 @@ discard block |
||
2466 | 2466 | } |
2467 | 2467 | } |
2468 | 2468 | static function shortnameToImageCallback($m) { |
2469 | - if((!is_array($m)) || (!isset($m[1])) || (empty($m[1]))) { |
|
2469 | + if ((!is_array($m)) || (!isset($m[1])) || (empty($m[1]))) { |
|
2470 | 2470 | return $m[0]; |
2471 | 2471 | } |
2472 | 2472 | else { |
2473 | 2473 | $shortname = $m[1]; |
2474 | 2474 | |
2475 | - if(!isset(self::$shortcode_replace[$shortname])) { |
|
2475 | + if (!isset(self::$shortcode_replace[$shortname])) { |
|
2476 | 2476 | return $m[0]; |
2477 | 2477 | } |
2478 | 2478 | |
@@ -2480,11 +2480,11 @@ discard block |
||
2480 | 2480 | $unicode = self::$shortcode_replace[$shortname]; |
2481 | 2481 | $filename = strtoupper($unicode); |
2482 | 2482 | |
2483 | - if(self::$unicodeAlt) { $alt = self::convert($unicode); } |
|
2483 | + if (self::$unicodeAlt) { $alt = self::convert($unicode); } |
|
2484 | 2484 | else { $alt = $shortname; } |
2485 | 2485 | |
2486 | - if(self::$imageType == 'png') { |
|
2487 | - if(self::$sprites) { |
|
2486 | + if (self::$imageType == 'png') { |
|
2487 | + if (self::$sprites) { |
|
2488 | 2488 | return '<span class="emojione-'.strtoupper($unicode).'" title="'.htmlspecialchars($shortname).'">'.$alt.'</span>'; |
2489 | 2489 | } |
2490 | 2490 | else { |
@@ -2492,7 +2492,7 @@ discard block |
||
2492 | 2492 | } |
2493 | 2493 | } |
2494 | 2494 | |
2495 | - if(self::$sprites) { |
|
2495 | + if (self::$sprites) { |
|
2496 | 2496 | return '<svg class="emojione"><description>'.$alt.'</description><use xlink:href="'.self::$imagePathSVGSprites.'#emoji-'.strtoupper($unicode).'"></use></svg>'; |
2497 | 2497 | } |
2498 | 2498 | else { |
@@ -2501,7 +2501,7 @@ discard block |
||
2501 | 2501 | } |
2502 | 2502 | } |
2503 | 2503 | static function asciiToUnicodeCallback($m) { |
2504 | - if((!is_array($m)) || (!isset($m[3])) || (empty($m[3]))) { |
|
2504 | + if ((!is_array($m)) || (!isset($m[3])) || (empty($m[3]))) { |
|
2505 | 2505 | return $m[0]; |
2506 | 2506 | } |
2507 | 2507 | else { |
@@ -2511,7 +2511,7 @@ discard block |
||
2511 | 2511 | } |
2512 | 2512 | } |
2513 | 2513 | static function asciiToImageCallback($m) { |
2514 | - if((!is_array($m)) || (!isset($m[3])) || (empty($m[3]))) { |
|
2514 | + if ((!is_array($m)) || (!isset($m[3])) || (empty($m[3]))) { |
|
2515 | 2515 | return $m[0]; |
2516 | 2516 | } |
2517 | 2517 | else { |
@@ -2519,11 +2519,11 @@ discard block |
||
2519 | 2519 | $unicode = self::$ascii_replace[$shortname]; |
2520 | 2520 | |
2521 | 2521 | // unicode char or shortname for the alt tag? (unicode is better for copying and pasting the resulting text) |
2522 | - if(self::$unicodeAlt) { $alt = self::convert($unicode); } |
|
2522 | + if (self::$unicodeAlt) { $alt = self::convert($unicode); } |
|
2523 | 2523 | else { $alt = htmlspecialchars($shortname); } |
2524 | 2524 | |
2525 | - if(self::$imageType == 'png') { |
|
2526 | - if(self::$sprites) { |
|
2525 | + if (self::$imageType == 'png') { |
|
2526 | + if (self::$sprites) { |
|
2527 | 2527 | return $m[2].'<span class="emojione-'.strtoupper($unicode).'" title="'.htmlspecialchars($shortname).'">'.$alt.'</span>'; |
2528 | 2528 | } |
2529 | 2529 | else { |
@@ -2531,7 +2531,7 @@ discard block |
||
2531 | 2531 | } |
2532 | 2532 | } |
2533 | 2533 | |
2534 | - if(self::$sprites) { |
|
2534 | + if (self::$sprites) { |
|
2535 | 2535 | return $m[2].'<svg class="emojione"><description>'.$alt.'</description><use xlink:href="'.self::$imagePathSVGSprites.'#emoji-'.strtoupper($unicode).'"></use></svg>'; |
2536 | 2536 | } |
2537 | 2537 | else { |
@@ -2540,14 +2540,14 @@ discard block |
||
2540 | 2540 | } |
2541 | 2541 | } |
2542 | 2542 | static function toShortCallback($m) { |
2543 | - if((!is_array($m)) || (!isset($m[1])) || (empty($m[1]))) { |
|
2543 | + if ((!is_array($m)) || (!isset($m[1])) || (empty($m[1]))) { |
|
2544 | 2544 | return $m[0]; |
2545 | 2545 | } |
2546 | 2546 | else { |
2547 | 2547 | $unicode = $m[1]; |
2548 | - if(!isset(self::$unicode_replace[$unicode])) { |
|
2548 | + if (!isset(self::$unicode_replace[$unicode])) { |
|
2549 | 2549 | $unicode = substr($m[1], 0, 4); |
2550 | - if(!isset(self::$unicode_replace[$unicode])) { |
|
2550 | + if (!isset(self::$unicode_replace[$unicode])) { |
|
2551 | 2551 | return $m[0]; |
2552 | 2552 | } |
2553 | 2553 | } |
@@ -2556,15 +2556,15 @@ discard block |
||
2556 | 2556 | } |
2557 | 2557 | } |
2558 | 2558 | static function unicodeToImageCallback($m) { |
2559 | - if((!is_array($m)) || (!isset($m[1])) || (empty($m[1]))) { |
|
2559 | + if ((!is_array($m)) || (!isset($m[1])) || (empty($m[1]))) { |
|
2560 | 2560 | return $m[0]; |
2561 | 2561 | } |
2562 | 2562 | else { |
2563 | 2563 | $unicode = $m[1]; |
2564 | 2564 | |
2565 | - if(!isset(self::$unicode_replace[$unicode])) { |
|
2565 | + if (!isset(self::$unicode_replace[$unicode])) { |
|
2566 | 2566 | $unicode = substr($m[1], 0, 4); |
2567 | - if(!isset(self::$unicode_replace[$unicode])) { |
|
2567 | + if (!isset(self::$unicode_replace[$unicode])) { |
|
2568 | 2568 | return $m[0]; |
2569 | 2569 | } |
2570 | 2570 | } |
@@ -2572,11 +2572,11 @@ discard block |
||
2572 | 2572 | $shortname = self::$unicode_replace[$unicode]; |
2573 | 2573 | $filename = strtoupper(self::$shortcode_replace[$shortname]); |
2574 | 2574 | |
2575 | - if(self::$unicodeAlt) { $alt = $unicode; } |
|
2575 | + if (self::$unicodeAlt) { $alt = $unicode; } |
|
2576 | 2576 | else { $alt = $shortname; } |
2577 | 2577 | |
2578 | - if(self::$imageType == 'png') { |
|
2579 | - if(self::$sprites) { |
|
2578 | + if (self::$imageType == 'png') { |
|
2579 | + if (self::$sprites) { |
|
2580 | 2580 | return '<span class="emojione-'.strtoupper($unicode).'" title="'.htmlspecialchars($shortname).'">'.$alt.'</span>'; |
2581 | 2581 | } |
2582 | 2582 | else { |
@@ -2584,7 +2584,7 @@ discard block |
||
2584 | 2584 | } |
2585 | 2585 | } |
2586 | 2586 | |
2587 | - if(self::$sprites) { |
|
2587 | + if (self::$sprites) { |
|
2588 | 2588 | return '<svg class="emojione"><description>'.$alt.'</description><use xlink:href="'.self::$imagePathSVGSprites.'#emoji-'.strtoupper($unicode).'"></use></svg>'; |
2589 | 2589 | } |
2590 | 2590 | else { |
@@ -2597,9 +2597,9 @@ discard block |
||
2597 | 2597 | // ######## helper methods |
2598 | 2598 | // ########################################## |
2599 | 2599 | static function convert($unicode) { |
2600 | - if(stristr($unicode,'-')) { |
|
2601 | - $pairs = explode('-',$unicode); |
|
2602 | - return '&#x'.implode(';&#x',$pairs).';'; |
|
2600 | + if (stristr($unicode, '-')) { |
|
2601 | + $pairs = explode('-', $unicode); |
|
2602 | + return '&#x'.implode(';&#x', $pairs).';'; |
|
2603 | 2603 | } |
2604 | 2604 | else { |
2605 | 2605 | return '&#x'.$unicode.';'; |
@@ -2432,8 +2432,7 @@ discard block |
||
2432 | 2432 | static function shortnameToAsciiCallback($m) { |
2433 | 2433 | if((!is_array($m)) || (!isset($m[1])) || (empty($m[1]))) { |
2434 | 2434 | return $m[0]; |
2435 | - } |
|
2436 | - else { |
|
2435 | + } else { |
|
2437 | 2436 | $aflipped = array_flip(self::$ascii_replace); |
2438 | 2437 | |
2439 | 2438 | $shortname = $m[0]; |
@@ -2450,8 +2449,7 @@ discard block |
||
2450 | 2449 | static function shortnameToUnicodeCallback($m) { |
2451 | 2450 | if((!is_array($m)) || (!isset($m[1])) || (empty($m[1]))) { |
2452 | 2451 | return $m[0]; |
2453 | - } |
|
2454 | - else { |
|
2452 | + } else { |
|
2455 | 2453 | $flipped = array_flip(self::$unicode_replace); |
2456 | 2454 | |
2457 | 2455 | $shortname = $m[1]; |
@@ -2468,8 +2466,7 @@ discard block |
||
2468 | 2466 | static function shortnameToImageCallback($m) { |
2469 | 2467 | if((!is_array($m)) || (!isset($m[1])) || (empty($m[1]))) { |
2470 | 2468 | return $m[0]; |
2471 | - } |
|
2472 | - else { |
|
2469 | + } else { |
|
2473 | 2470 | $shortname = $m[1]; |
2474 | 2471 | |
2475 | 2472 | if(!isset(self::$shortcode_replace[$shortname])) { |
@@ -2480,22 +2477,19 @@ discard block |
||
2480 | 2477 | $unicode = self::$shortcode_replace[$shortname]; |
2481 | 2478 | $filename = strtoupper($unicode); |
2482 | 2479 | |
2483 | - if(self::$unicodeAlt) { $alt = self::convert($unicode); } |
|
2484 | - else { $alt = $shortname; } |
|
2480 | + if(self::$unicodeAlt) { $alt = self::convert($unicode); } else { $alt = $shortname; } |
|
2485 | 2481 | |
2486 | 2482 | if(self::$imageType == 'png') { |
2487 | 2483 | if(self::$sprites) { |
2488 | 2484 | return '<span class="emojione-'.strtoupper($unicode).'" title="'.htmlspecialchars($shortname).'">'.$alt.'</span>'; |
2489 | - } |
|
2490 | - else { |
|
2485 | + } else { |
|
2491 | 2486 | return '<img class="emojione" alt="'.$alt.'" src="'.self::$imagePathPNG.$filename.'.png'.self::$cacheBustParam.'"/>'; |
2492 | 2487 | } |
2493 | 2488 | } |
2494 | 2489 | |
2495 | 2490 | if(self::$sprites) { |
2496 | 2491 | return '<svg class="emojione"><description>'.$alt.'</description><use xlink:href="'.self::$imagePathSVGSprites.'#emoji-'.strtoupper($unicode).'"></use></svg>'; |
2497 | - } |
|
2498 | - else { |
|
2492 | + } else { |
|
2499 | 2493 | return '<object class="emojione" data="'.self::$imagePathSVG.$filename.'.svg'.self::$cacheBustParam.'" type="image/svg+xml" standby="'.$alt.'">'.$alt.'</object>'; |
2500 | 2494 | } |
2501 | 2495 | } |
@@ -2503,8 +2497,7 @@ discard block |
||
2503 | 2497 | static function asciiToUnicodeCallback($m) { |
2504 | 2498 | if((!is_array($m)) || (!isset($m[3])) || (empty($m[3]))) { |
2505 | 2499 | return $m[0]; |
2506 | - } |
|
2507 | - else { |
|
2500 | + } else { |
|
2508 | 2501 | $shortname = $m[3]; |
2509 | 2502 | $unicode = self::$ascii_replace[$shortname]; |
2510 | 2503 | return $m[2].self::convert($unicode); |
@@ -2513,28 +2506,24 @@ discard block |
||
2513 | 2506 | static function asciiToImageCallback($m) { |
2514 | 2507 | if((!is_array($m)) || (!isset($m[3])) || (empty($m[3]))) { |
2515 | 2508 | return $m[0]; |
2516 | - } |
|
2517 | - else { |
|
2509 | + } else { |
|
2518 | 2510 | $shortname = html_entity_decode($m[3]); |
2519 | 2511 | $unicode = self::$ascii_replace[$shortname]; |
2520 | 2512 | |
2521 | 2513 | // unicode char or shortname for the alt tag? (unicode is better for copying and pasting the resulting text) |
2522 | - if(self::$unicodeAlt) { $alt = self::convert($unicode); } |
|
2523 | - else { $alt = htmlspecialchars($shortname); } |
|
2514 | + if(self::$unicodeAlt) { $alt = self::convert($unicode); } else { $alt = htmlspecialchars($shortname); } |
|
2524 | 2515 | |
2525 | 2516 | if(self::$imageType == 'png') { |
2526 | 2517 | if(self::$sprites) { |
2527 | 2518 | return $m[2].'<span class="emojione-'.strtoupper($unicode).'" title="'.htmlspecialchars($shortname).'">'.$alt.'</span>'; |
2528 | - } |
|
2529 | - else { |
|
2519 | + } else { |
|
2530 | 2520 | return $m[2].'<img class="emojione" alt="'.$alt.'" src="'.self::$imagePathPNG.strtoupper($unicode).'.png'.self::$cacheBustParam.'"/>'; |
2531 | 2521 | } |
2532 | 2522 | } |
2533 | 2523 | |
2534 | 2524 | if(self::$sprites) { |
2535 | 2525 | return $m[2].'<svg class="emojione"><description>'.$alt.'</description><use xlink:href="'.self::$imagePathSVGSprites.'#emoji-'.strtoupper($unicode).'"></use></svg>'; |
2536 | - } |
|
2537 | - else { |
|
2526 | + } else { |
|
2538 | 2527 | return $m[2].'<object class="emojione" data="'.self::$imagePathSVG.strtoupper($unicode).'.svg'.self::$cacheBustParam.'" type="image/svg+xml" standby="'.$alt.'">'.$alt.'</object>'; |
2539 | 2528 | } |
2540 | 2529 | } |
@@ -2542,8 +2531,7 @@ discard block |
||
2542 | 2531 | static function toShortCallback($m) { |
2543 | 2532 | if((!is_array($m)) || (!isset($m[1])) || (empty($m[1]))) { |
2544 | 2533 | return $m[0]; |
2545 | - } |
|
2546 | - else { |
|
2534 | + } else { |
|
2547 | 2535 | $unicode = $m[1]; |
2548 | 2536 | if(!isset(self::$unicode_replace[$unicode])) { |
2549 | 2537 | $unicode = substr($m[1], 0, 4); |
@@ -2558,8 +2546,7 @@ discard block |
||
2558 | 2546 | static function unicodeToImageCallback($m) { |
2559 | 2547 | if((!is_array($m)) || (!isset($m[1])) || (empty($m[1]))) { |
2560 | 2548 | return $m[0]; |
2561 | - } |
|
2562 | - else { |
|
2549 | + } else { |
|
2563 | 2550 | $unicode = $m[1]; |
2564 | 2551 | |
2565 | 2552 | if(!isset(self::$unicode_replace[$unicode])) { |
@@ -2572,22 +2559,19 @@ discard block |
||
2572 | 2559 | $shortname = self::$unicode_replace[$unicode]; |
2573 | 2560 | $filename = strtoupper(self::$shortcode_replace[$shortname]); |
2574 | 2561 | |
2575 | - if(self::$unicodeAlt) { $alt = $unicode; } |
|
2576 | - else { $alt = $shortname; } |
|
2562 | + if(self::$unicodeAlt) { $alt = $unicode; } else { $alt = $shortname; } |
|
2577 | 2563 | |
2578 | 2564 | if(self::$imageType == 'png') { |
2579 | 2565 | if(self::$sprites) { |
2580 | 2566 | return '<span class="emojione-'.strtoupper($unicode).'" title="'.htmlspecialchars($shortname).'">'.$alt.'</span>'; |
2581 | - } |
|
2582 | - else { |
|
2567 | + } else { |
|
2583 | 2568 | return '<img class="emojione" alt="'.$alt.'" src="'.self::$imagePathPNG.$filename.'.png'.self::$cacheBustParam.'"/>'; |
2584 | 2569 | } |
2585 | 2570 | } |
2586 | 2571 | |
2587 | 2572 | if(self::$sprites) { |
2588 | 2573 | return '<svg class="emojione"><description>'.$alt.'</description><use xlink:href="'.self::$imagePathSVGSprites.'#emoji-'.strtoupper($unicode).'"></use></svg>'; |
2589 | - } |
|
2590 | - else { |
|
2574 | + } else { |
|
2591 | 2575 | return '<object class="emojione" data="'.self::$imagePathSVG.$filename.'.svg'.self::$cacheBustParam.'" type="image/svg+xml" standby="'.$alt.'">'.$alt.'</object>'; |
2592 | 2576 | } |
2593 | 2577 | } |
@@ -2600,8 +2584,7 @@ discard block |
||
2600 | 2584 | if(stristr($unicode,'-')) { |
2601 | 2585 | $pairs = explode('-',$unicode); |
2602 | 2586 | return '&#x'.implode(';&#x',$pairs).';'; |
2603 | - } |
|
2604 | - else { |
|
2587 | + } else { |
|
2605 | 2588 | return '&#x'.$unicode.';'; |
2606 | 2589 | } |
2607 | 2590 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | array( |
21 | 21 | 'module_basename' => '\florinp\messenger\ucp\ucp_friends_module', |
22 | 22 | 'module_class' => 'ucp_friends_module', |
23 | - 'modes' => array('friends','requests'), |
|
23 | + 'modes' => array('friends', 'requests'), |
|
24 | 24 | ), |
25 | 25 | ) |
26 | 26 | ), |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | array( |
37 | 37 | 'module_basename' => '\florinp\messenger\ucp\ucp_friends_module', |
38 | 38 | 'module_class' => 'ucp_friends_module', |
39 | - 'modes' => array('friends','requests'), |
|
39 | + 'modes' => array('friends', 'requests'), |
|
40 | 40 | ) |
41 | 41 | ) |
42 | 42 | ), |
@@ -114,10 +114,11 @@ discard block |
||
114 | 114 | 'sentAt' => time() |
115 | 115 | ); |
116 | 116 | |
117 | - if ($this->db->insert('messages', $insert)) |
|
118 | - return $this->db->lastInsertId(); |
|
119 | - else |
|
120 | - return false; |
|
117 | + if ($this->db->insert('messages', $insert)) { |
|
118 | + return $this->db->lastInsertId(); |
|
119 | + } else { |
|
120 | + return false; |
|
121 | + } |
|
121 | 122 | } |
122 | 123 | |
123 | 124 | public function sendFile($data) |
@@ -131,10 +132,11 @@ discard block |
||
131 | 132 | 'sentAt' => time() |
132 | 133 | ); |
133 | 134 | |
134 | - if ($this->db->insert('files', $insert)) |
|
135 | - return $this->db->lastInsertId(); |
|
136 | - else |
|
137 | - return false; |
|
135 | + if ($this->db->insert('files', $insert)) { |
|
136 | + return $this->db->lastInsertId(); |
|
137 | + } else { |
|
138 | + return false; |
|
139 | + } |
|
138 | 140 | } |
139 | 141 | |
140 | 142 | public function getMessageById($id) |
@@ -63,12 +63,12 @@ |
||
63 | 63 | public function get_title() |
64 | 64 | { |
65 | 65 | $user_id = $this->user_loader->load_user_by_username($this->get_data('sender_username')); |
66 | - return $this->user->lang('FRIEND_REQUEST_FROM') .$this->user_loader->get_username($user_id, 'no_profile'); |
|
66 | + return $this->user->lang('FRIEND_REQUEST_FROM').$this->user_loader->get_username($user_id, 'no_profile'); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | public function get_url() |
70 | 70 | { |
71 | - return append_sid($this->phpbb_root_path . 'ucp.' . $this->php_ext, "i=-florinp-messenger-ucp-ucp_friends_module&mode=requests"); |
|
71 | + return append_sid($this->phpbb_root_path.'ucp.'.$this->php_ext, "i=-florinp-messenger-ucp-ucp_friends_module&mode=requests"); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | public function get_avatar() |
@@ -17,22 +17,22 @@ discard block |
||
17 | 17 | |
18 | 18 | $this->tpl_name = 'friends'; |
19 | 19 | |
20 | - switch($mode) |
|
20 | + switch ($mode) |
|
21 | 21 | { |
22 | 22 | case 'friends': |
23 | 23 | |
24 | 24 | $action = $request->variable('action', ''); |
25 | - switch($action) |
|
25 | + switch ($action) |
|
26 | 26 | { |
27 | 27 | case 'add_friend': |
28 | 28 | $user_id = $request->variable('user_id', 0); |
29 | - if($user_id > 0) |
|
29 | + if ($user_id > 0) |
|
30 | 30 | { |
31 | - if(confirm_box(true)) |
|
31 | + if (confirm_box(true)) |
|
32 | 32 | { |
33 | 33 | $user_id = $request->variable('user_id', 0); |
34 | 34 | $redirect_url = $request->variable('redirect_url', ''); |
35 | - if($friends_controller->send_request($user_id)) |
|
35 | + if ($friends_controller->send_request($user_id)) |
|
36 | 36 | { |
37 | 37 | redirect($redirect_url); |
38 | 38 | } |
@@ -71,17 +71,17 @@ discard block |
||
71 | 71 | } |
72 | 72 | break; |
73 | 73 | default: |
74 | - if($request->is_set_post('action')) |
|
74 | + if ($request->is_set_post('action')) |
|
75 | 75 | { |
76 | 76 | $action = $request->variable('action', ''); |
77 | - switch($action) |
|
77 | + switch ($action) |
|
78 | 78 | { |
79 | 79 | case 'remove': |
80 | - if(confirm_box(true)) |
|
80 | + if (confirm_box(true)) |
|
81 | 81 | { |
82 | 82 | $user_id = $request->variable('user_id', array(0)); |
83 | 83 | $redirect_url = $request->variable('redirect_url', ''); |
84 | - if($friends_controller->remove_friend($user_id)) |
|
84 | + if ($friends_controller->remove_friend($user_id)) |
|
85 | 85 | { |
86 | 86 | redirect($redirect_url); |
87 | 87 | } |
@@ -106,15 +106,15 @@ discard block |
||
106 | 106 | |
107 | 107 | case 'requests': |
108 | 108 | |
109 | - if($request->is_set_post('action')) |
|
109 | + if ($request->is_set_post('action')) |
|
110 | 110 | { |
111 | 111 | $action = $request->variable('action', ''); |
112 | 112 | |
113 | - switch($action) |
|
113 | + switch ($action) |
|
114 | 114 | { |
115 | 115 | case 'delete': |
116 | 116 | |
117 | - if(confirm_box(true)) |
|
117 | + if (confirm_box(true)) |
|
118 | 118 | { |
119 | 119 | $requests_id = $request->variable('requests_id', array(0)); |
120 | 120 | $friends_controller->delete_request($requests_id); |
@@ -138,14 +138,14 @@ discard block |
||
138 | 138 | } |
139 | 139 | |
140 | 140 | $action = $request->variable('action', ''); |
141 | - switch($action) |
|
141 | + switch ($action) |
|
142 | 142 | { |
143 | 143 | case 'cancel_request': |
144 | - if(confirm_box(true)) |
|
144 | + if (confirm_box(true)) |
|
145 | 145 | { |
146 | 146 | $request_id = $request->variable('request_id', 0); |
147 | 147 | $redirect_url = $request->variable('redirect_url', ''); |
148 | - if($friends_controller->delete_request($request_id)) |
|
148 | + if ($friends_controller->delete_request($request_id)) |
|
149 | 149 | { |
150 | 150 | redirect($redirect_url); |
151 | 151 | } |
@@ -85,8 +85,7 @@ discard block |
||
85 | 85 | { |
86 | 86 | redirect($redirect_url); |
87 | 87 | } |
88 | - } |
|
89 | - else |
|
88 | + } else |
|
90 | 89 | { |
91 | 90 | $user_id = $request->variable('user_id', array(0)); |
92 | 91 | $redirect_url = $request->server('HTTP_REFERER'); |
@@ -118,8 +117,7 @@ discard block |
||
118 | 117 | { |
119 | 118 | $requests_id = $request->variable('requests_id', array(0)); |
120 | 119 | $friends_controller->delete_request($requests_id); |
121 | - } |
|
122 | - else |
|
120 | + } else |
|
123 | 121 | { |
124 | 122 | $requests_id = $request->variable('requests_id', array(0)); |
125 | 123 | confirm_box(false, $user->lang('CONFIRM_REMOVE_REQUESTS'), build_hidden_fields(array( |
@@ -149,8 +147,7 @@ discard block |
||
149 | 147 | { |
150 | 148 | redirect($redirect_url); |
151 | 149 | } |
152 | - } |
|
153 | - else |
|
150 | + } else |
|
154 | 151 | { |
155 | 152 | $request_id = $request->variable('request_id', 0); |
156 | 153 | $redirect_url = $request->server('HTTP_REFERER'); |