2 /****************************************************************/
4 /****************************************************************/
5 /* Copyright (c) 2002-2010 */
6 /* Inclusive Design Institute */
9 /* This program is free software. You can redistribute it and/or*/
10 /* modify it under the terms of the GNU General Public License */
11 /* as published by the Free Software Foundation. */
12 /****************************************************************/
15 define('AT_INCLUDE_PATH', '../../../include/');
17 require(AT_INCLUDE_PATH.'vitals.inc.php');
18 require(AT_INCLUDE_PATH.'../mods/_core/editor/editor_tab_functions.inc.php');
20 $cid = intval($_POST['cid']);
23 require(AT_INCLUDE_PATH.'header.inc.php');
24 $missing_fields[] = _AT('content_id');
25 $msg->addError(array('EMPTY_FIELDS', $missing_fields));
26 require (AT_INCLUDE_PATH.'footer.inc.php');
30 $result = $contentManager->getContentPage($cid);
32 if (!($content_row = @mysql_fetch_assoc($result))) {
33 require(AT_INCLUDE_PATH.'header.inc.php');
34 $msg->printErrors('PAGE_NOT_FOUND');
35 require (AT_INCLUDE_PATH.'footer.inc.php');
39 if (defined('AT_FORCE_GET_FILE') && AT_FORCE_GET_FILE) {
40 $course_base_href = 'get.php/';
42 $course_base_href = 'content/' . $_SESSION['course_id'] . '/';
45 if ($content_row['content_path']) {
46 $content_base_href .= $content_row['content_path'].'/';
49 require(AT_INCLUDE_PATH.'header.inc.php');
54 echo '<h2>'.AT_print($stripslashes($_POST['title']), 'content.title').'</h2>';
55 if ($_POST['formatting'] == CONTENT_TYPE_WEBLINK) {
56 $url = $_POST['weblink_text'];
57 $validated_url = isValidURL($url);
58 if (!validated_url || $validated_url !== $url) {
59 $msg->addError(array('INVALID_INPUT', _AT('weblink')));
62 echo format_content($url, $_POST['formatting'], array());
65 echo format_content($stripslashes($_POST['body_text']), $_POST['formatting'], $_POST['glossary_defs']);
70 require(AT_INCLUDE_PATH.'footer.inc.php');