<?php 

function cp_attach_lesson_material_link_cb() {
	 
	if(!isset($_GET['id'])) return_method();
	$lesson_id = $_GET['id'];
	?>
	<form id="lesson-material-link-form" action="contents/plugins/classroom_plus/ajax.php" data-clearform=1>
		<input type="hidden" name="lesson_id" value="<?php echo $lesson_id; ?>" id="lesson_id">
		<?php 
			input(['label' => 'Title', 'id' => 'material-title', 'required' => 'required']);
			input(['label' => 'Link URL', 'id' => 'material-url', 'required' => 'required']);
			input(['label' => 'Link Text', 'id' => 'link_text', 'required' => 'required', 'value' => 'Go to Link']);
			textarea(['label' => 'Description(Optional)', 'id' => 'material-description']);
			submit_btn("attach_lesson_material_link", '<span class="btn-inner--icon"><i class="ni ni-user-run"></i></span>
        <span class="btn-inner--text">Publish</span>');
		 ?>
	</form>
	<?php
	global $post_meta;
	add_page_javascript('app/assets/js/page-scripts/js-functions.js');
	add_page_javascript('app/assets/js/page-scripts/submit.js');
}