/**
  * Initialize the slider renderer by retrieving the id and settings from the passed data.
  * 
  * @since 4.0.0
  *
  * @param array $data The data of the slider.
  */
 public function __construct($data)
 {
     $this->data = $data;
     $this->id = $this->data['id'];
     $this->settings = $this->data['settings'];
     $this->default_settings = BQW_SliderPro_Settings::getSettings();
 }
 /**
  * Return an instance of the renderer class based on the type of the slide.
  *
  * @since 4.0.0
  * 
  * @param  array  $data The data of the slide.
  * @return object       An instance of the appropriate renderer class.
  */
 public static function create_slide($data)
 {
     if (is_null(self::$default_type)) {
         $default_settings = BQW_SliderPro_Settings::getSlideSettings();
         self::$default_type = $default_settings['content_type']['default_value'];
     }
     $type = isset($data['settings']['content_type']) ? $data['settings']['content_type'] : self::$default_type;
     foreach (self::$registered_types as $registered_type_name => $registered_type_class) {
         if ($type === $registered_type_name) {
             return new $registered_type_class();
         }
     }
 }
 /**
  * Return the plugin settings.
  *
  * @since 4.0.0
  * 
  * @return array The array of plugin settings.
  */
 public static function getPluginSettings()
 {
     if (empty(self::$plugin_settings)) {
         self::$plugin_settings = array('load_stylesheets' => array('label' => __('Load stylesheets', 'sliderpro'), 'default_value' => 'automatically', 'available_values' => array('automatically' => __('Automatically', 'sliderpro'), 'homepage' => __('On homepage', 'sliderpro'), 'all' => __('On all pages', 'sliderpro')), 'description' => __('The plugin can detect the presence of the slider in a post, page or widget, and will automatically load the necessary stylesheets. However, when the slider is loaded in PHP code, like in the theme\'s header or another template file, you need to manually specify where the stylesheets should load. If you load the slider only on the homepage, select <i>On homepage</i>, or if you load it in the header or another section that is visible on multiple pages, select <i>On all pages</i>.', 'sliderpro')), 'load_custom_css_js' => array('label' => __('Load custom CSS and JavaScript', 'sliderpro'), 'default_value' => 'inline', 'available_values' => array('inline' => __('Inline', 'sliderpro'), 'in_files' => __('In files', 'sliderpro')), 'description' => __('By default, custom CSS and JavaScript code added to the slider will be loaded inline. However, if you want to add large amounts of custom CSS or JavaScript, it\'s better to have the code loaded in files, rather than inline. If you chose to load the custom code in files, after selecting this option, you need to re-save the custom CSS and/or JavaScript and the plugin will automatically create the <i>sliderpro-custom</i> folder inside <i>wp-plugins</i> and then <i>custom.css</i> and <i>custom.js</i> inside <i>sliderpro-custom</i>. You might also be prompted to provide credentials if the files can\'t be created due to folder permission issues.', 'sliderpro')), 'load_js_in_all_pages' => array('label' => __('Load JS files on all pages', 'sliderpro'), 'default_value' => false, 'description' => __('By enabling this option, the slider\'s JavaScript files will be loaded on all pages. This is necessary in sites that use AJAX for navigation between pages.', 'sliderpro')), 'load_unminified_scripts' => array('label' => __('Load unminified scripts', 'sliderpro'), 'default_value' => false, 'description' => __('Check this option if you want to load the unminified/uncompressed CSS and JavaScript files for the slider. This is useful for debugging purposes.', 'sliderpro')), 'cache_expiry_interval' => array('label' => __('Cache expiry interval', 'sliderpro'), 'default_value' => 24, 'description' => __('Indicates the time interval after which a slider\'s cache will expire. If the cache of a slider has expired, the slider will be rendered again and cached the next time it is viewed.', 'sliderpro')), 'hide_inline_info' => array('label' => __('Hide inline info', 'sliderpro'), 'default_value' => false, 'description' => __('Indicates whether the inline information will be displayed in admin slides and wherever it\'s available.', 'sliderpro')), 'hide_getting_started_info' => array('label' => __('Hide <i>Getting Started</i> info', 'sliderpro'), 'default_value' => false, 'description' => __('Indicates whether the <i>Getting Started</i> information will be displayed in the <i>All Sliders</i> page, above the list of sliders. This setting will be disabled if the <i>Close</i> button is clicked in the information box.', 'sliderpro')), 'access' => array('label' => __('Access', 'sliderpro'), 'default_value' => 'manage_options', 'available_values' => array('manage_options' => __('Administrator', 'sliderpro'), 'publish_pages' => __('Editor', 'sliderpro '), 'publish_posts' => __('Author', 'sliderpro'), 'edit_posts' => __('Contributor', 'sliderpro')), 'description' => __('Sets what category of users will have access to the plugin\'s admin area.', 'sliderpro')));
     }
     return self::$plugin_settings;
 }
 /**
  * Return the HTML markup of the slider.
  *
  * Also, retrieves the JavaScript output of the slider and CSS and JavaScript files that need to be loaded.
  *
  * @since 4.0.0
  * 
  * @param  array   $slider_data An array containing the slider's data.
  * @param  boolean $allow_cache    Indicates whether or not the output will be cached.
  * @return string                  The HTML code that needs to be printed for the slider.
  */
 public function output_slider($slider_data, $allow_cache = true)
 {
     $slider_data = apply_filters('sliderpro_data', $slider_data, $slider_data['id']);
     $slider = new BQW_SP_Slider_Renderer($slider_data);
     $html_output = $slider->render();
     $js_output = $slider->render_js();
     $this->js_output .= $js_output;
     $css_dependencies = $slider->get_css_dependencies();
     $js_dependencies = $slider->get_js_dependencies();
     foreach ($css_dependencies as $css_dependency) {
         wp_enqueue_style($this->plugin_slug . '-' . $css_dependency . '-style');
     }
     foreach ($js_dependencies as $js_dependency) {
         $this->add_script_to_load($this->plugin_slug . '-' . $js_dependency . '-script');
     }
     if ($allow_cache === true) {
         $slider_cache = array('html_output' => $html_output, 'js_output' => $js_output, 'css_dependencies' => $css_dependencies, 'js_dependencies' => $js_dependencies);
         $plugin_settings = BQW_SliderPro_Settings::getPluginSettings();
         $cache_time = 60 * 60 * floatval(get_option('sliderpro_cache_expiry_interval', $plugin_settings['cache_expiry_interval']['default_value']));
         set_transient('sliderpro_cache_' . $slider_data['id'], $slider_cache, $cache_time);
     }
     return $html_output;
 }
 /**
  * Return the HTML markup for the breakpoint setting.
  *
  * Generates a unique number that will be attributed to
  * the label and to the input/select field.
  *
  * @since 4.0.0
  * 
  * @param  string $name  The name of the setting.
  * @param  mixed  $value The value of the setting. If false, the default setting value will be assigned.
  * @return string        The HTML markup for the setting.
  */
 public function create_breakpoint_setting($name, $value)
 {
     $setting = BQW_SliderPro_Settings::getSettings($name);
     $setting_value = $value !== false ? $value : $setting['default_value'];
     $setting_html = '';
     $uid = mt_rand();
     if ($setting['type'] === 'number' || $setting['type'] === 'mixed') {
         $setting_html = '
         	<tr>
         		<td>
         			<label data-info="' . $setting['description'] . '" for="breakpoint-' . $name . '-' . $uid . '">' . $setting['label'] . '</label>
         		</td>
         		<td class="setting-cell">
         			<input id="breakpoint-' . $name . '-' . $uid . '" class="breakpoint-setting" type="text" name="' . $name . '" value="' . esc_attr($setting_value) . '" />
         			<span class="remove-breakpoint-setting"></span>
         		</td>
         	</tr>';
     } else {
         if ($setting['type'] === 'boolean') {
             $setting_html = '
         	<tr>
         		<td>
         			<label data-info="' . $setting['description'] . '" for="breakpoint-' . $name . '-' . $uid . '">' . $setting['label'] . '</label>
         		</td>
         		<td class="setting-cell">
         			<input id="breakpoint-' . $name . '-' . $uid . '" class="breakpoint-setting" type="checkbox" name="' . $name . '"' . ($setting_value === true ? ' checked="checked"' : '') . ' />
         			<span class="remove-breakpoint-setting"></span>
         		</td>
         	</tr>';
         } else {
             if ($setting['type'] === 'select') {
                 $setting_html = '
         	<tr>
         		<td>
         			<label data-info="' . $setting['description'] . '" for="breakpoint-' . $name . '-' . $uid . '">' . $setting['label'] . '</label>
         		</td>
         		<td class="setting-cell">
         			<select id="breakpoint-' . $name . '-' . $uid . '" class="breakpoint-setting" name="' . $name . '">';
                 foreach ($setting['available_values'] as $value_name => $value_label) {
                     $setting_html .= '<option value="' . $value_name . '"' . ($setting_value == $value_name ? ' selected="selected"' : '') . '>' . $value_label . '</option>';
                 }
                 $setting_html .= '
         			</select>
         			<span class="remove-breakpoint-setting"></span>
         		</td>
         	</tr>';
             }
         }
     }
     return $setting_html;
 }
	
		<tbody class="breakpoint-settings">
			<?php 
