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

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

@ -1,5 +1,5 @@
<?php <?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 Dokeos - elearning and course management software
@ -53,35 +53,26 @@ $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 temp=false; var temp=false;
var temp2=false; var temp2=false;
var use_document_title='.api_get_setting('use_document_title').'; var use_document_title='.api_get_setting('use_document_title').';
function launch_templates() function launch_templates()
{ {
//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(\'frmModel\').style.display="block"; //document.getElementById(\'content___Frame\').width=\'70%\';
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%\';
//window.frames[0].FCKToolbarItems.GetItem("Template").Click; //window.frames[0].FCKToolbarItems.GetItem("Template").Click;
} }
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=600px; width=230; frameborder=0 src=\''.api_get_path(WEB_LIBRARY_PATH).'fckeditor/editor/fckdialogframe.html \'>";
} }
function check_for_title() function check_for_title()
@ -145,7 +136,8 @@ function InnerDialogLoaded()
temp=true; temp=true;
} }
function trim(s) { function trim(s)
{
while(s.substring(0,1) == \' \') { while(s.substring(0,1) == \' \') {
s = s.substring(1,s.length); s = s.substring(1,s.length);
} }
@ -336,15 +328,15 @@ else
$form->addElement('submit', 'submit', get_lang('Ok')); $form->addElement('submit', 'submit', get_lang('Ok'));
// HTML-editor // 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 // Comment-field
//$form->addElement('textarea', 'comment', get_lang('Comment'), array ('rows' => 5, 'cols' => 50)); //$form->addElement('textarea', 'comment', get_lang('Comment'), array ('rows' => 5, 'cols' => 50));
$form->addElement('submit', 'submit', get_lang('Ok')); $form->addElement('submit', 'submit', get_lang('Ok'));
$form->setDefaults($default); $form->setDefaults($default);
// HTML-editor // HTML
$form->addElement('html','<div id="frmModel" style="display:none;height:500px;width:300px; position:absolute; top:72px; left:76%;"></div>'); $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 validates -> save the new document
if ($form->validate()) if ($form->validate())

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

@ -32,7 +32,7 @@ if ( !window.dialogArguments )
} }
// Dialog's size // Dialog's size
var WindowSize= '800px'; var WindowSize= '500px';
// Sets the Skin CSS // Sets the Skin CSS
document.write( '<link href="' + window.dialogArguments.Editor.FCKConfig.SkinPath + 'fck_dialog.css" type="text/css" rel="stylesheet">' ) ; 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 // we hide the DIV
window.parent.document.getElementById('frmModel').style.display='none'; 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' ) if ( eTabsRow.style.display == 'none' )
{ {
var eTitleArea = document.getElementById( 'TitleArea' ) ; var eTitleArea = document.getElementById( 'TitleArea' ) ;
eTitleArea.className = 'PopupTitle' ; eTitleArea.className = 'PopupTitleSimple' ;
oDiv.className = 'PopupTabSelected' ; oDiv.className = 'PopupTabSelected' ;
eTabsRow.style.display = '' ; eTabsRow.style.display = '' ;
@ -284,41 +284,18 @@ if ( window.dialogArguments.Editor.FCKBrowserInfo.IsIE )
<body onload="LoadInnerDialog();" class="PopupBody"> <body onload="LoadInnerDialog();" 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="PopupTitle PopupTitleBorder"> <td id="TitleArea" class="PopupTitleSimple">
<script type="text/javascript"> <script type="text/javascript">
document.write( sTitle ) ; document.write( sTitle ) ;
</script> </script>
</td> </td>
</tr> </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> <tr>
<td id="FrameCell" height="100%" valign="top"> <td id="FrameCell" height="100%" valign="top">
<iframe id="frmMain" src="fckblank.html" name="frmMain" frameborder="0" height="100%" width="100%" scrolling="auto"> <iframe id="frmMain" src="fckblank.html" name="frmMain" frameborder="0" height="100%" width="100%" scrolling="auto">
</iframe> </iframe>
</td> </td>
</tr> </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> </table>
</body> </body>
</html> </html>

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

Loading…
Cancel
Save