Example #1
0
 /**
  *  Widget construction
  */
 function Layers_Content_Widget()
 {
     /**
      * Widget variables
      *
      * @param  	string    		$widget_title    	Widget title
      * @param  	string    		$widget_id    		Widget slug for use as an ID/classname
      * @param  	string    		$post_type    		(optional) Post type for use in widget options
      * @param  	string    		$taxonomy    		(optional) Taxonomy slug for use as an ID/classname
      * @param  	array 			$checkboxes    	(optional) Array of checkbox names to be saved in this widget. Don't forget these please!
      */
     $this->widget_title = __('Content', 'layerswp');
     $this->widget_id = 'column';
     $this->post_type = '';
     $this->taxonomy = '';
     $this->checkboxes = array();
     /* Widget settings. */
     $widget_ops = array('classname' => 'obox-layers-' . $this->widget_id . '-widget', 'description' => __('This widget is used to display your ', 'layerswp') . $this->widget_title . '.');
     /* Widget control settings. */
     $control_ops = array('width' => LAYERS_WIDGET_WIDTH_LARGE, 'height' => NULL, 'id_base' => LAYERS_THEME_SLUG . '-widget-' . $this->widget_id);
     /* Create the widget. */
     parent::__construct(LAYERS_THEME_SLUG . '-widget-' . $this->widget_id, $this->widget_title, $widget_ops, $control_ops);
     /* Setup Widget Defaults */
     $this->defaults = array('title' => __('Our Services', 'layerswp'), 'excerpt' => __('Our services run deep and are backed by over ten years of experience.', 'layerswp'), 'design' => array('layout' => 'layout-boxed', 'liststyle' => 'list-grid', 'columns' => '3', 'gutter' => 'on', 'background' => array('position' => 'center', 'repeat' => 'no-repeat'), 'fonts' => array('align' => 'text-left', 'size' => 'medium', 'color' => NULL, 'shadow' => NULL)), 'column_ids' => rand(1, 1000) . ',' . rand(1, 1000) . ',' . rand(1, 1000));
     $this->column_defaults = array('title' => __('Your service title', 'layerswp'), 'excerpt' => __('Give us a brief description of the service that you are promoting. Try keep it short so that it is easy for people to scan your page.', 'layerswp'), 'width' => '4', 'design' => array('imagealign' => 'image-top', 'background' => NULL, 'fonts' => array('align' => 'text-left', 'size' => 'medium', 'color' => NULL, 'shadow' => NULL)));
     // Setup the defaults for each column object
     foreach (explode(',', $this->defaults['column_ids']) as $column_id) {
         $this->defaults['columns'][$column_id] = $this->column_defaults;
     }
 }
Example #2
0
 /**
  *  Widget construction
  */
 function Layers_Post_Widget()
 {
     /**
      * Widget variables
      *
      * @param  	string    		$widget_title    	Widget title
      * @param  	string    		$widget_id    		Widget slug for use as an ID/classname
      * @param  	string    		$post_type    		(optional) Post type for use in widget options
      * @param  	string    		$taxonomy    		(optional) Taxonomy slug for use as an ID/classname
      * @param  	array 			$checkboxes    	(optional) Array of checkbox names to be saved in this widget. Don't forget these please!
      */
     $this->widget_title = __('Posts', 'layerswp');
     $this->widget_id = 'post';
     $this->post_type = 'post';
     $this->taxonomy = 'category';
     $this->checkboxes = array('show_media', 'show_titles', 'show_excerpts', 'show_dates', 'show_author', 'show_tags', 'show_categories', 'show_call_to_action');
     // @TODO: Try make this more dynamic, or leave a different note reminding users to change this if they add/remove checkboxes
     /* Widget settings. */
     $widget_ops = array('classname' => 'obox-layers-' . $this->widget_id . '-widget', 'description' => __('This widget is used to display your ', 'layerswp') . $this->widget_title . '.');
     /* Widget control settings. */
     $control_ops = array('width' => LAYERS_WIDGET_WIDTH_SMALL, 'height' => NULL, 'id_base' => LAYERS_THEME_SLUG . '-widget-' . $this->widget_id);
     /* Create the widget. */
     parent::__construct(LAYERS_THEME_SLUG . '-widget-' . $this->widget_id, $this->widget_title, $widget_ops, $control_ops);
     /* Setup Widget Defaults */
     $this->defaults = array('title' => __('Latest Posts', 'layerswp'), 'excerpt' => __('Stay up to date with all our latest news and launches. Only the best quality makes it onto our blog!', 'layerswp'), 'text_style' => 'regular', 'category' => 0, 'show_media' => 'on', 'show_titles' => 'on', 'show_excerpts' => 'on', 'show_dates' => 'on', 'show_author' => 'on', 'show_tags' => 'on', 'show_categories' => 'on', 'excerpt_length' => 200, 'show_call_to_action' => 'on', 'call_to_action' => __('Read More', 'layerswp'), 'posts_per_page' => 6, 'design' => array('layout' => 'layout-boxed', 'imageratios' => 'image-square', 'textalign' => 'text-left', 'liststyle' => 'list-grid', 'columns' => '3', 'gutter' => 'on', 'background' => array('position' => 'center', 'repeat' => 'no-repeat'), 'fonts' => array('align' => 'text-left', 'size' => 'medium', 'color' => NULL, 'shadow' => NULL)));
 }