if (isset($breakpoint_settings) && !empty($breakpoint_settings)) {
    foreach ($breakpoint_settings as $setting_name => $setting_value) {
        if ($setting_name !== 'breakpoint_width') {
            echo $this->create_breakpoint_setting($setting_name, $setting_value);
        }
    }
}
?>
		</tbody>
	</table>
	<div class="add-breakpoint-setting-group">
        <a class="button add-breakpoint-setting" href="#"><?php 
_e('Add Setting', 'sliderpro');
?>
 <span class="add-breakpoint-setting-arrow">&#9660</span></a>
        <ul class="breakpoint-setting-name">
        	<?php 
$default_breakpoint_settings = BQW_SliderPro_Settings::getBreakpointSettings();
foreach ($default_breakpoint_settings as $setting_name) {
    if ($setting_name !== 'breakpoint_width') {
        $setting = BQW_SliderPro_Settings::getSettings($setting_name);
        echo '<li><a href="#" data-type="' . $setting_name . '">' . $setting['label'] . '</a></li>';
    }
}
?>
        </ul>
    </div>
</div>
 /**
  * Initialize the layer renderer.
  * 
  * @since 4.0.0
  */
 public function __construct()
 {
     $this->default_settings = BQW_SliderPro_Settings::getLayerSettings();
 }
 /**
  * Initialize the renderer.
  *
  * @since 4.0.0
  */
 public function __construct()
 {
     parent::__construct();
     $this->default_settings = BQW_SliderPro_Settings::getSlideSettings();
 }
 /**
  * Initialize the slider renderer by retrieving the id and settings from the passed data.
  * 
  * @since 4.0.0
  *
  * @param array $data The data of the slider.
  */
 public function __construct($data)
 {
     $this->data = $data;
     $this->id = $this->data['id'];
     $this->name = $this->data['name'];
     $this->settings = $this->data['settings'];
     $this->default_settings = BQW_SliderPro_Settings::getSettings();
     $this->idAttribute = isset($this->settings['use_name_as_id']) && $this->settings['use_name_as_id'] === true ? str_replace(' ', '-', strtolower($this->name)) : 'slider-pro-' . $this->id;
 }