2 /************************************************************************/
\r
4 /************************************************************************/
\r
5 /* Copyright (c) 2010 */
\r
6 /* Inclusive Design Institute */
\r
8 /* This program is free software. You can redistribute it and/or */
\r
9 /* modify it under the terms of the GNU General Public License */
\r
10 /* as published by the Free Software Foundation. */
\r
11 /************************************************************************/
\r
13 $page = 'form_editor';
\r
14 define('TR_INCLUDE_PATH', '../include/');
\r
15 require_once(TR_INCLUDE_PATH.'vitals.inc.php');
\r
16 require_once(TR_INCLUDE_PATH.'lib/tinymce.inc.php');
\r
17 require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
\r
19 Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
\r
21 $area = $_GET['area'];
\r
24 $parts = explode('_', $area, 2);
\r
25 if (is_numeric($parts[1])) {
\r
27 $title = _AT($parts[0]) . ' ' . $parts[1];
\r
29 $title = _AT($area);
\r
32 $onload = 'onload="init();"';
\r
37 global $errors, $onload;
\r
38 global $_user_location;
\r
40 global $contentManager;
\r
44 if (defined('TR_FORCE_GET_FILE') && TR_FORCE_GET_FILE) {
\r
45 $_tmp_base_href = TR_BASE_HREF . 'get.php/';
\r
47 $_tmp_base_href = 'content/' . $_SESSION['course_id'] . '/';
\r
52 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
\r
55 <title><?php echo _AT('form_editor'); ?></title>
\r
57 <link rel="stylesheet" href="<?php echo $_base_path.'themes/'.$_SESSION['prefs']['PREF_THEME']; ?>/styles.css" type="text/css" />
\r
58 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
\r
59 <base href="<?php echo TR_BASE_HREF; ?>" />
\r
60 <script src="<?php echo $_base_path; ?>include/jscripts/infusion/InfusionAll.js" type="text/javascript"></script>
\r
61 <script src="<?php echo $_base_path; ?>include/jscripts/transformable.js" type="text/javascript"></script>
\r
64 <body <?php echo $onload; ?> >
\r
66 <script type="text/javascript"><!--
\r
68 tinyMCE.activeEditor.setContent(window.opener.document.getElementById("<?php echo $area; ?>").value);
\r
72 <?php load_editor(); ?>
\r
75 <div align="right"><br /><a href="javascript:window.close()"><?php echo _AT('close_window'); ?></a></div>
\r
77 <table cellspacing="1" cellpadding="0" width="99%" border="0" class="bodyline" align="center" summary="">
\r
79 <th class="cyan"><?php echo $title; ?></th>
\r
82 <td colspan="2" valign="top" align="left" class="row1">
\r
83 <table cellspacing="0" cellpadding="0" width="98%" border="0" summary="">
\r
85 <td class="row1" align="left">
\r
86 <textarea name="body_text" id="body_text" rows="15" class="formfield" style="width: 99%;"></textarea>
\r
93 <td height="1" class="row2" colspan="2"></td>
\r
96 <td colspan="2" valign="top" align="center" class="row1">
\r
97 <input type="button" name="paste" value="<?php echo _AT('paste'); ?>" class="button" onclick="javascript:insertTo('<?php echo AT_print($area, 'input.text'); ?>');" />
\r
105 <script type="text/javascript">
\r
107 function insertTo(field) {
\r
108 if (window.opener.document.getElementById(field)) {
\r
109 //use the following if we want to apply absolute path. -harris.
\r
110 //window.opener.document.getElementById(field).value = tinyMCE.activeEditor.getContent({format : 'raw'});
\r
111 window.opener.document.getElementById(field).value = tinyMCE.activeEditor.getContent();
\r
117 <iframe src="<?php echo $_base_path; ?>file_manager/index.php?framed=1<?php echo SEP; ?>popup=1<?php echo SEP; ?>_course_id=<?php echo $_course_id; ?>" name="filemanager" width="98%" height="480">
\r