tagging as ATutor 1.5.4-release
[atutor.git] / include / html / editor_tabs / edit.inc.php
1 <?php
2 /****************************************************************/
3 /* ATutor                                                                                                               */
4 /****************************************************************/
5 /* Copyright (c) 2002-2007 by Greg Gay & Joel Kronenberg        */
6 /* Adaptive Technology Resource Centre / University of Toronto  */
7 /* http://atutor.ca                                                                                             */
8 /*                                                              */
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 /****************************************************************/
13 // $Id$
14
15 if (!defined('AT_INCLUDE_PATH')) { exit; }
16
17 ?>
18         <div class="row">
19                 <div class="required" title="<?php echo _AT('required_field'); ?>">*</div><label for="ctitle"><?php echo _AT('title');  ?></label><br />
20                 <input type="text" name="title" size="70" class="formfield" value="<?php echo ContentManager::cleanOutput($_POST['title']); ?>" id="ctitle" />
21         </div>
22         
23         <?php
24                 if ($content_row['content_path']) {
25                         echo '  <div class="row">'._AT('packaged_in').'<br />'.$content_row['content_path'].'</div>';
26                 }
27         ?>
28         <div class="row">
29                 <?php echo _AT('formatting'); ?><br />
30
31                 <input type="radio" name="formatting" value="0" id="text" <?php if ($_POST['formatting'] == 0) { echo 'checked="checked"'; } ?> onclick="javascript: document.form.setvisual.disabled=true;" <?php if ($_POST['setvisual'] && !$_POST['settext']) { echo 'disabled="disabled"'; } ?> />
32                 <label for="text"><?php echo _AT('plain_text'); ?></label>
33
34                 , <input type="radio" name="formatting" value="1" id="html" <?php if ($_POST['formatting'] == 1 || $_POST['setvisual']) { echo 'checked="checked"'; } ?> onclick="javascript: document.form.setvisual.disabled=false;"/>
35                 <label for="html"><?php echo _AT('html'); ?></label>
36
37                 <?php if (($_POST['setvisual'] && !$_POST['settext']) || $_GET['setvisual']) : ?>
38                         <input type="hidden" name="setvisual" value="<?php echo $_POST['setvisual']; ?>" />
39                         <input type="submit" name="settext" value="<?php echo _AT('switch_text'); ?>" />
40                 <?php else: ?>
41                         <input type="submit" name="setvisual" value="<?php echo _AT('switch_visual'); ?>" <?php if ($_POST['formatting']==0) { echo 'disabled="disabled"'; } ?> />
42                 <?php endif; ?>
43                 <script type="text/javascript" language="javascript">
44                 //<!--
45                         document.write(" <a href=\"#\" onclick=\"window.open('<?php echo AT_BASE_HREF; ?>tools/filemanager/index.php?framed=1<?php echo SEP; ?>popup=1<?php echo SEP; ?>cp=<?php echo $content_row['content_path']; ?>','newWin1','menubar=0,scrollbars=1,resizable=1,width=640,height=490'); return false;\"><?php echo _AT('open_file_manager'); ?> </a>");
46                 //-->
47                 </script>
48                 <noscript>
49                         <a href="<?php echo AT_BASE_HREF; ?>tools/filemanager/index.php?framed=1"><?php echo _AT('open_file_manager'); ?></a>
50                 </noscript>                     
51         </div>
52         <div class="row">
53                 <label for="body_text"><?php echo _AT('body');  ?></label><br />
54
55 <?php 
56
57 // kludge #1548
58 if (trim($_POST['body_text']) == '<br />') {
59         $_POST['body_text'] = '';
60 }
61
62 ?>
63
64                 <textarea name="body_text" id="body_text" cols="" rows="20"><?php echo ContentManager::cleanOutput($_POST['body_text']); ?></textarea>  
65         </div>
66         <div class="row">
67                 <?php require(AT_INCLUDE_PATH.'html/editor_tabs/content_code_picker.inc.php'); ?>
68         </div>
69
70         <div class="row">
71                 <strong><?php echo _AT('or'); ?></strong> <?php echo _AT('paste_file'); ?><br />
72                 <input type="file" name="uploadedfile" class="formfield" size="20" /> <input type="submit" name="submit_file" value="<?php echo _AT('upload'); ?>" /><br />
73                 <small class="spacer">&middot;<?php echo _AT('html_only'); ?><br />
74                 &middot;<?php echo _AT('edit_after_upload'); ?></small>
75         </div>