upgrade
This commit is contained in:
201
main/wiki/css/default.css
Normal file
201
main/wiki/css/default.css
Normal file
@@ -0,0 +1,201 @@
|
||||
/* WIKI STYLES */
|
||||
|
||||
.wikiTitle h1 {
|
||||
color: Black;
|
||||
background: none;
|
||||
font-size: 200%;
|
||||
font-weight: bold;
|
||||
/*font-weight: normal;*/
|
||||
border-bottom: 2px solid #aaaaaa;
|
||||
}
|
||||
.wiki2xhtml a.wikiEdit{
|
||||
color: #0000FF;
|
||||
}
|
||||
.diff{
|
||||
font-family: monospace;
|
||||
padding: 5px;
|
||||
margin: 5px;
|
||||
border:solid 2px #aaaaaa;
|
||||
}
|
||||
.diffEqual{
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
.diffMoved{
|
||||
background-color: #FFFFAA;
|
||||
}
|
||||
.diffAdded{
|
||||
background-color: #CCFFCC;
|
||||
}
|
||||
.diffDeleted{
|
||||
background-color: #FFAAAA;
|
||||
}
|
||||
|
||||
.diffAddedTex{
|
||||
background-color: #CCFFCC;
|
||||
text-decoration:underline;
|
||||
}
|
||||
|
||||
.diffDeletedTex{
|
||||
background-color: #FFAAAA;
|
||||
text-decoration:line-through;
|
||||
}
|
||||
|
||||
#wikititle {
|
||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||
font-size: 100%;
|
||||
font-weight: bold;
|
||||
background-color: #EFEFEF;
|
||||
border-bottom: 1px solid #cccccc;
|
||||
padding: 3px;
|
||||
padding-top:5px;
|
||||
border-top: 1px solid #ccc;
|
||||
height: auto!important;
|
||||
min-height:20px;
|
||||
}
|
||||
#wikititle input {
|
||||
border: 1px solid #333;
|
||||
padding-left: 3px;
|
||||
}
|
||||
#wikicontent {
|
||||
padding-top:5px;
|
||||
min-height:300px;
|
||||
font-size: 14px;
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
#menuwiki {
|
||||
float:left;
|
||||
border: 2px solid #cccccc;
|
||||
margin-right: 10px;
|
||||
padding: 2px;
|
||||
background-color: #efefef;
|
||||
width:74px;
|
||||
height:30px;
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
#menuwiki li{
|
||||
list-style-type: square;
|
||||
}
|
||||
|
||||
#mainwiki {
|
||||
}
|
||||
|
||||
#wikifooter {
|
||||
background-color: #EFEFEF;
|
||||
border-top: 1px solid #cccccc;
|
||||
border-bottom: 1px solid #cccccc;
|
||||
border-left: 1px solid #cccccc;
|
||||
border-right: 1px solid #cccccc;
|
||||
}
|
||||
|
||||
.fwiki1{
|
||||
font-size:larger;
|
||||
font-style:italic;
|
||||
font-weight:bold;
|
||||
background-color:#DAFFD9;
|
||||
}
|
||||
.fwiki2{
|
||||
font-size:smaller;
|
||||
background-color:#ffffff;
|
||||
}
|
||||
|
||||
.message {
|
||||
color: #cccccc;
|
||||
}
|
||||
.wiki_warning{
|
||||
color: #FF0000;
|
||||
font-weight:bold;
|
||||
}
|
||||
a.new_wiki_link{
|
||||
color: #FF0000;
|
||||
border-bottom: 1px dotted #cccccc;
|
||||
|
||||
}
|
||||
|
||||
a.wiki_link{
|
||||
border-bottom: 1px dotted #cccccc;
|
||||
}
|
||||
|
||||
a.wiki_link_ext{
|
||||
background: url(ext.png) center right no-repeat; padding-right: 14px; }
|
||||
|
||||
a.wiki_mail_link{
|
||||
background: url(email.gif) center right no-repeat; padding-right: 18px; }
|
||||
|
||||
a.wiki_news_link{
|
||||
background: url(news.png) center right no-repeat; padding-right: 18px; }
|
||||
|
||||
a.wiki_ftp_link{
|
||||
background: url(ftp.gif) center right no-repeat; padding-right: 18px; }
|
||||
|
||||
a.wiki_irc_link{
|
||||
background: url(irc.gif) center right no-repeat; padding-right: 18px; }
|
||||
|
||||
#main_navigation{
|
||||
height: 20px;
|
||||
margin: 0;
|
||||
padding-left: 10px;
|
||||
background-color:#cccccc;
|
||||
}
|
||||
|
||||
#tabnav{
|
||||
height: 20px;
|
||||
margin: 0;
|
||||
padding-left: 10px;
|
||||
|
||||
}
|
||||
#tabnav_content {
|
||||
margin: 0;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
padding-bottom: 10px;
|
||||
padding-top: 4px;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
#tabnav li {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: inline;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
#tabnav a:link, #tabnav a:visited {
|
||||
float: left;
|
||||
background: #fff;
|
||||
font-size: 10px;
|
||||
line-height: 14px;
|
||||
font-weight: bold;
|
||||
padding: 2px 10px 2px 10px;
|
||||
margin-right: 4px;
|
||||
border: 1px solid #ccc;
|
||||
border-bottom: 1px solid #f3f3f3;
|
||||
text-decoration: none;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
#tabnav a:link.active, #tabnav a:visited.active {
|
||||
border-bottom: 2px solid #f3f3f3;
|
||||
background: #f3f3f3;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
#tabnav a:link.right, #tabnav a:visited.right
|
||||
{
|
||||
border-bottom: 1px solid #f3f3f3;
|
||||
background: #f3f3f3;
|
||||
color: #666;
|
||||
margin-left: 100px;
|
||||
}
|
||||
|
||||
#tabnav a:link.rightactive, #tabnav a:visited.rightactive {
|
||||
border-bottom: 1px solid #fff;
|
||||
background: #fff;
|
||||
color: #000;
|
||||
margin-left: 170px;
|
||||
}
|
||||
|
||||
#tabnav a:hover {
|
||||
background: #fff;
|
||||
}
|
||||
BIN
main/wiki/css/email.gif
Normal file
BIN
main/wiki/css/email.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 918 B |
BIN
main/wiki/css/ext.png
Normal file
BIN
main/wiki/css/ext.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 165 B |
BIN
main/wiki/css/ftp.gif
Normal file
BIN
main/wiki/css/ftp.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 921 B |
0
main/wiki/css/index.html
Normal file
0
main/wiki/css/index.html
Normal file
BIN
main/wiki/css/irc.gif
Normal file
BIN
main/wiki/css/irc.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 949 B |
BIN
main/wiki/css/news.png
Normal file
BIN
main/wiki/css/news.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 297 B |
BIN
main/wiki/css/wgroup.gif
Normal file
BIN
main/wiki/css/wgroup.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 516 B |
197
main/wiki/diff.inc.php
Normal file
197
main/wiki/diff.inc.php
Normal file
@@ -0,0 +1,197 @@
|
||||
<?php
|
||||
/**
|
||||
* CLAROLINE.
|
||||
*
|
||||
* @version 1.7 $Revision: 1.12 $
|
||||
*
|
||||
* @copyright 2001-2005 Universite catholique de Louvain (UCL)
|
||||
* @license http://www.gnu.org/copyleft/gpl.html (GPL) GENERAL PUBLIC LICENSE
|
||||
* This program is under the terms of the GENERAL PUBLIC LICENSE (GPL)
|
||||
* as published by the FREE SOFTWARE FOUNDATION. The GPL is available
|
||||
* through the world-wide-web at http://www.gnu.org/copyleft/gpl.html
|
||||
* @author Frederic Minne <zefredz@gmail.com>
|
||||
*
|
||||
* @package Wiki
|
||||
*/
|
||||
define("DIFF_EQUAL", "=");
|
||||
define("DIFF_ADDED", "+");
|
||||
define("DIFF_DELETED", "-");
|
||||
define("DIFF_MOVED", "M");
|
||||
|
||||
/**
|
||||
* Get difference between two strings.
|
||||
*
|
||||
* @param string old first string
|
||||
* @param string new second string
|
||||
* @param bool show_equals set to true to see line that are equal between
|
||||
* the two strings (default true)
|
||||
* @param string format_line_function callback function to format line
|
||||
* (default 'format_line')
|
||||
*
|
||||
* @return string formated diff output
|
||||
*/
|
||||
function diff(
|
||||
$old,
|
||||
$new,
|
||||
$show_equals = false,
|
||||
$format_line_function = 'format_line'
|
||||
) {
|
||||
$oldArr = str_split_on_new_line($old);
|
||||
$newArr = str_split_on_new_line($new);
|
||||
|
||||
$oldCount = count($oldArr);
|
||||
$newCount = count($newArr);
|
||||
|
||||
$max = max($oldCount, $newCount);
|
||||
|
||||
//get added and deleted lines
|
||||
|
||||
$deleted = array_diff_assoc($oldArr, $newArr);
|
||||
$added = array_diff_assoc($newArr, $oldArr);
|
||||
|
||||
$moved = [];
|
||||
|
||||
foreach ($added as $key => $candidate) {
|
||||
foreach ($deleted as $index => $content) {
|
||||
if ($candidate == $content) {
|
||||
$moved[$key] = $candidate;
|
||||
unset($added[$key]);
|
||||
unset($deleted[$index]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$output = '';
|
||||
|
||||
for ($i = 0; $i < $max; $i++) {
|
||||
// line changed
|
||||
if (isset($deleted[$i]) && isset($added[$i])) {
|
||||
$output .= $format_line_function($i, DIFF_DELETED, $deleted[$i]);
|
||||
$output .= $format_line_function($i, DIFF_ADDED, $added[$i]);
|
||||
} elseif (isset($deleted[$i]) && !isset($added[$i])) {
|
||||
// line deleted
|
||||
$output .= $format_line_function($i, DIFF_DELETED, $deleted[$i]);
|
||||
} elseif (isset($added[$i]) && !isset($deleted[$i])) {
|
||||
// line added
|
||||
$output .= $format_line_function($i, DIFF_ADDED, $added[$i]);
|
||||
} elseif (isset($moved[$i])) {
|
||||
// line moved
|
||||
$output .= $format_line_function($i, DIFF_MOVED, $newArr[$i]);
|
||||
} elseif ($show_equals) {
|
||||
// line unchanged
|
||||
$output .= $format_line_function($i, DIFF_EQUAL, $newArr[$i]);
|
||||
}
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Split strings on new line.
|
||||
*/
|
||||
function str_split_on_new_line($str)
|
||||
{
|
||||
$content = [];
|
||||
|
||||
if (api_strpos($str, "\r\n") !== false) {
|
||||
$content = explode("\r\n", $str);
|
||||
} elseif (api_strpos($str, "\n") !== false) {
|
||||
$content = explode("\n", $str);
|
||||
} elseif (api_strpos($str, "\r") !== false) {
|
||||
$content = explode("\r", $str);
|
||||
} else {
|
||||
$content[] = $str;
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Default and prototype format line function.
|
||||
*
|
||||
* @param int line line number
|
||||
* @param mixed type line type, must be one of the following :
|
||||
* DIFF_EQUAL, DIFF_MOVED, DIFF_ADDED, DIFF_DELETED
|
||||
* @param string value line content
|
||||
* @param bool skip_empty skip empty lines (default false)
|
||||
*
|
||||
* @return string formated diff line
|
||||
*/
|
||||
function format_line($line, $type, $value, $skip_empty = false)
|
||||
{
|
||||
if (trim($value) == "" && $skip_empty) {
|
||||
return "";
|
||||
} elseif (trim($value) == "") {
|
||||
$value = ' ';
|
||||
}
|
||||
|
||||
switch ($type) {
|
||||
case DIFF_EQUAL:
|
||||
// return $line. ' : ' . ' = <span class="diffEqual" >' . $value . '</span><br />' . "\n" ;
|
||||
return '<span class="diffEqual" >'.$value.'</span><br />'."\n"; //juan carlos muestra solo color
|
||||
break;
|
||||
case DIFF_MOVED:
|
||||
//return $line. ' : ' . ' M <span class="diffMoved" >' . $value . '</span><br />' . "\n" ; //juan carlos ra<72>a la sustitye la inverior
|
||||
return '<span class="diffMoved" >'.$value.'</span><br />'."\n"; //juan carlos muestra solo color
|
||||
break;
|
||||
case DIFF_ADDED:
|
||||
//return $line . ' : ' . ' + <span class="diffAdded" >' . $value . '</span><br />' . "\n" ;
|
||||
return '<span class="diffAdded" >'.$value.'</span><br />'."\n"; //juan carlos muestra solo color
|
||||
break;
|
||||
case DIFF_DELETED:
|
||||
//return $line . ' : ' . ' - <span class="diffDeleted" >' . $value . '</span><br />' . "\n" ; //juan carlos ra<72>a la sustitye la inverior
|
||||
return '<span class="diffDeleted" >'.$value.'</span><br />'."\n"; //juan carlos muestra solo color
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Table format line function.
|
||||
*
|
||||
* @see format_line
|
||||
*/
|
||||
function format_table_line($line, $type, $value, $skip_empty = false)
|
||||
{
|
||||
if (trim($value) == "" && $skip_empty) {
|
||||
return "";
|
||||
} elseif (trim($value) == "") {
|
||||
$value = ' ';
|
||||
}
|
||||
|
||||
switch ($type) {
|
||||
case DIFF_EQUAL:
|
||||
return '<tr><td></td><td bgcolor="#FFFFFF">'.$value.'</td></tr>'."\n";
|
||||
//juan carlos muestra solo color (no tambi<62>n la l<>nea).
|
||||
// Adem<65>s EN IEXPLORER VA BIEN PERO EN FIREFOX 3 la etiqueta span no muestra el color de fondo que
|
||||
// est<73> definido en la hoja de estilos como background-color, aceptando s<>lo la propiedad color
|
||||
// pero esta solo da color al texto con lo cual los cambios quedan poco resaltados, adem<65>s
|
||||
// los cambios de otros objetos que no sean texto no se indican por ej. a<>adir una imagen,
|
||||
// por esta raz<61>n doy el color de fondo al td directamente.
|
||||
break;
|
||||
case DIFF_MOVED:
|
||||
return '<tr><td></td><td bgcolor="#FFFFAA">'.$value.'</td></tr>'."\n";
|
||||
//juan carlos muestra solo color (no tambi<62>n la l<>nea). Adem<65>s EN IEXPLORER VA BIEN PERO EN FIREFOX 3
|
||||
// la etiqueta span no muestra el color de fondo que est<73> definido en la hoja de estilos como
|
||||
// background-color, aceptando s<>lo la propiedad color pero esta solo da color al texto con lo cual
|
||||
// los cambios quedan poco resaltados, adem<65>s los cambios de otros objetos que no sean texto no se indican
|
||||
// por ej. a<>adir una imagen, por esta raz<61>n doy el color de fondo al td directamente.
|
||||
break;
|
||||
case DIFF_ADDED:
|
||||
return '<tr><td></td><td bgcolor="#CCFFCC">'.$value.'</td></tr>'."\n";
|
||||
//juan carlos muestra solo color (no tambi<62>n la l<>nea). Adem<65>s EN IEXPLORER VA BIEN
|
||||
// PERO EN FIREFOX 3 la etiqueta span no muestra el color de fondo que est<73> definido en la
|
||||
// hoja de estilos como background-color, aceptando s<>lo la propiedad color pero esta solo
|
||||
// da color al texto con lo cual los cambios quedan poco resaltados, adem<65>s los cambios de
|
||||
// otros objetos que no sean texto no se indican por ej. a<>adir una imagen, por esta raz<61>n
|
||||
// doy el color de fondo al td directamente.
|
||||
break;
|
||||
case DIFF_DELETED:
|
||||
return '<tr><td></td><td bgcolor="#FFAAAA">'.$value.'</td></tr>'."\n";
|
||||
//juan carlos muestra solo color (no tambi<62>n la l<>nea). Adem<65>s EN IEXPLORER VA BIEN PERO EN FIREFOX 3
|
||||
// la etiqueta span no muestra el color de fondo que est<73> definido en la hoja de estilos como background-color,
|
||||
// aceptando s<>lo la propiedad color pero esta solo da color al texto con lo cual los cambios quedan poco
|
||||
// resaltados, adem<65>s los cambios de otros objetos que no sean texto no se indican por ej. a<>adir una imagen,
|
||||
// por esta raz<61>n doy el color de fondo al td directamente.
|
||||
}
|
||||
}
|
||||
111
main/wiki/index.php
Normal file
111
main/wiki/index.php
Normal file
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
/* For licensing terms, see /license.txt */
|
||||
|
||||
/**
|
||||
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
|
||||
* @author Juan Carlos Raña <herodoto@telefonica.net>
|
||||
*
|
||||
* @package chamilo.wiki
|
||||
*/
|
||||
require_once __DIR__.'/../inc/global.inc.php';
|
||||
require_once 'wiki.inc.php';
|
||||
|
||||
global $charset;
|
||||
|
||||
$wiki = new Wiki();
|
||||
$wiki->charset = $charset;
|
||||
|
||||
// section (for the tabs)
|
||||
$this_section = SECTION_COURSES;
|
||||
$current_course_tool = TOOL_WIKI;
|
||||
|
||||
$course_id = api_get_course_int_id();
|
||||
$session_id = api_get_session_id();
|
||||
$condition_session = api_get_session_condition($session_id);
|
||||
$groupId = api_get_group_id();
|
||||
|
||||
// additional style information
|
||||
$htmlHeadXtra[] = '<link rel="stylesheet" type="text/css" href="'.api_get_path(WEB_CODE_PATH).'wiki/css/default.css"/>';
|
||||
|
||||
// javascript for advanced parameters menu
|
||||
$htmlHeadXtra[] = '<script>
|
||||
function setFocus() {
|
||||
$("#search_title").focus();
|
||||
}
|
||||
|
||||
$(function() {
|
||||
setFocus();
|
||||
$("#start_date_toggle").click(function() {
|
||||
$("#start_date").toggle();
|
||||
});
|
||||
|
||||
$("#end_date_toggle").click(function() {
|
||||
$("#end_date").toggle();
|
||||
});
|
||||
});
|
||||
|
||||
</script>';
|
||||
|
||||
/* Constants and variables */
|
||||
$tool_name = get_lang('ToolWiki');
|
||||
|
||||
/* ACCESS */
|
||||
api_protect_course_script();
|
||||
api_block_anonymous_users();
|
||||
api_protect_course_group(GroupManager::GROUP_TOOL_WIKI);
|
||||
|
||||
Event::event_access_tool(TOOL_WIKI);
|
||||
|
||||
if ($groupId) {
|
||||
$group_properties = GroupManager::get_group_properties($groupId);
|
||||
$interbreadcrumb[] = [
|
||||
'url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.api_get_cidreq(),
|
||||
'name' => get_lang('Groups'),
|
||||
];
|
||||
$interbreadcrumb[] = [
|
||||
'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(),
|
||||
'name' => get_lang('GroupSpace').' '.Security::remove_XSS($group_properties['name']),
|
||||
];
|
||||
}
|
||||
|
||||
$is_allowed_to_edit = api_is_allowed_to_edit(false, true);
|
||||
|
||||
// The page we are dealing with
|
||||
$page = $_GET['title'] ?? 'index';
|
||||
$action = isset($_GET['action']) ? Security::remove_XSS($_GET['action']) : 'showpage';
|
||||
$view = isset($_GET['view']) ? Security::remove_XSS($_GET['view']) : null;
|
||||
|
||||
$wiki->page = $page;
|
||||
$wiki->action = $action;
|
||||
|
||||
// Setting wiki data
|
||||
if (!empty($view)) {
|
||||
$wiki->setWikiData($view);
|
||||
}
|
||||
|
||||
$wiki->blockConcurrentEditions(api_get_user_id(), $action);
|
||||
|
||||
/* MAIN WIKI AREA */
|
||||
|
||||
ob_start();
|
||||
$wiki->handleAction($action);
|
||||
if ($action == 'export_to_pdf') {
|
||||
$wiki->handleAction('showpage');
|
||||
}
|
||||
$content = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
Display::display_header($tool_name, 'Wiki');
|
||||
|
||||
// check last version
|
||||
if (!empty($view)) {
|
||||
$wiki->checkLastVersion($view);
|
||||
}
|
||||
|
||||
// Tool introduction
|
||||
Display::display_introduction_section(TOOL_WIKI);
|
||||
|
||||
$wiki->showActionBar();
|
||||
echo $content;
|
||||
|
||||
Display::display_footer();
|
||||
7203
main/wiki/wiki.inc.php
Normal file
7203
main/wiki/wiki.inc.php
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user