Exemplo n.º 1
0
	}

	// Move tag to lesson
	if ($_GET['action'] == 'move_tag_to_lesson') {
		$lesson_tag_object = LessonTagQuery::create()
			->useTagQuery()
			->filterById($_GET['tag_id'])
			->endUse()
			->findOne()
			->setLessonId($_GET['lesson_id'])
			->save();
	}

	// Move lesson
	if ($_GET['action'] =='move_lesson') {
		moveLesson($_GET['lesson_id'], $_GET['parent_lesson_id']);
	}

	if (isset($_GET['add_topic_lesson'])) {
		addTopicLesson($_GET['topic_id'], $_GET['lesson_id']);
	}

	// Update tag highlighter
	if ($_GET['action'] == 'update_tag_highlighter') {
		$tag_highlighter = getTagHighlighter($_GET['tag_highlighter_id']);
		$tag_highlighter->setRelevantWords($_GET['tag_highlighter_relevant_words'])
			->save();
	}

	// Delete lesson
	if ($_GET['action'] == 'delete_lesson') {
Exemplo n.º 2
0
<?php

# Require files
require_once '../vendor/autoload.php';
require_once '../generated-conf/config.php';
require_once '../app/functions/functions.php';
# Add lesson (if applicable)
if (isset($_POST['lesson_parent_id']) && isset($_POST['lesson_name'])) {
    addLesson($_POST['lesson_parent_id'], $_POST['lesson_name']);
}
# Move lesson (if applicable)
if (isset($_POST['move_lesson'])) {
    moveLesson($_POST['lesson_id'], $_POST['lesson_parent_id']);
}
# Rename lesson (if applicable)
if (isset($_POST['rename_lesson'])) {
    renameLesson($_POST['lesson_id'], $_POST['lesson_summary']);
}
# Get lessons select options
$lessons_select_options = getLessonsSelectOptions($_POST['lesson_parent_id']);
echo <<<s
<html>
<head></head>
<body>
<h1>Add lesson</h1>
<form method="post">
\t<label>Lesson parent</label>
\t<select name="lesson_parent_id">
\t\t{$lessons_select_options}
\t</select>
\t<br/>