HEX
Server: Apache
System: Linux web2213.uni5.net 5.4.282-1.el8.elrepo.x86_64 #1 SMP Mon Aug 19 18:33:22 EDT 2024 x86_64
User: clinicamaciel (596848)
PHP: 7.3.33
Disabled: apache_child_terminate,c99_buff_prepare,c99_sess_put,dl,eval,exec,leak,link,myshellexec,openlog,passthru,pclose,pcntl_exec,php_check_syntax,php_strip_whitespace,popen,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,symlink,system,socket_listen,socket_create_listen,putenv
Upload Files
File: /home/clinicamaciel/www/wp-content/plugins/magee-shortcodes/shortcodes/class-heading.php
<?php
if( !class_exists('Magee_Title') ):
class Magee_Title {

	public static $args;
    private  $id;


	/**
	 * Initiate the shortcode
	 */
	public function __construct() {

        add_shortcode( 'ms_heading', array( $this, 'render' ) );
	}

	/**
	 * Render the shortcode
	 * @param  array $args     Shortcode paramters
	 * @param  string $content Content between shortcode
	 * @return string          HTML output
	 */
	function render( $args, $content = '') {

		$defaults =	Magee_Core::set_shortcode_defaults(
			array(
				'id' 					=> '',
				'class' 				=> '',
				'style'					=> 'none',	
				'color'				    => '',
				'border_color'          => '',
				'text_align'            => '',
				'font_weight'            => '400',
				'font_size'            => '36px',
				'margin_top'            => '',
				'margin_bottom'         => '',
				'border_width'           => '5px',
				'responsive_text'       => '',
			), $args 
		);
		
		extract( $defaults );
		self::$args = $defaults;
		
		
		$uniqid = uniqid('heading-');
		$class .=' '.$uniqid;
 		if(is_numeric($font_size))
		$font_size = $font_size.'px';
		if(is_numeric($font_weight))
		$font_weight = $font_weight.'px';
		if(is_numeric($margin_top))
		$margin_top = $margin_top.'px';
		if(is_numeric($margin_bottom))
		$margin_bottom = $margin_bottom.'px';
		if(is_numeric($border_width))
		$border_width = $border_width.'px';
		
		$html  = '<style type="text/css">
		                          
                                    .'.$uniqid.'.magee-heading{
                                        font-size:'.$font_size.';
                                        font-weight:'.$font_weight.';
                                        margin-top:'.$margin_top.';
                                        margin-bottom:'.$margin_bottom.';
                                        color: '.$color.';
                                        border-color: '.$border_color.';
                                        text-align: '.$text_align.';
                                    }
                                    .'.$uniqid.'.heading-border .heading-inner {
                                        border-width: '.$border_width.';
                                    }
								.'.$uniqid.'.heading-doubleline .heading-inner:before,
								.'.$uniqid.'.heading-doubleline .heading-inner:after {
									    border-color: '.$border_color.';
									    border-width: '.$border_width.';
									}
                                </style>';
		if( $responsive_text == 'yes'){
		$html .= '<script>' ; 
		$html .= 'jQuery(function($) {  
		          if($("#magee-sc-form-preview").length>0){
				  
				     $("#magee-sc-form-preview").ready(function(){
					      if($("#magee-sc-form-preview").contents().find("body").width() <1200){	
						  newPercentage = (($("#magee-sc-form-preview").contents().find("body").width() / 1200) * 100) + "%";
						  $("#magee-sc-form-preview").contents().find(".'.$uniqid.' .heading-inner").css({"font-size": newPercentage});
						  }	
					 });
				     $("#preview",window.parent.document).resize(function (){
					      
						  if($("#magee-sc-form-preview").contents().find("body").width() <1200){
						  newPercentage = (($("#magee-sc-form-preview").contents().find("body").width() / 1200) * 100) + "%";
						  $("#magee-sc-form-preview").contents().find(".'.$uniqid.' .heading-inner").css({"font-size": newPercentage});
						  }else{
						  $("#magee-sc-form-preview").contents().find(".'.$uniqid.' .heading-inner").css({"font-size": "'.$font_size.'"});
						  }
					  });     
				  }else{
				      $(document).ready(function () {	
						  if($(window).width() <1200){	
						  newPercentage = (($(window).width() / 1200) * 100) + "%";
						  $(".'.$uniqid.' .heading-inner").css({"font-size": newPercentage});
						  }	
					  });			
					  $(window).on("resize", function (){
						  if($(window).width() <1200){
						  newPercentage = (($(window).width() / 1200) * 100) + "%";
						  $(".'.$uniqid.' .heading-inner").css({"font-size": newPercentage});
						  }else{
						  $(".'.$uniqid.' .heading-inner").css({"font-size": "'.$font_size.'"});
						  }
					  });   
				  
				  
				  }    	
					  
		         });
		     </script>' ;
		}	
		if( $style == 'none'){
		$html .= '<h1 class="magee-heading  '.esc_attr($class).'" id="'.$id.'"><span class="heading-inner">'.do_shortcode( Magee_Core::fix_shortcodes($content)).'</span></h1>';
		}else{					
		$html .= '<h1 class="magee-heading heading-'.$style.' '.esc_attr($class).'" id="'.$id.'"><span class="heading-inner">'.do_shortcode( Magee_Core::fix_shortcodes($content)).'</span></h1>'; }
		
		
		return $html;
	}
	
}

new Magee_Title();
endif;