Admin
1 month ago
Builder
1 month ago
Helpers
1 month ago
Integrations
1 month ago
UsageTracking
1 month ago
CFF_Autolink.php
1 month ago
CFF_Blocks.php
1 month ago
CFF_Cache.php
1 month ago
CFF_Education.php
1 month ago
CFF_Elementor_Base.php
1 month ago
CFF_Elementor_Widget.php
1 month ago
CFF_Error_Reporter.php
1 month ago
CFF_FB_Settings.php
1 month ago
CFF_Feed_Elementor_Control.php
1 month ago
CFF_Feed_Locator.php
1 month ago
CFF_Feed_Pro.php
1 month ago
CFF_GDPR_Integrations.php
1 month ago
CFF_Group_Posts.php
1 month ago
CFF_HTTP_Request.php
1 month ago
CFF_Oembed.php
1 month ago
CFF_Parse.php
1 month ago
CFF_Resizer.php
1 month ago
CFF_Response.php
1 month ago
CFF_Shortcode.php
1 month ago
CFF_Shortcode_Display.php
1 month ago
CFF_SiteHealth.php
1 month ago
CFF_Utils.php
1 month ago
CFF_View.php
1 month ago
Custom_Facebook_Feed.php
1 month ago
Email_Notification.php
1 month ago
Platform_Data.php
1 month ago
SB_Facebook_Data_Encryption.php
1 month ago
SB_Facebook_Data_Manager.php
1 month ago
index.php
1 month ago
CFF_Feed_Elementor_Control.php
79 lines
| 1 | <?php |
| 2 | |
| 3 | namespace CustomFacebookFeed; |
| 4 | |
| 5 | use Elementor\Base_Data_Control; |
| 6 | use Elementor\Controls_Manager; |
| 7 | use CustomFacebookFeed\Builder\CFF_Db; |
| 8 | |
| 9 | if (!defined('ABSPATH')) { |
| 10 | exit; // Exit if accessed directly |
| 11 | } |
| 12 | |
| 13 | class CFF_Feed_Elementor_Control extends Base_Data_Control |
| 14 | { |
| 15 | public function get_type() |
| 16 | { |
| 17 | return 'cff_feed_control'; |
| 18 | } |
| 19 | |
| 20 | public function enqueue() |
| 21 | { |
| 22 | } |
| 23 | |
| 24 | protected function get_default_settings() |
| 25 | { |
| 26 | return [ |
| 27 | 'label_block' => false |
| 28 | ]; |
| 29 | } |
| 30 | |
| 31 | public function content_template() |
| 32 | { |
| 33 | $control_uid = $this->get_control_uid(); |
| 34 | ?> |
| 35 | <div class="elementor-control-field"> |
| 36 | <# if ( data.label ) {#> |
| 37 | <label for="<?php echo $control_uid; ?>" class="elementor-control-title">{{{ data.label }}}</label> |
| 38 | <# } #> |
| 39 | <div class="elementor-control-input-wrapper elementor-control-unit-5"> |
| 40 | <select id="<?php echo $control_uid; ?>" data-setting="{{ data.name }}" onchange="jQuery(this).parents('.elementor-control-field').find('.link-cff-builder').attr('href', '<?php echo admin_url('admin.php?page=cff-feed-builder') ?>&feed_id='+jQuery(this).val())"> |
| 41 | <# |
| 42 | var printOptions = function( options ) { |
| 43 | _.each( options, function( option_title, option_value ) { #> |
| 44 | <option value="{{ option_value }}">{{{ option_title }}}</option> |
| 45 | <# } ); |
| 46 | }; |
| 47 | |
| 48 | if ( data.groups ) { |
| 49 | for ( var groupIndex in data.groups ) { |
| 50 | var groupArgs = data.groups[ groupIndex ]; |
| 51 | if ( groupArgs.options ) { #> |
| 52 | <optgroup label="{{ groupArgs.label }}"> |
| 53 | <# printOptions( groupArgs.options ) #> |
| 54 | </optgroup> |
| 55 | <# } else if ( _.isString( groupArgs ) ) { #> |
| 56 | <option value="{{ groupIndex }}">{{{ groupArgs }}}</option> |
| 57 | <# } |
| 58 | } |
| 59 | } else { |
| 60 | printOptions( data.options ); |
| 61 | } |
| 62 | #> |
| 63 | </select> |
| 64 | <div style="font-weight: 700; color:#a73061; margin-top: 10px;"> |
| 65 | <# if( data.controlValue != undefined && data.controlValue != '' ) { #> |
| 66 | <a class="link-cff-builder" href="<?php echo admin_url('admin.php?page=cff-feed-builder') ?>&feed_id={{data.controlValue}}" target="_blank" rel="noopener noreferrer"><?php echo __('Edit this Feed', 'custom-facebook-feed'); ?></a> |
| 67 | <span style="color:#aaa; display: inline-block; margin: 0 5px;">|</span> |
| 68 | <# } #> |
| 69 | <a href="<?php echo admin_url('admin.php?page=cff-feed-builder') ?>" target="_blank" rel="noopener noreferrer"><?php echo __('Create New Feed', 'custom-facebook-feed'); ?></a> |
| 70 | </div> |
| 71 | </div> |
| 72 | </div> |
| 73 | <# if ( data.description ) { #> |
| 74 | <div class="elementor-control-field-description">{{{ data.description }}}</div> |
| 75 | <# } #> |
| 76 | |
| 77 | <?php |
| 78 | } |
| 79 | } |