remove old readme
[atutor.git] / mods / _core / editor / editor_tabs / edit.inc.php
1 <?php\r
2 /****************************************************************/\r
3 /* ATutor                                                                                                               */\r
4 /****************************************************************/\r
5 /* Copyright (c) 2002-2009                                                                              */\r
6 /* Inclusive Design Institute                                   */\r
7 /* http://atutor.ca                                                                                             */\r
8 /*                                                              */\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
13 // $Id$\r
14 \r
15 if (!defined('AT_INCLUDE_PATH')) { exit; }\r
16 ?>\r
17     <script type="text/javascript" language="javascript">\r
18     //<!--\r
19         ATutor.mods.editor.editor_pref = "<?php if(isset($_SESSION['prefs']['PREF_CONTENT_EDITOR'])) echo $_SESSION['prefs']['PREF_CONTENT_EDITOR'] ?>";\r
20     //-->\r
21     </script>\r
22     <input type="hidden" name="displayhead" id="displayhead" value="<?php if ($_POST['displayhead']==1 || $_REQUEST['displayhead']==1 || $_GET['displayhead']==1) echo '1'; else echo '0'; ?>" />\r
23     <input type="hidden" name="displaypaste" id="displaypaste" value="<?php if ($_POST['displaypaste']==1 || $_REQUEST['displaypaste']==1 || $_GET['displaypaste']==1) echo '1'; else echo '0'; ?>" />\r
24     <input type="hidden" name="complexeditor" id="complexeditor" value="<?php if ($_POST['complexeditor']==1 || $_REQUEST['complexeditor']==1 || $_GET['complexeditor']==1) echo '1'; else echo '0'; ?>" />\r
25 \r
26         <div class="row">\r
27             <span>\r
28                 <span class="required" title="<?php echo _AT('required_field'); ?>">*</span><label for="ctitle"><strong><?php echo _AT('title');  ?></strong></label>\r
29                 <input type="text" name="title" id="ctitle" size="60" class="formfield" value="<?php echo ContentManager::cleanOutput($_POST['title']); ?>" />\r
30         </span>\r
31        <br /> <span class="nowrap">\r
32         <label for="formatting_radios"><span class="required" title="<?php echo _AT('required_field'); ?>">*</span><strong><?php echo _AT('formatting'); ?></strong></label>\r
33         <span id="formatting_radios">\r
34             <input type="radio" name="formatting" value="0" id="text" <?php if ($_POST['formatting'] == 0) { echo 'checked="checked"'; } ?> />\r
35             <label for="text"><?php echo _AT('plain_text'); ?></label>\r
36 \r
37             <input type="radio" name="formatting" value="1" id="html" <?php if ($_POST['formatting'] == 1) { echo 'checked="checked"'; } ?> />\r
38             <label for="html"><?php echo _AT('html'); ?></label>\r
39        \r
40             <input type="radio" name="formatting" value="3" id="html_visual_editor" <?php if ($_POST['formatting'] == 3) { echo 'checked="checked"'; } ?> />\r
41             <label for="html_visual_editor"><?php echo _AT('html') . ' - '. _AT('visual_editor'); ?></label>\r
42        \r
43             <input type="radio" name="formatting" value="2" id="weblink" <?php if ($_POST['formatting'] == 2) { echo 'checked="checked"'; } ?> />\r
44             <label for="weblink"><?php echo _AT('weblink'); ?></label>\r
45        </span>\r
46        </span>\r
47     </div>\r
48 \r
49 <?php\r
50                 if ($content_row['content_path']) {\r
51                         echo '  <div class="row"><strong>'._AT('packaged_in').':</strong>&nbsp;&nbsp;'.$content_row['content_path'].'</div>';\r
52                 }\r
53         if (trim($_POST['head']) == '<br />') {\r
54               $_POST['head'] = '';\r
55         }\r
56         if ($do_check) {\r
57                $_POST['head'] = $stripslashes($_POST['head']);\r
58         }\r
59 ?>\r
60     <script type="text/javascript" language="javascript">\r
61     //<!--\r
62         ATutor.mods.editor.content_path = "<?php if(isset($content_row['content_path'])) echo $content_row['content_path'] ?>";\r
63         ATutor.mods.editor.content_id = "<?php if(isset($cid)) echo $cid ?>";\r
64         ATutor.mods.editor.head_enabled_title = "<?php echo _AT('customized_head_enabled_title'); ?>";\r
65         ATutor.mods.editor.head_disabled_title = "<?php echo _AT('customized_head_disabled_title'); ?>";\r
66         ATutor.mods.editor.paste_enabled_title = "<?php echo _AT('paste_enabled_title'); ?>";\r
67         ATutor.mods.editor.paste_disabled_title = "<?php echo _AT('paste_disabled_title'); ?>";\r
68         ATutor.mods.editor.fileman_enabled_title = "<?php echo _AT('fileman_enabled_title').' - '._AT('new_window'); ?>";\r
69         ATutor.mods.editor.fileman_disabled_title = "<?php echo _AT('fileman_disabled_title'); ?>";\r
70         ATutor.mods.editor.accessibility_enabled_title = "<?php echo _AT('accessibility_enabled').' - '._AT('new_window'); ?>";\r
71         ATutor.mods.editor.accessibility_disabled_title = "<?php echo _AT('accessibility_disabled'); ?>";\r
72         ATutor.mods.editor.processing_text = "<?php echo _AT('processing'); ?>";\r
73     //-->\r
74     </script>\r
75     \r
76     <div class="fl-container fl-fix">\r
77       <ul id="content-tool-links">\r
78         <?php \r
79         foreach ($_content_tools as $tool) {\r
80                 echo '<li><img id="'.$tool["id"].'" class="'.$tool["class"].'" title="'.$tool['title'].'" src="'.$tool['src'].'" alt="'.$tool['alt'].'" height="30" width="30" />'.$tool["text"].'</li>'."\n";\r
81         }\r
82         ?>\r
83       </ul>\r
84         </div> <!-- end toolbar -->\r
85 \r
86         <!-- Customized head -->\r
87         <div id="head" class="row fl-fix">\r
88         <label for="headtext"><?php echo _AT('customized_head');  ?>\r
89         <small>(<?php echo _AT('customized_head_note'); ?>)</small></label>\r
90         <input type="checkbox" name="use_customized_head" id="use_customized_head" value="1" <?php if ($_POST['use_customized_head']) { echo 'checked="checked"'; } ?> />\r
91         <label for="use_customized_head"><?php echo _AT('use_customized_head'); ?></label>\r
92                 <textarea id="headtext" name="head" cols="" rows="10"><?php echo htmlspecialchars($_POST['head']); ?></textarea>        \r
93         </div>\r
94                 \r
95     <!-- Paste from file -->\r
96         <div id="paste" class="row">\r
97         <div><?php echo _AT('paste_file')?><small>(<?php echo _AT('html_only'); ?>)</small></div>\r
98         <input title="<?php echo _AT('browse_for_upload'); ?>" type="file" name="uploadedfile_paste" id="uploadedfile" class="formfield" size="20" /> \r
99         <input type="submit" name="submit_file" value="<?php echo _AT('upload'); ?>"  class="button" />\r
100     </div>\r
101    \r
102     <?php \r
103         // kludge #1548\r
104         if (trim($_POST['body_text']) == '<br />') {\r
105                $_POST['body_text'] = '';\r
106         }\r
107         if ($do_check) {\r
108                $_POST['body_text'] = $stripslashes($_POST['body_text']);\r
109         }\r
110     ?>\r
111 \r
112     <div class="row">\r
113         <span id="textSpan">\r
114             <label for="body_text"><strong><?php echo _AT('body');  ?></strong></label><br />\r
115                     <textarea name="body_text" id="body_text" cols="" rows="20"><?php echo htmlspecialchars($_POST['body_text']);?></textarea>\r
116                 </span>\r
117                 <span id="weblinkSpan"> \r
118                 <label for="weblink_text"><?php echo _AT('weblink');  ?></label>\r
119             <input name="weblink_text" id="weblink_text" value="<?php echo ($_POST['weblink_text']!=''?htmlspecialchars($_POST['weblink_text']):'http://'); ?>" />\r
120                 </span>\r
121         </div>\r
122 \r