Skip to content
This repository has been archived by the owner on Aug 30, 2019. It is now read-only.

Commit

Permalink
fix(vars): allow disabling embeds on a longtext input
Browse files Browse the repository at this point in the history
  • Loading branch information
hypeJunction committed May 15, 2019
1 parent e1a6287 commit c91e299
Show file tree
Hide file tree
Showing 3 changed files with 1,826 additions and 1 deletion.
12 changes: 12 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 59,15 @@ file entities.

Create a folder in your dataroot `/embed/` and place your image files in there, flush the caches,
and you will see your images in the Assets tab of the embed lightbox window.


## Notes

To disabled embeds on a particular field:

```php
echo elgg_view_field([
'#type' => 'longtext',
'embeds' => false, // This disables the embeds
]);
```
6 changes: 5 additions & 1 deletion views/default/embed/toolbar.php
Original file line number Diff line number Diff line change
@@ -1,8 1,12 @@
<?php
/**
* @uses $vars['embeds'] Disable embed by setting to false
*/
?>

<div class="embed-toolbar">
<?php
if (!elgg_extract('embed', $vars)) {
if (!elgg_extract('embeds', $vars, true)) {
echo elgg_view_menu('embed', [
'sort_by' => 'priority',
'textarea_id' => elgg_extract('id', $vars),
Expand Down
Loading

0 comments on commit c91e299

Please sign in to comment.