Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
Helpers
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Modulus
Helpers
Commits
2aaf96ae
Commit
2aaf96ae
authored
Apr 01, 2020
by
Sylvain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mise à jour des helpers
parent
3f28dfad
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
7 deletions
+9
-7
src/divers.php
src/divers.php
+2
-2
src/html.php
src/html.php
+1
-1
src/list.php
src/list.php
+1
-0
src/url.php
src/url.php
+5
-4
No files found.
src/divers.php
View file @
2aaf96ae
...
@@ -5,14 +5,14 @@ use Illuminate\Support\Collection;
...
@@ -5,14 +5,14 @@ use Illuminate\Support\Collection;
use
Illuminate\Support\Str
;
use
Illuminate\Support\Str
;
if
(
!
function_exists
(
'
increaseP
ercent'
))
{
if
(
!
function_exists
(
'
calc_p
ercent'
))
{
/**
/**
* Calcul le pourcentage d'accroissement entre 2 valeurs
* Calcul le pourcentage d'accroissement entre 2 valeurs
* @param int|float $old_value
* @param int|float $old_value
* @param int|float $new_value
* @param int|float $new_value
* @return float La valeur d'accroissement
* @return float La valeur d'accroissement
*/
*/
function
calc
P
ercent
(
$old_value
,
$new_value
)
function
calc
_p
ercent
(
$old_value
,
$new_value
)
{
{
if
(
$new_value
==
0
)
{
if
(
$new_value
==
0
)
{
return
0
;
return
0
;
...
...
src/html.php
View file @
2aaf96ae
...
@@ -13,7 +13,7 @@ if ( !function_exists('published_html')) {
...
@@ -13,7 +13,7 @@ if ( !function_exists('published_html')) {
function
published_html
(
$status
)
function
published_html
(
$status
)
{
{
$html
=
''
;
$html
=
''
;
if
(
$status
==
1
)
{
if
(
$status
==
1
||
$status
==
true
)
{
$html
=
'<i class="fa fa-globe text-success"></i>'
;
$html
=
'<i class="fa fa-globe text-success"></i>'
;
}
else
{
}
else
{
$html
=
'<i class="fa fa-eye-slash text-warning"></i>'
;
$html
=
'<i class="fa fa-eye-slash text-warning"></i>'
;
...
...
src/list.php
View file @
2aaf96ae
...
@@ -4,6 +4,7 @@ use Illuminate\Support\HtmlString;
...
@@ -4,6 +4,7 @@ use Illuminate\Support\HtmlString;
use
Illuminate\Support\Collection
;
use
Illuminate\Support\Collection
;
use
Illuminate\Support\Str
;
use
Illuminate\Support\Str
;
if
(
!
function_exists
(
'col_sort'
))
{
if
(
!
function_exists
(
'col_sort'
))
{
/**
/**
* Affiche un icon de tri de colonne dans une vue tableau
* Affiche un icon de tri de colonne dans une vue tableau
...
...
src/url.php
View file @
2aaf96ae
...
@@ -3,13 +3,14 @@
...
@@ -3,13 +3,14 @@
use
Illuminate\Support\HtmlString
;
use
Illuminate\Support\HtmlString
;
use
Illuminate\Support\Collection
;
use
Illuminate\Support\Collection
;
use
Illuminate\Support\Str
;
use
Illuminate\Support\Str
;
use
Illuminate\Support\Facades\Request
;
if
(
!
function_exists
(
'get_
request_query
'
))
{
if
(
!
function_exists
(
'get_
query_string
'
))
{
/**
/**
* Retourne un tableau avec les paramètres de l'url courante
* Retourne un tableau avec les paramètres de l'url courante
* @return array Un tableau contenant les paramètres
* @return array Un tableau contenant les paramètres
*/
*/
function
get_
request_query
()
function
get_
query_string
()
{
{
parse_str
(
Request
::
getQueryString
(),
$array
);
parse_str
(
Request
::
getQueryString
(),
$array
);
...
@@ -25,7 +26,7 @@ if (! function_exists('str_current_query')) {
...
@@ -25,7 +26,7 @@ if (! function_exists('str_current_query')) {
*/
*/
function
str_current_query
()
:
string
function
str_current_query
()
:
string
{
{
$queries
=
array_filter
(
get_
request_query
());
$queries
=
array_filter
(
get_
query_string
());
return
http_build_query
(
$queries
);
return
http_build_query
(
$queries
);
}
}
}
}
...
@@ -36,7 +37,7 @@ if (! function_exists('current_route_belongs')) {
...
@@ -36,7 +37,7 @@ if (! function_exists('current_route_belongs')) {
* @param string La route à tester
* @param string La route à tester
* @return string
* @return string
*/
*/
function
belongs_route
(
$route_name
)
:
string
function
current_route_belongs
(
$route_name
)
:
string
{
{
$route
=
route
(
$route_name
,
[],
false
);
$route
=
route
(
$route_name
,
[],
false
);
$uri
=
trim
(
$route
,
'/'
);
$uri
=
trim
(
$route
,
'/'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment