403Webshell
Server IP : 213.186.33.4  /  Your IP : 216.73.216.222
Web Server : Apache
System : Linux webm005.cluster103.gra.hosting.ovh.net 6.18.39-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Tue Jul 21 12:03:15 CEST 2026 x86_64
User : karinebmkh ( 644538)
PHP Version : 8.4.22
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/karinebmkh/www2/wp-content/plugins/glaza-core/includes/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/karinebmkh/www2/wp-content/plugins/glaza-core/includes/builder.php
<?php
/**
 * @param $widgets
 *
 * @return mixed
 * set group for glaza widget
 */
if ( ! function_exists( 'glaza_panels_widget_group' ) ) {
	function glaza_panels_widget_group( $widgets ) {

		$widgets['glaza_widget_fw_instagram']['groups']      = array( 'glaza' );
		$widgets['glaza_widget_fw_instagram']['icon']        = 'icon-ruby';
		$widgets['glaza_widget_banner']['groups']            = array( 'glaza' );
		$widgets['glaza_widget_banner']['icon']              = 'icon-ruby';
		$widgets['glaza_widget_fw_slider_1']['groups']       = array( 'glaza' );
		$widgets['glaza_widget_fw_slider_1']['icon']         = 'icon-ruby';
		$widgets['glaza_widget_fw_slider_2']['groups']       = array( 'glaza' );
		$widgets['glaza_widget_fw_slider_2']['icon']         = 'icon-ruby';
		$widgets['glaza_widget_fw_slider_3']['groups']       = array( 'glaza' );
		$widgets['glaza_widget_fw_slider_3']['icon']         = 'icon-ruby';
		$widgets['glaza_widget_classic']['groups']           = array( 'glaza' );
		$widgets['glaza_widget_classic']['icon']             = 'icon-ruby';
		$widgets['glaza_widget_fw_grid_1']['groups']         = array( 'glaza' );
		$widgets['glaza_widget_fw_grid_1']['icon']           = 'icon-ruby';
		$widgets['glaza_widget_fw_grid_2']['groups']         = array( 'glaza' );
		$widgets['glaza_widget_fw_grid_2']['icon']           = 'icon-ruby';
		$widgets['glaza_widget_fw_list']['groups']           = array( 'glaza' );
		$widgets['glaza_widget_fw_list']['icon']             = 'icon-ruby';
		$widgets['glaza_widget_hs_grid_1']['groups']         = array( 'glaza' );
		$widgets['glaza_widget_hs_grid_1']['icon']           = 'icon-ruby';
		$widgets['glaza_widget_hs_grid_2']['groups']         = array( 'glaza' );
		$widgets['glaza_widget_hs_grid_2']['icon']           = 'icon-ruby';
		$widgets['glaza_widget_hs_list']['groups']           = array( 'glaza' );
		$widgets['glaza_widget_hs_list']['icon']             = 'icon-ruby';
		$widgets['glaza_widget_facebook']['groups']          = array( 'glaza' );
		$widgets['glaza_widget_facebook']['icon']            = 'icon-ruby';
		$widgets['glaza_widget_sb_flickr']['groups']         = array( 'glaza' );
		$widgets['glaza_widget_sb_flickr']['icon']           = 'icon-ruby';
		$widgets['glaza_widget_sb_instagram']['groups']      = array( 'glaza' );
		$widgets['glaza_widget_sb_instagram']['icon']        = 'icon-ruby';
		$widgets['glaza_widget_sb_post']['groups']           = array( 'glaza' );
		$widgets['glaza_widget_sb_post']['icon']             = 'icon-ruby';
		$widgets['glaza_widget_social_icon']['groups']       = array( 'glaza' );
		$widgets['glaza_widget_social_icon']['icon']         = 'icon-ruby';
		$widgets['glaza_widget_tweets']['groups']            = array( 'glaza' );
		$widgets['glaza_widget_tweets']['icon']              = 'icon-ruby';
		$widgets['glaza_widget_youtube_subscribe']['groups'] = array( 'glaza' );
		$widgets['glaza_widget_youtube_subscribe']['icon']   = 'icon-ruby';
		$widgets['glaza_widget_advertising']['groups']       = array( 'glaza' );
		$widgets['glaza_widget_advertising']['icon']         = 'icon-ruby';
		$widgets['glaza_widget_follower']['groups']          = array( 'glaza' );
		$widgets['glaza_widget_follower']['icon']            = 'icon-ruby';

		if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
			$widgets['glaza_widget_wc_cat']['groups']          = array( 'glaza' );
			$widgets['glaza_widget_wc_cat']['icon']            = 'icon-ruby';
			$widgets['glaza_widget_wc_sale']['groups']         = array( 'glaza' );
			$widgets['glaza_widget_wc_sale']['icon']           = 'icon-ruby';
			$widgets['glaza_widget_wc_featured']['groups']     = array( 'glaza' );
			$widgets['glaza_widget_wc_featured']['icon']       = 'icon-ruby';
			$widgets['glaza_widget_wc_latest']['groups']       = array( 'glaza' );
			$widgets['glaza_widget_wc_latest']['icon']         = 'icon-ruby';
			$widgets['glaza_widget_wc_best_selling']['groups'] = array( 'glaza' );
			$widgets['glaza_widget_wc_best_selling']['icon']   = 'icon-ruby';
			$widgets['glaza_widget_wc_top_rated']['groups']    = array( 'glaza' );
			$widgets['glaza_widget_wc_top_rated']['icon']      = 'icon-ruby';
		}

		return $widgets;
	}
}
add_filter( 'siteorigin_panels_widgets', 'glaza_panels_widget_group' );

/**
 * @param $tabs
 * glaza_widgets_dialog_tabs
 */
if ( ! function_exists( 'glaza_widgets_dialog_tabs' ) ) {
	function glaza_widgets_dialog_tabs( $tabs ) {
		$tabs[] = array(
			'title'  => esc_html__( 'Glaza Widgets', 'glaza' ),
			'filter' => array(
				'installed' => true,
				'groups'    => array( 'glaza' )
			)
		);

		return $tabs;
	}
}
add_filter( 'siteorigin_panels_widget_dialog_tabs', 'glaza_widgets_dialog_tabs' );

/**
 * @return bool
 * glaza_upgrade_teaser
 */
if ( ! function_exists( 'glaza_upgrade_teaser' ) ) {
	function glaza_upgrade_teaser() {
		return false;
	}
}
add_filter( 'siteorigin_premium_upgrade_teaser', 'glaza_upgrade_teaser' );


/**
 * @param $fields
 *
 * @return mixed
 * add & remove fields
 */
if ( ! function_exists( 'glaza_widget_style_fields' ) ) {
	function glaza_widget_style_fields( $fields ) {

		$fields['bottom_margin'] = array(
			'name'        => esc_html__( 'Bottom Margin', 'glaza-core' ),
			'type'        => 'measurement',
			'group'       => 'layout',
			'description' => esc_html__( 'Select a bottom margin value for this widget. Default is 60px', 'glaza-core' ),
			'priority'    => 1,
		);

		$fields['mobile_bottom_margin'] = array(
			'name'        => esc_html__( 'Mobile Bottom Margin', 'glaza-core' ),
			'type'        => 'measurement',
			'group'       => 'layout',
			'description' => esc_html__( 'Select a bottom margin value for this widget on mobile devices, Leave blank if you want to set default value.', 'glaza-core' ),
			'priority'    => 1,
		);

		$fields['text_style'] = array(
			'name'        => esc_html__( 'Text Color Style', 'glaza-core' ),
			'type'        => 'select',
			'group'       => 'design',
			'options'     => array(
				'dark'  => esc_html__( 'Dark Color', 'glaza-core' ),
				'light' => esc_html__( 'Light Color', 'glaza-core' ),
			),
			'description' => esc_html__( 'Select a text color style for this widget, depends on your background settings.', 'glaza-core' ),
			'priority'    => 6,
		);

		if ( isset( $fields['border_color'] ) ) {
			unset( $fields['border_color'] );
		}

		if ( isset( $fields['link_color'] ) ) {
			unset ( $fields['link_color'] );
		}

		if ( isset( $fields['font_color'] ) ) {
			unset ( $fields['font_color'] );
		}

		return $fields;
	}
}
add_filter( 'siteorigin_panels_widget_style_fields', 'glaza_widget_style_fields', 20 );


/**
 * @param $fields
 *
 * @return mixed
 * remove fields
 */
if ( ! function_exists( 'glaza_row_style_fields' ) ) {
	function glaza_row_style_fields( $fields ) {

		if ( isset( $fields['cell_class'] ) ) {
			unset ( $fields['cell_class'] );
		}

		if ( isset( $fields['border_color'] ) ) {
			unset ( $fields['border_color'] );
		}

		if ( isset( $fields['collapse_behaviour'] ) ) {
			unset ( $fields['collapse_behaviour'] );
		}

		if ( isset( $fields['collapse_order'] ) ) {
			unset( $fields['collapse_order'] );
		}

		if ( isset( $fields['row_stretch'] ) ) {
			unset( $fields['row_stretch'] );
		}

		$fields['row_stretch'] = array(
			'name'     => esc_html__( 'Row Layout', 'glaza-core' ),
			'type'     => 'select',
			'group'    => 'layout',
			'options'  => array(
				''               => esc_html__( 'Wrapper', 'glaza-core' ),
				'full'           => esc_html__( 'Full Width', 'glaza-core' ),
				'full-stretched' => esc_html__( 'Full Width Stretched', 'glaza-core' ),
			),
			'priority' => 10,
		);


		$fields['is_content'] = array(
			'name'        => esc_html__( 'Define Content Section', 'glaza-core' ),
			'type'        => 'select',
			'group'       => 'layout',
			'options'     => array(
				''  => esc_html__( '--None--', 'glaza-core' ),
				'1' => esc_html__( 'Content with Sidebar', 'glaza-core' ),
			),
			'description' => esc_html__( 'Define this row as a content has sidebar section, This will allow the theme can understand to add responsive on table devices (max-width: 911px).', 'glaza-core' ),
			'priority'    => 1,
		);

		return $fields;
	}
}
add_filter( 'siteorigin_panels_row_style_fields', 'glaza_row_style_fields', 20 );


if ( ! function_exists( 'glaza_cell_style_fields' ) ) {
	function glaza_cell_style_fields( $fields ) {

		$fields['is_sidebar'] = array(
			'name'        => esc_html__( 'Define Sidebar', 'glaza-core' ),
			'type'        => 'select',
			'group'       => 'layout',
			'options'     => array(
				''      => esc_html__( '--None--', 'glaza-core' ),
				'left'  => esc_html__( 'Left Sidebar', 'glaza-core' ),
				'right' => esc_html__( 'Right Sidebar', 'glaza-core' ),
			),
			'description' => esc_html__( 'Define this cell is as a sidebar, this will allow the theme can know this cell to add sidebar spacing.', 'glaza-core' ),
			'priority'    => 1,
		);

		$fields['sticky_sidebar'] = array(
			'name'        => esc_html__( 'Sticky Sidebar', 'glaza-core' ),
			'type'        => 'select',
			'group'       => 'layout',
			'options'     => array(
				''  => esc_html__( '--Disable--', 'glaza-core' ),
				'1' => esc_html__( 'Enable', 'glaza-core' ),
			),
			'description' => esc_html__( 'Enable sticky if this cell is a sidebar of this row.', 'glaza-core' ),
			'priority'    => 2,
		);

		if ( isset( $fields['border_color'] ) ) {
			unset( $fields['border_color'] );
		}

		if ( isset( $fields['link_color'] ) ) {
			unset ( $fields['link_color'] );
		}

		if ( isset( $fields['font_color'] ) ) {
			unset ( $fields['font_color'] );
		}

		return $fields;
	}
}

add_filter( 'siteorigin_panels_cell_style_fields', 'glaza_cell_style_fields', 20 );

/**
 * @param $defaults
 *
 * @return mixed
 * default config
 */
if ( ! function_exists( 'glaza_panels_settings_defaults' ) ) {
	function glaza_panels_settings_defaults( $defaults ) {
		$defaults['tablet-width']           = 991;
		$defaults['mobile-width']           = 767;
		$defaults['margin-sides']           = 0;
		$defaults['margin-bottom']          = 60;
		$defaults['margin-bottom-last-row'] = 1;
		$defaults['sticky_sidebar']         = 0;

		return $defaults;
	}
}
add_filter( 'siteorigin_panels_settings_defaults', 'glaza_panels_settings_defaults', 20 );


/**
 * @param $fields
 * default settings
 */
if ( ! function_exists( 'glaza_panels_settings_fields' ) ) {
	function glaza_panels_settings_fields( $fields ) {

		if ( isset( $fields['layout']['fields']['margin-bottom'] ) ) {
			unset ( $fields['layout']['fields']['margin-bottom'] );
		}

		if ( isset( $fields['layout']['fields']['margin-sides'] ) ) {
			unset ( $fields['layout']['fields']['margin-sides'] );
		}

		if ( isset( $fields['layout']['fields']['margin-bottom-last-row'] ) ) {
			unset ( $fields['layout']['fields']['margin-bottom-last-row'] );
		}

		return $fields;
	}
}
add_filter( 'siteorigin_panels_settings_fields', 'glaza_panels_settings_fields', 99 );