Example #3
0
 /**
  *  Widget construction
  */
 function Layers_Contact_Widget()
 {
     /**
      * Widget variables
      *
      * @param  	string    		$widget_title    	Widget title
      * @param  	string    		$widget_id    		Widget slug for use as an ID/classname
      * @param  	string    		$post_type    		(optional) Post type for use in widget options
      * @param  	string    		$taxonomy    		(optional) Taxonomy slug for use as an ID/classname
      * @param  	array 			$checkboxes    	(optional) Array of checkbox names to be saved in this widget. Don't forget these please!
      */
     $this->widget_title = __('Contact Details & Maps', 'layerswp');
     $this->widget_id = 'map';
     $this->post_type = '';
     $this->taxonomy = '';
     $this->checkboxes = array('show_google_map', 'show_address', 'show_contact_form');
     /* Widget settings. */
     $widget_ops = array('classname' => 'obox-layers-' . $this->widget_id . '-widget', 'description' => __('This widget is used to display your ', 'layerswp') . $this->widget_title . '.');
     /* Widget control settings. */
     $control_ops = array('width' => LAYERS_WIDGET_WIDTH_SMALL, 'height' => NULL, 'id_base' => LAYERS_THEME_SLUG . '-widget-' . $this->widget_id);
     /* Create the widget. */
     parent::__construct(LAYERS_THEME_SLUG . '-widget-' . $this->widget_id, $this->widget_title, $widget_ops, $control_ops);
     /* Setup Widget Defaults */
     $this->defaults = array('title' => __('Find Us', 'layerswp'), 'excerpt' => __('We are based in one of the most beautiful places on earth. Come visit us!', 'layerswp'), 'contact_form' => NULL, 'address_shown' => NULL, 'show_google_map' => 'on', 'show_contact_form' => 'on', 'google_maps_location' => NULL, 'google_maps_long_lat' => NULL, 'google_maps_zoom' => 14, 'map_height' => 400, 'design' => array('layout' => 'layout-boxed', 'background' => array('position' => 'center', 'repeat' => 'no-repeat'), 'fonts' => array('align' => 'text-center', 'size' => 'medium', 'color' => NULL, 'shadow' => NULL)));
 }
Example #4
0
 /**
  *  Widget construction
  */
 function Layers_Slider_Widget()
 {
     /**
      * Widget variables
      *
      * @param  	string    		$$this->widget_id    	Widget title
      * @param  	string    		$widget_id    		Widget slug for use as an ID/classname
      * @param  	string    		$post_type    		(optional) Post type for use in widget options
      * @param  	string    		$taxonomy    		(optional) Taxonomy slug for use as an ID/classname
      * @param  	array 			$checkboxes    	(optional) Array of checkbox names to be saved in this widget. Don't forget these please!
      */
     $this->widget_title = __('Slider', 'layerswp');
     $this->widget_id = 'slide';
     $this->post_type = '';
     $this->taxonomy = '';
     $this->checkboxes = array('show_slider_arrows', 'show_slider_dots', 'autoplay_slides');
     /* Widget settings. */
     $widget_ops = array('classname' => 'obox-layers-' . $this->widget_id . '-widget', 'description' => __('This widget is used to display your ', 'layerswp') . $this->widget_id . '.');
     /* Widget control settings. */
     $control_ops = array('width' => LAYERS_WIDGET_WIDTH_LARGE, 'height' => NULL, 'id_base' => LAYERS_THEME_SLUG . '-widget-' . $this->widget_id);
     /* Create the widget. */
     parent::__construct(LAYERS_THEME_SLUG . '-widget-' . $this->widget_id, $this->widget_title, $widget_ops, $control_ops);
     /* Setup Widget Defaults */
     $this->defaults = array('title' => NULL, 'excerpt' => NULL, 'slide_height' => '550', 'slide_ids' => rand(1, 1000), 'show_slider_arrows' => 'on', 'show_slider_dots' => 'on', 'animation_type' => 'slide');
     $this->slide_defaults = array('title' => __('Slider Title', 'layerswp'), 'excerpt' => __('Short Excerpt', 'layerswp'), 'link' => NULL, 'link_text' => __('See More', 'layerswp'), 'design' => array('imagealign' => 'image-top', 'imageratios' => NULL, 'background' => array('color' => '#444', 'position' => 'center', 'repeat' => 'no-repeat', 'size' => 'cover'), 'fonts' => array('align' => 'text-center', 'size' => 'large', 'shadow' => '')));
     // Setup the defaults for each slide
     $this->defaults['slides'][$this->defaults['slide_ids']] = $this->slide_defaults;
 }
