Minor - fixing URL, using api_get_course_info()

1.9.x
Julio Montoya 12 years ago
parent 03bcec9ea9
commit 9f6b0ec4fe
  1. 7
      main/group/group.php
  2. 24
      main/group/group_creation.php
  3. 2
      main/inc/lib/groupmanager.lib.php

@ -19,6 +19,9 @@
$language_file = 'group';
require_once '../inc/global.inc.php';
$is_allowed_in_course = api_is_allowed_to_edit(false, true);
$this_section = SECTION_COURSES;
$current_course_tool = TOOL_GROUP;
@ -27,12 +30,12 @@ api_protect_course_script(true);
$htmlHeadXtra[] = '<script>
$(document).ready( function() {
for (i=0;i<$(".actions").length;i++) {
for (i=0; i<$(".actions").length; i++) {
if ($(".actions:eq("+i+")").html()=="<table border=\"0\"></table>" || $(".actions:eq("+i+")").html()=="" || $(".actions:eq("+i+")").html()==null) {
$(".actions:eq("+i+")").hide();
}
}
} );
});
</script>';
$nameTools = get_lang('GroupManagement');
$course_id = api_get_course_int_id();

@ -92,7 +92,6 @@ elseif (isset($_POST['number_of_groups'])) {
if ($number_of_groups > 1) {
?>
<script type="text/javascript">
<!--
var number_of_groups = <?php echo $number_of_groups; ?>;
function switch_state(key) {
for( i=1; i<number_of_groups; i++) {
@ -124,7 +123,6 @@ elseif (isset($_POST['number_of_groups'])) {
element.value = ref.value;
}
}
-->
</script>
<?php
}
@ -136,7 +134,7 @@ elseif (isset($_POST['number_of_groups'])) {
$cat_options[$category['id']] = $category['title'];
}
}
$form = new FormValidator('create_groups_step2');
$form = new FormValidator('create_groups_step2', 'POST', api_get_self().'?'.api_get_cidreq());
// Modify the default templates
$renderer = $form->defaultRenderer();
@ -216,7 +214,7 @@ EOT;
$categories = GroupManager :: get_categories();
//echo '<blockquote>';
if (count($categories) > 1 || isset ($categories[0]) && $categories[0]['id'] != GroupManager::VIRTUAL_COURSE_CATEGORY) {
$create_groups_form = new FormValidator('create_groups');
$create_groups_form = new FormValidator('create_groups', 'post', api_get_self().'?'.api_get_cidreq());
$create_groups_form->addElement('header', '', $nameTools);
$group_el = array ();
$group_el[] = $create_groups_form->createElement('static', null, null, get_lang('Create'));
@ -231,24 +229,6 @@ EOT;
} else {
echo get_lang('NoCategoriesDefined');
}
//echo '</blockquote>';
/*
* Show form to generate groups from virtual courses
*/
$virtual_courses = CourseManager :: get_virtual_courses_linked_to_real_course($_course['sysCode']);
if (count($virtual_courses) > 0) {
echo '<b>'.get_lang('CreateGroupsFromVirtualCourses').'</b>';
echo '<blockquote>';
echo get_lang('CreateGroupsFromVirtualCoursesInfo');
$create_virtual_groups_form = new FormValidator('create_virtual_groups');
$create_virtual_groups_form->addElement('hidden', 'action');
$create_virtual_groups_form->addElement('submit', 'submit', get_lang('Ok'));
$create_virtual_groups_form->setDefaults(array('action' => 'create_virtual_groups'));
$create_virtual_groups_form->display();
echo '</blockquote>';
}
/*
* Show form to generate subgroups
*/

@ -185,7 +185,7 @@ class GroupManager
*/
public static function create_group($name, $category_id, $tutor, $places)
{
global $_course;
$_course = api_get_course_info();
$table_group = Database :: get_course_table(TABLE_GROUP);
$session_id = api_get_session_id();

Loading…
Cancel
Save