-
Notifications
You must be signed in to change notification settings - Fork 0
Added files #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Added files #1
Conversation
…into release/first_version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this works, but some parts are hard to understand. Some comments added and questions asked.
# itk_video | ||
# ITK Video | ||
|
||
Module that supplies video integration, through a dedicated itk_video field |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Module that supplies video integration, through a dedicated itk_video field | |
Module that supplies video integration through a dedicated itk_video field |
The definitions include; | ||
|
||
- host : Used to identify the provider from the supplied video URL. | ||
- type : Used to determine if videoinformation should be retrieved bu this | ||
module (custom) or Oembed | ||
- requiredCookies : The cookies that the provider sets when embedding a video |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The definitions include; | |
- host : Used to identify the provider from the supplied video URL. | |
- type : Used to determine if videoinformation should be retrieved bu this | |
module (custom) or Oembed | |
- requiredCookies : The cookies that the provider sets when embedding a video | |
The definitions include | |
- host: Used to identify the provider from the supplied video URL. | |
- type: Used to determine if videoinformation should be retrieved bu this | |
module (custom) or Oembed | |
- requiredCookies: The cookies that the provider sets when embedding a video |
The module includes a permission to access the configuration page: | ||
```"Administer ITK Video settings"``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The module includes a permission to access the configuration page: | |
```"Administer ITK Video settings"``` | |
The module includes a permission to access the configuration page: "Administer ITK Video settings" |
The module includes a permission to access the configuration page: | ||
```"Administer ITK Video settings"``` | ||
|
||
If allowed access the settings are set on ```/admin/config/media/itk-video```. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If allowed access the settings are set on ```/admin/config/media/itk-video```. | |
If allowed access the settings are set on `/admin/config/media/itk-video`. |
|
||
## Code | ||
|
||
To check that coding standards are up to scratch run the following commands: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does “up to scratch” mean?
$requiredCookies = $supportedProviders[$providerKey]['requiredCookies']; | ||
|
||
if (!empty($requiredCookies) && isset($videoArray['iframe'])) { | ||
$videoArray['iframe'] = str_replace(' src="', ' src="" data-category-consent="' . $requiredCookies . '" data-consent-src="', $videoArray['iframe']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably works, but it makes a lot of assumptions on the structure of the iframe
HTML.
$blockedText .= '<br>'; | ||
$blockedText .= $fieldValue->title ? '"' . $fieldValue->title . '"' : ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$blockedText .= '<br>'; | |
$blockedText .= $fieldValue->title ? '"' . $fieldValue->title . '"' : ''; | |
if ($fieldValue->title) { | |
$blockedText .= '<br>"' . $fieldValue->title.'"'; | |
} |
'title' => DRUPAL_REQUIRED, | ||
'link_type' => LinkItemInterface::LINK_EXTERNAL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand how this “title” trick is used …
// However, if it is inaccessible to the current user, do not display it | ||
// to them. | ||
// @phpstan-ignore globalDrupalDependencyInjection.useDependencyInjection | ||
if (\Drupal::currentUser()->hasPermission('link to any page') || $item->getUrl()->access()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use dependency injection to get the current user.
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand what's going on in this function, but it seems complicated.
I suppose that inserting a video requires both a title and a URL. Do we need this much code to ensure that?
Includes