2 /************************************************************************/
\r
4 /************************************************************************/
\r
5 /* Copyright (c) 2002-2010 */
\r
6 /* Inclusive Design Institute */
\r
7 /* http://atutor.ca */
\r
9 /* This program is free software. You can redistribute it and/or */
\r
10 /* modify it under the terms of the GNU General Public License */
\r
11 /* as published by the Free Software Foundation. */
\r
12 /************************************************************************/
\r
15 $page = 'form_editor';
\r
16 define('AT_INCLUDE_PATH', '../../../include/');
\r
17 require(AT_INCLUDE_PATH.'vitals.inc.php');
\r
19 require(AT_INCLUDE_PATH.'lib/tinymce.inc.php');
\r
21 authenticate(AT_PRIV_TESTS);
\r
23 $area = $_GET['area'];
\r
26 $parts = explode('_', $area, 2);
\r
27 if (is_numeric($parts[1])) {
\r
29 $title = _AT($parts[0]) . ' ' . $parts[1];
\r
31 $title = _AT($area);
\r
34 $onload = 'onload="init();"';
\r
40 global $errors, $onload;
\r
41 global $_user_location;
\r
44 global $contentManager;
\r
49 if (defined('AT_FORCE_GET_FILE') && AT_FORCE_GET_FILE) {
\r
50 $_tmp_base_href = AT_BASE_HREF . 'get.php/';
\r
52 $_tmp_base_href = 'content/' . $_SESSION['course_id'] . '/';
\r
57 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
\r
60 <title><?php echo _AT('form_editor'); ?></title>
\r
62 <link rel="stylesheet" href="<?php echo $_base_path.'themes/'.$_SESSION['prefs']['PREF_THEME']; ?>/styles.css" type="text/css" />
\r
63 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
\r
64 <base href="<?php echo AT_BASE_HREF; ?>" />
\r
65 <script src="<?php echo $_base_path; ?>jscripts/infusion/InfusionAll.js" type="text/javascript"></script>
\r
66 <script src="<?php echo $_base_path; ?>jscripts/ATutor.js" type="text/javascript"></script>
\r
70 <body <?php echo $onload; ?> >
\r
72 <script type="text/javascript"><!--
\r
74 tinyMCE.activeEditor.setContent(window.opener.document.getElementById("<?php echo $area; ?>"). value);
\r
78 <?php load_editor(); ?>
\r
81 <div align="right"><br /><a href="javascript:window.close()"><?php echo _AT('close_window'); ?></a></div>
\r
83 <table cellspacing="1" cellpadding="0" width="99%" border="0" class="bodyline" align="center" summary="">
\r
85 <th class="cyan"><?php echo $title; ?></th>
\r
88 <td colspan="2" valign="top" align="left" class="row1">
\r
89 <table cellspacing="0" cellpadding="0" width="98%" border="0" summary="">
\r
91 <td class="row1" align="left">
\r
92 <textarea name="body_text" id="body_text" rows="15" class="formfield" style="width: 99%;"></textarea>
\r
99 <td height="1" class="row2" colspan="2"></td>
\r
102 <td colspan="2" valign="top" align="center" class="row1">
\r
103 <input type="button" name="paste" value="<?php echo _AT('paste'); ?>" class="button" onclick="javascript:insertTo('<?php echo $area; ?>');" />
\r
111 <script type="text/javascript">
\r
113 function insertTo(field) {
\r
114 if (window.opener.document.getElementById(field)) {
\r
115 //use the following if we want to apply absolute path. -harris.
\r
116 //window.opener.document.getElementById(field).value = tinyMCE.activeEditor.getContent({format : 'raw'});
\r
117 window.opener.document.getElementById(field).value = tinyMCE.activeEditor.getContent();
\r
124 <iframe src="<?php echo $_base_path; ?>mods/_core/file_manager/index.php?framed=1<?php echo SEP; ?>popup=1" name="filemanager" width="98%" height="480">
\r