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');
17 require(TR_INCLUDE_PATH.'../home/classes/ContentUtility.class.php');
19 global $_course_id, $_content_id, $contentManager;
21 Utility::authenticate(TR_PRIV_ISAUTHOR);
26 require(TR_INCLUDE_PATH.'header.inc.php');
27 $msg->printInfos('NO_PAGE_CONTENT');
28 require (TR_INCLUDE_PATH.'footer.inc.php');
32 if (isset($contentManager)) $content_row = $contentManager->getContentPage($cid);
34 if (!$content_row || !isset($contentManager)) {
35 require(TR_INCLUDE_PATH.'header.inc.php');
36 $msg->printErrors('MISSING_CONTENT');
37 require (TR_INCLUDE_PATH.'footer.inc.php');
41 if (defined('TR_FORCE_GET_FILE') && TR_FORCE_GET_FILE) {
42 $course_base_href = 'get.php/';
44 $course_base_href = 'content/' . $_course_id . '/';
47 if ($content_row['content_path']) {
48 $content_base_href .= $content_row['content_path'].'/';
51 $popup = intval($_GET['popup']);
52 require(TR_INCLUDE_PATH.'header.inc.php');
56 echo '<h2>'.AT_print($stripslashes($_POST['title']), 'content.title').'</h2>';
57 if ($_POST['formatting'] == CONTENT_TYPE_WEBLINK) {
58 $url = $_POST['weblink_text'];
59 $validated_url = isValidURL($url);
60 if (!validated_url || $validated_url !== $url) {
61 $msg->addError(array('INVALID_INPUT', _AT('weblink')));
64 echo ContentUtility::formatContent($url, $_POST['formatting']);
67 echo ContentUtility::formatContent($stripslashes($_POST['body_text']), $_POST['formatting']);
72 require(TR_INCLUDE_PATH.'footer.inc.php');