LLMS_Admin_System_Report::output_copy_box()

Output the copy for support box


Return Return

(void)


Top ↑

Source Source

File: includes/admin/class.llms.admin.system-report.php

	 * @return void
	 */
	public static function output_copy_box() {
		?>
		<div class="llms-setting-group top">
			<p class="llms-label"><?php _e( 'Support', 'lifterlms' ); ?></p>
			<div id="llms-debug-report">
				<textarea style="display:none;width: 100%" rows="12" readonly="readonly"></textarea>
				<p class="submit">
					<button id="copy-for-support" class="llms-button-primary"><?php _e( 'Copy for Support', 'lifterlms' ); ?></button>
					<a class="llms-button-secondary" href="https://lifterlms.com/my-account/my-tickets/?utm_source=LifterLMS%20Plugin&utm_medium=System%20Report&utm_campaign=Get%20Help&utm_content=button001" target="_blank"><?php _e( 'Get Help', 'lifterlms' ); ?></a>
				</p>
			</div>
		</div>
		<script>
			jQuery( document ).ready( function( $ ) {
				var $textarea = $( '#llms-debug-report textarea' );

				$( '.llms-setting-group' ).each( function( index, element ) {
					var title = $( this ).find( '.llms-label' ).text();
					title = title + '\n' + '-------------------------------------------';
					var val = $( this ).find( 'li' ).text().replace(/  /g, '').replace(/\t/g, '').replace(/\n\n/g, '\n');
					$textarea.val( $textarea.val() + title + '\n' + val + '\n\n' );
				} );

				$( '#copy-for-support' ).on( 'click', function() {
					$textarea.show().select();
					try {
						if ( ! document.execCommand( 'copy' ) ) {
							throw 'Not allowed.';
						}
					} catch( e ) {
						alert( 'copy the text below' );
					}
				} );

				$textarea.on( 'click', function() {
					$( this ).select();
				} );
			});
		</script>
		<?php
	}

	/**


Top ↑

Changelog Changelog

Changelog
Version Description
3.11.2 Unknown.
2.1.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.