PluginProbe
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration / 1.11
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration v1.11
2.0.15 2.0.12 2.0.10 2.0.4 2.0.1 2.0.0 1.95.3 1.95.2 1.95 1.91.6 trunk 1.11 1.12 1.13 1.20 1.21 1.22 1.23 1.30 1.31 1.32 1.35 1.40 1.41 1.45 All 41 releases
fluent-boards / app / Functions / helpers.php

helpers.php in FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration 1.11, at app/Functions/helpers.php

115 lines 2.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 use FluentBoards\App\App;
4
5 // $app is available
6
7 if (!function_exists('fluentBoards')) {
8 function fluentBoards($module = null)
9 {
10 return App::getInstance($module);
11 }
12 }
13
14 if (!function_exists('FluentBoardsApi')) {
15 function FluentBoardsApi($key = null)
16 {
17 $api = fluentBoards('api');
18 return is_null($key) ? $api : $api->{$key};
19 }
20 }
21
22 if (!function_exists('fluent_boards_user_avatar')) {
23 function fluent_boards_user_avatar($email, $name = '')
24 {
25 $hash = md5(strtolower(trim($email)));
26 /**
27 * Gravatar URL by Email
28 *
29 * @return string $gravatar url of the gravatar image
30 */
31 $fallback = '';
32 if ($name) {
33 $fallback = '&d=https%3A%2F%2Fui-avatars.com%2Fapi%2F' . urlencode($name) . '/128';
34 }
35
36 return apply_filters('fluent_boards/get_avatar',
37 "https://www.gravatar.com/avatar/{$hash}?s=128" . $fallback,
38 $email
39 );
40 }
41 }
42
43 if (!function_exists('fluent_boards_mix')) {
44 function fluent_boards_mix($path, $manifestDirectory = '')
45 {
46 return fluentBoards('url.assets') . ltrim($path, '/');
47 }
48 }
49
50 if (!function_exists('FluentBoardsAssetUrl')) {
51 function FluentBoardsAssetUrl($path = null)
52 {
53 $assetUrl = fluentBoards('url.assets');
54
55 return $path ? ($assetUrl . $path) : $assetUrl;
56 }
57 }
58
59 if (!function_exists('fluent_boards_page_url')) {
60 function fluent_boards_page_url(): ?string
61 {
62 return apply_filters('fluent_boards/app_url', admin_url('admin.php?page=fluent-boards#/'));
63 }
64 }
65
66 function fluent_boards_get_pref_settings($cached = true)
67 {
68 static $pref = null;
69
70 if ($cached && $pref) {
71 return $pref;
72 }
73
74 $settings = [
75 'timeTracking' => [
76 'enabled' => 'no',
77 'all_boards' => 'yes',
78 'selected_boards' => []
79 ],
80 'frontend' => [
81 'enabled' => 'no',
82 'slug' => 'projects',
83 'render_type' => 'standalone',
84 'page_id' => ''
85 ],
86 'menu_settings' => [
87 'in_fluent_crm' => 'no',
88 'menu_position' => 3
89 ]
90 ];
91
92 $storedSettings = get_option('fluent_boards_modules', []);
93 if ($storedSettings && is_array($storedSettings)) {
94 $settings = wp_parse_args($storedSettings, $settings);
95 }
96
97 $pref = $settings;
98
99 return $settings;
100 }
101
102 if (!function_exists('fluent_boards_site_logo')) {
103 function fluent_boards_site_logo()
104 {
105 $logo_url = '';
106 if (function_exists('get_custom_logo') && has_custom_logo()) {
107 $custom_logo_id = get_theme_mod('custom_logo');
108 $logo = wp_get_attachment_image_src($custom_logo_id, 'full');
109 if ($logo) {
110 $logo_url = $logo[0];
111 }
112 }
113 return apply_filters('fluent_boards/site_logo', $logo_url);
114 }
115 }