[svn r15271] Liste des templates a gauche (FS#2502)

skala
Julio Montoya 18 years ago
parent 67526d0a4b
commit 2d7b0e8b83
  1. 30
      main/document/create_document.php
  2. 36
      main/inc/lib/fckeditor/editor/dialog/fck_template.html
  3. 31
      main/inc/lib/fckeditor/editor/fckdialogframe.html
  4. 16
      main/inc/lib/fckeditor/editor/skins/silver/fck_dialog.css

@ -1,5 +1,5 @@
<?php
// $Id: create_document.php 15209 2008-05-05 18:02:15Z juliomontoya $
// $Id: create_document.php 15271 2008-05-13 15:37:00Z juliomontoya $
/*
==============================================================================
Dokeos - elearning and course management software
@ -54,34 +54,25 @@ $htmlHeadXtra[]='<script>
function InnerDialogLoaded()
{
var B=new window.frames[0].FCKToolbarButton(\'Templates\',window.frames[0].FCKLang.Templates);
return B.ClickFrame();
};
var temp=false;
var temp2=false;
var use_document_title='.api_get_setting('use_document_title').';
function launch_templates()
{
document.getElementById(\'frmModel\').style.display="block";
document.getElementById(\'frmModel\').innerHTML = "<iframe height=945px; frameborder=0 src=\''.api_get_path(WEB_LIBRARY_PATH).'fckeditor/editor/fckdialogframe.html \'>";
document.getElementById(\'content___Frame\').width=\'70%\';
//document.getElementById(\'frmModel\').style.display="block";
document.getElementById(\'frmModel\').innerHTML = "<iframe height=600px; width=230; frameborder=0 src=\''.api_get_path(WEB_LIBRARY_PATH).'fckeditor/editor/fckdialogframe.html \'>";
//document.getElementById(\'content___Frame\').width=\'70%\';
//window.frames[0].FCKToolbarItems.GetItem("Template").Click;
}
function FCKeditor_OnComplete( editorInstance )
{
editorInstance.Events.AttachEvent( \'OnSelectionChange\', check_for_title ) ;
editorInstance.Events.AttachEvent( \'OnSelectionChange\', check_for_title ) ;
document.getElementById(\'frmModel\').innerHTML = "<iframe height=600px; width=230; frameborder=0 src=\''.api_get_path(WEB_LIBRARY_PATH).'fckeditor/editor/fckdialogframe.html \'>";
}
function check_for_title()
@ -145,7 +136,8 @@ function InnerDialogLoaded()
temp=true;
}
function trim(s) {
function trim(s)
{
while(s.substring(0,1) == \' \') {
s = s.substring(1,s.length);
}
@ -336,15 +328,15 @@ else
$form->addElement('submit', 'submit', get_lang('Ok'));
// HTML-editor
$form->add_html_editor('content','<a style="cursor:pointer" onclick="launch_templates()"><img src="'.api_get_path(WEB_IMG_PATH).'templates.gif" /></a>', false, true);
$form->add_html_editor('content','<a style="cursor:pointer" onclick="launch_templates()"></a>', false, true);
// Comment-field
//$form->addElement('textarea', 'comment', get_lang('Comment'), array ('rows' => 5, 'cols' => 50));
$form->addElement('submit', 'submit', get_lang('Ok'));
$form->setDefaults($default);
// HTML-editor
$form->addElement('html','<div id="frmModel" style="display:none;height:500px;width:300px; position:absolute; top:72px; left:76%;"></div>');
// HTML
$form->addElement('html','<div id="frmModel" style="display:block; height:600px;width:100px; position:absolute; top:135px; left:1%;"></div>');
// If form validates -> save the new document
if ($form->validate())

@ -24,7 +24,7 @@
<style>
.TplList
{
border: #dcdcdc 2px solid;
/* border: #dcdcdc 2px solid; */
background-color: #ffffff;
overflow: auto;
width: 90%;
@ -33,8 +33,9 @@
.TplItem
{
margin: 5px;
padding: 7px;
border: #eeeeee 1px solid;
padding: 0px;
border: #eeeeee 0px solid;
text-align:right;
}
.TplItem TABLE
@ -44,7 +45,7 @@
.TplTitle
{
font-weight: bold;
//font-weight: bold;
}
</style>
<script src="common/fck_dialog_common.js" type="text/javascript"></script>
@ -108,10 +109,11 @@ function LoadTemplatesXml()
if ( oPart = oXml.SelectSingleNode( 'Description', oNode ) )
oTemplate.Description = oPart.text ? oPart.text : oPart.textContent ;
/*
// Get the Template Image.
if ( oPart = oNode.attributes.getNamedItem('image') )
oTemplate.Image = sImagesBasePath + oPart.value ;
*/
// Get the Template HTML.
if ( oPart = oXml.SelectSingleNode( 'Html', oNode ) )
oTemplate.Html = oPart.text ? oPart.text : oPart.textContent ;
@ -142,13 +144,15 @@ function LoadTemplatesXml()
// Build the inner HTML of our new item DIV.
var sInner = '<table><tr>' ;
if ( oTemplate.Image )
/*if ( oTemplate.Image )
sInner += '<td valign="top"><img src="' + oTemplate.Image + '"><\/td>' ;
*/
sInner += '<td valign="top"><div class="TplTitle">' + oTemplate.Title + '<\/div>';
sInner += '<td valign="top"><div class="TplTitle">' + oTemplate.Title + '<\/div>' ;
/*
if ( oTemplate.Description )
sInner += '<div>' + oTemplate.Description + '<\/div>' ;
*/
sInner += '<\/td><\/tr><\/table>' ;
@ -186,22 +190,14 @@ function SelectTemplate( index )
</script>
</head>
<body scroll="no" style="OVERFLOW: hidden">
<table width="100%" height="100%">
<tr>
<td align="center">
<span fckLang="DlgTemplatesSelMsg">Please select the template to open in the editor<br>
(the actual contents will be lost):</span>
</td>
</tr>
<table width="100%" height="100%" valign="top">
<tr>
<td height="100%" align="center">
<div id="eList" align="left" class="TplList">
<div id="eLoading" align="center" style="DISPLAY: none">
<br>
<div id="eList" align="left" valign="top" class="TplList">
<div id="eLoading" align="center" style="display: none"><br />
<span fckLang="DlgTemplatesLoading">Loading templates list. Please wait...</span>
</div>
<div id="eEmpty" align="center" style="DISPLAY: none">
<br>
<div id="eEmpty" align="center" style="display: none"><br />
<span fckLang="DlgTemplatesNoTpl">(No templates defined)</span>
</div>
</div>

@ -32,7 +32,7 @@ if ( !window.dialogArguments )
}
// Dialog's size
var WindowSize= '800px';
var WindowSize= '500px';
// Sets the Skin CSS
document.write( '<link href="' + window.dialogArguments.Editor.FCKConfig.SkinPath + 'fck_dialog.css" type="text/css" rel="stylesheet">' ) ;
@ -129,7 +129,7 @@ function Hide()
{
// we hide the DIV
window.parent.document.getElementById('frmModel').style.display='none';
window.parent.document.getElementById('content___Frame').width='100%';
// window.parent.document.getElementById('content___Frame').width='100%';
}
@ -167,7 +167,7 @@ function AddTab( tabCode, tabText, startHidden )
if ( eTabsRow.style.display == 'none' )
{
var eTitleArea = document.getElementById( 'TitleArea' ) ;
eTitleArea.className = 'PopupTitle' ;
eTitleArea.className = 'PopupTitleSimple' ;
oDiv.className = 'PopupTabSelected' ;
eTabsRow.style.display = '' ;
@ -284,41 +284,18 @@ if ( window.dialogArguments.Editor.FCKBrowserInfo.IsIE )
<body onload="LoadInnerDialog();" class="PopupBody">
<table height="100%" cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td id="TitleArea" class="PopupTitle PopupTitleBorder">
<td id="TitleArea" class="PopupTitleSimple">
<script type="text/javascript">
document.write( sTitle ) ;
</script>
</td>
</tr>
<tr id="TabsRow" style="DISPLAY: none">
<td class="PopupTabArea">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr id="Tabs" onselectstart="return false;">
<td class="PopupTabEmptyArea">&nbsp;</td>
<td class="PopupTabEmptyArea" width="100%">&nbsp;</td>
</tr>
</table>
</td>
</tr>
<tr>
<td id="FrameCell" height="100%" valign="top">
<iframe id="frmMain" src="fckblank.html" name="frmMain" frameborder="0" height="100%" width="100%" scrolling="auto">
</iframe>
</td>
</tr>
<tr>
<td class="PopupButtons">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="100%">&nbsp;</td>
<td nowrap="nowrap">
<input id="btnOk" style="VISIBILITY: hidden; WIDTH: 100px" type="button" value="Ok" class="Button"
onclick="Ok();" fckLang="DlgBtnOK" />&nbsp; <input type="button" value="Cancel" class="Button" onclick="Hide();" fckLang="DlgBtnCancel" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>

@ -26,13 +26,13 @@ body
body, td, input, select, textarea
{
font-size: 11px;
font-size: 12px;
font-family: 'Microsoft Sans Serif' , Arial, Helvetica, Verdana;
}
body, .BackColor
{
background-color: #f7f7f7;
background-color: #fff;
}
.PopupBody
@ -53,6 +53,17 @@ body, .BackColor
background-color: #dedede;
}
.PopupTitleSimple
{
font-size: 11pt;
color: #000;
font-weight: bold;
background-color: #fff;
text-align:right;
padding-right:28px;
}
.PopupButtons
{
border-top: #cec6b5 1px solid;
@ -125,7 +136,6 @@ body, .BackColor
.PopupSelectionBox
{
border: #a9a9a9 1px solid;
background-color: #dcdcdc;
cursor: pointer;
cursor: hand;

Loading…
Cancel
Save