http://www.atutor.ca/atutor/mantis/view.php?id=2269
authorjoel kronenberg <joel.kronenberg@utoronto.ca>
Wed, 14 Dec 2005 17:29:39 +0000 (17:29 -0000)
committerjoel kronenberg <joel.kronenberg@utoronto.ca>
Wed, 14 Dec 2005 17:29:39 +0000 (17:29 -0000)
http://www.atutor.ca/atutor/mantis/view.php?id=2268

docs/include/header.inc.php
docs/include/html/editor_tabs/content_code_picker.inc.php
docs/include/html/editor_tabs/edit.inc.php
docs/include/html/filemanager_display.inc.php
docs/tools/filemanager/index.php
docs/tools/filemanager/top.php
docs/tools/tests/form_editor.php

index 8165dae..9c749d3 100644 (file)
@@ -205,9 +205,9 @@ if ($_SESSION['course_id'] > -1) {
 // if filemanager is a inside a popup or a frame
 // i don't like this code. i don't know were these two variables are coming from
 // anyone can add ?framed=1 to a URL to alter the behaviour.
-if ($framed || $popup) {
-       $savant->assign('framed', $framed);
-       $savant->assign('popup', $popup);
+if ($_REQUEST['framed'] || $_REQUEST['popup']) {
+       $savant->assign('framed', 1);
+       $savant->assign('popup', 1);
        $savant->display('include/fm_header.tmpl.php');
 } else {
        $savant->display('include/header.tmpl.php');
index 363bc64..1be14c3 100644 (file)
@@ -19,12 +19,10 @@ if (!defined('AT_INCLUDE_PATH')) { exit; }
 <table border="0" cellspacing="0" cellpadding="0" width="100%">
 <?php
        if (isset($current_tab)) {
-               if (!($_POST['setvisual'] && !$_POST['settext'])) {
-                       echo '<tr><td align="right"><small><b>'._AT('codes').': </b></small></td><td><small>';
-                       echo '<a href="javascript:smilie(\'[?]\', \'[/?]\')" title="[?][/?]">',_AT('add_term'), '</a> ';
-                       echo '<a href="javascript:smilie(\'[code]\', \'[/code]\')" title="[code][/code]" onclick="document.form.formatting.html.checked=\'true\';">'._AT('add_code').'</a>';
+                       echo '<tr><td align="right"><small><strong>'._AT('codes').': </strong></small></td><td><small>';
+                       echo '<a href="javascript:smilie(\'[?] [/?]\')" title="[?][/?]">',_AT('add_term'), '</a> ';
+                       echo '<a href="javascript:smilie(\'[code] [/code]\')" title="[code][/code]">'._AT('add_code').'</a>';
                        echo '</small></td></tr>';
-               }
        } ?>
 <tr>
        <td align="right"><small><b><?php echo _AT('colors'); ?>:</b></small></td>
@@ -41,34 +39,32 @@ if (!defined('AT_INCLUDE_PATH')) { exit; }
 </tr>
 </table>
 
-<?php if ($_POST['setvisual'] && !$_POST['settext']) { ?>
-
-<script type="text/javascript"><!--
-function smilie(thesmilie, extra) {
-       editor.focusEditor();
-       if (!extra) {
-               editor.insertHTML(thesmilie);
-       }
-       else
-       {
-               editor.surroundHTML(thesmilie, extra);
+<?php if ($_POST['setvisual'] && !$_POST['settext']): ?>
+       <script type="text/javascript">
+       //<!--
+       function smilie(thesmilie, extra) {
+               tinyMCE.execCommand("mceInsertContent", false, thesmilie);
+               return;
+               editor.focusEditor();
+               if (!extra) {
+                       editor.insertHTML(thesmilie);
+               } else {
+                       editor.surroundHTML(thesmilie, extra);
+               }
        }
-}
-//--></script>
-
-<?php } else { ?>
+       //--></script>
+<?php else: ?>
+       <script type="text/javascript">
+       //<!--
+       function smilie(thesmilie, extra) {
+               if (!extra) {
+                       document.form.body_text.value += thesmilie+" ";
+                       document.form.body_text.focus();
+               } else {
+                       document.form.body_text.value += thesmilie+extra+" ";
+                       document.form.body_text.focus();
+               }
 
-<script type="text/javascript"><!--
-function smilie(thesmilie, extra) {
-       if (!extra) {
-               document.form.body_text.value += thesmilie+" ";
-               document.form.body_text.focus();
-       } else {
-               document.form.body_text.value += thesmilie+extra+" ";
-               document.form.body_text.focus();
        }
-
-}
-//--></script>
-
-<?php } ?>
\ No newline at end of file
+       //--></script>
+<?php endif; ?>
\ No newline at end of file
index 10fcc60..08c4f08 100644 (file)
@@ -22,7 +22,7 @@ if (!defined('AT_INCLUDE_PATH')) { exit; }
        
        <?php
                if ($content_row['content_path']) {
-                       echo '  <div class="row">'._AT('packaged_in').'<br /> <a href="'.$_base_href.'tools/filemanager/index.php?pathext='.urlencode($content_row['content_path'].'/').'">'.$content_row['content_path'].'</a></div>';
+                       echo '  <div class="row">'._AT('packaged_in').'<br /> <a href="'.$_base_href.'tools/filemanager/index.php?pathext='.urlencode($content_row['content_path'].'/').SEP.'framed=1">'.$content_row['content_path'].'</a></div>';
                }
        ?>
        <div class="row">
@@ -42,11 +42,11 @@ if (!defined('AT_INCLUDE_PATH')) { exit; }
                <?php endif; ?>
                <script type="text/javascript" language="javascript">
                // <!--
-                       document.write(" <a onclick=\"window.open('<?php echo $_base_href; ?>tools/filemanager/index.php?popup=1','newWin1','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width=640,height=490')\" style=\"cursor: pointer; text-decoration:underline;\" ><?php echo _AT('open_file_manager'); ?> </a>");
+                       document.write(" <a onclick=\"window.open('<?php echo $_base_href; ?>tools/filemanager/index.php?framed=1<?php echo SEP; ?>popup=1','newWin1','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width=640,height=490')\" style=\"cursor: pointer; text-decoration:underline;\" ><?php echo _AT('open_file_manager'); ?> </a>");
                //-->
                </script>
                <noscript>
-                       <a href="<?php echo $_base_href; ?>tools/filemanager/index.php"><?php echo _AT('open_file_manager'); ?></a>
+                       <a href="<?php echo $_base_href; ?>tools/filemanager/index.php?framed=1"><?php echo _AT('open_file_manager'); ?></a>
                </noscript>                     
        </div>
        <div class="row">
index 1bdbb5a..2afb5ae 100644 (file)
@@ -17,6 +17,9 @@ if (!defined('AT_INCLUDE_PATH')) { exit; }
 // get the course total in Bytes 
 $course_total = dirsize($current_path);
 
+$framed = intval($_GET['framed']);
+$popup = intval($_GET['popup']);
+
 if (defined('AT_FORCE_GET_FILE') && AT_FORCE_GET_FILE) {
        $get_file = 'get.php/';
 } else {
@@ -309,8 +312,7 @@ echo '</table></form>';
 ?>
 
 <script type="text/javascript">
-<!--
-
+//<!--
 function insertFile(fileName, pathTo, ext) { 
 
        if (ext == "gif" || ext == "jpg" || ext == "jpeg" || ext == "png") {
@@ -359,6 +361,5 @@ function insertAtCursor(myField, myValue) {
                myField.focus();
        }
 }
-
--->
+//-->
 </script>
\ No newline at end of file
index ab26037..7376572 100644 (file)
 
 define('AT_INCLUDE_PATH', '../../include/');
 
-if ((isset($_REQUEST['popup']))  && ($_REQUEST['popup'] == TRUE) && 
-       (!isset($_REQUEST['framed']) || $_REQUEST['framed'] == FALSE)) {
+if ((isset($_REQUEST['popup']) && $_REQUEST['popup']) && 
+       (!isset($_REQUEST['framed']) || !$_REQUEST['framed'])) {
        $popup = TRUE;
        $framed = FALSE;
-} else if ((isset($_REQUEST['framed'])) && ($_REQUEST['framed'] == TRUE)) {
+} else if (isset($_REQUEST['framed']) && $_REQUEST['framed'] && isset($_REQUEST['popup']) && $_REQUEST['popup']) {
        $popup = TRUE;
        $framed = TRUE;
 } else {
index d4bcfe3..f6d7295 100644 (file)
@@ -191,5 +191,4 @@ if (isset($_POST['cancel'])) {
 }
 
 require(AT_INCLUDE_PATH.'header.inc.php');
-       
 ?>
\ No newline at end of file
index 70c1c6f..73ce011 100644 (file)
@@ -116,7 +116,7 @@ function insertTo(field) {
 </script>\r
 \r
 \r
-<iframe src="<?php echo $_base_path; ?>tools/filemanager/index.php?framed=1" name="filemanager" width="98%" height="480">\r
+<iframe src="<?php echo $_base_path; ?>tools/filemanager/index.php?framed=1<?php echo SEP; ?>popup=1" name="filemanager" width="98%" height="480">\r
 </iframe>\r
 \r
 </body>\r