/**
 * @param $attr
 * @param $style
 *
 * @return mixed
 * add widget class
 */
if ( ! function_exists( 'glaza_widget_style_attributes' ) ) {
	function glaza_widget_style_attributes( $attr, $style ) {

		if ( empty( $attr['style'] ) ) {
			$attr['style'] = '';
		}

		if ( ! empty( $style['text_style'] ) && 'light' == $style['text_style'] ) {
			$attr['class'][] = 'is-light-text';
		}

		if ( empty( $attr['style'] ) ) {
			unset( $attr['style'] );
		}

		return $attr;
	}
}
add_filter( 'siteorigin_panels_widget_style_attributes', 'glaza_widget_style_attributes', 10, 2 );

/**
 * @param $css
 * @param $style
 *
 * @return mixed
 * custom margin
 */
if ( ! function_exists( 'glaza_widget_style_css' ) ) {
	function glaza_widget_style_css( $css, $style ) {
		if ( isset( $style['bottom_margin'] ) ) {
			$css['margin-bottom'] = $style['bottom_margin'];
		}

		return $css;
	}
}
add_filter( 'siteorigin_panels_widget_style_css', 'glaza_widget_style_css', 10, 2 );

/**
 * mobile margin
 */
if ( ! function_exists( 'glaza_widget_style_mobile_css' ) ) {
	function glaza_widget_style_mobile_css( $css, $style ) {
		if ( isset( $style['mobile_bottom_margin'] ) ) {
			$css['margin-bottom'] = $style['mobile_bottom_margin'];
		}

		return $css;
	}
}
add_filter( 'siteorigin_panels_widget_style_mobile_css', 'glaza_widget_style_mobile_css', 10, 2 );


//remove cell margin
if ( ! function_exists( 'glaza_remove_margin_bottom' ) ) {
	function glaza_remove_margin_bottom() {
		return false;
	}
}
add_filter( 'siteorigin_panels_css_cell_margin_bottom', 'glaza_remove_margin_bottom', 10 );
add_filter( 'siteorigin_panels_css_cell_last_margin_bottom', 'glaza_remove_margin_bottom', 10 );


/**
 * @param $attr
 * @param $style
 *
 * @return mixed
 * define section content
 */
if ( ! function_exists( 'glaza_row_style_attributes' ) ) {
	function glaza_row_style_attributes( $attr, $style ) {
		if ( ! empty( $style['is_content'] ) ) {
			$attr['class'][] = 'section-content';
		}

		return $attr;
	}
}
add_filter( 'siteorigin_panels_row_style_attributes', 'glaza_row_style_attributes', 10, 2 );


/**
 * @param $attr
 * @param $style
 *
 * @return mixed
 * define sidebar
 */
if ( ! function_exists( 'glaza_cell_style_attributes' ) ) {
	function glaza_cell_style_attributes( $attr, $style ) {
		if ( ! empty( $style['sticky_sidebar'] ) ) {
			$attr['class'][] = 'sidebar-sticky';
		}
		if ( ! empty( $style['is_sidebar'] ) ) {
			if ( 'left' == $style['is_sidebar'] ) {
				$attr['class'][] = 'sidebar-inner';
				$attr['class'][] = 'is-left';
			} else {
				$attr['class'][] = 'sidebar-inner';
			}
		}

		return $attr;
	}
}
add_filter( 'siteorigin_panels_cell_style_attributes', 'glaza_cell_style_attributes', 10, 2 );


/**
 * @param $classes
 * @param $widget_class
 * @param $instance
 * @param $widget_info
 *
 * @return array
 * add widget class
 */
if ( ! function_exists( 'glaza_panels_widget_classess' ) ) {
	function glaza_panels_widget_classess( $classes, $widget_class, $instance, $widget_info ) {

		if ( ! empty( $widget_info['style']['bottom_margin'] ) ) {
			$classes[] = 'custom-margin';
		} else {
			$classes[] = 'default-margin';
		}

		return $classes;
	}
}
add_filter( 'siteorigin_panels_widget_classes', 'glaza_panels_widget_classess', 10, 4 );

/**
 * glaza columns
 */
if ( ! function_exists( 'glaza_panels_column_ratios' ) ) {
	function glaza_panels_column_ratios() {

		$columns = array(
			'Even (Fullwidth)' => 1,
			'Thirds (Sidebar)' => 0.5
		);

		return $columns;
	}
}
add_filter( 'siteorigin_panels_column_ratios', 'glaza_panels_column_ratios', 10 );

Youez - 2016 - github.com/yon3zu
LinuXploit