2 /************************************************************************/
4 /************************************************************************/
5 /* Copyright (c) 2010 */
6 /* Inclusive Design Institute */
8 /* This program is free software. You can redistribute it and/or */
9 /* modify it under the terms of the GNU General Public License */
10 /* as published by the Free Software Foundation. */
11 /************************************************************************/
13 define('TR_INCLUDE_PATH', '../../include/');
15 require(TR_INCLUDE_PATH.'vitals.inc.php');
16 require(TR_INCLUDE_PATH.'../home/editor/editor_tab_functions.inc.php');
18 // commented out this require which was causing the a redeclare error #4846
19 // delete the following line when its confirmed the require is not needed
20 // require(TR_INCLUDE_PATH.'../home/classes/ContentUtility.class.php');
22 global $_course_id, $_content_id, $contentManager;
24 Utility::authenticate(TR_PRIV_ISAUTHOR);
29 require(TR_INCLUDE_PATH.'header.inc.php');
30 $msg->printInfos('NO_PAGE_CONTENT');
31 require (TR_INCLUDE_PATH.'footer.inc.php');
35 if (isset($contentManager)) $content_row = $contentManager->getContentPage($cid);
37 if (!$content_row || !isset($contentManager)) {
38 require(TR_INCLUDE_PATH.'header.inc.php');
39 $msg->printErrors('MISSING_CONTENT');
40 require (TR_INCLUDE_PATH.'footer.inc.php');
44 if (defined('TR_FORCE_GET_FILE') && TR_FORCE_GET_FILE) {
45 $course_base_href = 'get.php/';
47 $course_base_href = 'content/' . $_course_id . '/';
50 if ($content_row['content_path']) {
51 $content_base_href .= $content_row['content_path'].'/';
54 $popup = intval($_GET['popup']);
55 require(TR_INCLUDE_PATH.'header.inc.php');
59 echo '<h2>'.AT_print($stripslashes($_POST['title']), 'content.title').'</h2>';
60 if ($_POST['formatting'] == CONTENT_TYPE_WEBLINK) {
61 $url = $_POST['weblink_text'];
62 $validated_url = isValidURL($url);
63 if (!validated_url || $validated_url !== $url) {
64 $msg->addError(array('INVALID_INPUT', _AT('weblink')));
67 echo ContentUtility::formatContent($url, $_POST['formatting']);
70 echo ContentUtility::formatContent($stripslashes($_POST['body_text']), $_POST['formatting']);
75 require(TR_INCLUDE_PATH.'footer.inc.php');