} return $filename; } // MAIN $display = ''; $mode = ''; if (isset($_REQUEST['mode'])) { $mode = $_REQUEST['mode']; } if ($mode == $LANG_ADMIN['delete'] && !empty($LANG_ADMIN['delete'])) { $tid = COM_applyFilter($_POST['tid']); if (!isset($tid) || empty($tid)) { COM_errorLog('Attempted to delete topic tid=' . $tid); COM_redirect($_CONF['site_admin_url'] . '/topic.php'); } elseif (SEC_checkToken()) { $display .= deleteTopic($tid); } else { COM_accessLog("User {$_USER['username']} tried to illegally delete topic {$tid} and failed CSRF checks."); COM_redirect($_CONF['site_admin_url'] . '/index.php'); } } elseif ($mode == $LANG_ADMIN['save'] && !empty($LANG_ADMIN['save']) && SEC_checkToken()) { if (empty($_FILES['newicon']['name'])) { $imageurl = COM_applyFilter($_POST['imageurl']); } else { $imageurl = handleIconUpload($_POST['tid']); $imageurl = COM_applyFilter($imageurl); } $is_default = ''; if (isset($_POST['is_default'])) { $is_default = $_POST['is_default']; }
} # Add topic adoptee (if applicable) if (isset($_GET['add_topic_adoptee'])) { addTopicAdoptee($_GET['topic_parent_id'], $_GET['topic_adoptee_id']); } # Move topic (if applicable) if (isset($_GET['move_topic'])) { moveTopic($_GET['topic_id'], $_GET['topic_parent_id']); } # Rename topic (if applicable) if (isset($_GET['rename_topic'])) { renameTopic($_GET['topic_id'], $_GET['topic_name']); } # Delete topic (if applicable) if (isset($_GET['delete_topic'])) { deleteTopic($_GET['topic_id']); } # Get topics select options $topics_select_options = getTopicsSelectOptions($_GET['topic_parent_id']); echo <<<s <html> <head></head> <body> <h1>Add topic</h1> <form> \t<label>Topic parent</label> \t<select name="topic_parent_id"> \t\t{$topics_select_options} \t</select> \t<br/> \t<label>Topic name</label>
<?php include "functions.php"; session_start(); // -------------------- DELETE TOPIC ----------------------- if (isset($_POST['deleteID'])) { deleteTopic($_POST['deleteID']); } if (isset($_POST['newID']) && isset($_POST['subj']) && !isset($POST['topicID'])) { newTopic($_POST['newID'], $_POST['subj']); } if (isset($_POST['topicName']) && isset($_POST['subj']) && isset($_POST['topicID'])) { editTopic($_POST['topicName'], $_POST['subj'], $_POST['topicID']); } if (isset($_POST['drag_topic'])) { //die($_SESSION['user_ID']); getTableQuestionSingle($_POST['drag_topic'], $_SESSION['user_ID']); //echo "all good so far"; // showSelectTopic() } //edit question if (isset($_POST['ans']) && isset($_POST['ques']) && isset($_POST['diff']) && isset($_POST['question_ID'])) { editQuestion($_POST['question_ID'], $_POST['ques'], $_POST['ans'], $_POST['diff']); } //delete question if (isset($_POST['questionID']) && isset($_POST['questionConfirm'])) { deleteQuestionSingle($_POST['questionID']); } //save new question if (isset($_POST['ques']) && isset($_POST['topicID']) && isset($_POST['ans']) && isset($_POST['diff']) && isset($_POST['newQues'])) { //first, validate the data
require_once 'siteAdmin.php'; $fileInfo = array('fileName' => 'includes/faqEditMethods.php'); $debug->newFile($fileInfo['fileName']); $success = false; if (MODE == 'addFaq') { addFaq(); } elseif (MODE == 'addTopic') { addTopic(); } elseif (MODE == 'buildFaqs') { buildFaqs(); } elseif (MODE == 'changeFaqTopic') { changeFaqTopic(); } elseif (MODE == 'deleteFaq') { deleteFaq(); } elseif (MODE == 'deleteTopic') { deleteTopic(); } elseif (MODE == 'modifyFaq') { modifyFaq(); } elseif (MODE == 'modifyTopic') { modifyTopic(); } else { $debug->add('No matching mode in ' . $fileInfo['fileName'] . '.'); } function addFaq() { global $debug, $message, $success, $Dbc, $returnThis; $output = ''; if (empty($_POST['chooseTopicDropDownVal'])) { error(__LINE__, '', '$_POST[\'chooseTopicDropDownVal\'] is empty.'); } else { try {
$element_ordering = intval(mosGetParam($_REQUEST, 'element_ordering', 0)); $state = intval(mosGetParam($_REQUEST, 'state', 0)); $t_id = intval(mosGetParam($_REQUEST, 't_id', 0)); require_once _JOOMLMS_FRONT_HOME . "/joomla_lms.topics.html.php"; require_once _JOOMLMS_FRONT_HOME . "/joomla_lms.topics.class.php"; require_once _JOOMLMS_FRONT_HOME . "/joomla_lms.docs.hlpr.php"; switch ($task) { // case 'details_course': showCourseDetails( $option ); break; case 'orderup_topic': orderTopic($course_id, $topic_ordering, -1); break; case 'orderdown_topic': orderTopic($course_id, $topic_ordering, 1); break; case 'delete_topic': deleteTopic($course_id, $topic_id); break; case 'add_topic_element': $course = new JLMS_Course_HomePage($course_id, true); $course->listElements($topic_id); break; case 'add_submit_topic_element': addElement($course_id, $topic_id, $t_id); break; case 'publish_topic': publishTopic($course_id, $topic_id, mosGetParam($_REQUEST, 'state', 0)); break; case 'add_topic': case 'edit_topic': editTopic($course_id, $topic_id); break;