| 1 |
<?php |
| 2 |
// phpcs:disable PSR1.Methods.CamelCapsMethodName |
| 3 |
// phpcs:disable WordPressVIPMinimum.TemplatingEngines.UnescapedOutputMustache.OutputNotation |
| 4 |
|
| 5 |
namespace Beyondwords\Wordpress\Compatibility\Elementor\Controls; |
| 6 |
|
| 7 |
use Elementor\Base_Control; |
| 8 |
use Elementor\Controls_Manager; |
| 9 |
|
| 10 |
use Beyondwords\Wordpress\Component\Post\PostMetaUtils; |
| 11 |
|
| 12 |
/** |
| 13 |
* Elementor BeyondWords Player control. |
| 14 |
* |
| 15 |
* @codeCoverageIgnore |
| 16 |
* |
| 17 |
* @since 3.10.0 |
| 18 |
*/ |
| 19 |
class Player extends Base_Control |
| 20 |
{ |
| 21 |
public function get_type() |
| 22 |
{ |
| 23 |
return 'beyondwords_player'; |
| 24 |
} |
| 25 |
|
| 26 |
public function get_default_settings() |
| 27 |
{ |
| 28 |
$postId = get_the_ID(); |
| 29 |
|
| 30 |
return [ |
| 31 |
'label_block' => true, |
| 32 |
'separator' => 'before', |
| 33 |
'post_id' => $postId, |
| 34 |
'project_id' => null, |
| 35 |
'content_id' => null, |
| 36 |
'generate_audio' => null, |
| 37 |
'display_player' => null, |
| 38 |
]; |
| 39 |
} |
| 40 |
|
| 41 |
public function content_template() |
| 42 |
{ |
| 43 |
// phpcs:disable |
| 44 |
?> |
| 45 |
<div class="elementor-control-field"> |
| 46 |
<div class="elementor-control-input-wrapper elementor-control-unit-5"> |
| 47 |
<div id="beyondwords-elementor-player" data-post-id="{{ data.post_id }}"> |
| 48 |
<div |
| 49 |
id="beyondwords-elementor-editor-player" |
| 50 |
data-beyondwords-player="true" |
| 51 |
data-beyondwords-project-id="{{ data.project_id }}" |
| 52 |
data-beyondwords-content-id="{{ data.content_id }}" |
| 53 |
contenteditable="false" |
| 54 |
></div> |
| 55 |
</div> |
| 56 |
|
| 57 |
<script type="text/javascript"> |
| 58 |
if (window.$e) { |
| 59 |
window.$e.run('beyondwords/panel-open'); |
| 60 |
} |
| 61 |
</script> |
| 62 |
</div> |
| 63 |
</div> |
| 64 |
<?php |
| 65 |
// phpcs:enable |
| 66 |
} |
| 67 |
} |
| 68 |
|