2 /****************************************************************/
4 /****************************************************************/
5 /* Copyright (c) 2002-2009 */
6 /* Adaptive Technology Resource Centre / University of Toronto */
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 if (!defined('AT_INCLUDE_PATH')) { exit; }
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" id="ctitle" size="70" class="formfield" value="<?php echo ContentManager::cleanOutput($_POST['title']); ?>" />
24 if ($content_row['content_path']) {
25 echo ' <div class="row">'._AT('packaged_in').'<br />'.$content_row['content_path'].'</div>';
30 <label for="edithead"><?php echo _AT('customized_head'); ?></label>
31 <input type="button" name="edithead" id="edithead" value="<?php echo _AT('edit'); ?>" onclick="switch_head_editor()" class="button"/><br />
32 <small>· <?php echo _AT('customized_head_note'); ?></small>
36 if (trim($_POST['head']) == '<br />') {
40 $_POST['head'] = $stripslashes($_POST['head']);
45 <div id="headDiv" style="display:none">
46 <input type="checkbox" name="use_customized_head" id="use_customized_head" value="1" <?php if ($_POST['use_customized_head']) { echo 'checked="checked"'; } ?> />
47 <label for="use_customized_head"><?php echo _AT('use_customized_head'); ?></label><br />
48 <label for="head"><?php echo _AT('customized_head'); ?></label><br /><textarea name="head" id="head" cols="" rows="10"><?php echo htmlspecialchars($_POST['head']); ?></textarea>
53 <?php echo _AT('formatting'); ?><br />
55 <input type="radio" name="formatting" value="0" id="text" <?php if ($_POST['formatting'] == 0) { echo 'checked="checked"'; } ?> onclick="javascript: document.form.setvisualbutton.disabled=true; switch_body_weblink(this.value);" />
56 <label for="text"><?php echo _AT('plain_text'); ?></label>
58 <input type="radio" name="formatting" value="1" id="html" <?php if ($_POST['formatting'] == 1 || $_POST['setvisual']) { echo 'checked="checked"'; } ?> onclick="javascript: document.form.setvisualbutton.disabled=false; switch_body_weblink(this.value);"/>
60 <label for="html"><?php echo _AT('html'); ?></label>
62 <input type="hidden" name="displayhead" value="<?php if ($_POST['displayhead']==1 || $_REQUEST['displayhead']==1 || $_GET['displayhead']==1) echo '1'; else echo '0'; ?>" />
63 <input type="hidden" name="setvisual" value="<?php if ($_POST['setvisual']==1 || $_REQUEST['setvisual']==1 || $_GET['setvisual']==1) echo '1'; else echo '0'; ?>" />
64 <input type="hidden" name="settext" value="<?php if ($_POST['settext']==1 || $_REQUEST['settext']==1 || $_GET['settext']==1) echo '1'; else echo '0'; ?>" />
65 <input type="button" name="setvisualbutton" value="<?php echo _AT('switch_visual'); ?>" onclick="switch_body_editor()" class="button" />
67 <input type="radio" name="formatting" value="2" id="weblink" <?php if ($_POST['formatting'] == 2) { echo 'checked="checked"'; } ?> onclick="javascript: document.form.setvisualbutton.disabled=true; switch_body_weblink(this.value);"/>
68 <label for="weblink"><?php echo _AT('weblink'); ?></label>
70 <script type="text/javascript" language="javascript">
72 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>");
76 <a href="<?php echo AT_BASE_HREF; ?>tools/filemanager/index.php?framed=1"><?php echo _AT('open_file_manager'); ?></a>
80 <!-- ******** Tool Manager ******* -->
82 <?php //TODO***************BOLOGNA******************REMOVE ME***********/
83 echo _AT('tools_manager').'<br/>';
85 foreach($all_tools as $tool) {
86 if($tool['tool_file'] != '' && $tool['table'] != '') {
87 $sql_assoc = "SELECT * FROM ".TABLE_PREFIX.$tool['table']." WHERE content_id='$cid'";
88 $result_assoc = mysql_query($sql_assoc,$db);
89 if($num_row = mysql_num_rows($result_assoc)){
90 $tool['style']='border:solid; border-color:#43addb';
91 $tool['alt'] = $tool['title'].' added';
94 $tool['alt'] = $tool['title'].' noen';
98 <script type="text/javascript" language="javascript">
99 document.write(" <a href=\"#\" onclick=\"window.open('<?php echo AT_BASE_HREF; ?>tools/toolmanager/index.php?framed=1<?php echo SEP; ?>popup=1<?php echo SEP; ?>tool_file=<?php echo $tool['tool_file'].SEP;?>cid=<?php echo $cid;?>','newWin2','menubar=0,scrollbars=1,resizable=1,width=600,height=400'); return false;\"><img id=\"<?php echo $tool['title'];?>\" style=\"<?php echo $tool['style'];?>\" src='<?php echo $tool['img']; ?>' alt='<?php echo $tool['alt'];?>' title='<?php echo $tool['title'];?>' height='30' hspace='2' border='0'/></a>");
104 echo '<em>'._AT('none_found').'</em>';
108 <!-- ****** end Tool Manager ***** -->
112 <label for="body_text"><?php echo _AT('body'); ?></label><br />
117 if (trim($_POST['body_text']) == '<br />') {
118 $_POST['body_text'] = '';
121 $_POST['body_text'] = $stripslashes($_POST['body_text']);
124 //check if this is a weblink.
125 $body_text_hidden = '';
126 $weblink_text_hidden = 'display:none;';
127 if ($_POST['formatting']==CONTENT_TYPE_WEBLINK) {
128 $_POST['weblink_text'] = $_POST['body_text'];
129 $_POST['body_text'] = '';
130 $body_text_hidden = 'display:none;';
131 $weblink_text_hidden = '';
134 <textarea name="body_text" id="body_text" cols="" rows="20" style="<?php echo $body_text_hidden; ?>"><?php echo htmlspecialchars($_POST['body_text']); ?></textarea>
135 <input name="weblink_text" id="weblink_text" value="<?php echo ($_POST['weblink_text']!=''?htmlspecialchars($_POST['weblink_text']):'http://'); ?>" style="width:60%; <?php echo $weblink_text_hidden; ?>"/>
139 <?php require(AT_INCLUDE_PATH.'html/editor_tabs/content_code_picker.inc.php'); ?>
143 <strong><?php echo _AT('or'); ?></strong> <label for="uploadedfile"><?php echo _AT('paste_file'); ?></label><br />
144 <input type="file" name="uploadedfile_paste" id="uploadedfile" class="formfield" size="20" /> <input type="submit" name="submit_file" value="<?php echo _AT('upload'); ?>" class="button" /><br />
145 <small class="spacer">·<?php echo _AT('html_only'); ?><br />
146 ·<?php echo _AT('edit_after_upload'); ?></small>
149 <script type="text/javascript" language="javascript">
153 if (document.getElementById("text").checked)
154 document.form.setvisualbutton.disabled = true;
156 if (document.form.displayhead.value==1)
158 document.getElementById("headDiv").style.display = '';
159 document.form.edithead.value = "<?php echo _AT('hide'); ?>"
162 if (document.form.setvisual.value==1)
164 tinyMCE.execCommand('mceAddControl', false, 'body_text');
165 document.form.formatting[0].disabled = "disabled";
166 document.form.setvisualbutton.value = "<?php echo _AT('switch_text'); ?>";
170 document.form.setvisualbutton.value = "<?php echo _AT('switch_visual'); ?>";
174 // show/hide "cusomized head" editor
175 function switch_head_editor()
177 if (document.form.edithead.value=="<?php echo _AT('edit'); ?>")
179 document.form.edithead.value = "<?php echo _AT('hide'); ?>"
180 document.getElementById("headDiv").style.display = "";
181 document.form.displayhead.value=1;
185 document.form.edithead.value = "<?php echo _AT('edit'); ?>"
186 document.getElementById("headDiv").style.display = "none";
187 document.form.displayhead.value=0;
191 // switch between text, visual editor for "body text"
192 function switch_body_editor()
194 if (document.form.setvisualbutton.value=="<?php echo _AT('switch_visual'); ?>")
196 tinyMCE.execCommand('mceAddControl', false, 'body_text');
197 document.form.setvisual.value=1;
198 document.form.settext.value=0;
199 document.form.formatting[0].disabled = "disabled";
200 document.form.setvisualbutton.value = "<?php echo _AT('switch_text'); ?>";
204 disable_visual_txt();
208 //switch between weblinks.
209 function switch_body_weblink(formatting){
211 if (document.form.setvisualbutton.value=="<?php echo _AT('switch_text'); ?>"){
212 //take out the visual editor
213 disable_visual_txt();
216 document.form.body_text.style.display = "none";
217 document.form.weblink_text.style.display = "inline";
219 document.form.body_text.style.display = "inline";
220 document.form.weblink_text.style.display = "none";
224 //disabling the text box.
225 function disable_visual_txt(){
226 tinyMCE.execCommand('mceRemoveControl', false, 'body_text');
227 document.form.setvisual.value=0;
228 document.form.settext.value=1;
229 document.form.formatting[0].disabled = "";
230 document.form.setvisualbutton.value = "<?php echo _AT('switch_visual'); ?>";