HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux WebLive 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wptuneprotect/wp-content/plugins/insert-php/admin/assets/js/tinymce4.4.js
(function($) {
	$(document).on('tinymce-editor-setup', function(event, editor) {

		if( void 0 === wbcr_inp_shortcode_snippets ) {
			console.log('Unknown error.');
			return;
		}

		if( $.isEmptyObject(wbcr_inp_shortcode_snippets) ) {
			return;
		}

		editor.settings.toolbar1 += ',wbcr_insert_php_button';

		var menu = [];

		$.each(wbcr_inp_shortcode_snippets, function(index, item) {
			menu.push({
				text: item.title,
				value: item.id,
				onclick: function() {
					var content = "";
					var snippet_type = item.type;
					var snippet_name = item.name;
					var selected_content = editor.selection.getContent();

					for( var tag in item ) {
						if( !item.hasOwnProperty(tag) ) {
							continue;
						}

						if( 'type' === tag ) {
							snippet_type = item[tag];
						} else if( 'name' === tag ) {
							snippet_name = item[tag];
						} else if( tag.indexOf('snippet_tags') === -1 ) {
							if( !('' !== selected_content && 'content' === tag) ) {
								content += ' ' + tag + '="' + item[tag] + '"';
							}
						}
					}

					if( '' === snippet_name || undefined === snippet_name ) {
						if( 'universal' === snippet_type ) {
							snippet_name = "wbcr_snippet";
						} else {
							snippet_name = "wbcr_" + snippet_type + "_snippet";
						}
					}

					if( '' === selected_content ) {
						editor.selection.setContent('[' + snippet_name + content + ']');
					} else {
						editor.selection.setContent(
							'[' + snippet_name + content + ']' +
							selected_content +
							'[/' + snippet_name + ']');
					}
				}
			});
		});

		editor.addButton('wbcr_insert_php_button', {
			title: wbcr_inp_tinymce_snippets_button_title,
			type: 'menubutton',
			icon: 'icon wbcr-inp-shortcode-icon',
			menu: menu
		});

	});
})(jQuery);