Exemple #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');
 }
PBComponentData::set('notice', 'first_line_header_important_default', '6');
PBComponentData::set('notice', 'icon_path', get_template_directory() . '/media/image/public/icon_feature/small/');
PBComponentData::set('notice', 'icon_url', get_template_directory_uri() . '/media/image/public/icon_feature/small/');
PBComponentData::set('notice', 'icon_url_retina', get_template_directory_uri() . '/media/image/public/2x/icon_feature/small/');
/******************************************************************************/
PBComponentData::set('pricing_plan', 'bullet', array('url' => get_template_directory_uri() . '/media/image/public/icon_bullet/', 'url_retina' => get_template_directory_uri() . '/media/image/public/2x/icon_bullet/', 'path' => get_template_directory() . '/media/image/public/icon_bullet/'));
/******************************************************************************/
PBComponentData::set('recent_post', 'image_default', 'image-525-315');
PBComponentData::set('recent_post', 'image_hover_type_default', 'fade');
PBComponentData::set('recent_post', 'template_default', '2');
PBComponentData::set('recent_post', 'header_important_default', '5');
/******************************************************************************/
PBComponentData::set('social_icon', 'icon_path', get_template_directory() . '/media/image/public/icon_social/');
PBComponentData::set('social_icon', 'icon_url', get_template_directory_uri() . '/media/image/public/icon_social/');
PBComponentData::set('social_icon', 'icon_url_retina', get_template_directory_uri() . '/media/image/public/2x/icon_social/');
PBComponentData::set('social_icon', 'icon_type', 'gr');
/******************************************************************************/
PBComponentData::set('sitemap', 'bullet', array('url' => get_template_directory_uri() . '/media/image/public/icon_bullet/', 'url_retina' => get_template_directory_uri() . '/media/image/public/2x/icon_bullet/', 'path' => get_template_directory() . '/media/image/public/icon_bullet/'));
PBComponentData::set('sitemap', 'icon_type', 'gr');
/******************************************************************************/
PBComponentData::set('team', 'image_default', 'image-525-560');
PBComponentData::set('team', 'image_hover_type_default', 'fade');
PBComponentData::set('team', 'image_text_caption_header_tag', 'h6');
PBComponentData::set('team', 'social_icon_path', get_template_directory() . '/media/image/public/icon_social/');
PBComponentData::set('team', 'social_icon_url', get_template_directory_uri() . '/media/image/public/icon_social/');
PBComponentData::set('team', 'social_icon_url_retina', get_template_directory_uri() . '/media/image/public/2x/icon_social/');
/******************************************************************************/
PBComponentData::set('zaccordion', 'image_default', 'image-1050-770');
/******************************************************************************/
PBData::set('css_class', array(array('value' => 'pb-top-0', 'description' => 'Reset top margin'), array('value' => 'pb-bottom-0', 'description' => 'Reset top margin'), array('value' => 'pb-margin-top-0', 'description' => 'Set a 0px top margin'), array('value' => 'pb-margin-top-10', 'description' => 'Set a 10px top margin'), array('value' => 'pb-margin-top-20', 'description' => 'Set a 20px top margin'), array('value' => 'pb-margin-top-30', 'description' => 'Set a 30px top margin'), array('value' => 'pb-margin-top-40', 'description' => 'Set a 40px top margin'), array('value' => 'pb-margin-top-50', 'description' => 'Set a 50px top margin'), array('value' => 'pb-margin-top-60', 'description' => 'Set a 60px top margin'), array('value' => 'pb-margin-top-70', 'description' => 'Set a 70px top margin'), array('value' => 'pb-margin-top-80', 'description' => 'Set a 80px top margin'), array('value' => 'pb-margin-top-90', 'description' => 'Set a 90px top margin'), array('value' => 'pb-margin-top-100', 'description' => 'Set a 100px top margin'), array('value' => 'pb-margin-bottom-0', 'description' => 'Set a 0px bottom margin'), array('value' => 'pb-margin-bottom-10', 'description' => 'Set a 10px bottom margin'), array('value' => 'pb-margin-bottom-20', 'description' => 'Set a 20px bottom margin'), array('value' => 'pb-margin-bottom-30', 'description' => 'Set a 30px bottom margin'), array('value' => 'pb-margin-bottom-40', 'description' => 'Set a 40px bottom margin'), array('value' => 'pb-margin-bottom-50', 'description' => 'Set a 50px bottom margin'), array('value' => 'pb-margin-bottom-60', 'description' => 'Set a 60px bottom margin'), array('value' => 'pb-margin-bottom-70', 'description' => 'Set a 70px bottom margin'), array('value' => 'pb-margin-bottom-80', 'description' => 'Set a 80px bottom margin'), array('value' => 'pb-margin-bottom-90', 'description' => 'Set a 90px bottom margin'), array('value' => 'pb-margin-bottom-100', 'description' => 'Set a 100px bottom margin'), array('value' => 'pb-margin-left-0', 'description' => 'Set a 0px left margin'), array('value' => 'pb-margin-left-10', 'description' => 'Set a 10px left margin'), array('value' => 'pb-margin-left-20', 'description' => 'Set a 20px left margin'), array('value' => 'pb-margin-left-30', 'description' => 'Set a 30px left margin'), array('value' => 'pb-margin-left-40', 'description' => 'Set a 40px left margin'), array('value' => 'pb-margin-left-50', 'description' => 'Set a 50px left margin'), array('value' => 'pb-margin-left-60', 'description' => 'Set a 60px left margin'), array('value' => 'pb-margin-left-70', 'description' => 'Set a 70px left margin'), array('value' => 'pb-margin-left-80', 'description' => 'Set a 80px left margin'), array('value' => 'pb-margin-left-90', 'description' => 'Set a 90px left margin'), array('value' => 'pb-margin-left-100', 'description' => 'Set a 100px left margin'), array('value' => 'pb-margin-right-0', 'description' => 'Set a 0px right margin'), array('value' => 'pb-margin-right-10', 'description' => 'Set a 10px right margin'), array('value' => 'pb-margin-right-20', 'description' => 'Set a 20px right margin'), array('value' => 'pb-margin-right-30', 'description' => 'Set a 30px right margin'), array('value' => 'pb-margin-right-40', 'description' => 'Set a 40px right margin'), array('value' => 'pb-margin-right-50', 'description' => 'Set a 50px right margin'), array('value' => 'pb-margin-right-60', 'description' => 'Set a 60px right margin'), array('value' => 'pb-margin-right-70', 'description' => 'Set a 70px right margin'), array('value' => 'pb-margin-right-80', 'description' => 'Set a 80px right margin'), array('value' => 'pb-margin-right-90', 'description' => 'Set a 90px right margin'), array('value' => 'pb-margin-right-100', 'description' => 'Set a 100px right margin'), array('value' => 'pb-position-absolute', 'description' => 'Set element absolute'), array('value' => 'pb-position-relative', 'description' => 'Set element relative'), array('value' => 'pb-float-left', 'description' => 'Add left float'), array('value' => 'pb-float-right', 'description' => 'Add right float'), array('value' => 'theme-section-padding-top', 'description' => 'Add default (80px) top padding to the layout'), array('value' => 'theme-section-padding-bottom', 'description' => 'Add default (80px) bottom padding to the layout'), array('value' => 'theme-section-white', 'description' => 'Create selected component in white version')));
/******************************************************************************/
 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>				
				';
            }
        }
    }