Example #5
0
 /**
  *  Widget construction
  */
 function __construct()
 {
     /**
      * Widget variables
      *
      * @param  	string    		$this->widget_id    	Widget title
      * @param  	string    		$widget_id    		Widget slug for use as an ID/classname
      * @param  	string    		$post_type    		(optional) Post type for use in widget options
      * @param  	string    		$taxonomy    		(optional) Taxonomy slug for use as an ID/classname
      * @param  	array 			$checkboxes    	(optional) Array of checkbox names to be saved in this widget. Don't forget these please!
      */
     $this->widget_title = __('Slider', 'layerswp');
     $this->widget_id = 'slide';
     $this->post_type = '';
     $this->taxonomy = '';
     $this->checkboxes = array('show_slider_arrows', 'show_slider_dots', 'autoplay_slides', 'autoheight_slides');
     /* Widget settings. */
     $widget_ops = array('classname' => 'obox-layers-' . $this->widget_id . '-widget', 'description' => __('This widget is used to display slides and can be used to display a page-banner.', 'layerswp'), 'customize_selective_refresh' => TRUE);
     /* Widget control settings. */
     $control_ops = array('width' => LAYERS_WIDGET_WIDTH_LARGE, 'height' => NULL, 'id_base' => LAYERS_THEME_SLUG . '-widget-' . $this->widget_id);
     /* Create the widget. */
     parent::__construct(LAYERS_THEME_SLUG . '-widget-' . $this->widget_id, $this->widget_title, $widget_ops, $control_ops);
     /* Setup Widget Defaults */
     $this->defaults = array('title' => NULL, 'excerpt' => NULL, 'slide_height' => '550', 'show_slider_arrows' => 'on', 'show_slider_dots' => 'on', 'animation_type' => 'slide');
     /* Setup Widget Repeater Defaults */
     $this->register_repeater_defaults('slide', 2, array('title' => __('Slider Title', 'layerswp'), 'excerpt' => __('Short Excerpt', 'layerswp'), 'design' => array('imagealign' => 'image-top', 'imageratios' => NULL, 'background' => array('color' => '#f8f8f8', 'position' => 'center', 'repeat' => 'no-repeat', 'size' => 'cover'), 'fonts' => array('color' => NULL, 'align' => 'text-center', 'size' => 'large', 'shadow' => '', 'heading-type' => 'h3')), 'button' => array('link_type' => 'custom', 'link_type_custom' => '#more', 'link_text' => __('See More', 'layerswp'))));
 }
