[svn r10971] WCAG editor on local page

skala
Patrick Vandermaesen 19 years ago
parent 14622bacc7
commit 2c0dbc6cb5
  1. 65
      main/admin/configure_homepage.php

@ -1,4 +1,4 @@
<?php // $Id: configure_homepage.php 10959 2007-01-29 10:48:41Z pvandermaesen $ <?php // $Id: configure_homepage.php 10971 2007-01-29 17:40:20Z pvandermaesen $
/* /*
============================================================================== ==============================================================================
Dokeos - elearning and course management software Dokeos - elearning and course management software
@ -27,12 +27,13 @@ $language_file = array ('admin', 'accessibility');
$cidReset=true; $cidReset=true;
include('../WCAG/WCAG_rendering.php');
include('../inc/global.inc.php'); include('../inc/global.inc.php');
$this_section=SECTION_PLATFORM_ADMIN; $this_section=SECTION_PLATFORM_ADMIN;
api_protect_admin_script(); api_protect_admin_script();
include_once(api_get_path(LIBRARY_PATH).'WCAG/WCAG_rendering.php');
include_once(api_get_path(LIBRARY_PATH).'fileUpload.lib.php'); include_once(api_get_path(LIBRARY_PATH).'fileUpload.lib.php');
require_once(api_get_path(LIBRARY_PATH) . "/fckeditor/fckeditor.php"); require_once(api_get_path(LIBRARY_PATH) . "/fckeditor/fckeditor.php");
@ -69,20 +70,7 @@ if(!empty($action))
$home_top=''; $home_top='';
if (api_get_setting('wcag_anysurfer_public_pages')=='true') { if (api_get_setting('wcag_anysurfer_public_pages')=='true') {
$text = $_POST['text']; $home_top=WCAG_Rendering::prepareXHTML();
$text = WCAG_Rendering::text2HTML ( $text );
$imageFile = $_POST['imagefile'];
$imageLabel = $_POST['imageLabel'];
$link = $_POST['link'];
$linkLabel = $_POST['linkLabel'];
if (strlen($linkLabel) == 0) {
$linkLabel = $link;
}
$home_top='<div id="WCAG-home"><img src="'.$imageFile.'" alt="'.$imageLabel.'" />'.'<p>'.$text.'</p>';
if (strlen($link) > 0) {
$home_top = $home_top.'<a href="'.$link.'">'.$linkLabel.'</a>';
}
$home_top=$home_top."<div style=\"clear:both;\"><span></span></div></div>";
} else { } else {
$home_top=trim(stripslashes($_POST['home_top'])); $home_top=trim(stripslashes($_POST['home_top']));
} }
@ -201,7 +189,12 @@ if(!empty($action))
$insert_where=intval($_POST['insert_where']); $insert_where=intval($_POST['insert_where']);
$link_name=trim(stripslashes($_POST['link_name'])); $link_name=trim(stripslashes($_POST['link_name']));
$link_url=trim(stripslashes($_POST['link_url'])); $link_url=trim(stripslashes($_POST['link_url']));
$link_html=trim(stripslashes($_POST['link_html'])); // WCAG
if (api_get_setting('wcag_anysurfer_public_pages')=='true') {
$link_html=WCAG_Rendering::prepareXHTML();
} else {
$link_html=trim(stripslashes($_POST['link_html']));
}
$filename=trim(stripslashes($_POST['filename'])); $filename=trim(stripslashes($_POST['filename']));
$target_blank=$_POST['target_blank']?true:false; $target_blank=$_POST['target_blank']?true:false;
@ -594,22 +587,25 @@ foreach($home_menu as $key=>$enreg)
<?php <?php
//api_disp_html_area('link_html',isset($_POST['link_html'])?$_POST['link_html']:$link_html,'400px'); //api_disp_html_area('link_html',isset($_POST['link_html'])?$_POST['link_html']:$link_html,'400px');
$oFCKeditor = new FCKeditor('link_html') ; if (api_get_setting('wcag_anysurfer_public_pages')=='true') {
$oFCKeditor->BasePath = api_get_path(WEB_PATH) . 'main/inc/lib/fckeditor/' ; echo WCAG_Rendering::create_xhtml(isset($_POST['link_html'])?$_POST['link_html']:$link_html);
$oFCKeditor->Height = '400'; } else {
$oFCKeditor->Width = '100%'; $oFCKeditor = new FCKeditor('link_html') ;
$oFCKeditor->Value = isset($_POST['link_html'])?$_POST['link_html']:$link_html; $oFCKeditor->BasePath = api_get_path(WEB_PATH) . 'main/inc/lib/fckeditor/' ;
$oFCKeditor->Config['CustomConfigurationsPath'] = api_get_path(REL_PATH)."main/inc/lib/fckeditor/myconfig.js"; $oFCKeditor->Height = '400';
$oFCKeditor->ToolbarSet = "Small"; $oFCKeditor->Width = '100%';
$oFCKeditor->Value = isset($_POST['link_html'])?$_POST['link_html']:$link_html;
$TBL_LANGUAGES = Database::get_main_table(TABLE_MAIN_LANGUAGE); $oFCKeditor->Config['CustomConfigurationsPath'] = api_get_path(REL_PATH)."main/inc/lib/fckeditor/myconfig.js";
$sql="SELECT isocode FROM ".$TBL_LANGUAGES." WHERE english_name='".$_SESSION["_user"]["language"]."'"; $oFCKeditor->ToolbarSet = "Small";
$result_sql=api_sql_query($sql);
$isocode_language=mysql_result($result_sql,0,0); $TBL_LANGUAGES = Database::get_main_table(TABLE_MAIN_LANGUAGE);
$oFCKeditor->Config['DefaultLanguage'] = $isocode_language; $sql="SELECT isocode FROM ".$TBL_LANGUAGES." WHERE english_name='".$_SESSION["_user"]["language"]."'";
$result_sql=api_sql_query($sql);
echo $oFCKeditor->CreateHtml(); $isocode_language=mysql_result($result_sql,0,0);
$oFCKeditor->Config['DefaultLanguage'] = $isocode_language;
echo $oFCKeditor->CreateHtml();
}
?> ?>
@ -702,7 +698,6 @@ if($action == 'edit_news'){
if (api_get_setting('wcag_anysurfer_public_pages')=='true') { if (api_get_setting('wcag_anysurfer_public_pages')=='true') {
echo ('<div id="WCAG-editor"><div class="title">WCAG editor</div><div class="body">'); echo ('<div id="WCAG-editor"><div class="title">WCAG editor</div><div class="body">');
WCAG_Rendering::prepare_admin_form($open)->display(); WCAG_Rendering::prepare_admin_form($open)->display();
/*echo ('<iframe src=' . api_get_path(WEB_PATH) . 'main/inc/lib/fckeditor/'.'editor/plugins/ImageManager/manager.php" name="imgManager" id="imgManager" class="imageFrame" scrolling="auto" title="Image Selection" frameborder="0"></iframe>');*/
echo ("</div></div>"); echo ("</div></div>");
} else { } else {
$oFCKeditor = new FCKeditor($name) ; $oFCKeditor = new FCKeditor($name) ;

Loading…
Cancel
Save