[svn r18772] FS#3643: The Documents tool: A visual fix: trying to fix the ugly way of overlapping between the template list and the online editor's area.

skala
Ivan Tcholakov 17 years ago
parent facf545b86
commit 77b02d4030
  1. 42
      main/document/create_document.php
  2. 44
      main/document/edit_document.php
  3. 2
      main/inc/lib/fckeditor/editor/fckdialogframe.html

@ -1,4 +1,4 @@
<?php // $Id: create_document.php 18521 2009-02-16 18:28:44Z ivantcholakov $ <?php // $Id: create_document.php 18772 2009-03-03 02:31:56Z ivantcholakov $
/* /*
============================================================================== ==============================================================================
@ -50,8 +50,38 @@ $htmlHeadXtra[]='<script>
function InnerDialogLoaded() function InnerDialogLoaded()
{ {
/*
var B=new window.frames[0].FCKToolbarButton(\'Templates\',window.frames[0].FCKLang.Templates); var B=new window.frames[0].FCKToolbarButton(\'Templates\',window.frames[0].FCKLang.Templates);
return B.ClickFrame(); return B.ClickFrame();
*/
var isIE = (navigator.appVersion.indexOf(\'MSIE\') != -1) ? true : false ;
var EditorFrame = null ;
if ( !isIE )
{
EditorFrame = window.frames[0] ;
}
else
{
// For this dynamic page window.frames[0] enumerates frames in a different order in IE.
// We need a sure method to locate the frame that contains the online editor.
for ( var i = 0, n = window.frames.length ; i < n ; i++ )
{
if ( window.frames[i].location.toString().indexOf(\'InstanceName=content\') != -1 )
{
EditorFrame = window.frames[i] ;
}
}
}
if ( !EditorFrame )
{
return null ;
}
var B = new EditorFrame.FCKToolbarButton(\'Templates\', EditorFrame.FCKLang.Templates);
return B.ClickFrame();
}; };
var temp=false; var temp=false;
@ -69,7 +99,7 @@ function InnerDialogLoaded()
function FCKeditor_OnComplete( editorInstance ) function FCKeditor_OnComplete( editorInstance )
{ {
editorInstance.Events.AttachEvent( \'OnSelectionChange\', check_for_title ) ; editorInstance.Events.AttachEvent( \'OnSelectionChange\', check_for_title ) ;
document.getElementById(\'frmModel\').innerHTML = "<iframe height=525px; width=240px; scrolling=\'no\' id=\"template_iframe\" frameborder=0 src=\''.api_get_path(WEB_LIBRARY_PATH).'fckeditor/editor/fckdialogframe.html \'>"; document.getElementById(\'frmModel\').innerHTML = "<iframe style=\'height: 525px; width: 180px;\' scrolling=\'no\' frameborder=\'0\' src=\''.api_get_path(WEB_LIBRARY_PATH).'fckeditor/editor/fckdialogframe.html \'>";
} }
function check_for_title() function check_for_title()
@ -302,6 +332,9 @@ if (isset ($group))
// Create a new form // Create a new form
$form = new FormValidator('create_document'); $form = new FormValidator('create_document');
$renderer = & $form->defaultRenderer();
// Hidden element with current directory // Hidden element with current directory
$form->addElement('hidden', 'dir'); $form->addElement('hidden', 'dir');
$default['dir'] = $dir; $default['dir'] = $dir;
@ -320,7 +353,9 @@ function document_exists($filename)
} }
// Change the default renderer for the filename-field to display the dir and extension // Change the default renderer for the filename-field to display the dir and extension
/*
$renderer = & $form->defaultRenderer(); $renderer = & $form->defaultRenderer();
*/
//$filename_template = str_replace('{element}', "<tt>$display_dir</tt> {element} <tt>.html</tt>", $renderer->_elementTemplate); //$filename_template = str_replace('{element}', "<tt>$display_dir</tt> {element} <tt>.html</tt>", $renderer->_elementTemplate);
$filename_template = str_replace('{element}', "{element}", $renderer->_elementTemplate); $filename_template = str_replace('{element}', "{element}", $renderer->_elementTemplate);
$renderer->setElementTemplate($filename_template, 'filename'); $renderer->setElementTemplate($filename_template, 'filename');
@ -379,6 +414,7 @@ else
//$form->addElement('style_submit_button', 'submit', get_lang('SaveDocument'), 'class="save"'); //$form->addElement('style_submit_button', 'submit', get_lang('SaveDocument'), 'class="save"');
// HTML-editor // HTML-editor
$renderer->setElementTemplate('<div class="row"><div class="label" id="frmModel" style="overflow: visible;"></div><div class="formw">{element}</div></div>', 'content');
$form->add_html_editor('content','', false, false); $form->add_html_editor('content','', false, false);
// Comment-field // Comment-field
@ -387,7 +423,9 @@ $form->addElement('style_submit_button', 'submit', get_lang('langCreateDoc'), 'c
$form->setDefaults($default); $form->setDefaults($default);
// HTML // HTML
/*
$form->addElement('html','<div id="frmModel" style="display:block; height:525px; width:240px; position:absolute; top:115px; left:1px;"></div>'); $form->addElement('html','<div id="frmModel" style="display:block; height:525px; width:240px; position:absolute; top:115px; left:1px;"></div>');
*/
// If form validates -> save the new document // If form validates -> save the new document
if ($form->validate()) if ($form->validate())

@ -1,4 +1,4 @@
<?php // $Id: edit_document.php 18521 2009-02-16 18:28:44Z ivantcholakov $ <?php // $Id: edit_document.php 18772 2009-03-03 02:31:56Z ivantcholakov $
/* /*
============================================================================== ==============================================================================
Dokeos - elearning and course management software Dokeos - elearning and course management software
@ -65,13 +65,43 @@ $htmlHeadXtra[] = '
function InnerDialogLoaded() function InnerDialogLoaded()
{ {
/*
var B=new window.frames[0].FCKToolbarButton(\'Templates\',window.frames[0].FCKLang.Templates); var B=new window.frames[0].FCKToolbarButton(\'Templates\',window.frames[0].FCKLang.Templates);
return B.ClickFrame(); return B.ClickFrame();
*/
var isIE = (navigator.appVersion.indexOf(\'MSIE\') != -1) ? true : false ;
var EditorFrame = null ;
if ( !isIE )
{
EditorFrame = window.frames[0] ;
}
else
{
// For this dynamic page window.frames[0] enumerates frames in a different order in IE.
// We need a sure method to locate the frame that contains the online editor.
for ( var i = 0, n = window.frames.length ; i < n ; i++ )
{
if ( window.frames[i].location.toString().indexOf(\'InstanceName=texte\') != -1 )
{
EditorFrame = window.frames[i] ;
}
}
}
if ( !EditorFrame )
{
return null ;
}
var B = new EditorFrame.FCKToolbarButton(\'Templates\', EditorFrame.FCKLang.Templates);
return B.ClickFrame();
}; };
function FCKeditor_OnComplete( editorInstance ) function FCKeditor_OnComplete( editorInstance )
{ {
document.getElementById(\'frmModel\').innerHTML = "<iframe height=525px; width=240px; scrolling=\'no\' frameborder=0 src=\''.api_get_path(WEB_LIBRARY_PATH).'fckeditor/editor/fckdialogframe.html \'>"; document.getElementById(\'frmModel\').innerHTML = "<iframe style=\'height: 525px; width: 180px;\' scrolling=\'no\' frameborder=\'0\' src=\''.api_get_path(WEB_LIBRARY_PATH).'fckeditor/editor/fckdialogframe.html \'>";
} }
@ -595,6 +625,9 @@ if ($owner_id == $_user['user_id'] || api_is_platform_admin() || api_is_allowed_
$action = api_get_self().'?sourceFile='.urlencode($file_name).'&curdirpath='.urlencode($_GET['curdirpath']).'&file='.urlencode($_GET['file']).'&doc='.urlencode($doc); $action = api_get_self().'?sourceFile='.urlencode($file_name).'&curdirpath='.urlencode($_GET['curdirpath']).'&file='.urlencode($_GET['file']).'&doc='.urlencode($doc);
$form = new FormValidator('formEdit','post',$action); $form = new FormValidator('formEdit','post',$action);
$renderer = $form->defaultRenderer();
$form->addElement('hidden','filename'); $form->addElement('hidden','filename');
$form->addElement('hidden','extension'); $form->addElement('hidden','extension');
$form->addElement('hidden','file_path'); $form->addElement('hidden','file_path');
@ -626,6 +659,7 @@ if ($owner_id == $_user['user_id'] || api_is_platform_admin() || api_is_allowed_
if (empty($readonly) && $readonly==0) if (empty($readonly) && $readonly==0)
{ {
$_SESSION['showedit']=1; $_SESSION['showedit']=1;
$renderer->setElementTemplate('<div class="row"><div class="label" id="frmModel" style="overflow: visible;"></div><div class="formw">{element}</div></div>', 'texte');
$form->add_html_editor('texte','',false,true); $form->add_html_editor('texte','',false,true);
} }
} }
@ -637,9 +671,9 @@ if ($owner_id == $_user['user_id'] || api_is_platform_admin() || api_is_allowed_
} }
$form->addElement('textarea','newComment',get_lang('Comment'),'rows="3" style="width:300px;"'); $form->addElement('textarea','newComment',get_lang('Comment'),'rows="3" style="width:300px;"');
/*
$renderer = $form->defaultRenderer(); $renderer = $form->defaultRenderer();
*/
if ($owner_id == $_user['user_id'] || api_is_platform_admin()) if ($owner_id == $_user['user_id'] || api_is_platform_admin())
{ {
$renderer->setElementTemplate('<div class="row"><div class="label"></div><div class="formw">{element}{label}</div></div>', 'readonly'); $renderer->setElementTemplate('<div class="row"><div class="label"></div><div class="formw">{element}{label}</div></div>', 'readonly');
@ -660,7 +694,9 @@ if ($owner_id == $_user['user_id'] || api_is_platform_admin() || api_is_allowed_
$form->setDefaults($defaults); $form->setDefaults($defaults);
// show templates // show templates
/*
$form->addElement('html','<div id="frmModel" style="display:block; height:525px; width:240px; position:absolute; top:115px; left:1px;"></div>'); $form->addElement('html','<div id="frmModel" style="display:block; height:525px; width:240px; position:absolute; top:115px; left:1px;"></div>');
*/
$form->display(); $form->display();
//Display::display_error_message(get_lang('ReadOnlyFile')); //main API //Display::display_error_message(get_lang('ReadOnlyFile')); //main API

@ -150,7 +150,7 @@ document.write( '<link href="' + FCKConfig.SkinPath + 'fck_dialog.css" type="tex
<body onload="Init();" class="PopupBody"> <body onload="Init();" class="PopupBody">
<table height="100%" cellspacing="0" cellpadding="0" width="100%" border="0"> <table height="100%" cellspacing="0" cellpadding="0" width="100%" border="0">
<tr> <tr>
<td id="TitleArea" class="PopupTitleSimple" style="padding-right: 45px;"> <td id="TitleArea" class="PopupTitleSimple">
<script type="text/javascript"> <script type="text/javascript">
document.write( Args().Title ) ; document.write( Args().Title ) ;
</script> </script>

Loading…
Cancel
Save