skala
Juan Carlos Raña 16 years ago
commit b886d53798
  1. 4
      main/admin/course_edit.php
  2. 29
      main/admin/course_list.php
  3. 2
      main/admin/user_list.php
  4. 1124
      main/exercice/exercice_submit.php
  5. 2
      main/forum/newthread.php
  6. 2
      main/forum/reply.php
  7. 39
      main/inc/lib/blog.lib.php
  8. 48
      main/inc/lib/fckeditor/editor/plugins/glossary/fck_glossary_automatic.js
  9. 1
      main/inc/lib/fckeditor/fcktemplates.xml.php
  10. 1
      main/inc/lib/javascript/jquery.highlight.js
  11. 56
      main/newscorm/scorm_api.php
  12. 2
      main/survey/create_new_survey.php

@ -137,7 +137,9 @@ EOT;
$renderer = $form->defaultRenderer();
$renderer -> setElementTemplate($element_template, 'group');
$form -> addGroup($group,'group',get_lang('CourseTeachers'),'</td><td width="50" align="center"><input type="button" onclick="moveItem(document.getElementById(\'platform_teachers\'), document.getElementById(\'course_teachers\'))" value=">>"><br><br><input type="button" onclick="moveItem(document.getElementById(\'course_teachers\'), document.getElementById(\'platform_teachers\'))" value="<<"></td><td>');
$form -> addGroup($group,'group',get_lang('CourseTeachers'),'</td><td width="80" align="center">'.
'<input class="arrowr" style="width:30px;height:30px;padding-right:12px" type="button" onclick="moveItem(document.getElementById(\'platform_teachers\'), document.getElementById(\'course_teachers\'))" ><br><br>' .
'<input class="arrowl" style="width:30px;height:30px;padding-left:13px" type="button" onclick="moveItem(document.getElementById(\'course_teachers\'), document.getElementById(\'platform_teachers\'))" ></td><td>');
$categories_select = $form->addElement('select', 'category_code', get_lang('CourseFaculty'), $categories);

