obs fix pull request buttons

1.10.x
aragonc 11 years ago
commit 21781c94ae
  1. 10
      composer.lock
  2. 38
      main/admin/settings.lib.php
  3. 8
      main/admin/settings.php
  4. 6
      main/admin/user_list.php
  5. 2
      main/announcements/announcements.php
  6. 17
      main/attendance/attendance_sheet.php
  7. 2
      main/calendar/agenda_js.php
  8. 3
      main/chat/chat.php
  9. 1
      main/course_progress/layout_no_header.php
  10. 6
      main/course_progress/thematic.php
  11. 45
      main/course_progress/thematic_advance.php
  12. 23
      main/course_progress/thematic_controller.php
  13. 2
      main/create_course/add_course.php
  14. 30
      main/css/base.css
  15. 1
      main/document/document.php
  16. 2
      main/forum/viewforum.php
  17. 2
      main/glossary/index.php
  18. 2
      main/gradebook/lib/fe/evalform.class.php
  19. 12
      main/group/group.php
  20. 26
      main/group/group_space.php
  21. 130
      main/inc/ajax/thematic.ajax.php
  22. 25
      main/inc/lib/api.lib.php
  23. 28
      main/inc/lib/display.lib.php
  24. 3
      main/inc/lib/events.lib.inc.php
  25. 186
      main/inc/lib/formvalidator/FormValidator.class.php
  26. 6
      main/inc/lib/groupmanager.lib.php
  27. 2
      main/inc/lib/pear/HTML/Common.php
  28. 6
      main/inc/lib/pear/HTML/QuickForm.php
  29. 4
      main/inc/lib/pear/HTML/QuickForm/advanced_settings.php
  30. 100
      main/inc/lib/pear/HTML/QuickForm/button.php
  31. 6
      main/inc/lib/pear/HTML/QuickForm/element.php
  32. 99
      main/inc/lib/pear/HTML/QuickForm/group.php
  33. 5
      main/inc/lib/pear/HTML/QuickForm/header.php
  34. 26
      main/inc/lib/pear/HTML/QuickForm/html.php
  35. 2
      main/inc/lib/pear/HTML/QuickForm/label.php
  36. 5
      main/inc/lib/pear/HTML/QuickForm/select.php
  37. 14
      main/inc/lib/pear/HTML/QuickForm/static.php
  38. 2
      main/inc/lib/pear/HTML/QuickForm/submit.php
  39. 2
      main/inc/lib/pear/HTML/QuickForm/text.php
  40. 4
      main/inc/lib/pear/HTML/QuickForm/textarea.php
  41. 2
      main/inc/lib/pear/HTML/Table.php
  42. 2
      main/inc/lib/pear/HTML/Table/Storage.php
  43. 27
      main/survey/reporting.php
  44. 8
      main/survey/survey.lib.php
  45. 24
      main/template/default/create_course/add_course.tpl
  46. 1
      main/wiki/index.php
  47. 18
      main/work/work.php

10
composer.lock generated

@ -1425,16 +1425,16 @@
},
{
"name": "monolog/monolog",
"version": "1.13.0",
"version": "1.13.1",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/monolog.git",
"reference": "c41c218e239b50446fd883acb1ecfd4b770caeae"
"reference": "c31a2c4e8db5da8b46c74cf275d7f109c0f249ac"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/c41c218e239b50446fd883acb1ecfd4b770caeae",
"reference": "c41c218e239b50446fd883acb1ecfd4b770caeae",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/c31a2c4e8db5da8b46c74cf275d7f109c0f249ac",
"reference": "c31a2c4e8db5da8b46c74cf275d7f109c0f249ac",
"shasum": ""
},
"require": {
@ -1494,7 +1494,7 @@
"logging",
"psr-3"
],
"time": "2015-03-05 01:12:12"
"time": "2015-03-09 09:58:04"
},
{
"name": "mpdf/mpdf",

@ -92,13 +92,13 @@ function handle_regions()
}
echo '</table>';
echo '<br />';
echo '<button class="save" type="submit" name="submit_plugins">'.get_lang('EnablePlugins').'</button></form>';
echo '<button class="btn btn-success" type="submit" name="submit_plugins">'.get_lang('EnablePlugins').'</button></form>';
}
function handle_extensions()
{
echo Display::page_subheader(get_lang('ConfigureExtensions'));
echo '<a class="btn" href="configure_extensions.php?display=ppt2lp">'.get_lang('Ppt2lp').'</a>';
echo '<a class="btn btn-success" href="configure_extensions.php?display=ppt2lp" role="button">'.get_lang('Ppt2lp').'</a>';
}
/**
@ -175,12 +175,12 @@ function handle_plugins()
echo '<div class="btn-group">';
if (in_array($plugin, $installed_plugins)) {
echo Display::url(get_lang('Configure'), 'configure_plugin.php?name='.$plugin, array('class' => 'btn'));
echo Display::url(get_lang('Regions'), 'settings.php?category=Regions&name='.$plugin, array('class' => 'btn'));
echo Display::url('<i class="fa fa-cogs"></i> '.get_lang('Configure'), 'configure_plugin.php?name='.$plugin, array('class' => 'btn btn-default'));
echo Display::url('<i class="fa fa-th-large"></i> '.get_lang('Regions'), 'settings.php?category=Regions&name='.$plugin, array('class' => 'btn btn-default'));
}
if (file_exists(api_get_path(SYS_PLUGIN_PATH).$plugin.'/readme.txt')) {
echo Display::url("readme.txt", api_get_path(WEB_PLUGIN_PATH).$plugin."/readme.txt", array('class' => 'btn ajax', '_target' => '_blank'));
echo Display::url("<i class='fa fa-file-text-o'></i> readme.txt", api_get_path(WEB_PLUGIN_PATH).$plugin."/readme.txt", array('class' => 'btn btn-default', '_target' => '_blank'));
}
echo '</div>';
echo '</td></tr>';
@ -189,7 +189,7 @@ function handle_plugins()
echo '</table>';
echo '<div class="form-actions bottom_actions">';
echo '<button class="save" type="submit" name="submit_plugins">'.get_lang('EnablePlugins').'</button>';
echo '<button class="btn btn-success" type="submit" name="submit_plugins">'.get_lang('EnablePlugins').'</button>';
echo '</div>';
echo '</form>';
}
@ -226,7 +226,7 @@ function handle_stylesheets()
$form->addRule('new_stylesheet', get_lang('InvalidExtension').' ('.implode(',', $allowed_file_types).')', 'filetype', $allowed_file_types);
$form->addRule('new_stylesheet', get_lang('ThisFieldIsRequired'), 'required');
$form->addElement('style_submit_button', 'stylesheet_upload', get_lang('Upload'), array('class'=>'save'));
$form->addButtonUpload(get_lang('Upload'), 'stylesheet_upload');
$show_upload_form = false;
@ -346,10 +346,20 @@ function handle_stylesheets()
}
if ($is_style_changeable) {
//$group[] = $form_change->addButtonSave(get_lang('SaveSettings'),'submit');
$group[] = $form_change->createElement('button', 'save', get_lang('SaveSettings'));
$group[] = $form_change->createElement('button', 'preview', get_lang('Preview'));
$group[] = $form_change->createElement('button', 'download', get_lang('Download'));
/*$group = [
$form_change->createElement('button', 'save', get_lang('SaveSettings')),
$form_change->createElement('button', 'preview', get_lang('Preview')),
$form_change->createElement('button', 'download', get_lang('Download'))
];*/
//var_dump($group);
$group = [
$form_change->addButtonSave(get_lang('SaveSettings'), 'save', true),
$form_change->addButtonPreview(get_lang('Preview'), 'preview', true),
$form_change->addButtonDownload(get_lang('Download'), 'download', true)
];
$form_change->addGroup($group);
if ($show_upload_form) {
@ -634,12 +644,11 @@ function handle_search()
$form->addElement('select', 'search_prefilter_prefix', array(get_lang('SearchPrefilterPrefix'), $url), $sf_values, '');
$default_values['search_prefilter_prefix'] = api_get_setting('search_prefilter_prefix');
}
}
$default_values['search_enabled'] = $search_enabled;
$form->addElement('style_submit_button', 'submit', get_lang('Save'));
$form->addButtonSave(get_lang('Save'));
$form->setDefaults($default_values);
echo '<div id="search-options-form">';
@ -1341,7 +1350,8 @@ function generate_settings_form($settings, $settings_by_access_list) {
if (!empty($settings)) {
$form->setDefaults($default_values);
}
$form->addElement('button', 'submit_fixed_in_bottom', get_lang('SaveSettings'), 'floppy-o','btn btn-success');
$form->addButtonSave(get_lang('SaveSettings'));
//$form->addElement('button', 'submit_fixed_in_bottom', get_lang('SaveSettings'), 'class="save"');
return $form;
}

@ -73,13 +73,11 @@ if (isset($_GET['action']) && $_GET['action'] == 'delete_grading') {
api_delete_setting_option($id);
}
$form_search = new FormValidator('search_settings', 'get', api_get_self() , null, array('class'=>'well form-inline'));
$form_search = new FormValidator('search_settings', 'get', api_get_self() , null, array(), FormValidator::LAYOUT_INLINE);
$form_search->addElement('text', 'search_field');
$form_search->addElement('hidden', 'category', 'search_setting');
// Button rules: arg1 = type, arg2 = name, arg3 = text, arg4 = icon (fa-[...]), arg5 = class, arg6 = array('style' => 'display: block;', 'size' => 32, ...)
//$form_search->addElement('button', 'submit_button', get_lang('Search'), 'search', 'btn btn-primary');
$form_search->addButtonSearch(get_lang('Search'),'');
$form_search->setDefaults(array('search_field' => (isset($_REQUEST['search_field'])?$_REQUEST['search_field']:null)));
$form_search->addButtonSearch(get_lang('Search'), 'submit_button');
$form_search->setDefaults(array('search_field' => isset($_REQUEST['search_field'])?$_REQUEST['search_field']:null));
$form_search_html = $form_search->return_form();

@ -798,10 +798,8 @@ if (!empty($action)) {
}
// Create a search-box
$form = new FormValidator('search_simple', 'get', '', '', array());
$renderer = & $form->defaultRenderer();
$renderer->setElementTemplate('<span>{element}</span> ');
$form->addElement('text','keyword', get_lang('keyword'));
$form = new FormValidator('search_simple', 'get', '', '', array(), FormValidator::LAYOUT_INLINE);
$form->addElement('text', 'keyword', get_lang('keyword'));
$form->addButtonSearch(get_lang('Search'));
$form->addElement(
'static',

@ -55,6 +55,8 @@ $tbl_item_property = Database::get_course_table(TABLE_ITEM_PROPERTY);
$course_id = api_get_course_int_id();
$_course = api_get_course_info();
api_protect_course_group(GroupManager::GROUP_TOOL_ANNOUNCEMENT);
/* Tracking */
Event::event_access_tool(TOOL_ANNOUNCEMENT);

@ -109,11 +109,11 @@ if (api_is_allowed_to_edit(null, true) ||
echo '<div class="actions">';
echo '<a style="float:left;" href="index.php?'.api_get_cidreq().'&action=calendar_list&attendance_id='.$attendance_id.$param_gradebook.'">'.
Display::return_icon('attendance_calendar.png',get_lang('AttendanceCalendar'),'',ICON_SIZE_MEDIUM).'</a>';
//if (count($users_in_course) > 0) {
$form->display();
//}
echo '<a id="pdf_export" style="float:left;" href="index.php?'.api_get_cidreq().'&action=attendance_sheet_export_to_pdf&attendance_id='.$attendance_id.$param_gradebook.'&filter='.$default_filter.'&group_id='.$groupId.'">'.
Display::return_icon('pdf.png',get_lang('ExportToPDF'),'',ICON_SIZE_MEDIUM).'</a>';
//if (count($users_in_course) > 0) {
$form->display();
//}
echo '</div>';
}
@ -398,7 +398,7 @@ if (api_is_allowed_to_edit(null, true) ||
<?php if (!$is_locked_attendance || api_is_platform_admin()) {
if (api_is_allowed_to_edit(null, true)) {
?>
<button type="submit" class="save"><?php echo get_lang('Save') ?></button>
<button type="submit" class="btn btn-primary"><?php echo get_lang('Save') ?></button>
<?php }
}
?>
@ -417,8 +417,9 @@ if (api_is_allowed_to_edit(null, true) ||
<table width="250px;">
<tr>
<td><?php echo get_lang('ToAttend').': ' ?></td>
<td><center><div class="attendance-faults-bar" style="background-color:<?php echo (!empty($faults['color_bar'])?$faults['color_bar']:'none') ?>">
<?php echo $faults['faults'].'/'.$faults['total'].' ('.$faults['faults_porcent'].'%)' ?></div></center>
<td>
<center><div class="attendance-faults-bar" style="background-color:<?php echo (!empty($faults['color_bar'])?$faults['color_bar']:'none') ?>">
<?php echo $faults['faults'].'/'.$faults['total'].' ('.$faults['faults_porcent'].'%)' ?></div></center>
</td>
</tr>
</table>
@ -442,14 +443,14 @@ if (api_is_allowed_to_edit(null, true) ||
?>
<tr class="<?php echo $class ?>">
<td>
<?php echo $presence['presence']?Display::return_icon('checkbox_on.gif',get_lang('Presence')):Display::return_icon('checkbox_off.gif',get_lang('Presence')) ?>
<?php echo $presence['presence'] ? Display::return_icon('checkbox_on.gif',get_lang('Presence')) : Display::return_icon('checkbox_off.gif',get_lang('Presence')) ?>
<?php echo "&nbsp; ".$presence['date_time'] ?>
</td>
</tr>
<?php }
} else { ?>
<tr><td>
<center><?php echo get_lang('YouDoNotHaveDoneAttendances')?></center></td>
<center><?php echo get_lang('YouDoNotHaveDoneAttendances')?></center></td>
</tr>
<?php }
?>

@ -48,6 +48,8 @@ if (isset($_REQUEST['cidReq']) && !empty($_REQUEST['cidReq'])) {
}
}
api_protect_course_group(GroupManager::GROUP_TOOL_CALENDAR);
$agenda = new Agenda();
$agenda->type = $type;

@ -23,8 +23,9 @@ if ($origin != 'whoisonline') {
$_SESSION['target']= $target;
}
/* TRACKING */
api_protect_course_group(GroupManager::GROUP_TOOL_CHAT, false);
/* TRACKING */
Event::event_access_tool(TOOL_CHAT);
header('Content-Type: text/html; charset='.api_get_system_encoding());

@ -6,6 +6,7 @@ api_protect_course_script(true);
Display :: display_reduced_header();
$tool = isset($tool) ? $tool : null;
// Tracking
Event::event_access_tool($tool);

@ -180,7 +180,7 @@ if ($action == 'thematic_list') {
$edit_link = '';
if (api_is_allowed_to_edit(null, true)) {
$edit_link = '<a class="thickbox" href="index.php?'.api_get_cidreq().'&action=thematic_advance_edit&thematic_id='.$thematic['id'].'&thematic_advance_id='.$thematic_advance['id'].'&display=no_header" >'.Display::return_icon('edit.png',get_lang('EditThematicAdvance'),array(),ICON_SIZE_SMALL).'</a>';
$edit_link = '<a class="ajax" href="index.php?'.api_get_cidreq().'&action=thematic_advance_edit&thematic_id='.$thematic['id'].'&thematic_advance_id='.$thematic_advance['id'].'&display=no_header" >'.Display::return_icon('edit.png',get_lang('EditThematicAdvance'),array(),ICON_SIZE_SMALL).'</a>';
$edit_link .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_advance_delete&thematic_id='.$thematic['id'].'&thematic_advance_id='.$thematic_advance['id'].'">'.
Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a></center>';
@ -253,8 +253,8 @@ if ($action == 'thematic_list') {
}
$form->addText('title', get_lang('Title'), true, array('size'=>'50'));
$form->addHtmlEditor('content', get_lang('Content'), false, false, array('ToolbarSet' => 'TrainingDescription', 'Width' => '80%', 'Height' => '150'));
$form->addElement('style_submit_button', null, get_lang('Save'), 'class="save"');
$form->addHtmlEditor('content', get_lang('Content'), false, false, array('ToolbarSet' => 'TrainingDescription', 'Height' => '150'));
$form->addButtonSave(get_lang('Save'));
$show_form = true;

@ -18,15 +18,15 @@ if ($action == 'thematic_advance_add' || $action == 'thematic_advance_edit') {
$header_form = get_lang('EditThematicAdvance');
}
if (!$start_date_error && !$duration_error) {
/*if (!$start_date_error && !$duration_error) {
$token = md5(uniqid(rand(),TRUE));
$_SESSION['thematic_advance_token'] = $token;
}
}*/
// display form
$form = new FormValidator('thematic_advance','POST','index.php?action=thematic_advance_list&thematic_id='.$thematic_id.'&'.api_get_cidreq(),'','style="width: 100%;"');
$form = new FormValidator('thematic_advance','POST','index.php?action=thematic_advance_list&thematic_id='.$thematic_id.'&'.api_get_cidreq());
$form->addElement('header', $header_form);
$form->addElement('hidden', 'thematic_advance_token',$token);
//$form->addElement('hidden', 'thematic_advance_token',$token);
$form->addElement('hidden', 'action', $action);
if (!empty($thematic_advance_id)) {
@ -41,7 +41,8 @@ if ($action == 'thematic_advance_add' || $action == 'thematic_advance_edit') {
$radios[] = $form->createElement('radio', 'start_date_type', null, get_lang('StartDateCustom'),'2',array('onclick' => 'check_per_custom_date(this)', 'id'=>'custom_date'));
$form->addGroup($radios, null, get_lang('StartDateOptions'));
if (isset($thematic_advance_data['attendance_id']) && $thematic_advance_data['attendance_id'] == 0) {
if (isset($thematic_advance_data['attendance_id']) &&
$thematic_advance_data['attendance_id'] == 0) {
$form->addElement('html', '<div id="div_custom_datetime" style="display:block">');
} else {
$form->addElement('html', '<div id="div_custom_datetime" style="display:none">');
@ -50,7 +51,9 @@ if ($action == 'thematic_advance_add' || $action == 'thematic_advance_edit') {
$form->addElement('DatePicker', 'custom_start_date', get_lang('StartDate'));
$form->addElement('html', '</div>');
if (isset($thematic_advance_data['attendance_id']) && $thematic_advance_data['attendance_id'] == 0) {
if (isset($thematic_advance_data['attendance_id']) &&
$thematic_advance_data['attendance_id'] == 0
) {
$form->addElement('html', '<div id="div_datetime_by_attendance" style="display:none">');
} else {
$form->addElement('html', '<div id="div_datetime_by_attendance" style="display:block">');
@ -71,14 +74,12 @@ if ($action == 'thematic_advance_add' || $action == 'thematic_advance_edit') {
$form->addElement('html', '</div>');
$form->addText('duration_in_hours', get_lang('DurationInHours'), false, array('size'=>'3','id'=>'duration_in_hours_element', 'autofocus' => 'autofocus'));
$form->addHtmlEditor('content', get_lang('Content'), false, false, array('ToolbarStartExpanded'=>'false', 'ToolbarSet' => 'TrainingDescription', 'Width' => '80%', 'Height' => '150'));
//$form->addElement('textarea', 'content', get_lang('Content'));
$form->addHtmlEditor('content', get_lang('Content'), false, false, array('ToolbarStartExpanded'=>'false', 'ToolbarSet' => 'TrainingDescription', 'Height' => '150'));
if ($action == 'thematic_advance_add') {
$form->addElement('style_submit_button', null, get_lang('Save'), 'id="add_button" class="save"');
$form->addButtonSave(get_lang('Save'));
} else {
$form->addElement('style_submit_button', null, get_lang('Save'), 'id="update_button" class="save"');
$form->addButtonUpdate(get_lang('Save'));
}
//$form->addElement('html', '<a href="#" id="save_button" onclick="save();">Save</a>');
$attendance_select_item_id = null;
@ -103,17 +104,23 @@ if ($action == 'thematic_advance_add' || $action == 'thematic_advance_edit') {
}
$default['start_date_type'] = 1;
$default['custom_start_date'] = date('d-F-Y H:i', api_strtotime(api_get_local_time()));
$default['custom_start_date'] = date('Y-m-d', api_strtotime(api_get_local_time()));
$default['duration_in_hours'] = 1;
if (!empty($thematic_advance_data)) {
// set default values
$default['content'] = $thematic_advance_data['content'];
$default['duration_in_hours'] = $thematic_advance_data['duration'];
$default['content'] = isset($thematic_advance_data['content']) ? $thematic_advance_data['content'] : null;
$default['duration_in_hours'] = isset($thematic_advance_data['duration']) ? $thematic_advance_data['duration'] : null;
if (empty($thematic_advance_data['attendance_id'])) {
$default['start_date_type'] = 2;
$default['custom_start_date'] = date('d-F-Y H:i', api_strtotime(api_get_local_time($thematic_advance_data['start_date'])));
$default['custom_start_date'] = null;
if (isset($thematic_advance_data['start_date'])) {
$default['custom_start_date'] = date(
'Y-m-d',
api_strtotime(api_get_local_time($thematic_advance_data['start_date']))
);
}
} else {
$default['start_date_type'] = 1;
if (!empty($thematic_advance_data['start_date'])) {
@ -127,12 +134,12 @@ if ($action == 'thematic_advance_add' || $action == 'thematic_advance_edit') {
// error messages
$msg_error = '';
if ($start_date_error) {
/*if ($start_date_error) {
$msg_error .= get_lang('YouMustSelectAtleastAStartDate').'<br />';
}
if ($duration_error) {
$msg_error .= get_lang('DurationInHoursMustBeNumeric');
}
}*/
if (!empty($msg_error)) {
Display::display_error_message($msg_error,false);
@ -148,9 +155,9 @@ if ($action == 'thematic_advance_add' || $action == 'thematic_advance_edit') {
}
echo '</div>';
$table = new SortableTable('thematic_advance_list', array('Thematic', 'get_number_of_thematic_advances'), array('Thematic', 'get_thematic_advance_data'));
$table->set_additional_parameters($parameters);
//$table->set_additional_parameters($parameters);
$table->set_header(0, '', false, array('style'=>'width:20px;'));
$table->set_header(1, get_lang('StartDate'), false );
$table->set_header(1, get_lang('StartDate'), false);
$table->set_header(2, get_lang('DurationInHours'), false, array('style'=>'width:80px;'));
$table->set_header(3, get_lang('Content'), false);

@ -387,16 +387,15 @@ class ThematicController
}
$thematic_id = intval($_REQUEST['thematic_id']);
$thematic_advance_id = intval($_REQUEST['thematic_advance_id']);
$thematic_advance_id = isset($_REQUEST['thematic_advance_id']) ? intval($_REQUEST['thematic_advance_id']) : null;
$thematic_advance_data = array();
switch ($action) {
case 'thematic_advance_delete':
if (!empty($thematic_advance_id)) {
if (api_is_allowed_to_edit(null, true)) {
$affected_rows = $thematic->thematic_advance_destroy($thematic_advance_id);
$thematic->thematic_advance_destroy($thematic_advance_id);
}
$action = 'thematic_list';
header('Location: index.php');
exit;
}
@ -407,7 +406,7 @@ class ThematicController
exit;
}
if (($_REQUEST['start_date_type'] == 1 && empty($_REQUEST['start_date_by_attendance'])) ||
if ((isset($_REQUEST['start_date_type']) && $_REQUEST['start_date_type'] == 1 && empty($_REQUEST['start_date_by_attendance'])) ||
(!empty($_REQUEST['duration_in_hours']) && !is_numeric($_REQUEST['duration_in_hours']))
) {
if ($_REQUEST['start_date_type'] == 1 && empty($_REQUEST['start_date_by_attendance'])) {
@ -429,19 +428,17 @@ class ThematicController
$data['thematic_advance_data'] = $thematic_advance_data;
}
} else {
if ($_REQUEST['thematic_advance_token'] == $_SESSION['thematic_advance_token'] &&
api_is_allowed_to_edit(null, true)
) {
$thematic_advance_id = $_REQUEST['thematic_advance_id'];
if (api_is_allowed_to_edit(null, true)) {
$thematic_advance_id = isset($_REQUEST['thematic_advance_id']) ? $_REQUEST['thematic_advance_id'] : null;
$thematic_id = $_REQUEST['thematic_id'];
$content = $_REQUEST['content'];
$duration = $_REQUEST['duration_in_hours'];
$content = isset($_REQUEST['content']) ? $_REQUEST['content'] : null;
$duration = isset($_REQUEST['duration_in_hours']) ? $_REQUEST['duration_in_hours'] : null;
if (isset($_REQUEST['start_date_type']) && $_REQUEST['start_date_type'] == 2) {
$start_date = $thematic->build_datetime_from_array($_REQUEST['custom_start_date']);
$start_date = $_REQUEST['custom_start_date'];
$attendance_id = 0;
} else {
$start_date = $_REQUEST['start_date_by_attendance'];
$attendance_id = $_REQUEST['attendance_select'];
$start_date = isset($_REQUEST['start_date_by_attendance']) ? $_REQUEST['start_date_by_attendance'] : null;
$attendance_id = isset($_REQUEST['attendance_select']) ? $_REQUEST['attendance_select'] : null;
}
$thematic->set_thematic_advance_attributes(
$thematic_advance_id,

@ -156,7 +156,7 @@ $obj->fill_grade_model_select_in_form($form);
$form->addElement('html','</div>');
// Submit button.
$form->addElement('button', 'submit', $course_validation_feature ? get_lang('CreateThisCourseRequest') : get_lang('CreateCourseArea'), 'plus-square', 'btn btn-primary');
$form->addButtonCreate($course_validation_feature ? get_lang('CreateThisCourseRequest') : get_lang('CreateCourseArea'));
// The progress bar of this form.
$form->add_progress_bar();

@ -76,7 +76,8 @@ ul#navigation .report a {
.button-load{
background: url("../img/icons/64/file_upload.png") no-repeat center 20px;
padding-top: 70px;
}
}
/* START COURSE PROGRESS */
.thematic-postit{
padding-top: 5px;
@ -404,35 +405,18 @@ form .formw input {
width: 110px;
}
html, body {
html {
margin: 0;
padding: 0;
}
html {
position: relative;
min-height: 100%;
}
body {
margin-bottom: 80px;
/* hack ignored by non-IE to enable ie to support :hover on button */
behavior:url("/main/css/csshover3.htc");
margin: 0;
padding: 0;
background-color: #fff;
height: 100%; /* stick */
}
/* Sticky footer*/
#wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -9em; /* Do not change this value */
}
#topbar {
z-index:9000; /* bug when using full area fckeditor */
}
footer {
@ -3884,10 +3868,6 @@ a:active{
}
/*#homepage, #hot_courses, #announcements {*/
#top_main_content section{
/* margin-left: 5px; */
}
.welcome_course li {
float:left;
list-style-type: none;
@ -5472,4 +5452,4 @@ i.size-32.icon-new-work{
.menu-column .nav li a img{
vertical-align: bottom;
margin-right: 5px;
}
}

@ -40,6 +40,7 @@ $message = null;
$lib_path = api_get_path(LIBRARY_PATH);
api_protect_course_script(true);
api_protect_course_group(GroupManager::GROUP_TOOL_DOCUMENTS);
DocumentManager::removeGeneratedAudioTempFile();

@ -79,7 +79,7 @@ if (!empty($groupId)) {
(($current_forum_category && $current_forum_category['visibility'] == 0) OR
$current_forum['visibility'] == 0 OR !$user_has_access_in_group)
) {
api_not_allowed();
api_not_allowed(true);
}
} else {
//Course

@ -105,7 +105,7 @@ if (api_is_allowed_to_edit(null, true)) {
$form->addElement('header', '', get_lang('TermAddNew'));
$form->addElement('text', 'glossary_title', get_lang('TermName'), array('size'=>'80', 'id'=>'glossary_title'));
//$form->applyFilter('glossary_title', 'html_filter');
$form->addElement('html_editor', 'glossary_comment', get_lang('TermDefinition'), null, array('ToolbarSet' => 'Glossary', 'Width' => '90%', 'Height' => '300'));
$form->addElement('html_editor', 'glossary_comment', get_lang('TermDefinition'), null, array('ToolbarSet' => 'Glossary', 'Height' => '300'));
$form->addElement('style_submit_button', 'SubmitGlossary', get_lang('TermAddButton'), 'class="save"');
// setting the rules
$form->addRule('glossary_title',get_lang('ThisFieldIsRequired'), 'required');

@ -109,7 +109,7 @@ class EvalForm extends FormValidator
$select->addoption($user[1] . ' ' . $user[2] . ' (' . $user[3] . ')', $user[0]);
}
}
$this->addElement('submit', 'submit_button', get_lang('AddUserToEval'));
$this->addButtonCreate(get_lang('AddUserToEval'), 'submit_button');
}
/**

@ -74,12 +74,16 @@ $my_get_id = isset($_GET['id']) ? Security::remove_XSS($_GET['id']) : null;
if (isset($_GET['action']) && $is_allowed_in_course) {
switch ($_GET['action']) {
case 'set_visible':
GroupManager::setVisible($my_get_id);
Display :: display_confirmation_message(get_lang('ItemUpdated'));
if (api_is_allowed_to_edit()) {
GroupManager::setVisible($my_get_id);
Display:: display_confirmation_message(get_lang('ItemUpdated'));
}
break;
case 'set_invisible':
GroupManager::setInvisible($my_get_id);
Display :: display_confirmation_message(get_lang('ItemUpdated'));
if (api_is_allowed_to_edit()) {
GroupManager::setInvisible($my_get_id);
Display:: display_confirmation_message(get_lang('ItemUpdated'));
}
break;
case 'self_reg':
if (GroupManager::is_self_registration_allowed($userId, $my_group_id)) {

@ -26,7 +26,7 @@ require_once api_get_path(SYS_CODE_PATH).'forum/forumconfig.inc.php';
$group_id = api_get_group_id();
$user_id = api_get_user_id();
$current_group = GroupManager :: get_group_properties($group_id);
$current_group = GroupManager::get_group_properties($group_id);
if (empty($current_group)) {
api_not_allowed(true);
@ -40,7 +40,7 @@ $interbreadcrumb[] = array('url' => 'group.php', 'name' => get_lang('Groups'));
$forums_of_groups = get_forums_of_group($current_group['id']);
$forum_state_public = 0;
/*$forum_state_public = 0;
if (is_array($forums_of_groups)) {
foreach ($forums_of_groups as $key => $value) {
if ($value['forum_group_public_private'] == 'public') {
@ -57,18 +57,21 @@ if ($current_group['doc_state'] != 1 &&
$current_group['chat_state'] != 1 &&
$forum_state_public != 1
) {
if (!api_is_allowed_to_edit(null, true) &&
!GroupManager::is_user_in_group($user_id, $group_id)) {
api_not_allowed($print_headers);
}
}*/
if (!api_is_allowed_to_edit(null, true) &&
(!GroupManager::is_user_in_group($user_id, $group_id) ||
$current_group['status'] == 0
)
) {
api_not_allowed(true);
}
/* Header */
Display::display_header($nameTools.' '.Security::remove_XSS($current_group['name']), 'Group');
/* Introduction section (editable by course admin) */
Display::display_introduction_section(TOOL_GROUP);
/* Actions and Action links */
@ -226,8 +229,11 @@ if (api_is_allowed_to_edit(false, true) OR
// Link to the chat area of this group
if (api_get_course_setting('allow_open_chat_window')) {
$actions_array[] = array(
'url' => "javascript: void(0);\" onclick=\"window.open('../chat/chat.php?".api_get_cidreq()."&amp;toolgroup=".$current_group['id']."','window_chat_group_".$_SESSION['_cid']."_".$_SESSION['_gid']."','height=380, width=625, left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no') \"",
'content' => Display::return_icon('chat.png', get_lang('Chat'), array(), 32)
'url' => "javascript: void(0);",
'content' => Display::return_icon('chat.png', get_lang('Chat'), array(), 32),
'url_attributes' => array(
'onclick' => " window.open('../chat/chat.php?".api_get_cidreq()."&toolgroup=".$current_group['id']."','window_chat_group_".api_get_course_id()."_".api_get_group_id()."','height=380, width=625, left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no')"
)
);
} else {
$actions_array[] = array(

@ -30,56 +30,56 @@ switch ($action) {
if (!api_is_allowed_to_edit(null, true)) {
echo '';
exit;
}
/*
if (($_REQUEST['start_date_type'] == 1 && empty($_REQUEST['start_date_by_attendance'])) || (!empty($_REQUEST['duration_in_hours']) && !is_numeric($_REQUEST['duration_in_hours'])) ) {
if ($_REQUEST['start_date_type'] == 1 && empty($_REQUEST['start_date_by_attendance'])) {
$start_date_error = true;
$data['start_date_error'] = $start_date_error;
}
}
/*
if (($_REQUEST['start_date_type'] == 1 && empty($_REQUEST['start_date_by_attendance'])) || (!empty($_REQUEST['duration_in_hours']) && !is_numeric($_REQUEST['duration_in_hours'])) ) {
if ($_REQUEST['start_date_type'] == 1 && empty($_REQUEST['start_date_by_attendance'])) {
$start_date_error = true;
$data['start_date_error'] = $start_date_error;
}
if (!empty($_REQUEST['duration_in_hours']) && !is_numeric($_REQUEST['duration_in_hours'])) {
$duration_error = true;
$data['duration_error'] = $duration_error;
}
if (!empty($_REQUEST['duration_in_hours']) && !is_numeric($_REQUEST['duration_in_hours'])) {
$duration_error = true;
$data['duration_error'] = $duration_error;
}
$data['action'] = $_REQUEST['action'];
$data['thematic_id'] = $_REQUEST['thematic_id'];
$data['attendance_select'] = $attendance_select;
if (isset($_REQUEST['thematic_advance_id'])) {
$data['thematic_advance_id'] = $_REQUEST['thematic_advance_id'];
$thematic_advance_data = $thematic->get_thematic_advance_list($_REQUEST['thematic_advance_id']);
$data['thematic_advance_data'] = $thematic_advance_data;
}
} else {
if ($_REQUEST['thematic_advance_token'] == $_SESSION['thematic_advance_token'] && api_is_allowed_to_edit(null, true)) {
$thematic_advance_id = $_REQUEST['thematic_advance_id'];
$thematic_id = $_REQUEST['thematic_id'];
$content = $_REQUEST['real_content'];
$duration = $_REQUEST['duration_in_hours'];
if (isset($_REQUEST['start_date_type']) && $_REQUEST['start_date_type'] == 2) {
$start_date = $thematic->build_datetime_from_array($_REQUEST['custom_start_date']);
$attendance_id = 0;
} else {
$start_date = $_REQUEST['start_date_by_attendance'];
$attendance_id = $_REQUEST['attendance_select'];
}
$thematic->set_thematic_advance_attributes($thematic_advance_id, $thematic_id, $attendance_id, $content, $start_date, $duration);
$affected_rows = $thematic->thematic_advance_save();
if ($affected_rows) {
// get last done thematic advance before move thematic list
$last_done_thematic_advance = $thematic->get_last_done_thematic_advance();
// update done advances with de current thematic list
if (!empty($last_done_thematic_advance)) {
$update_done_advances = $thematic->update_done_thematic_advances($last_done_thematic_advance);
}
}
}
}
$thematic_advance_data = $thematic->get_thematic_advance_list(null, null, true);
$return = $thematic->get_thematic_advance_div($thematic_advance_data);
echo $return[$_REQUEST['thematic_id']][$_REQUEST['thematic_advance_id']];*/
break;
$data['action'] = $_REQUEST['action'];
$data['thematic_id'] = $_REQUEST['thematic_id'];
$data['attendance_select'] = $attendance_select;
if (isset($_REQUEST['thematic_advance_id'])) {
$data['thematic_advance_id'] = $_REQUEST['thematic_advance_id'];
$thematic_advance_data = $thematic->get_thematic_advance_list($_REQUEST['thematic_advance_id']);
$data['thematic_advance_data'] = $thematic_advance_data;
}
} else {
if ($_REQUEST['thematic_advance_token'] == $_SESSION['thematic_advance_token'] && api_is_allowed_to_edit(null, true)) {
$thematic_advance_id = $_REQUEST['thematic_advance_id'];
$thematic_id = $_REQUEST['thematic_id'];
$content = $_REQUEST['real_content'];
$duration = $_REQUEST['duration_in_hours'];
if (isset($_REQUEST['start_date_type']) && $_REQUEST['start_date_type'] == 2) {
$start_date = $thematic->build_datetime_from_array($_REQUEST['custom_start_date']);
$attendance_id = 0;
} else {
$start_date = $_REQUEST['start_date_by_attendance'];
$attendance_id = $_REQUEST['attendance_select'];
}
$thematic->set_thematic_advance_attributes($thematic_advance_id, $thematic_id, $attendance_id, $content, $start_date, $duration);
$affected_rows = $thematic->thematic_advance_save();
if ($affected_rows) {
// get last done thematic advance before move thematic list
$last_done_thematic_advance = $thematic->get_last_done_thematic_advance();
// update done advances with de current thematic list
if (!empty($last_done_thematic_advance)) {
$update_done_advances = $thematic->update_done_thematic_advances($last_done_thematic_advance);
}
}
}
}
$thematic_advance_data = $thematic->get_thematic_advance_list(null, null, true);
$return = $thematic->get_thematic_advance_div($thematic_advance_data);
echo $return[$_REQUEST['thematic_id']][$_REQUEST['thematic_advance_id']];*/
break;
case 'get_datetime_by_attendance':
$attendance_id = intval($_REQUEST['attendance_id']);
$thematic_advance_id = intval($_REQUEST['thematic_advance_id']);
@ -89,13 +89,13 @@ switch ($action) {
if (!empty($attendance_id)) {
$attendance = new Attendance();
$thematic = new Thematic();
$thematic_list = $thematic->get_thematic_list();
$thematic_list = $thematic->get_thematic_list();
$my_list = $thematic_list_temp = array();
foreach ($thematic_list as $item) {
$my_list = $thematic->get_thematic_advance_by_thematic_id($item['id']);
$thematic_list_temp = array_merge($my_list, $thematic_list_temp);
}
$my_list = $thematic_list_temp = array();
foreach ($thematic_list as $item) {
$my_list = $thematic->get_thematic_advance_by_thematic_id($item['id']);
$thematic_list_temp = array_merge($my_list, $thematic_list_temp);
}
$new_thematic_list = array();
foreach($thematic_list_temp as $item) {
@ -108,19 +108,19 @@ switch ($action) {
$label = get_lang('StartDate');
if (!empty($attendance_calendar)) {
$input_select .= '<select id="start_date_select_calendar" name="start_date_by_attendance" UNIQUE size="5">';
$input_select .= '<select id="start_date_select_calendar" name="start_date_by_attendance" size="5">';
foreach ($attendance_calendar as $calendar) {
$selected = null;
$selected = null;
$insert = true;
//checking if was already taken
foreach ($new_thematic_list as $key => $thematic_item) {
//if ($calendar['db_date_time'] == $thematic_item['start_date'] && $calendar['attendance_id'] == $thematic_item['attendance_id'] ) {
if ($calendar['db_date_time'] == $thematic_item['start_date'] ) {
if ($calendar['db_date_time'] == $thematic_item['start_date'] ) {
$insert = false;
if ($thematic_advance_id == $key) {
$insert = true;
$selected = 'selected';
}
if ($thematic_advance_id == $key) {
$insert = true;
$selected = 'selected';
}
break;
}
}
@ -134,12 +134,12 @@ switch ($action) {
}
}
?>
<div class="control-group">
<label class="control-label"><?php echo $label ?></label>
<div class="controls"><?php echo $input_select ?></div>
<div class="form-group">
<label class="col-sm-2 control-label"><?php echo $label ?></label>
<div class="col-sm-10"><?php echo $input_select ?></div>
</div>
<?php
break;
break;
case 'update_done_thematic_advance':
$thematic_advance_id = intval($_GET['thematic_advance_id']);
$total_average = 0;

@ -1230,7 +1230,6 @@ function api_block_anonymous_users($print_headers = true) {
function api_get_navigator() {
$navigator = 'Unknown';
$version = 0;
if (strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') !== false) {
$navigator = 'Opera';
list (, $version) = explode('Opera', $_SERVER['HTTP_USER_AGENT']);
@ -1240,7 +1239,6 @@ function api_get_navigator() {
} elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') !== false) {
$navigator = 'Chrome';
list (, $version) = explode('Chrome', $_SERVER['HTTP_USER_AGENT']);
} elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Gecko') !== false) {
$navigator = 'Mozilla';
list (, $version) = explode('; rv:', $_SERVER['HTTP_USER_AGENT']);
@ -7986,3 +7984,26 @@ function api_mail_html(
$mail->ClearAddresses();
return 1;
}
/**
* @param string $tool Possible values:
* GroupManager::GROUP_TOOL_*
*
*/
function api_protect_course_group($tool, $showHeader = true)
{
$userId = api_get_user_id();
$groupId = api_get_group_id();
if (!empty($groupId)) {
$allow = GroupManager::user_has_access(
$userId,
$groupId,
$tool
);
if (!$allow) {
api_not_allowed($showHeader);
}
}
}

@ -832,41 +832,46 @@ class Display
/**
* Creates a URL anchor
* @param string $name
* @param string $url
* @param array $attributes
*
* @return string
*/
public static function url($name, $url, $extra_attributes = array())
public static function url($name, $url, $attributes = array())
{
if (!empty($url)) {
$url = htmlspecialchars($url, ENT_QUOTES, 'UTF-8');
$extra_attributes['href'] = $url;
$attributes['href'] = $url;
}
return self::tag('a', $name, $extra_attributes);
return self::tag('a', $name, $attributes);
}
/**
* Creates a div tag
*
* @param $content
* @param string $content
* @param array $extra_attributes
* @return string
*/
public static function div($content, $extra_attributes = array())
public static function div($content, $attributes = array())
{
return self::tag('div', $content, $extra_attributes);
return self::tag('div', $content, $attributes);
}
/**
* Creates a span tag
*/
public static function span($content, $extra_attributes = array())
public static function span($content, $attributes = array())
{
return self::tag('span', $content, $extra_attributes);
return self::tag('span', $content, $attributes);
}
/**
* Displays an HTML input tag
*
*/
public static function input($type, $name, $value, $extra_attributes = array())
public static function input($type, $name, $value, $attributes = array())
{
if (isset($type)) {
$extra_attributes['type']= $type;
@ -877,7 +882,7 @@ class Display
if (isset($value)) {
$extra_attributes['value']= $value;
}
return self::tag('input', '', $extra_attributes);
return self::tag('input', '', $attributes);
}
/**
@ -1828,7 +1833,8 @@ class Display
$class = 'class ="active"';
}
$html .= "<li $class >";
$html .= self::url($value['content'], $value['url']);
$attributes = isset($value['url_attributes']) ? $value['url_attributes'] : array();
$html .= self::url($value['content'], $value['url'], $attributes);
$html .= '</li>';
}
$html .= '</ul></div>';

@ -146,6 +146,9 @@ class Event
*/
public static function event_access_tool($tool, $id_session = 0)
{
if (empty($tool)) {
return false;
}
$TABLETRACK_ACCESS = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ACCESS);
$TABLETRACK_LASTACCESS = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LASTACCESS); //for "what's new" notification

@ -110,8 +110,9 @@ class FormValidator extends HTML_QuickForm
//Set required field template
HTML_QuickForm::setRequiredNote('<span class="form_required">*</span> <small>' . get_lang('ThisFieldIsRequired') . '</small>');
$noteTemplate = <<<EOT
<div class="control-group">
<div class="controls">{requiredNote}</div>
<div class="form-group">
<div class="col-sm-2"></div>
<div class="col-sm-10">{requiredNote}</div>
</div>
EOT;
$renderer->setRequiredNoteTemplate($noteTemplate);
@ -138,11 +139,11 @@ EOT;
{
return '
<div class="form-group {error_class}">
<label {label-for} class="col-md-2 control-label" >
<label {label-for} class="col-sm-2 control-label" >
<!-- BEGIN required --><span class="form_required">*</span><!-- END required -->
{label}
</label>
<div class="col-md-10">
<div class="col-sm-10">
{element}
<!-- BEGIN label_3 -->
@ -239,8 +240,22 @@ EOT;
$style = 'default',
$size = 'default',
$class = null,
$attributes = array()
$attributes = array(),
$createElement = false
) {
if ($createElement) {
return $this->createElement(
'button',
$name,
$label,
$icon,
$style,
$size,
$class,
$attributes
);
}
return $this->addElement(
'button',
$name,
@ -256,44 +271,89 @@ EOT;
/**
* @param string $label
*/
public function addButtonSave($label, $name = 'submit')
public function addButtonSave($label, $name = 'submit', $createElement = false)
{
return $this->addButton($name, $label, 'floppy-o', 'btn btn-success');
return $this->addButton(
$name,
$label,
'check',
'primary',
null,
null,
array(),
$createElement
);
}
/**
* @param string $label
*/
public function addButtonCreate($label, $name = 'submit')
public function addButtonCreate($label, $name = 'submit', $createElement = false)
{
return $this->addButton($name, $label, 'plus-square', 'btn btn-success');
return $this->addButton(
$name,
$label,
'plus',
'primary',
null,
null,
array(),
$createElement
);
}
/**
* Shortcut to create/add button
* @param string $label
*/
public function addButtonUpdate($label, $name = 'submit')
public function addButtonUpdate($label, $name = 'submit', $createElement = false)
{
return $this->addButton($name, $label, 'pencil', 'primary');
return $this->addButton(
$name,
$label,
'pencil',
'primary',
null,
null,
array(),
$createElement
);
}
/**
* Shortcut to delete button
* @param string $label
*/
public function addButtonDelete($label, $name = 'submit')
public function addButtonDelete($label, $name = 'submit', $createElement = false)
{
return $this->addButton($name, $label, 'trash', 'danger');
return $this->addButton(
$name,
$label,
'trash',
'danger',
null,
null,
array(),
$createElement
);
}
/**
* Shortcut to "send" button
* @param string $label
*/
public function addButtonSend($label, $name = 'submit')
public function addButtonSend($label, $name = 'submit', $createElement = false)
{
return $this->addButton($name, $label, 'paper-plane', 'primary');
return $this->addButton(
$name,
$label,
'paper-plane',
'primary',
null,
null,
array(),
$createElement
);
}
/**
@ -305,7 +365,7 @@ EOT;
if (empty($label)) {
$label = get_lang('Search');
}
return $this->addButton('submit', $label, 'search','btn btn-primary');
return $this->addButton('submit', $label, 'search', 'default');
}
/**
@ -321,27 +381,108 @@ EOT;
* Shortcut to import button
* @param string $label
*/
public function addButtonImport($label, $name = 'submit')
public function addButtonImport($label, $name = 'submit', $createElement = false)
{
return $this->addButton($name, $label, 'check', 'primary');
return $this->addButton(
$name,
$label,
'check',
'primary',
null,
null,
array(),
$createElement
);
}
/**
* Shortcut to export button
* @param string $label
*/
public function addButtonExport($label, $name = 'submit')
public function addButtonExport($label, $name = 'submit', $createElement = false)
{
return $this->addButton($name, $label, 'check', 'primary');
return $this->addButton(
$name,
$label,
'check',
'primary',
null,
null,
array(),
$createElement
);
}
/**
* Shortcut to filter button
* @param string $label
*/
public function addButtonFilter($label, $name = 'submit')
public function addButtonFilter($label, $name = 'submit', $createElement = false)
{
return $this->addButton($name, $label, 'filter', 'primary');
return $this->addButton(
$name,
$label,
'filter',
'primary',
null,
null,
array(),
$createElement
);
}
/**
* Shortcut to upload button
* @param string $label
*/
public function addButtonUpload($label, $name = 'submit', $createElement = false)
{
return $this->addButton(
$name,
$label,
'upload',
'primary',
null,
null,
array(),
$createElement
);
}
/**
* Shortcut to upload button
* @param string $label
*/
public function addButtonDownload($label, $name = 'submit', $createElement = false)
{
return $this->addButton(
$name,
$label,
'download',
'primary',
null,
null,
array(),
$createElement
);
}
/**
* Shortcut to preview button
* @param string $label
*/
public function addButtonPreview($label, $name = 'submit', $createElement = false)
{
return $this->addButton(
$name,
$label,
'search',
'primary',
null,
null,
array(),
$createElement
);
}
/**
@ -482,6 +623,7 @@ EOT;
* @param int $delay (optional) The number of seconds between the moment the user
* @param string $label (optional) Custom label to be shown
* submits the form and the start of the progress bar.
* @deprecated ?
*/
public function add_progress_bar($delay = 2, $label = '')
{

@ -1964,7 +1964,11 @@ class GroupManager
return false;
}
if (!$user_is_in_group && $groupInfo['status'] == 0) {
if (!$user_is_in_group) {
return false;
}
if ($groupInfo['status'] == 0) {
return false;
}

@ -77,7 +77,7 @@ class HTML_Common
* @param int $tabOffset Indent offset in tabs
* @access public
*/
public function HTML_Common($attributes = null, $tabOffset = 0)
public function __construct($attributes = null, $tabOffset = 0)
{
$this->setAttributes($attributes);
$this->setTabOffset($tabOffset);

@ -250,7 +250,7 @@ class HTML_QuickForm extends HTML_Common
*/
public function __construct($formName='', $method='post', $action='', $target='', $attributes=null, $trackSubmit = false)
{
HTML_Common::HTML_Common($attributes);
parent::__construct($attributes);
$method = (strtoupper($method) == 'GET') ? 'get' : 'post';
$action = ($action == '') ? api_get_self() : $action;
$target = empty($target) ? array() : array('target' => $target);
@ -547,8 +547,8 @@ class HTML_QuickForm extends HTML_Common
*/
public function &createElement($elementType)
{
$args = func_get_args();
$element =& HTML_QuickForm::_loadElement('createElement', $elementType, array_slice($args, 1));
$args = func_get_args();
$element = HTML_QuickForm::_loadElement('createElement', $elementType, array_slice($args, 1));
return $element;
} // end func createElement

@ -30,7 +30,7 @@ class HTML_QuickForm_advanced_settings extends HTML_QuickForm_static
*/
public function HTML_QuickForm_advanced_settings($text = null)
{
$this->HTML_QuickForm_static(null, null, $text);
parent::__construct(null, null, $text);
$this->_type = 'html';
}
@ -52,7 +52,7 @@ class HTML_QuickForm_advanced_settings extends HTML_QuickForm_static
<label class="control-label col-sm-2"></label>
<div class="col-sm-10">
<div class="form-control-static">
'.HTML_QuickForm_static::toHtml().'
'.parent::toHtml().'
</div>
</div>
</div>

@ -39,22 +39,6 @@ class HTML_QuickForm_button extends HTML_QuickForm_input
private $size;
private $class;
/**
* @return mixed
*/
public function getClass()
{
return $this->class;
}
/**
* @param mixed $class
*/
public function setClass($class)
{
$this->class = $class;
}
/**
* @param string $name input name example 'submit'
* @param string $text button text to show
@ -64,7 +48,7 @@ class HTML_QuickForm_button extends HTML_QuickForm_input
* @param string $class
* @param array $attributes
*/
public function HTML_QuickForm_button(
public function __construct(
$name,
$text,
$icon = 'check',
@ -78,7 +62,7 @@ class HTML_QuickForm_button extends HTML_QuickForm_input
$this->setSize($size);
$this->setClass($class);
HTML_QuickForm_input::HTML_QuickForm_input(
parent::__construct(
$name,
null,
$attributes
@ -88,6 +72,55 @@ class HTML_QuickForm_button extends HTML_QuickForm_input
$this->setType('submit');
}
/**
* @return string
*/
public function toHtml()
{
if ($this->_flagFrozen) {
return $this->getFrozenHtml();
} else {
$value = null;
if (isset($this->_attributes['value'])) {
$value = $this->_attributes['value'];
unset($this->_attributes['value']);
}
unset($this->_attributes['class']);
$icon = $this->getIcon();
if (!empty($icon)) {
$icon = '<i class="' . $this->getIcon() . '"></i> ';
}
$class = $this->getClass().' '.$this->getStyle().' '.$this->getSize();
return
$this->_getTabs() . '
<button class="'.$class.'" ' . $this->_getAttrString($this->_attributes) . ' />'.
$icon.
$value.
'</button>';
}
}
/**
* @return mixed
*/
public function getClass()
{
return $this->class;
}
/**
* @param mixed $class
*/
public function setClass($class)
{
$this->class = $class;
}
/**
* @return mixed
*/
@ -117,7 +150,7 @@ class HTML_QuickForm_button extends HTML_QuickForm_input
*/
public function setStyle($style)
{
$style = !empty($style) ? 'btn-'.$style : null;
$style = !empty($style) ? 'btn btn-'.$style : null;
$this->style = $style;
}
@ -153,35 +186,6 @@ class HTML_QuickForm_button extends HTML_QuickForm_input
$this->size = $size;
}
/**
* @return string
*/
public function toHtml()
{
if ($this->_flagFrozen) {
return $this->getFrozenHtml();
} else {
$value = $this->_attributes['value'];
unset($this->_attributes['value']);
unset($this->_attributes['class']);
$icon = $this->getIcon();
if (!empty($icon)) {
$icon = '<i class="' . $this->getIcon() . '"></i> ';
}
$class = $this->getClass().' '.$this->getStyle().' '.$this->getSize();
return
$this->_getTabs() . '
<button class="'.$class.'" ' . $this->_getAttrString($this->_attributes) . ' />'.
$icon.$value.
'</button>';
}
}
/**
* Freeze the element so that only its value is returned
*

@ -90,18 +90,18 @@ class HTML_QuickForm_element extends HTML_Common
*/
function HTML_QuickForm_element($elementName = null, $elementLabel = null, $attributes = null)
{
HTML_Common::HTML_Common($attributes);
parent::__construct($attributes);
if (isset($elementName)) {
$this->setName($elementName);
}
if (isset($elementLabel)) {
$labelFor = "";
//Default Inputs generate this
// Default Inputs generate this
if (!empty($attributes['id'])) {
$labelFor = $attributes['id'];
}
//Default Labels generate this
// Default Labels generate this
if (!empty($attributes['for'])) {
$labelFor = $attributes['for'];
}

@ -36,8 +36,6 @@
*/
class HTML_QuickForm_group extends HTML_QuickForm_element
{
// {{{ properties
/**
* Name of the element
* @var string
@ -78,9 +76,6 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
*/
var $_appendName = true;
// }}}
// {{{ constructor
/**
* Class constructor
*
@ -98,7 +93,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
*/
function HTML_QuickForm_group($elementName=null, $elementLabel=null, $elements=null, $separator=null, $appendName = true)
{
$this->HTML_QuickForm_element($elementName, $elementLabel);
parent::__construct($elementName, $elementLabel);
$this->_type = 'group';
if (isset($elements) && is_array($elements)) {
$this->setElements($elements);
@ -109,10 +104,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
if (isset($appendName)) {
$this->_appendName = $appendName;
}
} //end constructor
// }}}
// {{{ setName()
}
/**
* Sets the group name
@ -125,10 +117,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
function setName($name)
{
$this->_name = $name;
} //end func setName
// }}}
// {{{ getName()
}
/**
* Returns the group name
@ -140,10 +129,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
function getName()
{
return $this->_name;
} //end func getName
// }}}
// {{{ setValue()
}
/**
* Sets values for group's elements
@ -175,10 +161,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
}
}
}
} //end func setValue
// }}}
// {{{ getValue()
}
/**
* Returns the value of the group
@ -219,10 +202,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
}
}
return $value;
} // end func getValue
// }}}
// {{{ setElements()
}
/**
* Sets the grouped elements
@ -238,10 +218,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
if ($this->_flagFrozen) {
$this->freeze();
}
} // end func setElements
// }}}
// {{{ getElements()
}
/**
* Gets the grouped elements
@ -254,10 +231,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
{
$this->_createElementsIfNotExist();
return $this->_elements;
} // end func getElements
// }}}
// {{{ getGroupType()
}
/**
* Gets the group type based on its elements
@ -279,10 +253,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
$prevType = $type;
}
return $type;
} // end func getGroupType
// }}}
// {{{ toHtml()
}
/**
* Returns Html for the group
@ -291,20 +262,14 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
* @access public
* @return string
*/
function toHtml()
public function toHtml()
{
include_once('HTML/QuickForm/Renderer/Default.php');
// Modified by Ivan Tcholakov, 16-MAR-2010. Suppressing a deprecation warning on PHP 5.3
//$renderer =& new HTML_QuickForm_Renderer_Default();
$renderer = new HTML_QuickForm_Renderer_Default();
//
$renderer->setElementTemplate('{element}');
$this->accept($renderer);
return $renderer->toHtml();
} //end func toHtml
// }}}
// {{{ getElementName()
return $renderer->toHtml();
}
/**
* Returns the element name inside the group such as found in the html form
@ -345,10 +310,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
}
}
return $elementName;
} //end func getElementName
// }}}
// {{{ getFrozenHtml()
}
/**
* Returns the value of field without HTML tags
@ -373,10 +335,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
}
}
return $html;
} //end func getFrozenHtml
// }}}
// {{{ onQuickFormEvent()
}
/**
* Called by HTML_QuickForm whenever form event is made on this element
@ -415,10 +374,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
parent::onQuickFormEvent($event, $arg, $caller);
}
return true;
} // end func onQuickFormEvent
// }}}
// {{{ accept()
}
/**
* Accepts a renderer
@ -456,10 +412,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
}
}
$renderer->finishGroup($this);
} // end func accept
// }}}
// {{{ exportValue()
}
/**
* As usual, to get the group's value we access its elements and call
@ -507,9 +460,6 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
return $value;
}
// }}}
// {{{ _createElements()
/**
* Creates the group's elements.
*
@ -526,9 +476,6 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
// abstract
}
// }}}
// {{{ _createElementsIfNotExist()
/**
* A wrapper around _createElements()
*
@ -548,9 +495,6 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
}
}
// }}}
// {{{ freeze()
function freeze()
{
parent::freeze();
@ -559,9 +503,6 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
}
}
// }}}
// {{{ unfreeze()
function unfreeze()
{
parent::unfreeze();
@ -570,9 +511,6 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
}
}
// }}}
// {{{ setPersistantFreeze()
function setPersistantFreeze($persistant = false)
{
parent::setPersistantFreeze($persistant);
@ -580,7 +518,4 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
$this->_elements[$key]->setPersistantFreeze($persistant);
}
}
// }}}
} //end class HTML_QuickForm_group
?>
}

@ -42,11 +42,12 @@ class HTML_QuickForm_header extends HTML_QuickForm_static
* @access public
* @return void
*/
function HTML_QuickForm_header($elementName = null, $text = null) {
function HTML_QuickForm_header($elementName = null, $text = null)
{
if (!empty($elementName)) {
$text = $elementName;
}
$this->HTML_QuickForm_static($elementName, null, $text);
parent::__construct($elementName, null, $text);
$this->_type = 'header';
}

@ -36,7 +36,6 @@
*/
class HTML_QuickForm_html extends HTML_QuickForm_static
{
// {{{ constructor
/**
* Class constructor
@ -45,34 +44,21 @@ class HTML_QuickForm_html extends HTML_QuickForm_static
* @access public
* @return void
*/
function HTML_QuickForm_html($text = null)
public function __construct($text = null)
{
$this->HTML_QuickForm_static(null, null, $text);
parent::__construct(null, null, $text);
$this->_type = 'html';
}
// }}}
// {{{ accept()
/**
* Accepts a renderer
*
* @param HTML_QuickForm_Renderer renderer object (only works with Default renderer!)
* @access public
* @return void
*/
function accept(&$renderer, $required = false, $error = null)
*/
public function accept(&$renderer, $required = false, $error = null)
{
$renderer->renderHtml($this);
} // end func accept
function toHtml()
{
return HTML_QuickForm_static::toHtml();
} //end func toHtml
// }}}
} //end class HTML_QuickForm_html
}
}

@ -33,7 +33,7 @@ class HTML_QuickForm_label extends HTML_QuickForm_static
$text = null,
$attributes = null
) {
$this->HTML_QuickForm_static(null, $label, $text, $attributes);
parent::__construct(null, $label, $text, $attributes);
$this->_type = 'html';
}

@ -34,7 +34,8 @@
* @version Release: 3.2.11
* @since 1.0
*/
class HTML_QuickForm_select extends HTML_QuickForm_element {
class HTML_QuickForm_select extends HTML_QuickForm_element
{
// {{{ properties
@ -81,7 +82,7 @@ class HTML_QuickForm_select extends HTML_QuickForm_element {
if (is_array($attributes) || empty($attributes)) {
$attributes['class'] = 'form-control';
}
HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
parent::__construct($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = true;
$this->_type = 'select';
if (isset($options)) {

@ -30,7 +30,8 @@
* @version Release: 3.2.11
* @since 2.7
*/
class HTML_QuickForm_static extends HTML_QuickForm_element {
class HTML_QuickForm_static extends HTML_QuickForm_element
{
// {{{ properties
@ -52,9 +53,9 @@ class HTML_QuickForm_static extends HTML_QuickForm_element {
* @access public
* @return void
*/
function HTML_QuickForm_static($elementName = null, $elementLabel = null, $text = null, $attributes = null)
public function __construct($elementName = null, $elementLabel = null, $text = null, $attributes = null)
{
HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
parent::__construct($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = false;
$this->_type = 'static';
$this->_text = $text;
@ -128,7 +129,7 @@ class HTML_QuickForm_static extends HTML_QuickForm_element {
* @access public
* @return string
*/
function toHtml()
public function toHtml()
{
return $this->_getTabs() . $this->_text;
} //end func toHtml
@ -190,7 +191,4 @@ class HTML_QuickForm_static extends HTML_QuickForm_element {
{
return null;
}
// }}}
} //end class HTML_QuickForm_static
?>
}

@ -46,7 +46,7 @@ class HTML_QuickForm_submit extends HTML_QuickForm_input
* @access public
* @return void
*/
function HTML_QuickForm_submit($elementName=null, $value=null, $attributes=null)
public function __construct($elementName=null, $value=null, $attributes=null)
{
HTML_QuickForm_input::HTML_QuickForm_input($elementName, null, $attributes);
$this->setValue($value);

@ -45,7 +45,7 @@ class HTML_QuickForm_text extends HTML_QuickForm_input
* @access public
* @return void
*/
public function HTML_QuickForm_text(
public function __construct(
$elementName = null,
$elementLabel = null,
$attributes = array()

@ -57,10 +57,10 @@ class HTML_QuickForm_textarea extends HTML_QuickForm_element
* @access public
* @return void
*/
public function HTML_QuickForm_textarea($elementName=null, $elementLabel=null, $attributes=null)
public function __construct($elementName=null, $elementLabel=null, $attributes=null)
{
$attributes['class'] = isset($attributes['class']) ? $attributes['class'] : 'form-control';
HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
parent::__construct($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = true;
$this->_type = 'textarea';
} //end constructor

@ -172,7 +172,7 @@ class HTML_Table extends HTML_Common {
*/
function HTML_Table($attributes = null, $tabOffset = 0, $useTGroups = false)
{
HTML_Common::HTML_Common($attributes, (int)$tabOffset);
parent::__construct($attributes, (int)$tabOffset);
$this->_useTGroups = (boolean)$useTGroups;
$this->addBody();
if ($this->_useTGroups) {

@ -128,7 +128,7 @@ class HTML_Table_Storage extends HTML_Common {
*/
function HTML_Table_Storage($tabOffset = 0, $useTGroups = false)
{
HTML_Common::HTML_Common(null, (int)$tabOffset);
parent::__construct(null, (int)$tabOffset);
$this->_useTGroups = (boolean)$useTGroups;
}

@ -79,8 +79,13 @@ $people_filled = survey_manager::get_people_who_filled_survey(
SurveyUtil::check_parameters($people_filled);
$survey_data = survey_manager::get_survey($survey_id);
$isDrhOfCourse = CourseManager::isUserSubscribedInCourseAsDrh(
api_get_user_id(),
api_get_course_info()
);
/** @todo this has to be moved to a more appropriate place (after the display_header of the code)*/
if (!api_is_allowed_to_edit(false, true)) {
if (!api_is_allowed_to_edit(false, true) || $isDrhOfCourse) {
Display :: display_header(get_lang('ToolSurvey'));
// Show error message if the survey can be seen only by tutors
if ($survey_data['visible_results'] != SURVEY_VISIBLE_TUTOR) {
@ -151,13 +156,19 @@ echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?survey_id='.$sur
echo '</div>';
// Content
if (!isset($_GET['action']) || isset($_GET['action']) && $_GET['action'] == 'overview') {
$myweb_survey_id = $survey_id;
echo '<div class="sectiontitle"><a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action=questionreport&amp;'.$cidReq.'&amp;survey_id='.$myweb_survey_id.'">'.Display::return_icon('survey_reporting_question.gif',get_lang('DetailedReportByQuestion')).' '.get_lang('DetailedReportByQuestion').'</a></div><div class="sectioncomment">'.get_lang('DetailedReportByQuestionDetail').' </div>';
echo '<div class="sectiontitle"><a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action=userreport&amp;'.$cidReq.'&amp;survey_id='.$myweb_survey_id.'">'.Display::return_icon('survey_reporting_user.gif',get_lang('DetailedReportByUser')).' '.get_lang('DetailedReportByUser').'</a></div><div class="sectioncomment">'.get_lang('DetailedReportByUserDetail').'.</div>';
echo '<div class="sectiontitle"><a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action=comparativereport&amp;'.$cidReq.'&amp;survey_id='.$myweb_survey_id.'">'.Display::return_icon('survey_reporting_comparative.gif',get_lang('ComparativeReport')).' '.get_lang('ComparativeReport').'</a></div><div class="sectioncomment">'.get_lang('ComparativeReportDetail').'.</div>';
echo '<div class="sectiontitle"><a href="reporting.php?action=completereport&amp;'.$cidReq.'&amp;survey_id='.$myweb_survey_id.'">'.Display::return_icon('survey_reporting_complete.gif',get_lang('CompleteReport')).' '.get_lang('CompleteReport').'</a></div><div class="sectioncomment">'.get_lang('CompleteReportDetail').'</div>';
if (!isset($_GET['action']) ||
isset($_GET['action']) &&
$_GET['action'] == 'overview'
) {
$myweb_survey_id = $survey_id;
echo '<div class="sectiontitle"><a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action=questionreport&amp;survey_id='.$myweb_survey_id.'&'.api_get_cidreq().'">'.
Display::return_icon('survey_reporting_question.gif',get_lang('DetailedReportByQuestion')).' '.get_lang('DetailedReportByQuestion').'</a></div><div class="sectioncomment">'.get_lang('DetailedReportByQuestionDetail').' </div>';
echo '<div class="sectiontitle"><a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action=userreport&amp;survey_id='.$myweb_survey_id.'&'.api_get_cidreq().'">'.
Display::return_icon('survey_reporting_user.gif',get_lang('DetailedReportByUser')).' '.get_lang('DetailedReportByUser').'</a></div><div class="sectioncomment">'.get_lang('DetailedReportByUserDetail').'.</div>';
echo '<div class="sectiontitle"><a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action=comparativereport&amp;survey_id='.$myweb_survey_id.'&'.api_get_cidreq().'">'.
Display::return_icon('survey_reporting_comparative.gif',get_lang('ComparativeReport')).' '.get_lang('ComparativeReport').'</a></div><div class="sectioncomment">'.get_lang('ComparativeReportDetail').'.</div>';
echo '<div class="sectiontitle"><a href="reporting.php?action=completereport&amp;survey_id='.$myweb_survey_id.'&'.api_get_cidreq().'">'.
Display::return_icon('survey_reporting_complete.gif',get_lang('CompleteReport')).' '.get_lang('CompleteReport').'</a></div><div class="sectioncomment">'.get_lang('CompleteReportDetail').'</div>';
}
// Footer

@ -857,11 +857,12 @@ class survey_manager
$tbl_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION);
$table_survey_question_option = Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION);
if (empty($course_id))
{
if (empty($course_id)) {
$course_id = api_get_course_int_id();
}
$return = array();
// Getting the information of the question
$sql = "SELECT * FROM $tbl_survey_question
WHERE c_id = $course_id AND survey_id='".intval($survey_id)."'";
@ -1715,8 +1716,9 @@ class SurveyUtil
$temp_questions_data = survey_manager::get_questions($_GET['survey_id']);
// Sorting like they should be displayed and removing the non-answer question types (comment and pagebreak)
$my_temp_questions_data = ($temp_questions_data==null) ? array() : $temp_questions_data;
$my_temp_questions_data = $temp_questions_data == null ? array() : $temp_questions_data;
$questions_data = array();
foreach ($my_temp_questions_data as $key => & $value) {
if ($value['type'] != 'comment' && $value['type'] != 'pagebreak') {
$questions_data[$value['sort']] = $value;

@ -8,43 +8,43 @@
<br />
<div id="course_thing_to_do" class="row">
<div class="span3">
<div class="col-md-3">
<div class="thumbnail">
<img src="{{ _p.web_img }}icons/64/info.png"/>
<div class="caption">
<a href="{{ _p.web_main }}course_description/?cidReq={{ course_id }}" class="btn">
{{'AddCourseDescription'|get_lang}}
<a href="{{ _p.web_main }}course_description/?cidReq={{ course_id }}" class="btn btn-default">
<i class="fa fa-info-circle"></i> {{'AddCourseDescription'|get_lang}}
</a>
</div>
</div>
</div>
<div class="span3">
<div class="col-md-3">
<div class="thumbnail">
<img src="{{ _p.web_img }}icons/64/folder_document.png"/>
<div class="caption">
<a href="{{ _p.web_main }}document/document.php?cidReq={{ course_id }}" class="btn">
{{'UploadADocument'|get_lang}}
<a href="{{ _p.web_main }}document/document.php?cidReq={{ course_id }}" class="btn btn-default">
<i class="fa fa-paper-plane"></i> {{'UploadADocument'|get_lang}}
</a>
</div>
</div>
</div>
<div class="span3">
<div class="col-md-3">
<div class="thumbnail">
<img src="{{ _p.web_img }}icons/64/forum.png"/>
<div class="caption">
<a href="{{ _p.web_main }}forum/index.php?cidReq={{ course_id }}" class="btn">
{{ 'AddForum'|get_lang }}
<a href="{{ _p.web_main }}forum/index.php?cidReq={{ course_id }}" class="btn btn-default">
<i class="fa fa-users"></i> {{ 'AddForum'|get_lang }}
</a>
</div>
</div>
</div>
{% if ("allow_user_course_subscription_by_course_admin" | get_setting) == 'true' or _u.is_admin == 1 %}
<div class="span3">
<div class="col-md-3">
<div class="thumbnail">
<img src="{{ _p.web_img }}icons/64/user.png"/>
<div class="caption">
<a href="{{ _p.web_main }}user/subscribe_user.php?cidReq={{ course_id }}" class="btn">
{{ 'SubscribeUserToCourse'|get_lang }}
<a href="{{ _p.web_main }}user/subscribe_user.php?cidReq={{ course_id }}" class="btn btn-default">
<i class="fa fa-user-plus"></i> {{ 'SubscribeUserToCourse'|get_lang }}
</a>
</div>
</div>

@ -67,6 +67,7 @@ $tool_name = get_lang('ToolWiki');
/* ACCESS */
api_protect_course_script();
api_block_anonymous_users();
api_protect_course_group(GroupManager::GROUP_TOOL_WIKI);
/* TRACKING */
Event::event_access_tool(TOOL_WIKI);

@ -76,23 +76,9 @@ if (!empty($gradebook) && $gradebook == 'view') {
}
if (!empty($group_id)) {
$group_properties = GroupManager::get_group_properties($group_id);
$show_work = false;
if (api_is_allowed_to_edit(false, true)) {
$show_work = true;
} else {
// you are not a teacher
$show_work = GroupManager::user_has_access(
$user_id,
$group_id,
GroupManager::GROUP_TOOL_WORK
);
}
api_protect_course_group(GroupManager::GROUP_TOOL_WORK);
if (!$show_work) {
api_not_allowed();
}
$group_properties = GroupManager::get_group_properties($group_id);
$interbreadcrumb[] = array ('url' => '../group/group.php', 'name' => get_lang('Groups'));
$interbreadcrumb[] = array ('url' => '../group/group_space.php?gidReq='.$group_id, 'name' => get_lang('GroupSpace').' '.$group_properties['name']);

Loading…
Cancel
Save