Example #6
0
 /**
  *  Widget construction
  */
 function __construct()
 {
     /**
      * Widget variables
      *
      * @param  	string    		$widget_title    	Widget title
      * @param  	string    		$widget_id    		Widget slug for use as an ID/classname
      * @param  	string    		$post_type    		(optional) Post type for use in widget options
      * @param  	string    		$taxonomy    		(optional) Taxonomy slug for use as an ID/classname
      * @param  	array 			$checkboxes    	(optional) Array of checkbox names to be saved in this widget. Don't forget these please!
      */
     $this->widget_title = __('Content', 'layerswp');
     $this->widget_id = 'column';
     $this->post_type = '';
     $this->taxonomy = '';
     $this->checkboxes = array();
     /* Widget settings. */
     $widget_ops = array('classname' => 'obox-layers-' . $this->widget_id . '-widget', 'description' => __('This widget is used to display text and images in a flexible grid.', 'layerswp'), 'customize_selective_refresh' => TRUE);
     /* Widget control settings. */
     $control_ops = array('width' => LAYERS_WIDGET_WIDTH_LARGE, 'height' => NULL, 'id_base' => LAYERS_THEME_SLUG . '-widget-' . $this->widget_id);
     /* Create the widget. */
     parent::__construct(LAYERS_THEME_SLUG . '-widget-' . $this->widget_id, $this->widget_title, $widget_ops, $control_ops);
     /* Setup Widget Defaults */
     $this->defaults = array('title' => __('Our Services', 'layerswp'), 'excerpt' => __('Our services run deep and are backed by over ten years of experience.', 'layerswp'), 'design' => array('layout' => 'layout-boxed', 'liststyle' => 'list-grid', 'gutter' => 'on', 'background' => array('position' => 'center', 'repeat' => 'no-repeat'), 'fonts' => array('align' => 'text-left', 'size' => 'medium', 'color' => NULL, 'shadow' => NULL, 'heading-type' => 'h3')));
     /* Setup Widget Repeater Defaults */
     $this->register_repeater_defaults('column', 3, array('title' => __('Your service title', 'layerswp'), 'excerpt' => __('Give us a brief description of the service that you are promoting. Try keep it short so that it is easy for people to scan your page.', 'layerswp'), 'width' => '4', 'design' => array('featuredimage-size' => '', 'imagealign' => 'image-top', 'background' => NULL, 'fonts' => array('align' => 'text-left', 'size' => 'medium', 'color' => NULL, 'shadow' => NULL, 'heading-type' => 'h5'))));
 }
 /**
  *  1 - Widget construction
  * http://docs.layerswp.com/development-tutorials-layers-builder-widgets/#1-widget-construction
  */
 function Layers_IWM_Widget()
 {
     $this->widget_title = __('Interactive Map', 'iwm');
     $this->widget_id = 'iwm_layers_widget';
     /* Widget settings. */
     $widget_ops = array('classname' => 'obox-layers-' . $this->widget_id . '-widget', 'description' => __('Display a previously created map', 'iwm'));
     /* Widget control settings. */
     $control_ops = array('width' => '660', 'height' => NULL, 'id_base' => 'layers-widget-' . $this->widget_id);
     /* Create the widget. */
     parent::__construct('layers' . '-widget-' . $this->widget_id, $this->widget_title, $widget_ops, $control_ops);
     /* Setup Widget Defaults */
     $this->defaults = array('title' => __('Map', 'iwm'), 'excerpt' => __('', 'iwm'), 'design' => array('layout' => 'layout-boxed', 'textalign' => 'text-left', 'gutter' => 'on', 'background' => array('position' => 'center', 'repeat' => 'no-repeat'), 'fonts' => array('align' => 'text-left', 'size' => 'medium', 'color' => NULL, 'shadow' => NULL)));
 }
 /**
  *  1 - Widget construction
  * http://docs.layerswp.com/development-tutorials-layers-builder-widgets/#1-widget-construction
  */
 function Layers_Demo_Widget()
 {
     $this->widget_title = __('Stories', 'layerswp');
     $this->widget_id = 'stories';
     $this->post_type = 'layers-demo-posts';
     $this->taxonomy = 'layers-demo-category';
     $this->checkboxes = array('show_media', 'show_titles', 'show_excerpts', 'show_dates', 'show_author', 'show_credit', 'show_topics', 'show_call_to_action');
     /* Widget settings. */
     $widget_ops = array('classname' => 'obox-layers-' . $this->widget_id . '-widget', 'description' => __('This widget is used to display your Posts', 'layerswp'));
     /* Widget control settings. */
     $control_ops = array('width' => '660', 'height' => NULL, 'id_base' => 'layers-widget-' . $this->widget_id);
     /* Create the widget. */
     parent::__construct('layers' . '-widget-' . $this->widget_id, $this->widget_title, $widget_ops, $control_ops);
     /* Setup Widget Defaults */
     $this->defaults = array('title' => __('Latest Stories', 'layerswp'), 'excerpt' => __('Stay up to date with all our latest news and launches. Only the best quality makes it onto our blog!', 'layerswp'), 'text_style' => 'overlay', 'category' => 0, 'show_media' => 'on', 'show_titles' => 'on', 'show_excerpts' => 'off', 'show_dates' => 'on', 'show_author' => 'on', 'show_credit' => 'on', 'show_topics' => 'on', 'excerpt_length' => 200, 'show_call_to_action' => 'on', 'call_to_action' => __('Read Story', 'layerswp'), 'posts_per_page' => 6, 'design' => array('layout' => 'layout-boxed', 'imageratios' => 'image-square', 'textalign' => 'text-left', 'liststyle' => 'list-grid', 'columns' => '3', 'gutter' => 'on', 'background' => array('position' => 'center', 'repeat' => 'no-repeat'), 'fonts' => array('align' => 'text-left', 'size' => 'medium', 'color' => NULL, 'shadow' => NULL)));
 }