Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
paragraphs_inline_entity_form
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
paragraphs_inline_entity_form
Commits
6ca7970e
Commit
6ca7970e
authored
Oct 27, 2023
by
Marcelo Vani
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3348890
: Deleting un-needed files.
parent
77d9380d
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!5
Resolve #3348890 "Drupal10 ckeditor5"
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/paragraphs_inline_entity_form_example/paragraphs_inline_entity_form_example.install
+0
-39
0 additions, 39 deletions
...orm_example/paragraphs_inline_entity_form_example.install
paragraphs_inline_entity_form.install
+0
-22
0 additions, 22 deletions
paragraphs_inline_entity_form.install
with
0 additions
and
61 deletions
modules/paragraphs_inline_entity_form_example/paragraphs_inline_entity_form_example.install
deleted
100644 → 0
+
0
−
39
View file @
77d9380d
<?php
/**
* @file Install file.
*/
use
Drupal\paragraphs\Entity\ParagraphsType
;
use
Drupal\Core\File\FileSystemInterface
;
/**
* Implements hook_install().
*/
function
paragraphs_inline_entity_form_example_install
()
{
// Creates the paragraph icons.
$embed_types
=
[
'block'
,
'columns'
,
'facebook'
,
'gallery'
,
'image'
,
'instagram'
,
'text'
,
'twitter'
,
'view'
,
'youtube'
,
];
// Create and set icons.
foreach
(
$embed_types
as
$type
)
{
$filename
=
$type
.
'_thumb.jpg'
;
$icon
=
\Drupal
::
service
(
'extension.path.resolver'
)
->
getPath
(
'module'
,
'paragraphs_inline_entity_form_example'
)
.
'/images/'
.
$filename
;
$data
=
file_get_contents
(
$icon
);
if
(
$file
=
\Drupal
::
service
(
'file.repository'
)
->
writeData
(
$data
,
'public://'
.
$filename
,
FileSystemInterface
::
EXISTS_REPLACE
))
{
$paragraphs_type
=
'paragraphs_ief_'
.
$type
;
if
(
$paragraphs_type_entity
=
ParagraphsType
::
load
(
$paragraphs_type
))
{
$paragraphs_type_entity
->
set
(
'icon_uuid'
,
$file
->
uuid
());
$paragraphs_type_entity
->
save
();
}
}
}
}
This diff is collapsed.
Click to expand it.
paragraphs_inline_entity_form.install
deleted
100644 → 0
+
0
−
22
View file @
77d9380d
<?php
/**
* @file Install file.
*/
use
Drupal\embed\Entity\EmbedButton
;
use
Drupal\Core\File\FileSystemInterface
;
/**
* Implements hook_install().
*/
function
paragraphs_inline_entity_form_install
()
{
// Set the default icon.
$icon
=
\Drupal
::
service
(
'extension.path.resolver'
)
->
getPath
(
'module'
,
'paragraphs_inline_entity_form'
)
.
'/images/paragraph_icon.png'
;
$data
=
file_get_contents
(
$icon
);
if
(
$file
=
\Drupal
::
service
(
'file.repository'
)
->
writeData
(
$data
,
'public://paragraph_icon.png'
,
FileSystemInterface
::
EXISTS_REPLACE
))
{
if
(
$embed_button
=
EmbedButton
::
load
(
'paragraphs_inline_entity_form'
))
{
$embed_button
->
set
(
'icon'
,
EmbedButton
::
convertImageToEncodedData
(
$file
->
getFileUri
()));
$embed_button
->
save
();
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment