Actualización
This commit is contained in:
63
main/help/allowed_html_tags.php
Normal file
63
main/help/allowed_html_tags.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
/* For licensing terms, see /license.txt */
|
||||
|
||||
/**
|
||||
* This script displays a help window with an overview of the allowed HTML-
|
||||
* tags and their attributes.
|
||||
*
|
||||
* @package chamilo.help
|
||||
*/
|
||||
require '../inc/global.inc.php';
|
||||
|
||||
header('Content-Type: text/html; charset='.api_get_system_encoding());
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo api_get_language_isocode(); ?>" lang="<?php echo api_get_language_isocode(); ?>">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo api_get_system_encoding(); ?>" />
|
||||
<title>
|
||||
<?php echo get_lang('AllowedHTMLTags'); ?>
|
||||
</title>
|
||||
<style type="text/css" media="screen, projection">
|
||||
/*<![CDATA[*/
|
||||
@import "<?php echo api_get_path(WEB_CSS_PATH); ?>chamilo/default.css";
|
||||
/*]]>*/
|
||||
</style>
|
||||
<?php
|
||||
if (api_get_setting('stylesheets') != '') {
|
||||
?>
|
||||
<style type="text/css" media="screen, projection">
|
||||
/*<![CDATA[*/
|
||||
@import "<?php echo api_get_path(WEB_CSS_PATH), api_get_setting('stylesheets'); ?>/default.css";
|
||||
/*]]>*/
|
||||
</style>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</head>
|
||||
<body dir="<?php echo api_get_text_direction(); ?>">
|
||||
<div style="margin:10px;">
|
||||
<div style="text-align:right;"><a href="javascript: window.close();"><?php echo get_lang('Close'); ?></a></div>
|
||||
<h4>
|
||||
<?php echo get_lang('AllowedHTMLTags'); ?>
|
||||
</h4>
|
||||
<?php
|
||||
$html_type = $_SESSION['status'] == COURSEMANAGER ? TEACHER_HTML : STUDENT_HTML;
|
||||
|
||||
$fullpage = intval($_GET['fullpage']) != 0;
|
||||
$tags = HTML_QuickForm_Rule_HTML::get_allowed_tags($html_type, $fullpage);
|
||||
$table_header = [];
|
||||
$table_header[] = ['tag', true];
|
||||
$table_header[] = ['attributes', false];
|
||||
foreach ($tags as $tag => &$attributes) {
|
||||
$row = [];
|
||||
$row[] = '<kbd>'.$tag.'</kbd>';
|
||||
$row[] = '<kbd> '.implode(', ', array_keys($attributes)).'</kbd>';
|
||||
$table_data[] = $row;
|
||||
}
|
||||
Display::display_sortable_table($table_header, $table_data, [], [], ['fullpage' => intval($_GET['fullpage'])]);
|
||||
?>
|
||||
<div style="text-align:right;"><a href="javascript: window.close();"><?php echo get_lang('Close'); ?></a></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
54
main/help/faq.php
Normal file
54
main/help/faq.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/* For licensing terms, see /license.txt */
|
||||
|
||||
/**
|
||||
* This script displays a help window.
|
||||
*
|
||||
* @package chamilo.help
|
||||
*/
|
||||
require_once __DIR__.'/../inc/global.inc.php';
|
||||
$help_name = isset($_GET['open']) ? Security::remove_XSS($_GET['open']) : null;
|
||||
|
||||
Display::display_header(get_lang('Faq'));
|
||||
|
||||
if (api_is_platform_admin()) {
|
||||
echo ' <a href="faq.php?edit=true">'.Display::return_icon('edit.png').'</a>';
|
||||
}
|
||||
|
||||
echo Display::page_header(get_lang('Faq'));
|
||||
|
||||
$faq_file = 'faq.html';
|
||||
if (!empty($_GET['edit']) && $_GET['edit'] == 'true' && api_is_platform_admin()) {
|
||||
$form = new FormValidator('set_faq', 'post', 'faq.php?edit=true');
|
||||
$form->addHtmlEditor(
|
||||
'faq_content',
|
||||
null,
|
||||
false,
|
||||
false,
|
||||
['ToolbarSet' => 'FAQ', 'Width' => '100%', 'Height' => '300']
|
||||
);
|
||||
$form->addButtonSave(get_lang('Ok'), 'faq_submit');
|
||||
$faq_content = @(string) file_get_contents(api_get_path(SYS_APP_PATH).'home/faq.html');
|
||||
$faq_content = api_to_system_encoding($faq_content, api_detect_encoding(strip_tags($faq_content)));
|
||||
$form->setDefaults(['faq_content' => $faq_content]);
|
||||
if ($form->validate()) {
|
||||
$content = $form->getSubmitValue('faq_content');
|
||||
$fpath = api_get_path(SYS_APP_PATH).'home/'.$faq_file;
|
||||
if (is_file($fpath) && is_writeable($fpath)) {
|
||||
$fp = fopen(api_get_path(SYS_APP_PATH).'home/'.$faq_file, 'w');
|
||||
fwrite($fp, $content);
|
||||
fclose($fp);
|
||||
} else {
|
||||
echo Display::return_message(get_lang('WarningFaqFileNonWriteable'), 'warning');
|
||||
}
|
||||
echo $content;
|
||||
} else {
|
||||
$form->display();
|
||||
}
|
||||
} else {
|
||||
$faq_content = @(string) file_get_contents(api_get_path(SYS_APP_PATH).'home/'.$faq_file);
|
||||
$faq_content = api_to_system_encoding($faq_content, api_detect_encoding(strip_tags($faq_content)));
|
||||
echo $faq_content;
|
||||
}
|
||||
|
||||
Display::display_footer();
|
||||
27
main/help/help.php
Normal file
27
main/help/help.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/* For licensing terms, see /license.txt */
|
||||
|
||||
/**
|
||||
* This script displays a help window.
|
||||
*
|
||||
* @package chamilo.help
|
||||
*/
|
||||
require_once __DIR__.'/../inc/global.inc.php';
|
||||
|
||||
$help_name = isset($_GET['open']) ? Security::remove_XSS($_GET['open']) : null;
|
||||
if (empty($help_name)) {
|
||||
api_not_allowed(true);
|
||||
}
|
||||
|
||||
?>
|
||||
<a class="btn btn-default" href="<?php echo api_get_path(WEB_CODE_PATH); ?>help/faq.php">
|
||||
<?php echo get_lang('AccessToFaq'); ?>
|
||||
</a>
|
||||
<div class="page-header">
|
||||
<h3><?php echo get_lang('H'.$help_name); ?></h3>
|
||||
</div>
|
||||
<?php echo get_lang($help_name.'Content'); ?>
|
||||
<hr>
|
||||
<a class="btn btn-default" href="<?php echo api_get_path(WEB_CODE_PATH); ?>help/faq.php">
|
||||
<?php echo get_lang('AccessToFaq'); ?>
|
||||
</a>
|
||||
6
main/help/index.html
Normal file
6
main/help/index.html
Normal file
@@ -0,0 +1,6 @@
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user