@ -71,9 +71,8 @@ function get_course_data($from, $number_of_items, $column, $direction)
$course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$users_table = Database :: get_main_table(TABLE_MAIN_USER);
$course_users_table = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
$sql = "SELECT code AS col0, visual_code AS col1, title AS col2, course_language AS col3, category_code AS col4, subscribe AS col5, unsubscribe AS col6, code AS col7, tutor_name as col8, code AS col9, visibility AS col10,directory as col11 FROM $course_table";
$sql = "SELECT code AS col0, visual_code AS col1, title AS col2, course_language AS col3, category_code AS col4, subscribe AS col5, unsubscribe AS col6, tutor_name as col7, code AS col8, visibility AS col9,directory as col10 FROM $course_table";
//$sql = "SELECT code AS col0, visual_code AS col1, title AS col2, course_language AS col3, category_code AS col4, subscribe AS col5, unsubscribe AS col6, code AS col7, tutor_name as col8, code AS col9, visibility AS col10,directory as col11 FROM $course_table";
global $_configuration;
if ((api_is_platform_admin() || api_is_session_admin()) && $_configuration['multiple_access_urls']==true && api_get_current_access_url_id()!=-1) {
$access_url_rel_course_table = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
@ -109,12 +108,12 @@ function get_course_data($from, $number_of_items, $column, $direction)
while ($course = Database::fetch_row($res))
{
//place colour icons in front of courses
$course[1] = get_course_visibility_icon($course[10]).'<a href="'.api_get_path(WEB_COURSE_PATH).$course[11].'/index.php">'.$course[1].'</a>';
$course[1] = get_course_visibility_icon($course[9]).'<a href="'.api_get_path(WEB_COURSE_PATH).$course[9].'/index.php">'.$course[1].'</a>';
$course[5] = $course[5] == SUBSCRIBE_ALLOWED ? get_lang('Yes') : get_lang('No');
$course[6] = $course[6] == UNSUBSCRIBE_ALLOWED ? get_lang('Yes') : get_lang('No');
$course[7] = CourseManager :: is_virtual_course_from_system_code($course[7]) ? get_lang('Yes') : get_lang('No');
$course_rem = array($course[0],$course[1],$course[2],$course[3],$course[4],$course[5],$course[6],$course[7],$course[8],$course[9]);
//$course[7] = CourseManager :: is_virtual_course_from_system_code($course[7]) ? get_lang('Yes') : get_lang('No');
//$course_rem = array($course[0],$course[1],$course[2],$course[3],$course[4],$course[5],$course[6],$course[7],$course[8],$course[9]);
$course_rem = array($course[0],$course[1],$course[2],$course[3],$course[4],$course[5],$course[6],$course[7],$course[8]);
$courses[] = $course_rem;
}
return $courses;
@ -125,15 +124,15 @@ function get_course_data($from, $number_of_items, $column, $direction)
function modify_filter($code)
{
global $charset;
return
return
'<a href="course_information.php?code='.$code.'">'.Display::return_icon('synthese_view.gif', get_lang('Info')).'</a>&nbsp;'.
//'<a href="../course_home/course_home.php?cidReq='.$code.'">'.Display::return_icon('course_home.gif', get_lang('CourseHomepage')).'</a>&nbsp;'. // This is not the preferable way to go to the homepage.
'<a href="'.api_get_path(WEB_COURSE_PATH).$code.'/index.php">'.Display::return_icon('course_home.gif', get_lang('CourseHomepage')).'</a>&nbsp;'.
'<a href="../coursecopy/backup.php?cidReq='.$code.'">'.Display::return_icon('backup.gif', get_lang('CreateBackup')).'</a>&nbsp;'.
'<a href="../tracking/courseLog.php?cidReq='.$code.'">'.Display::return_icon('statistics.gif', get_lang('Tracking')).'</a>&nbsp;'.
'<a href="course_edit.php?course_code='.$code.'">'.Display::return_icon('edit.gif', get_lang('Edit')).'</a>&nbsp;'.
'<a href="course_list.php?delete_course='.$code.'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.Display::return_icon('delete.gif', get_lang('Delete')).'</a>';
}
/**
* Return an icon representing the visibility of the course
@ -283,11 +282,11 @@ else
$table->set_header(3, get_lang('Language'));
$table->set_header(4, get_lang('Category'));
$table->set_header(5, get_lang('SubscriptionAllowed'));
$table->set_header(6, get_lang('UnsubscriptionAllowed'));
$table->set_header(7, get_lang('IsVirtualCourse'));
$table->set_header(8, get_lang('Teacher'));
$table->set_header(9, get_lang('Action'), false,'width="120px"');
$table->set_column_filter(9,'modify_filter');
$table->set_header(6, get_lang('UnsubscriptionAllowed'),false,'width="50px"');
//$table->set_header(7, get_lang('IsVirtualCourse'));
$table->set_header(7, get_lang('Teacher'));
$table->set_header(8, get_lang('Action'), false,'width="125px"');
$table->set_column_filter(8,'modify_filter');
$table->set_form_actions(array ('delete_courses' => get_lang('DeleteCourse')),'course');
$table->display();
}

@ -761,7 +761,7 @@ else
$table->set_header(5, get_lang('Email'));
$table->set_header(6, get_lang('Status'));
$table->set_header(7, get_lang('Active'));
$table->set_header(8, get_lang('Action'), false);
$table->set_header(8, get_lang('Action'), false,'width="170px"');
$table->set_column_filter(5, 'email_filter');
$table->set_column_filter(6, 'status_filter');
$table->set_column_filter(7, 'active_filter');

File diff suppressed because it is too large Load Diff

@ -201,7 +201,7 @@ handle_forum_and_forumcategories();
echo '<div class="actions">';
echo '<span style="float:right;">'.search_link().'</span>';
echo '<a href="index.php?gradebook='.$gradebook.'">'.Display::return_icon('back.png',get_lang('BackToForumOverview')).' '.get_lang('BackToForumOverview').'</a>';
echo '<a href="viewforum.php?forum='.Security::remove_XSS($_GET['forum']).'">'.Display::return_icon('forum.gif',get_lang('BackToForum')).' '.get_lang('BackToForum').'</a>';
echo '<a href="viewforum.php?forum='.Security::remove_XSS($_GET['forum']).'&amp;gidReq='.$_SESSION['toolgroup'].'">'.Display::return_icon('forum.gif',get_lang('BackToForum')).' '.get_lang('BackToForum').'</a>';
echo '</div>';
/*

@ -191,7 +191,7 @@ if ($origin != 'learnpath') {
echo '<div class="actions">';
echo '<span style="float:right;">'.search_link().'</span>';
echo '<a href="index.php?gradebook='.$gradebook.'">'.Display::return_icon('back.png',get_lang('BackToForumOverview')).' '.get_lang('BackToForumOverview').'</a>';
echo '<a href="viewforum.php?forum='.Security::remove_XSS($_GET['forum']).'">'.Display::return_icon('forum.gif',get_lang('BackToForum')).' '.get_lang('BackToForum').'</a>';
echo '<a href="viewforum.php?forum='.Security::remove_XSS($_GET['forum']).'&amp;gidReq='.$_SESSION['toolgroup'].'">'.Display::return_icon('forum.gif',get_lang('BackToForum')).' '.get_lang('BackToForum').'</a>';
echo '<a href="viewthread.php?forum='.Security::remove_XSS($_GET['forum']).'&amp;gradebook='.$gradebook.'&amp;thread='.Security::remove_XSS($_GET['thread']).'">'.Display::return_icon('forumthread.gif',get_lang('BackToThread')).' '.get_lang('BackToThread').'</a>';
echo '</div>';
} else {

@ -119,12 +119,9 @@ class Blog {
/**
* Creates a new blog in the given course
* @author Toon Keppens
*
* @param Integer $course_id Id
* @param String $title
* @param Text $description
*
* @return void
*/
public static function create_blog ($title, $subtitle) {
global $_user;
@ -170,12 +167,9 @@ class Blog {
/**
* Update title and subtitle of a blog in the given course
* @author Toon Keppens
*
* @param Integer $course_id Id
* @param String $title
* @param Text $description
*
* @return void
*/
public static function edit_blog ($blog_id, $title, $subtitle) {
global $_user;
@ -200,10 +194,7 @@ class Blog {
/**
* Deletes a blog and it's posts from the course database
* @author Toon Keppens
*
* @param Integer $blog_id
*
* @return void
*/
public static function delete_blog ($blog_id) {
// Init
@ -249,12 +240,9 @@ class Blog {
/**
* Creates a new post in a given blog
* @author Toon Keppens
*
* @param String $title
* @param String $full_text
* @param Integer $blog_id
*
* @return void
*/
public static function create_post ($title, $full_text, $file_comment, $blog_id) {
global $_user;
@ -327,13 +315,10 @@ class Blog {
/**
* Edits a post in a given blog
* @author Toon Keppens
*
* @param Integer $blog_id
* @param String $title
* @param String $full_text
* @param Integer $blog_id
*
* @return void
*/
public static function edit_post ($post_id, $title, $full_text, $blog_id) {
// Init
@ -347,11 +332,8 @@ class Blog {
/**
* Deletes an article and it's comments
* @author Toon Keppens
*
* @param Integer $blog_id
* @param Integer $post_id
*
* @return void
*/
public static function delete_post($blog_id, $post_id) {
// Init
@ -378,14 +360,11 @@ class Blog {
/**
* Creates a comment on a post in a given blog
* @author Toon Keppens
*
* @param String $title
* @param String $full_text
* @param Integer $blog_id
* @param Integer $post_id
* @param Integer $parent_id
*
* @return void
*/
public static function create_comment($title, $full_text, $file_comment,$blog_id, $post_id, $parent_id, $task_id = 'NULL') {
global $_user;
@ -458,11 +437,8 @@ class Blog {
/**
* Deletes a comment from a blogpost
* @author Toon Keppens
*
* @param Integer $blog_id
* @param Integer $comment_id
*
* @return void
*/
public static function delete_comment ($blog_id, $post_id, $comment_id) {
// Init
@ -496,13 +472,10 @@ class Blog {
/**
* Creates a new task in a blog
* @author Toon Keppens
*
* @param Integer $blog_id
* @param String $title
* @param String $description
* @param String $color
*
* @return void
*/
public static function create_task ($blog_id, $title, $description, $articleDelete, $articleEdit, $commentsDelete, $color) {
// Init
@ -569,13 +542,10 @@ class Blog {
/**
* Edit a task in a blog
* @author Toon Keppens
*
* @param Integer $task_id
* @param String $title
* @param String $description
* @param String $color
*
* @return void
*/
public static function edit_task($blog_id, $task_id, $title, $description, $articleDelete, $articleEdit, $commentsDelete, $color) {
// Init
@ -649,11 +619,8 @@ class Blog {
/**
* Deletes a task from a blog
*
* @param Integer $blog_id
* @param Integer $task_id
*
* @return void
*/
public static function delete_task ($blog_id, $task_id) {
// Init
@ -666,11 +633,8 @@ class Blog {
/**
* Deletes an assigned task from a blog
*
* @param Integer $blog_id
* @param Integer $assignment_id
*
* @return void
*/
public static function delete_assigned_task ($blog_id, $task_id,$user_id) {
// Init
@ -727,10 +691,7 @@ class Blog {
/**
* Changes the visibility of a blog
* @author Toon Keppens
*
* @param Integer $blog_id
*
* @return void
*/
public static function change_blog_visibility ($blog_id) {
// Init

@ -1,9 +1,10 @@
$(document).ready(function() {
$(window).load(function () {
var my_text=$("body").html();
my_protocol = location.protocol;
my_pathname=location.pathname;
work_path = my_pathname.substr(0,my_pathname.indexOf('/courses/'));
$.ajax({
contentType: "application/x-www-form-urlencoded",
beforeSend: function(content_object) {
@ -11,19 +12,43 @@ $(document).ready(function() {
type: "POST",
url: my_protocol+"//"+location.host+work_path+"/main/glossary/glossary_ajax_request.php",
data: "glossary_data=true",
success: function(datos) {
if (datos.length==0) {
success: function(datas) {
if (datas.length==0) {
return false;
}
data_terms=datas.split("[|.|_|.|-|.|]");
var complex_array = new Array();
var cp_complex_array = new Array();
for(i=0;i<data_terms.length;i++) {
specific_terms=data_terms[i].split("__|__|");
var real_term = specific_terms[1];
var my_specific_terms = new RegExp('([^A-Za-z0-9/_\<>])'+specific_terms[1]+'[\ .,]{0,1}',"gi");
new_html=my_text.replace(my_specific_terms,function(m){return replace_complete_char(m)});
$("body").html(new_html);
my_text=$("body").html();
var real_code = specific_terms[0];
complex_array[real_code] = real_term;
cp_complex_array[real_code] = real_term;
}
complex_array.reverse();
for (var my_index in complex_array) {
n = complex_array[my_index];
if (n == null) {
n = '';
} else {
for (var cp_my_index in cp_complex_array) {
cp_data = cp_complex_array[cp_my_index];
if (cp_data == null) {
cp_data = '';
} else {
if (cp_data == n) {
my_index = cp_my_index;
}
}
}
$('body').removeHighlight().highlight(n,my_index)
}
}
var complex_array = new Array();
//mouse over event
$("body .glossary-ajax").mouseover(function(){
@ -56,14 +81,7 @@ $(document).ready(function() {
div_show_id=current_element.find("div").attr("id");
$("div#"+div_show_id).remove();
});
//Callback Helper
function replace_complete_char(m) {
var complete_term_pattern = new RegExp(real_term,"i");
var tag = m.replace(complete_term_pattern," <span class=\"glossary-ajax\" style='color:blue' name=\"link"+specific_terms[0]+"\">$&</span>");
return tag;
}
}
});

@ -25,6 +25,7 @@ if (api_get_setting('show_glossary_in_documents') != 'none') {
if (api_get_setting('show_glossary_in_documents') == 'ismanual') {
$js .= '<script language="javascript" src="'.api_get_path(WEB_LIBRARY_PATH).'fckeditor/editor/plugins/glossary/fck_glossary_manual.js"/>';
} else {
$js .= '<script language="javascript" src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.highlight.js"/>'.PHP_EOL;
$js .= '<script language="javascript" src="'.api_get_path(WEB_LIBRARY_PATH).'fckeditor/editor/plugins/glossary/fck_glossary_automatic.js"/>';
}
}

@ -23,6 +23,7 @@ jQuery.fn.highlight = function(pat,real_code) {
var spannode = document.createElement('a');
spannode.className = 'glossary-ajax';
spannode.style.color = 'blue';
spannode.style.textDecoration = 'none';
spannode.name = 'link'+real_code;
spannode.href = '#';
var SearchRegExp = new RegExp("(" + pat +")","gi");

@ -180,6 +180,7 @@ $(document).ready( function() {
$(document).ready( function() {
$("iframe").contents().find('head').append('<script src="/main/inc/lib/javascript/jquery.highlight.js" type="text/javascript" language="javascript"></script>');
$("iframe#content_id").load( function(){
//alert("Document title: " + $("iframe#content_id").attr('src'));
info_lms_item[0]=info_lms_item[1];
@ -1592,7 +1593,6 @@ if(lms_lp_type==1 || lms_item_type=='asset'){
*/
function attach_glossary_into_scorm() {
var f = $('#content_id')[0];
var doc = f.contentWindow ? f.contentWindow.document :
f.contentDocument ? f.contentDocument : f.document;
@ -1605,24 +1605,49 @@ function attach_glossary_into_scorm() {
$.ajax({
contentType: "application/x-www-form-urlencoded",
beforeSend: function(objeto) {
beforeSend: function(content_object) {
},
type: "POST",
url: my_protocol+"//"+location.host+work_path+"/main/glossary/glossary_ajax_request.php",
data: "glossary_data=true",
success: function(datos) {
if (datos.length==0) {
success: function(datas) {
if (datas.length==0) {
return false;
}
data_terms=datos.split("[|.|_|.|-|.|]");
data_terms=datas.split("[|.|_|.|-|.|]");
var complex_array = new Array();
var cp_complex_array = new Array();
for(i=0;i<data_terms.length;i++) {
specific_terms=data_terms[i].split("__|__|");
var real_term = specific_terms[1];
var my_specific_terms = new RegExp('([^A-Za-z0-9/_\<>])'+specific_terms[1]+'[\ .,]{0,1}',"gi");
new_html=my_text.replace(my_specific_terms,function(m){return replace_complete_char(m)});
$frame_content.html(new_html);
my_text=$frame_content.html();
var real_code = specific_terms[0];
complex_array[real_code] = real_term;
cp_complex_array[real_code] = real_term;
}
complex_array.reverse();
for (var my_index in complex_array) {
n = complex_array[my_index];
if (n == null) {
n = '';
} else {
for (var cp_my_index in cp_complex_array) {
cp_data = cp_complex_array[cp_my_index];
if (cp_data == null) {
cp_data = '';
} else {
if (cp_data == n) {
my_index = cp_my_index;
}
}
}
$("iframe").contents().find('body').removeHighlight().highlight(n,my_index)
}
}
var complex_array = new Array();
//mouse over event
$("iframe").contents().find('body').find('.glossary-ajax').mouseover(function(){
random_id=Math.round(Math.random()*100);
@ -1636,13 +1661,13 @@ function attach_glossary_into_scorm() {
my_glossary_id=data_notebook[1];
$.ajax({
contentType: "application/x-www-form-urlencoded",
beforeSend: function(objeto) {
beforeSend: function(content_object) {
$("iframe").contents().find('body').find("div#"+div_content_id).html("<img src="+my_protocol+"//"+location.host+work_path+"/main/inc/lib/javascript/indicator.gif />"); },
type: "POST",
url: my_protocol+"//"+location.host+work_path+"/main/glossary/glossary_ajax_request.php",
data: "glossary_id="+my_glossary_id,
success: function(datos) {
$("iframe").contents().find('body').find("div#"+div_content_id).html(datos);
success: function(datas) {
$("iframe").contents().find('body').find("div#"+div_content_id).html(datas);
}
});
});
@ -1653,13 +1678,6 @@ function attach_glossary_into_scorm() {
div_show_id=current_element.find("div").attr("id");
$("iframe").contents().find('body').find("div#"+div_show_id).remove();
});
//Callback Helper
function replace_complete_char(m) {
var complete_term_pattern = new RegExp(real_term,"i");
var tag = m.replace(complete_term_pattern," <span class=\"glossary-ajax\" style='color:blue' name=\"link"+specific_terms[0]+"\">$&</span>");
return tag;
}
}

@ -163,6 +163,8 @@ foreach ($lang_array['name'] as $key=>$value) {
}
$form->addElement('select', 'survey_language', get_lang('Language'), $languages);
*/
// Pass the language of the survey in the form
$form->addElement('hidden', 'survey_language');
$form->addElement('datepickerdate', 'start_date', get_lang('StartDate'), array('form_name'=>'survey'));
$form->addElement('datepickerdate', 'end_date', get_lang('EndDate'), array('form_name'=>'survey'));

Loading…
Cancel
Save