示例#1
0
 static function createOption($refresh = false)
 {
     $option = PBData::get(PLUGIN_PAGE_BUILDER_OPTION);
     if ($option === false || $refresh) {
         $option = (array) get_option(PLUGIN_PAGE_BUILDER_OPTION);
         PBData::set(PLUGIN_PAGE_BUILDER_OPTION, $option, $refresh);
     } else {
         $option = PBData::get(PLUGIN_PAGE_BUILDER_OPTION);
     }
     return $option;
 }
 function createCSS($code = null, $retina = false)
 {
     $CSS = new PBCSS();
     $key = $retina ? 'icon_url_retina' : 'icon_url';
     $codeCurrent = null;
     foreach ($this->social as $index => $value) {
         $codeCurrent .= $CSS->create(array('selector' => array('ul.pb-social-icon>li>a.pb-social-icon-' . $index), 'property' => array('background-image' => PBComponentData::get($this->getComponentId(), $key) . $value[1])));
     }
     if ($retina) {
         $codeCurrent = $CSS->getRetinaMediaQuery($codeCurrent);
     }
     $code .= $codeCurrent;
     if (PBData::get('retina_ready') == 1 && !$retina) {
         $this->createCSS($code, true);
         return;
     }
     PBComponentData::set($this->getComponentId(), 'css', $code);
 }
 function createCSS($code = null, $retina = false)
 {
     $CSS = new PBCSS();
     $url = $retina ? $this->icon_url_retina : $this->icon_url;
     $codeCurrent = null;
     foreach ($this->icon_file as $value) {
         $codeCurrent .= $CSS->create(array('selector' => array('.pb-button>a>span.pb-button-box>span.pb-button-icon.pb-button-icon-' . PBHelper::createHash($value)), 'property' => array('background-image' => $url . $value)));
     }
     if ($retina) {
         $codeCurrent = $CSS->getRetinaMediaQuery($codeCurrent);
     }
     $code .= $codeCurrent;
     if (PBData::get('retina_ready') == 1 && !$retina) {
         $this->createCSS($code, true);
         return;
     }
     PBComponentData::set($this->getComponentId(), 'css', $code);
 }
 function createCSS($code = null, $retina = false)
 {
     $CSS = new PBCSS();
     $key = $retina ? 'url_retina' : 'url';
     $codeCurrent = null;
     foreach ((array) $this->bullet['file'] as $file) {
         $codeCurrent .= $CSS->create(array('selector' => array('.pb-pricing-plan .pb-pricing-plan-item-feature-list.pb-pricing-plan-item-feature-list-' . PBHelper::createHash($file) . ' ul li'), 'property' => array('background-image' => $this->bullet[$key] . $file)));
     }
     if ($retina) {
         $codeCurrent = $CSS->getRetinaMediaQuery($codeCurrent);
     }
     $code .= $codeCurrent;
     if (PBData::get('retina_ready') == 1 && !$retina) {
         $this->createCSS($code, true);
         return;
     }
     PBComponentData::set($this->getComponentId(), 'css', $code);
 }
 function createCSS($code = null, $retina = false)
 {
     $CSS = new PBCSS();
     $key = $retina ? 'url_retina' : 'url';
     $codeCurrent = null;
     foreach ($this->icon as $iconSize => $iconFile) {
         foreach ($iconFile['file'] as $iconName) {
             $codeCurrent .= $CSS->create(array('selector' => array('.pb-box.pb-box-icon.pb-box-icon-size-' . $iconSize . '.pb-box-icon-' . PBHelper::createHash($iconName) . '>.pb-box-inner'), 'property' => array('background-image' => $this->icon[$iconSize][$key] . $iconName)));
         }
     }
     if ($retina) {
         $codeCurrent = $CSS->getRetinaMediaQuery($codeCurrent);
     }
     $code .= $codeCurrent;
     if (PBData::get('retina_ready') == 1 && !$retina) {
         $this->createCSS($code, true);
         return;
     }
     PBComponentData::set($this->getComponentId(), 'css', $code);
 }
 function createCSS($code = null, $retina = false)
 {
     if (PBComponentData::get($this->getComponentId(), 'icon_type') !== 'gr') {
         return;
     }
     $CSS = new PBCSS();
     $key = $retina ? 'url_retina' : 'url';
     $codeCurrent = null;
     foreach ($this->bullet['file'] as $file) {
         $codeCurrent .= $CSS->create(array('selector' => array($this->bullet['css_class'] . ' div.pb-list.pb-list-icon-name-' . PBHelper::createHash($file) . ' ul li'), 'property' => array('background-image' => $this->bullet[$key] . $file)));
     }
     if ($retina) {
         $codeCurrent = $CSS->getRetinaMediaQuery($codeCurrent);
     }
     $code .= $codeCurrent;
     if (PBData::get('retina_ready') == 1 && !$retina) {
         $this->createCSS($code, true);
         return;
     }
     PBComponentData::set($this->getComponentId(), 'css', $code);
 }
 function isVisualModeEnable()
 {
     return (bool) PBData::get('visual_mode');
 }
 function __construct()
 {
     $this->responsiveMode = PBData::get('responsive_mode');
 }
    function adminNotice()
    {
        $file = array(PBData::get('theme_path_multiste_site_style') . 'PB.Frontend.css');
        foreach ($file as $path) {
            if (!is_writable($path)) {
                echo '
					<div class="error">
						<p>' . sprintf(__('<b>File %s cannot be created. Please make sure that this location is writable.</b>', PLUGIN_PAGE_BUILDER_DOMAIN), str_replace('\\', '/', $path)) . '</p>
					</div>				
				';
            }
        }
    }