Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
Field
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Modulus
Services
Field
Commits
7ddad67c
Commit
7ddad67c
authored
Jan 24, 2022
by
Sylvain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ajout du Field Bt3
parent
56a2cec3
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1333 additions
and
1 deletion
+1333
-1
composer.json
composer.json
+2
-1
src/Compose/Field2Bt3.php
src/Compose/Field2Bt3.php
+1045
-0
src/FieldBt3.php
src/FieldBt3.php
+286
-0
No files found.
composer.json
View file @
7ddad67c
...
...
@@ -28,7 +28,8 @@
],
"aliases"
:
{
"Field"
:
"Goldenscarab
\\
Modulus
\\
Service
\\
Field
\\
Facades
\\
Field"
,
"Field2"
:
"Goldenscarab
\\
Modulus
\\
Service
\\
Field
\\
Facades
\\
Field2"
"Field2"
:
"Goldenscarab
\\
Modulus
\\
Service
\\
Field
\\
Facades
\\
Field2"
,
"FieldBt3"
:
"Goldenscarab
\\
Modulus
\\
Service
\\
Field
\\
Facades
\\
FieldBt3"
}
}
},
...
...
src/Compose/Field2Bt3.php
0 → 100644
View file @
7ddad67c
This diff is collapsed.
Click to expand it.
src/FieldBt3.php
0 → 100644
View file @
7ddad67c
<?php
namespace
Goldenscarab\Modulus\Service\Field
;
use
Illuminate\Support\Facades\Request
;
use
Goldenscarab\Modulus\Service\Field\Compose\Field2Bt3
as
Field
;
class
FieldBt3
{
/**
* Retourne un champs code source
*
* @param array $attrs Attributs du champs
* @return string Le HTML du champs code source
*/
public
function
code
(
$attrs
)
:
string
{
$field
=
new
Field
(
$attrs
);
$code
=
$field
->
renderCodeEditor
();
$render
=
$field
->
renderWrapFieldEnvironment
(
$code
,
true
);
return
$field
->
renderHTML
(
$render
);
}
/**
* Retourne un champs select de choix de publication
* @param boolean $status La valeur du champs
* @return string Le HTML du champs de publication
*/
public
function
publish
(
$status
)
:
string
{
$render
=
$this
->
select
([
'label'
=>
'Visibilité'
,
'name'
=>
'status'
,
'prefix'
=>
'<i class="fa fa-globe"></i>'
,
'value'
=>
$status
,
'attributes'
=>
[
'required'
=>
true
],
'options'
=>
[
'source'
=>
[
0
=>
'Brouillon'
,
1
=>
'En ligne'
]]
]);
return
$render
;
}
/**
* Retourne un champs de recherche dans une liste
* @return string Le HTML du champs de recherche
*/
public
function
search
()
:
string
{
$render
=
$this
->
input
([
'name'
=>
'search'
,
'value'
=>
Request
::
get
(
'search'
),
'attributes'
=>
[
'placeholder'
=>
'Recherche...'
,
'class'
=>
'form-control-sm'
,
],
'suffix'
=>
'<button class="btn btn-outline-secondary btn-sm" type="submit" id="button-search"><i class="fa fa-search"></i></button>'
,
]);
return
$render
;
}
/**
* Retourne un champs select pour choisir le nombre d'éléments d'une liste à afficher
* @return string Le HTML du menu déroulant
*/
public
function
perpage
()
:
string
{
$render
=
$this
->
select
([
'label'
=>
'Lignes par page'
,
'value'
=>
Request
::
fullUrlWithQuery
([
"perpage"
=>
Request
::
get
(
'perpage'
)]),
'attributes'
=>
[
'class'
=>
'ml-2'
,
'placeholder'
=>
'Choisir...'
,
'onchange'
=>
'return document.location.href = this.value;'
],
'options'
=>
[
'source'
=>
[
Request
::
fullUrlWithQuery
([
"perpage"
=>
10
])
=>
'10'
,
Request
::
fullUrlWithQuery
([
"perpage"
=>
15
])
=>
'15'
,
Request
::
fullUrlWithQuery
([
"perpage"
=>
50
])
=>
'50'
,
Request
::
fullUrlWithQuery
([
"perpage"
=>
100
])
=>
'100'
,
Request
::
fullUrlWithQuery
([
"perpage"
=>
200
])
=>
'200'
,
Request
::
fullUrlWithQuery
([
"perpage"
=>
500
])
=>
'500'
,
Request
::
fullUrlWithQuery
([
"perpage"
=>
1000
])
=>
'1000'
]
]
]);
return
$render
;
}
/**
* Retourne un champs file avec son environnement
* @param array $attrs Les attributs du champs
* @return string le HTML du champs et de son environnement
*/
public
function
file
(
$attrs
=
[])
:
string
{
$field
=
new
Field
(
$attrs
);
$file
=
$field
->
renderFile
();
$render
=
$field
->
renderWrapFieldEnvironment
(
$file
);
return
$field
->
renderHTML
(
$render
);
}
/**
* Retourne un champs pdf avec son environnement
* @param array $attrs Les attributs du champs
* @return string le HTML du champs et de son environnement
*/
public
function
pdf
(
$attrs
=
[])
:
string
{
$field
=
new
Field
(
$attrs
);
$image
=
$field
->
renderPdf
();
$render
=
$field
->
renderWrapFieldEnvironment
(
$image
);
return
$field
->
renderHTML
(
$render
);
}
/**
* Retourne un champs video avec son environnement
* @param array $attrs Les attributs du champs
* @return string le HTML du champs et de son environnement
*/
public
function
video
(
$attrs
=
[])
:
string
{
$field
=
new
Field
(
$attrs
);
$image
=
$field
->
renderVideo
();
$render
=
$field
->
renderWrapFieldEnvironment
(
$image
);
return
$field
->
renderHTML
(
$render
);
}
/**
* Retourne un champs image avec son environnement
* @param array $attrs Les attributs du champs
* @return string le HTML du champs et de son environnement
*/
public
function
image
(
$attrs
=
[])
:
string
{
$field
=
new
Field
(
$attrs
);
$image
=
$field
->
renderImage
();
$render
=
$field
->
renderWrapFieldEnvironment
(
$image
);
return
$field
->
renderHTML
(
$render
);
}
/**
* Retourne un champs dossier avec son environnement
* @param array $attrs Les attributs du champs
* @return string le HTML du champs et de son environnement
*/
public
function
folder
(
$attrs
=
[])
:
string
{
$field
=
new
Field
(
$attrs
);
$folder
=
$field
->
renderFolder
();
$render
=
$field
->
renderWrapFieldEnvironment
(
$folder
);
return
$field
->
renderHTML
(
$render
);
}
/**
* Retourne un champs toggle avec son environnement
* @param array $attrs Les attributs du champs
* @return string Le HTML du champs et de son environnement
*/
public
function
toggle
(
$attrs
=
[])
:
string
{
$field
=
new
Field
(
$attrs
);
$toggle
=
$field
->
renderToggle
();
$render
=
$field
->
renderWrapFieldEnvironment
(
$toggle
);
return
$field
->
renderHTML
(
$render
);
}
/**
* Retourne un champs radio avec son environnement
* @param array $attrs Les attributs du champs
* @return string Le HTML du champs et de son environnement
*/
public
function
radio
(
$attrs
=
[])
:
string
{
$field
=
new
Field
(
$attrs
);
$radio
=
$field
->
renderRadio
();
$render
=
$field
->
renderWrapFieldEnvironment
(
$radio
);
return
$field
->
renderHTML
(
$render
);
}
/**
* Retourne un champs checkbox avec son environnement
* @param array $attrs Les attributs du champs
* @return string Le HTML du champs et de son environnement
*/
public
function
checkbox
(
$attrs
=
[])
:
string
{
$field
=
new
Field
(
$attrs
);
$checkbox
=
$field
->
renderCheckbox
();
$render
=
$field
->
renderWrapFieldEnvironment
(
$checkbox
);
return
$field
->
renderHTML
(
$render
);
}
/**
* Retourne un champs range avec son environnement
* @param array $attrs Les attributs du champs
* @return string Le HTML du champs et de son environnement
*/
public
function
range
(
$attrs
=
[])
:
string
{
$field
=
new
Field
(
$attrs
);
$range
=
$field
->
renderRange
();
$render
=
$field
->
renderWrapFieldEnvironment
(
$range
);
return
$field
->
renderHTML
(
$render
);
}
/**
* Retourne un champs pot de miel avec son environnement
* @return string Le HTML du champs et son environnement
*/
public
function
honeypot
()
:
string
{
$field
=
new
Field
([
'name'
=>
'my-name'
,
'attributes'
=>
[
'class'
=>
'd-none'
]
]);
$input1
=
$field
->
renderInput
();
$field
=
new
Field
([
'name'
=>
'my-time'
,
'value'
=>
encrypt
(
time
()),
'attributes'
=>
[
'class'
=>
'd-none'
]
]);
$input2
=
$field
->
renderInput
();
return
$field
->
renderHTML
(
$input1
.
$input2
);
}
/**
* Retourne un champs textarea avec son environnement
* @param array $attrs Les attributs du champs
* @return string Le HTML du champs et de son environnement
*/
public
function
textarea
(
$attrs
=
[])
:
string
{
$field
=
new
Field
(
$attrs
);
$textarea
=
$field
->
renderTextarea
();
$render
=
$field
->
renderWrapFieldEnvironment
(
$textarea
,
true
);
return
$field
->
renderHTML
(
$render
);
}
/**
* Retourne un champs select avec son environnement
* @param array $attrs Les attributs du champs
* @return string Le HTML du champs et de son environnement
*/
public
function
select
(
$attrs
=
[])
:
string
{
$field
=
new
Field
(
$attrs
);
$select
=
$field
->
renderSelect
();
$render
=
$field
->
renderWrapFieldEnvironment
(
$select
);
return
$field
->
renderHTML
(
$render
);
}
/**
* Retourne un champs input avec son environnement
* @param array $attrs Les attributs du champs
* @return string Le HTML du champs et de son environnement
*/
public
function
input
(
$attrs
=
[])
:
string
{
$field
=
new
Field
(
$attrs
);
$input
=
$field
->
renderInput
();
$render
=
$field
->
renderWrapFieldEnvironment
(
$input
);
return
$field
->
renderHTML
(
$render
);
}
}
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