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
970d7a97
Commit
970d7a97
authored
Apr 14, 2020
by
Sylvain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ajout d'un champs folder
parent
848301ea
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
0 deletions
+47
-0
src/Compose/FieldBt4.php
src/Compose/FieldBt4.php
+33
-0
src/Field.php
src/Field.php
+14
-0
No files found.
src/Compose/FieldBt4.php
View file @
970d7a97
...
...
@@ -194,6 +194,39 @@ class FieldBt4
return
$render
;
}
/**
* Retourne le rendu du champs Image avec ses paramètres
* @return string Le rendu du champs
*/
public
function
renderFolder
()
:
string
{
$template
=
'<div class="input-group img-group">'
.
PHP_EOL
;
$template
.=
' <div class="input-group-prepend">'
.
PHP_EOL
;
$template
.=
' <img id="thumb-%s" class="image-thumb" src="%s" alt="thumb">'
.
PHP_EOL
;
$template
.=
' </div>'
.
PHP_EOL
;
$template
.=
' %s'
.
PHP_EOL
;
$template
.=
' <div class="input-group-append">'
.
PHP_EOL
;
$template
.=
' <button class="btn btn-outline-secondary popupfinder" type="button" id="btn-%s" data-field="%s" data-folder="true">'
.
PHP_EOL
;
$template
.=
' %s'
.
PHP_EOL
;
$template
.=
' </button>'
.
PHP_EOL
;
$template
.=
' </div>'
.
PHP_EOL
;
$template
.=
'</div>'
;
$render
=
vsprintf
(
$template
,
[
$this
->
id
,
url
(
'images/folder.jpg'
),
$this
->
renderInput
(),
$this
->
id
,
'#'
.
$this
->
id
,
$this
->
suffix
??
'<i class="fa fa-picture-o mr-2"></i>Choisir image'
]);
$this
->
prefix
=
null
;
$this
->
suffix
=
null
;
return
$render
;
}
/**
* Retourne le rendu du champs Image avec ses paramètres
* @return string Le rendu du champs
...
...
src/Field.php
View file @
970d7a97
...
...
@@ -147,6 +147,20 @@ class Field
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
FieldBt4
(
$attrs
);
$image
=
$field
->
renderFolder
();
$render
=
$field
->
renderWrapFieldEnvironment
(
$image
);
return
$field
->
renderHTML
(
$render
);
}
/**
* Retourne un champs toggle avec son environnement
* @param array $attrs Les attributs du champs
...
...
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