<?php 

function classroom_plus_template($templates) {
	$templates[] = 'classroom_plus';
	return $templates;
}

function classroom_plus_template_link($link, ...$post_meta) {
	return "contents/plugins/classroom_plus/template/classroom_plus.php";
}

function cp_view_material_header($title) {
	if(!isset($_GET['id'])) {
		return $title;
	}
	$post = new post;
	$meta = $post->get_post_meta($_GET['id']);
	return "Material: ".$meta['material-title'];
}

function cp_lesson_header($title) {
	if(!isset($_GET['id'])) {
		return $title;
	}
	$post = new post;
	$meta = $post->get_post_meta($_GET['id']);
	return "Lesson Topic: ".$meta['topic'];
}

function cp_select_topic_header($title) {
  return "Select Topic: ".get_class_name($_GET['class'])." ".get_course_name($_GET['subject']);
}