accountSetup.php
1 year ago
adminView.php
11 months ago
appConfig.php
7 months ago
feedbackForm.php
1 year ago
integrations.php
1 year ago
powerBI.php
7 months ago
powerBIsettings.php
7 months ago
support_form.php
1 year ago
powerBIsettings.php
169 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Handles powerBI settings View |
| 4 | * |
| 5 | * @package embed-power-bi-reports\View |
| 6 | */ |
| 7 | |
| 8 | namespace MoEmbedPowerBI\View; |
| 9 | |
| 10 | use MoEmbedPowerBI\Wrappers\wpWrapper; |
| 11 | use MoEmbedPowerBI\Wrappers\pluginConstants; |
| 12 | |
| 13 | if ( ! defined( 'ABSPATH' ) ) { |
| 14 | exit; |
| 15 | } |
| 16 | |
| 17 | /** |
| 18 | * Class to handle Power BI Settings tab functionalities. |
| 19 | */ |
| 20 | class powerBIsettings { |
| 21 | |
| 22 | /** |
| 23 | * Holds the instance of PowerBISettings class. |
| 24 | * |
| 25 | * @var PowerBISettings |
| 26 | */ |
| 27 | private static $instance; |
| 28 | |
| 29 | /** |
| 30 | * Object instance(PowerBISettings) getter method. |
| 31 | * |
| 32 | * @return PowerBISettings |
| 33 | */ |
| 34 | public static function get_view() { |
| 35 | if ( ! isset( self::$instance ) ) { |
| 36 | $class = __CLASS__; |
| 37 | self::$instance = new $class(); |
| 38 | } |
| 39 | return self::$instance; |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * Function to display the power bi settings tab details. |
| 44 | * |
| 45 | * @return void |
| 46 | */ |
| 47 | public function mo_epbr_display__tab_details() { |
| 48 | ?> |
| 49 | <div class="mo-ms-tab-content"> |
| 50 | <h1><b>Resource Settings</b></h1> |
| 51 | <div> |
| 52 | <div class="mo-ms-tab-content-left-border" style="display: flex;flex-direction: column;"> |
| 53 | <?php $this->mo_epbr_display__powerbi_settings_tab(); ?> |
| 54 | </div> |
| 55 | </div> |
| 56 | </div> |
| 57 | <?php |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Function to display the power bi settings tab. |
| 62 | * |
| 63 | * @return void |
| 64 | */ |
| 65 | private function mo_epbr_display__powerbi_settings_tab() { |
| 66 | wp_enqueue_style( 'mo_epbr_css_powerbi_settings_display', plugins_url( '../includes/css/mo_epbr_powerbi_settings.css', __FILE__ ), array(), MO_EPBR_PLUGIN_VERSION, 'all' ); |
| 67 | wp_enqueue_style( 'mo_epbr_css_app_display', plugins_url( '../includes/css/mo_epbr_appConfig.css', __FILE__ ), array(), MO_EPBR_PLUGIN_VERSION, 'all' ); |
| 68 | $mobile_height = ! empty( wpWrapper::mo_epbr_get_option( 'mo_epbr_embed_mobile_height' ) ) ? wpWrapper::mo_epbr_get_option( 'mo_epbr_embed_mobile_height' ) : '100px'; |
| 69 | $mobile_width = ! empty( wpWrapper::mo_epbr_get_option( 'mo_epbr_embed_mobile_width' ) ) ? wpWrapper::mo_epbr_get_option( 'mo_epbr_embed_mobile_width' ) : '100%'; |
| 70 | $mobile_breakpoint = ! empty( wpWrapper::mo_epbr_get_option( 'mo_epbr_mobile_display_breakpoint' ) ) ? wpWrapper::mo_epbr_get_option( 'mo_epbr_mobile_display_breakpoint' ) : '320'; |
| 71 | $languagesarray = pluginConstants::LANGUAGES; |
| 72 | if ( empty( wpWrapper::mo_epbr_get_option( 'mo_epbr_selected_locale_language_for_embed' ) ) ) { |
| 73 | wpWrapper::mo_epbr_set_option( 'mo_epbr_selected_locale_language_for_embed', 'en-US' );} |
| 74 | if ( empty( wpWrapper::mo_epbr_get_option( 'mo_epbr_selected_language_for_embed' ) ) ) { |
| 75 | wpWrapper::mo_epbr_set_option( 'mo_epbr_selected_language_for_embed', 'en-US' );} |
| 76 | $res_tenant_id = ! empty( wpWrapper::mo_epbr_get_option( 'mo_epbr_resource_tenantid' ) ) ? wpWrapper::mo_epbr_get_option( 'mo_epbr_resource_tenantid' ) : ''; |
| 77 | $res_subscription_id = ! empty( wpWrapper::mo_epbr_get_option( 'mo_epbr_resource_subscriptionid' ) ) ? wpWrapper::mo_epbr_get_option( 'mo_epbr_resource_subscriptionid' ) : ''; |
| 78 | $res_name = ! empty( wpWrapper::mo_epbr_get_option( 'mo_epbr_resource_name' ) ) ? wpWrapper::mo_epbr_get_option( 'mo_epbr_resource_name' ) : ''; |
| 79 | $res_grp_name = ! empty( wpWrapper::mo_epbr_get_option( 'mo_epbr_resource_groupname' ) ) ? wpWrapper::mo_epbr_get_option( 'mo_epbr_resource_groupname' ) : ''; |
| 80 | |
| 81 | ?> |
| 82 | <form id="mo_epbr_report_settings_form" action="" method="post" class="mo_epbr_ajax_submit_form" style="margin-right: 10px;"> |
| 83 | <?php wp_nonce_field( 'mo_epbr_report_settings' ); ?> |
| 84 | <input type="hidden" name="option" value="mo_epbr_report_settings"/> |
| 85 | <input type="hidden" name="mo_epbr_tab" value="settings_tab"> |
| 86 | <div class="mo-ms-tab-content-tile"> |
| 87 | <div class="mo-ms-tab-content-tile-content"> |
| 88 | <span style="font-size:18px;padding-top:10px;"><b>Settings For Embedded Resource</b></span> |
| 89 | <div class="mo-ms-settings-tab-content" style="padding-top:20px;padding-bottom:0px;"> |
| 90 | <ul class="form-fields" style="margin-bottom: 21px;"><li class="field check-round slide-inverse" style="float:left;margin-left: -5px;" > |
| 91 | <input type="checkbox" id="switch-filters-button" name="mo_epbr_add_filters_pane" |
| 92 | <?php |
| 93 | if ( get_option( 'mo_epbr_add_filters_pane' ) ) { |
| 94 | echo 'checked';} |
| 95 | ?> |
| 96 | style="margin-left: 70px;"/> |
| 97 | <label for="switch-filters-button" class="input_label">Filter Pane     <span style="margin-left: 65px;"></span></label> |
| 98 | </li></ul> |
| 99 | <span class="info_span" style="margin-left:10px;"> Enable the filter pane on the embedded resource </span> |
| 100 | </div> |
| 101 | <div class="mo-ms-settings-tab-content" style="padding-bottom: 25px;"> |
| 102 | <ul class="form-fields" style="margin-bottom: 21px;"><li class="field check-round slide-inverse" style="float:left;margin-left: -5px;" > |
| 103 | <input type="checkbox" id="switch-pagenav-button" name="mo_epbr_add_page_navigation" |
| 104 | <?php |
| 105 | if ( get_option( 'mo_epbr_add_page_navigation' ) ) { |
| 106 | echo 'checked';} |
| 107 | ?> |
| 108 | style="margin-left: 28px;"/> |
| 109 | <label for="switch-pagenav-button" class="input_label">Page Navigation     <span style="margin-left:25px;"></span></label> |
| 110 | </li></ul> |
| 111 | <span class="info_span" style="margin-left:10px;"> Enable the filter pane on the embedded resource </span> |
| 112 | </div> |
| 113 | <div class="mo-ms-settings-tab-content"> |
| 114 | <label for="languages" class="input_label">Language    </label> |
| 115 | <select id="languages" name="languages" style="padding-left:10px;margin-left:76px;width:44%;"> |
| 116 | <option disabled>Select your Language</option> |
| 117 | <?php |
| 118 | foreach ( $languagesarray as $key => $value ) { |
| 119 | $selected = ( wpWrapper::mo_epbr_get_option( 'mo_epbr_selected_language_for_embed' ) === $key ) ? ' selected' : ''; |
| 120 | echo '<option value="' . esc_attr( $key ) . '"' . esc_attr( $selected ) . '>' . esc_html( $value ) . '</option>'; |
| 121 | } |
| 122 | ?> |
| 123 | </select> |
| 124 | </div> |
| 125 | <div class="mo-ms-settings-tab-content"> |
| 126 | <label for="localelanguages" class="input_label">Format Locale    </label> |
| 127 | <select id="localelanguages" name="localelanguages" style="padding-left:10px;margin-left:47px;width:44%;"> |
| 128 | <option disabled>Select your Locale Language</option> |
| 129 | <?php |
| 130 | foreach ( $languagesarray as $key => $value ) { |
| 131 | $selected = ( wpWrapper::mo_epbr_get_option( 'mo_epbr_selected_locale_language_for_embed' ) === $key ) ? ' selected' : ''; |
| 132 | echo '<option value="' . esc_attr( $key ) . '"' . esc_attr( $selected ) . '>' . esc_html( $value ) . '</option>'; |
| 133 | } |
| 134 | ?> |
| 135 | </select> |
| 136 | </div> |
| 137 | <div class="mo-ms-settings-tab-content" style="padding-bottom: 0px;"> |
| 138 | <label for="embed_mobile_breakpoint" class="input_label">Mobile Breakpoint     <span></span></label> |
| 139 | <input id="embed_mobile_breakpoint" name="embed_mobile_breakpoint" style="margin-left:16px;width: 44%;" placeholder="Only Numeric Value" value="<?php echo esc_html( $mobile_breakpoint ); ?>" type="text" pattern="[1-9][0-9]*"/> |
| 140 | <p class="info_p"> Enter the mobile width display breakpoint in pixels(Numeric value only). Any width less than the entered amount will trigger the mobile report functionality. </p> |
| 141 | </div> |
| 142 | <div class="mo-ms-settings-tab-content" style="padding-bottom: 0px;"> |
| 143 | <label for="embed_mobile_height" class="input_label">Mobile Height     <span></span></label> |
| 144 | <input id="embed_mobile_height" name="embed_mobile_height" style="margin-left: 44px;width: 44%;" placeholder="" value="<?php echo esc_html( $mobile_height ); ?>" type="text" pattern="(([1-9][0-9]*(px|%|))|(auto)?)"/> |
| 145 | <p class="info_p"> Enter mobile height in pixels(px) or percentage (%) or type auto</p> |
| 146 | </div> |
| 147 | <div class="mo-ms-settings-tab-content" style="padding-bottom: 0px;"> |
| 148 | <label for="embed_mobile_width" class="input_label">Mobile Width     <span></span></label> |
| 149 | <input id="embed_mobile_width" name="embed_mobile_width" style="margin-left:49px;width: 44%;" placeholder="" value="<?php echo esc_html( $mobile_width ); ?>" type="text" pattern="([1-9][0-9]*(px|%|)"/> |
| 150 | <p class="info_p"> Enter mobile width in pixels(px) or percentage (%) </p> |
| 151 | </div> |
| 152 | <div class="mo-ms-settings-tab-content premium_feature_wrapper" style="padding-bottom: 0px;position:relative;"> |
| 153 | <label for="embed_pageName" class="input_label">Page Name     <span></span></label> |
| 154 | <input id="embed_pageName" name="embed_pageName" style="margin-left:65px;width:44%;" placeholder="Premium Feature" type="text" disabled/> |
| 155 | <img class="premium_crown" style="width:3%;position:relative;margin-bottom:-7px;margin-left: 4px;" src="<?php echo esc_url( plugin_dir_url( __FILE__ ) . '../images/crown.png' ); ?>" /> |
| 156 | <p class="nameid-prem-text">This feature is available in Premium version of the plugin. Please <a style="color:#ffd700;cursor:pointer;" href="<?php echo esc_url( pluginConstants::PRICING_LINK ); ?>" target="_blank">upgrade</a> to use the following functionality.</p> |
| 157 | <p class="info_p"> Enter page name if you specifically want to embed particular page. Example:ReportSectionf9df106e1f2181da5afc </p> |
| 158 | </div> |
| 159 | <div class="save_configs_report"> |
| 160 | <div style="margin:10px;"> |
| 161 | <input style="height:30px;float:left;" type="submit" id="saveButton" class="mo-ms-tab-content-button" value="Save"> |
| 162 | </div> |
| 163 | </div> |
| 164 | </div></div> |
| 165 | </form> |
| 166 | <?php |
| 167 | } |
| 168 | } |
| 169 |