Exemplo n.º 1
0
 /**
  * Load public styles
  */
 public function onPublicStyles()
 {
     if (!$this->canDisplayBackground()) {
         return;
     }
     $style = '';
     // Extract filtered options
     extract($this->getFilteredOptions());
     list($css_url, $version, $debug) = $this->getResourceUrl('css');
     // Default CSS for the public side
     wp_enqueue_style($this->getName() . '-pub', $css_url . 'pub' . $debug . '.css', false, $version);
     // qTip2 style, if required
     if ($info_tab && $info_tab_desc) {
         wp_enqueue_style('jquery.qtip', $css_url . 'vendor/jquery.qtip.min.css', false, $version);
     }
     // The image for the overlay, as CSS embedded data
     if ($active_overlay && ($data = Helpers::embedDataUri($active_overlay, 'image/png', defined('WP_DEBUG') && WP_DEBUG)) != false) {
         $opacity_style = '';
         if ($overlay_opacity < 100) {
             $opacity_style = sprintf('-moz-opacity:.%s; filter:alpha(opacity=%1$s); opacity:.%1$s', str_pad($overlay_opacity, 2, '0', STR_PAD_LEFT));
         }
         $style .= sprintf('#myatu_bgm_overlay{background:url(\'%s\') repeat fixed top left transparent; %s}', $data, $opacity_style);
     }
     // The info icon
     if ($info_tab) {
         $style .= sprintf('#myatu_bgm_info_tab{%s}', $this->getCornerStyle($info_tab_location, 5, 5));
     }
     // The "Pin It" button
     if ($pin_it_btn) {
         // Horizontal spacer depends whether the info tab is shown as well
         $hspacer = $info_tab && $info_tab_location == $pin_it_btn_location ? 35 : 10;
         $style .= sprintf('#myatu_bgm_pin_it_btn{%s}', $this->getCornerStyle($pin_it_btn_location, $hspacer, 5));
     }
     if ($style) {
         printf('<style type="text/css" media="screen">%s</style>' . PHP_EOL, $style);
     }
 }