Minor - fixing course list removing a "nobr" tag otherwise if the course title is too long the table breaks, fixing bug when saving platform/course quota settings

skala
Julio Montoya 14 years ago
parent 3ab738ec2f
commit 87df34c5ad
  1. 2
      main/admin/course_edit.php
  2. 6
      main/admin/course_list.php
  3. 19
      main/admin/settings.php

@ -168,7 +168,7 @@ $group[]= $form->createElement('radio', 'unsubscribe', null, get_lang('NotAllowe
$form->addGroup($group,'', get_lang('Unsubscription'), '<br />');
$form->addElement('text','disk_quota',array(get_lang('CourseQuota'),null, get_lang('MB')));
$form->addElement('text','disk_quota',array(get_lang('CourseQuota'), null, get_lang('MB')));
$form->addRule('disk_quota', get_lang('ThisFieldIsRequired'),'required');
$form->addRule('disk_quota',get_lang('ThisFieldShouldBeNumeric'),'numeric');

@ -101,7 +101,7 @@ function get_course_data($from, $number_of_items, $column, $direction) {
$courses = array ();
while ($course = Database::fetch_row($res)) {
// Place colour icons in front of courses.
$course[1] = '<nobr>'.get_course_visibility_icon($course[8]).'<a href="'.api_get_path(WEB_COURSE_PATH).$course[9].'/index.php">'.$course[1].'</a></nobr>';
$course[1] = get_course_visibility_icon($course[8]).'<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');
@ -265,7 +265,7 @@ if (isset ($_GET['search']) && $_GET['search'] == 'advanced') {
$table->set_additional_parameters($parameters);
$table->set_header(0, '', false, 'width="8px"');
$table->set_header(1, get_lang('Title'));
$table->set_header(1, get_lang('Title'), true, 'width="360px"');
$table->set_header(2, get_lang('Code'));
$table->set_header(3, get_lang('Language'), true, 'width="70px"');
$table->set_header(4, get_lang('Category'));
@ -273,7 +273,7 @@ if (isset ($_GET['search']) && $_GET['search'] == 'advanced') {
$table->set_header(6, get_lang('UnsubscriptionAllowed'), false, 'width="50px"');
//$table->set_header(7, get_lang('Teacher'));
$table->set_header(7, get_lang('Action'), false, 'width="150px"');
$table->set_header(7, get_lang('Action'), false, 'width="160px"');
$table->set_column_filter(7, 'modify_filter');
$table->set_form_actions(array('delete_courses' => get_lang('DeleteCourse')), 'course');
$content .= $table->return_table();

@ -46,6 +46,9 @@ $settings_to_avoid = array(
'example_material_course_creation' => 'true' // ON by default - now we have this option when we create a course
);
$convert_byte_to_mega_list = array('dropbox_max_filesize', 'message_max_upload_filesize', 'default_document_quotum', 'default_group_quotum');
// Submit stylesheets.
if (isset($_POST['submit_stylesheets'])) {
@ -199,10 +202,11 @@ if (!empty($_GET['category']) && !in_array($_GET['category'], array('Plugins', '
}
}
switch ($row['type']) {
case 'textfield':
if (in_array($row['variable'], array('dropbox_max_filesize', 'message_max_upload_filesize'))) {
$form->addElement('text', $row['variable'], array(get_lang($row['title']), get_lang($row['comment']), get_lang('MB')), array('maxlength' => '5'));
if (in_array($row['variable'], $convert_byte_to_mega_list)) {
$form->addElement('text', $row['variable'], array(get_lang($row['title']), get_lang($row['comment']), get_lang('MB')), array('maxlength' => '8'));
$form->applyFilter($row['variable'], 'html_filter');
$default_values[$row['variable']] = round($row['selected_value']/1024/1024, 1);
@ -498,9 +502,14 @@ if (!empty($_GET['category']) && !in_array($_GET['category'], array('Plugins', '
}
// Set true for allow_message_tool variable if social tool is actived
foreach ($convert_byte_to_mega_list as $item) {
if (isset($values[$item])) {
$values[$item] = round($values[$item]*1024*1024);
}
}
$values['dropbox_max_filesize'] = $values['dropbox_max_filesize']*1024*1024;
$values['message_max_upload_filesize'] = $values['message_max_upload_filesize']*1024*1024;
/*$values['dropbox_max_filesize'] = $values['dropbox_max_filesize']*1024*1024;
$values['message_max_upload_filesize'] = $values['message_max_upload_filesize']*1024*1024;*/
if ($values['allow_social_tool'] == 'true') {
$values['allow_message_tool'] = 'true';
@ -527,8 +536,6 @@ if (!empty($_GET['category']) && !in_array($_GET['category'], array('Plugins', '
api_set_setting($key, $value, null, null, $_configuration['access_url']);
}
// Save the settings.
$keys = array();

Loading…
Cancel
Save