static function includeFileFromDir($path)
 {
     $file = PBFile::scanDir($path);
     if ($file === false) {
         return false;
     }
     foreach ($file as $value) {
         self::includeFile($path . $value);
     }
     return true;
 }
예제 #2
0
 static function setFile($componentId, $name, $path)
 {
     global $pb_data;
     PBComponentData::prepare($componentId);
     if (array_key_exists($name, $pb_data['component'][$componentId])) {
         return $pb_data['component'][$componentId][$name];
     }
     $pb_data['component'][$componentId][$name] = array();
     $file = PBFile::scanDir($path);
     if (is_array($file)) {
         foreach ($file as $value) {
             $pb_data['component'][$componentId][$name][$value] = $value;
         }
     }
     return $pb_data['component'][$componentId][$name];
 }
 function __construct()
 {
     $this->bullet = array();
     $this->bullet['file'] = array();
     $bullet = (array) PBComponentData::get($this->getComponentId(), 'bullet');
     $this->bullet['url'] = $bullet['url'];
     $this->bullet['url_retina'] = $bullet['url_retina'];
     $this->bullet['path'] = $bullet['path'];
     $this->bullet['css_class'] = $bullet['css_class'];
     $file = PBFile::scanDir($bullet['path']);
     if (is_array($file)) {
         $this->bullet['file'] = array_combine($file, $file);
     }
     $this->style = array('list' => array('use' => 2, 'path' => $this->getStyleURL(), 'file' => 'style.css'));
     $this->component = array('name' => __('List', PLUGIN_PAGE_BUILDER_DOMAIN), 'description' => __('Displays list', PLUGIN_PAGE_BUILDER_DOMAIN), 'structure' => array('window' => array('title' => __('List', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array(array('id' => 'bullet', 'ui' => array('text' => array('header' => __('Bullet', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('Select bullet of the list element', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'select-one', 'dictionary' => array('source' => $this->bullet['file'])))), array('id' => 'list', 'ui' => array('text' => array('header' => __('List', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('Content of the list', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'editor')), 'visibility' => 1, 'shortcode' => array('path' => '@content')), array('id' => 'css_class', 'ui' => array('text' => array('header' => __('CSS class', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('List of CSS classes defined in CSS files separated by space.', PLUGIN_PAGE_BUILDER_DOMAIN)))))));
     parent::__construct();
 }
 function __construct()
 {
     $Post = new PBPost();
     $this->style = array('sitemap' => array('use' => 2, 'path' => $this->getStyleURL(), 'file' => 'style.css'));
     $bullet = (array) PBComponentData::get($this->getComponentId(), 'bullet');
     $this->bullet = array();
     $this->bullet['url'] = $bullet['url'];
     $this->bullet['url_retina'] = $bullet['url_retina'];
     $this->bullet['path'] = $bullet['path'];
     $file = PBFile::scanDir($bullet['path']);
     $this->bullet['file'] = array();
     if (is_array($file)) {
         $this->bullet['file'] = array_combine($file, $file);
     }
     /***/
     $this->component = array('name' => __('Sitemap', PLUGIN_PAGE_BUILDER_DOMAIN), 'description' => __('Displays Sitemap', PLUGIN_PAGE_BUILDER_DOMAIN), 'structure' => array('window' => array('title' => __('Sitemap', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array(array('id' => 'bullet', 'ui' => array('text' => array('header' => __('List bullet', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'select-one', 'dictionary' => array('source' => $this->bullet['file'], 'use_default' => false)))), array('id' => 'post_type', 'ui' => array('text' => array('header' => __('Post type', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('Select types of posts which have to be displayed.', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'checkbox', 'dictionary' => array('source' => PBHelper::extractDictionary($Post->postType)))), 'shortcode' => array('default' => '')), array('id' => 'post_status', 'ui' => array('text' => array('header' => __('Post status', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('Select types of post statuses which have to be displayed.', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'checkbox', 'dictionary' => array('source' => PBHelper::extractDictionary($Post->postStatus)))), 'shortcode' => array('default' => '')), array('id' => 'post__in', 'ui' => array('text' => array('header' => __('Include', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('Define a comma-separated list of page ID\'s to be included to the list', PLUGIN_PAGE_BUILDER_DOMAIN))), 'shortcode' => array('default' => '')), array('id' => 'post__not_in', 'ui' => array('text' => array('header' => __('Exclude', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('Define a comma-separated list of page ID\'s to be excluded from the list.', PLUGIN_PAGE_BUILDER_DOMAIN))), 'shortcode' => array('default' => '')), array('id' => 'posts_per_page', 'ui' => array('text' => array('header' => __('Limit number of posts', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('Number of posts to show. Leave this field empty to show all posts.', PLUGIN_PAGE_BUILDER_DOMAIN))), 'shortcode' => array('default' => '-2')), array('id' => 'orderby', 'ui' => array('text' => array('header' => __('Sort column', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'radio', 'dictionary' => array('source' => PBHelper::extractDictionary($Post->sortColumn)))), 'shortcode' => array('default' => 'date')), array('id' => 'order', 'ui' => array('text' => array('header' => __('Sort order', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'radio', 'dictionary' => array('source' => array('asc' => __('Ascending', PLUGIN_PAGE_BUILDER_DOMAIN), 'desc' => __('Descending', PLUGIN_PAGE_BUILDER_DOMAIN))))), 'shortcode' => array('default' => 'asc')), array('id' => 'css_class', 'ui' => array('text' => array('header' => __('CSS class', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('List of CSS classes defined in CSS files separated by space.', PLUGIN_PAGE_BUILDER_DOMAIN)))))));
     parent::__construct();
 }
 function __construct()
 {
     $this->style = array('list' => array('use' => 2, 'path' => $this->getStyleURL(), 'file' => 'style.css'));
     $this->script = array('list' => array('use' => 2, 'path' => $this->getScriptURL(), 'file' => 'PB.List.js'));
     $element = array();
     if (PBComponentData::get($this->getComponentId(), 'icon_type') === 'gr') {
         $bullet = (array) PBComponentData::get($this->getComponentId(), 'bullet');
         $file = PBFile::scanDir($bullet['path']);
         $this->bullet = array('url' => $bullet['url'], 'url_retina' => $bullet['url_retina'], 'path' => $bullet['path'], 'file' => array_combine($file, $file), 'css_class' => $bullet['css_class']);
         $element = array(array('id' => 'bullet', 'ui' => array('panel' => 2, 'text' => array('header' => __('Bullet', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('Select bullet of the list element', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'select-one', 'dictionary' => array('source' => $this->bullet['file'])))));
     } else {
         $element = array(array('id' => 'font_icon_name', 'ui' => array('panel' => 2, 'text' => array('header' => __('Icon', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('Enter name of the icon (you have to enter at least two characters to get best matched set of icons).', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'fa-icon')), 'shortcode' => array('default' => 'check-square')), array('id' => 'font_icon_color', 'ui' => array('panel' => 2, 'text' => array('header' => __('Icon color', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('Icon color in HEX', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'color-picker'))), array('id' => 'font_icon_size', 'ui' => array('panel' => 2, 'text' => array('header' => __('Icon size', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('Icon size in pixels. Value 0 means that default size will be used.', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'slider', 'value' => 0, 'option' => array('min' => 0, 'max' => 200)))));
     }
     $this->component = array('name' => __('List', PLUGIN_PAGE_BUILDER_DOMAIN), 'description' => __('Displays list', PLUGIN_PAGE_BUILDER_DOMAIN), 'structure' => array('window' => array('title' => __('List', PLUGIN_PAGE_BUILDER_DOMAIN)), 'ui' => array('panel' => array(1 => array('header' => __('General', PLUGIN_PAGE_BUILDER_DOMAIN)), 2 => array('header' => __('Styles', PLUGIN_PAGE_BUILDER_DOMAIN)))), 'element' => array(array('id' => 'list', 'ui' => array('panel' => 1, 'text' => array('header' => __('List', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('Content of the list', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'editor')), 'shortcode' => array('path' => '@content')), array('id' => 'css_class', 'ui' => array('panel' => 1, 'text' => array('header' => __('CSS class', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('List of CSS classes defined in CSS files separated by space.', PLUGIN_PAGE_BUILDER_DOMAIN)))))));
     foreach ($element as $elementValue) {
         $this->component['structure']['element'][] = $elementValue;
     }
     parent::__construct();
 }
 function __construct()
 {
     $Post = new PBPost();
     $this->style = array('sitemap' => array('use' => 2, 'path' => $this->getStyleURL(), 'file' => 'style.css'));
     /***/
     $element = array();
     if (PBComponentData::get($this->getComponentId(), 'icon_type') === 'gr') {
         $bullet = (array) PBComponentData::get($this->getComponentId(), 'bullet');
         $file = PBFile::scanDir($bullet['path']);
         $this->bullet = array('url' => $bullet['url'], 'url_retina' => $bullet['url_retina'], 'path' => $bullet['path'], 'file' => array_combine($file, $file));
         $element = array(array('id' => 'bullet', 'ui' => array('panel' => 3, 'text' => array('header' => __('List bullet', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'select-one', 'dictionary' => array('source' => $this->bullet['file'], 'use_default' => false)))));
     } else {
         $element = array(array('id' => 'font_icon_name', 'ui' => array('panel' => 3, 'text' => array('header' => __('Icon', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('Enter name of the icon (you have to enter at least two characters to get best matched set of icons).', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'fa-icon')), 'shortcode' => array('default' => 'check-square')), array('id' => 'font_icon_color', 'ui' => array('panel' => 3, 'text' => array('header' => __('Icon color', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('Icon color in HEX', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'color-picker'))), array('id' => 'font_icon_size', 'ui' => array('panel' => 3, 'text' => array('header' => __('Icon size', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('Icon size in pixels. Value 0 means that default size for will be used.', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'slider', 'value' => 0, 'option' => array('min' => 0, 'max' => 200)))));
     }
     /***/
     $this->component = array('name' => __('Sitemap', PLUGIN_PAGE_BUILDER_DOMAIN), 'description' => __('Displays Sitemap', PLUGIN_PAGE_BUILDER_DOMAIN), 'structure' => array('window' => array('title' => __('Sitemap', PLUGIN_PAGE_BUILDER_DOMAIN)), 'ui' => array('panel' => array(1 => array('header' => __('General', PLUGIN_PAGE_BUILDER_DOMAIN)), 2 => array('header' => __('Data source', PLUGIN_PAGE_BUILDER_DOMAIN)), 3 => array('header' => __('Styles', PLUGIN_PAGE_BUILDER_DOMAIN)))), 'element' => array(array('id' => 'css_class', 'ui' => array('panel' => 1, 'text' => array('header' => __('CSS class', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('List of CSS classes defined in CSS files separated by space.', PLUGIN_PAGE_BUILDER_DOMAIN)))), array('id' => 'post_type', 'ui' => array('panel' => 2, 'text' => array('header' => __('Post type', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('Select types of posts which have to be displayed.', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'checkbox', 'dictionary' => array('source' => PBHelper::extractDictionary($Post->postType)))), 'shortcode' => array('default' => '')), array('id' => 'post_status', 'ui' => array('panel' => 2, 'text' => array('header' => __('Post status', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('Select types of post statuses which have to be displayed.', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'checkbox', 'dictionary' => array('source' => PBHelper::extractDictionary($Post->postStatus)))), 'shortcode' => array('default' => '')), array('id' => 'post__in', 'ui' => array('panel' => 2, 'text' => array('header' => __('Include', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('Define a comma-separated list of page ID\'s to be included to the list', PLUGIN_PAGE_BUILDER_DOMAIN))), 'shortcode' => array('default' => '')), array('id' => 'post__not_in', 'ui' => array('panel' => 2, 'text' => array('header' => __('Exclude', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('Define a comma-separated list of page ID\'s to be excluded from the list.', PLUGIN_PAGE_BUILDER_DOMAIN))), 'shortcode' => array('default' => '')), array('id' => 'posts_per_page', 'ui' => array('panel' => 2, 'text' => array('header' => __('Limit number of posts', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('Number of posts to show. Leave this field empty to show all posts.', PLUGIN_PAGE_BUILDER_DOMAIN))), 'shortcode' => array('default' => '-2')), array('id' => 'orderby', 'ui' => array('panel' => 2, 'text' => array('header' => __('Sort column', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'radio', 'dictionary' => array('source' => PBHelper::extractDictionary($Post->sortColumn)))), 'shortcode' => array('default' => 'date')), array('id' => 'order', 'ui' => array('panel' => 2, 'text' => array('header' => __('Sort order', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'radio', 'dictionary' => array('source' => array('asc' => __('Ascending', PLUGIN_PAGE_BUILDER_DOMAIN), 'desc' => __('Descending', PLUGIN_PAGE_BUILDER_DOMAIN))))), 'shortcode' => array('default' => 'asc')))));
     foreach ($element as $elementValue) {
         $this->component['structure']['element'][] = $elementValue;
     }
     parent::__construct();
 }
 function __construct()
 {
     $Background = new PBBackground();
     $bullet = (array) PBComponentData::get($this->getComponentId(), 'bullet');
     $this->bullet = array();
     $this->bullet['url'] = $bullet['url'];
     $this->bullet['url_retina'] = $bullet['url_retina'];
     $this->bullet['path'] = $bullet['path'];
     $file = PBFile::scanDir($bullet['path']);
     $this->bullet['file'] = array();
     if (is_array($file)) {
         $this->bullet['file'] = array_combine($file, $file);
     }
     $Layout = new PBLayout();
     $this->currentIndex = 0;
     $this->currentLayout = null;
     $this->style = array('pricing-plan' => array('use' => 2, 'path' => $this->getStyleURL(), 'file' => 'style.css'));
     $this->script = array('pricing-plan' => array('use' => 2, 'path' => $this->getScriptURL(), 'file' => 'PB.PricingPlan.js'));
     $this->type = array('1' => array(__('Type 1', PLUGIN_PAGE_BUILDER_DOMAIN)), '2' => array(__('Type 2', PLUGIN_PAGE_BUILDER_DOMAIN)));
     $this->layout = $Layout->getMainLayout();
     $this->component = array('name' => __('Pricing Plan', PLUGIN_PAGE_BUILDER_DOMAIN), 'description' => __('Displays Pricing Plan', PLUGIN_PAGE_BUILDER_DOMAIN), 'structure' => array('window' => array('title' => __('Pricing Plan', PLUGIN_PAGE_BUILDER_DOMAIN)), 'ui' => array('panel' => array(1 => array('header' => __('General', PLUGIN_PAGE_BUILDER_DOMAIN)), 2 => array('header' => __('Plans', PLUGIN_PAGE_BUILDER_DOMAIN))), 'multi' => array(1 => array('header' => __('Content of the plan', PLUGIN_PAGE_BUILDER_DOMAIN)))), 'element' => array(array('id' => 'layout', 'ui' => array('panel' => 1, 'text' => array('header' => __('Layout', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('Select layout of the pricing plan.', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'select-one', 'dictionary' => array('source' => PBHelper::extractDictionary($this->layout, 'name')))), 'shortcode' => array('default' => '50x50')), array('id' => 'type', 'ui' => array('panel' => 1, 'text' => array('header' => __('Type', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('Select one from the available types.', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'radio', 'dictionary' => array('source' => PBHelper::extractDictionary($this->type)))), 'shortcode' => array('default' => '1')), array('id' => 'css_class', 'ui' => array('panel' => 1, 'text' => array('header' => __('CSS class', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('List of CSS classes defined in CSS files separated by space.', PLUGIN_PAGE_BUILDER_DOMAIN)))), array('id' => 'item_header', 'ui' => array('panel' => 2, 'multi' => 1, 'text' => array('header' => __('Header', PLUGIN_PAGE_BUILDER_DOMAIN))), 'shortcode' => array('path' => '*item/item_header/@content')), array('id' => 'item_description', 'ui' => array('panel' => 2, 'multi' => 1, 'text' => array('header' => __('Description', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'textarea')), 'shortcode' => array('path' => '*item/item_description/@content')), array('id' => 'item_feature', 'ui' => array('panel' => 2, 'multi' => 1, 'text' => array('header' => __('Feature list', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('List of features separated by new line.', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'textarea')), 'shortcode' => array('path' => '*item/item_feature/@content')), array('id' => 'item_feature_bullet', 'ui' => array('panel' => 2, 'multi' => 1, 'text' => array('header' => __('Feature list bullet', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('Bullet for the feature list elements', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'select-one', 'dictionary' => array('source' => $this->bullet['file'], 'use_default' => false))), 'shortcode' => array('path' => '*item/item_feature/@bullet')), array('id' => 'item_image_url', 'ui' => array('panel' => 2, 'multi' => 1, 'text' => array('header' => __('Image URL', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('Select image of the background. This option works only with type named "Style 2".', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'select-image')), 'shortcode' => array('path' => '*item/@image_url')), array('id' => 'item_image_position', 'ui' => array('panel' => 2, 'multi' => 1, 'text' => array('header' => __('Image position', PLUGIN_PAGE_BUILDER_DOMAIN))), 'shortcode' => array('path' => '*item/@image_position')), array('id' => 'item_image_repeat', 'ui' => array('panel' => 2, 'multi' => 1, 'text' => array('header' => __('Image repeat', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('Select type of background repeat.', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'select-one', 'dictionary' => array('source' => PBHelper::extractDictionary($Background->backgroundRepeat)))), 'shortcode' => array('path' => '*item/@image_repeat')), array('id' => 'item_image_size_a', 'ui' => array('panel' => 2, 'multi' => 1, 'text' => array('header' => __('Image size', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('Specify the image size. For options "Length" and "Percentage" you have to specify these values in next field.', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'select-one', 'dictionary' => array('source' => PBHelper::extractDictionary($Background->backgroundSize)))), 'shortcode' => array('path' => '*item/@image_size_a')), array('id' => 'item_image_size_b', 'ui' => array('panel' => 2, 'multi' => 1, 'text' => array('header' => __('Image size', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => array(__('Sets the width and height of the background image.', PLUGIN_PAGE_BUILDER_DOMAIN), __('Sets the width and height of the background image in percent of the parent element.', PLUGIN_PAGE_BUILDER_DOMAIN), __('The first value sets the width, the second value sets the height. If only one value is given, the second is set to "auto"', PLUGIN_PAGE_BUILDER_DOMAIN)))), 'shortcode' => array('path' => '*item/@image_size_b')), array('id' => 'item_button_label', 'ui' => array('panel' => 2, 'multi' => 1, 'text' => array('header' => __('Button label', PLUGIN_PAGE_BUILDER_DOMAIN))), 'shortcode' => array('path' => '*item/item_button/@content')), array('id' => 'item_button_url', 'ui' => array('panel' => 2, 'multi' => 1, 'text' => array('header' => __('Button URL', PLUGIN_PAGE_BUILDER_DOMAIN))), 'shortcode' => array('path' => '*item/item_button/@url')), array('id' => 'item_price_value', 'ui' => array('panel' => 2, 'multi' => 1, 'text' => array('header' => __('Price', PLUGIN_PAGE_BUILDER_DOMAIN))), 'shortcode' => array('path' => '*item/item_price/item_price_value/@content')), array('id' => 'item_price_suffix', 'ui' => array('panel' => 2, 'multi' => 1, 'text' => array('header' => __('Price suffix', PLUGIN_PAGE_BUILDER_DOMAIN))), 'shortcode' => array('path' => '*item/item_price/item_price_suffix/@content')))));
     parent::__construct();
 }