1.10.x
jmontoya 9 years ago
parent 23173d5ea6
commit b65d66ae2e
  1. 4
      main/admin/course_intro_pdf_import.php
  2. 51
      main/attendance/attendance_sheet.php
  3. 2
      main/course_home/3column.php
  4. 79
      main/document/create_paint.php
  5. 18
      main/document/slideshow.php
  6. 11
      main/inc/lib/course_home.lib.php
  7. 4
      main/inc/lib/display.lib.php
  8. 21
      main/inc/lib/document.lib.php
  9. 9
      main/inc/lib/formvalidator/FormValidator.class.php
  10. 9
      main/inc/lib/tracking.lib.php

@ -127,7 +127,9 @@ function import_pdfs($file, $subDir = '/')
api_set_default_visibility($docId, TOOL_DOCUMENT);
$errors[] = array('Line' => 0, 'Code' => $course['code'], 'Title' => $course['title']);
// Now add a link to the file from the Course description tool
$link = '<p>Sílabo de la asignatura <a href="'.api_get_path(WEB_CODE_PATH).'document/document.php?cidReq='.$course['code'].'&id_session=0&gidReq=0&action=download&id='.$docId.'" target="_blank"><img src="'.api_get_path(WEB_IMG_PATH).'icons/32/pdf.png"></a></p>';
$link = '<p>Sílabo de la asignatura <a href="'.api_get_path(WEB_CODE_PATH).'document/document.php?cidReq='.$course['code'].'&id_session=0&gidReq=0&action=download&id='.$docId.'" target="_blank">
'.Display::return_icon('pdf.png').'
</a></p>';
$course_description = new CourseDescription();
$session_id = api_get_session_id();
$course_description->set_course_id($course['real_id']);

@ -107,14 +107,12 @@ if (api_is_allowed_to_edit(null, true) ||
if (!$is_locked_attendance || api_is_platform_admin()) {
$actionsLeft = '<a style="float:left;" href="index.php?'.api_get_cidreq().'&action=calendar_list&attendance_id='.$attendance_id.'">'.
Display::return_icon('attendance_calendar.png',get_lang('AttendanceCalendar'),'',ICON_SIZE_MEDIUM).'</a>';
Display::return_icon('attendance_calendar.png', get_lang('AttendanceCalendar'), '', ICON_SIZE_MEDIUM).'</a>';
$actionsLeft .= '<a id="pdf_export" style="float:left;" href="index.php?'.api_get_cidreq().'&action=attendance_sheet_export_to_pdf&attendance_id='.$attendance_id.'&filter='.$default_filter.'&group_id='.$groupId.'">'.
Display::return_icon('pdf.png',get_lang('ExportToPDF'),'',ICON_SIZE_MEDIUM).'</a>';
//if (count($users_in_course) > 0) {
$actionsRight = $form->returnForm();
//}
Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_MEDIUM).'</a>';
$toolbar = Display::toolbarAction('toolbar-attendance', array(0 => $actionsLeft, 1 => $actionsRight), 2 , false);
$actionsRight = $form->returnForm();
$toolbar = Display::toolbarAction('toolbar-attendance', array($actionsLeft, $actionsRight), 2, false);
echo $toolbar;
}
@ -207,7 +205,6 @@ if (api_is_allowed_to_edit(null, true) ||
</script>
<form method="post" action="index.php?action=attendance_sheet_add&<?php echo api_get_cidreq().$param_filter ?>&attendance_id=<?php echo $attendance_id?>" >
<div class="attendance-sheet-content" style="width:100%;background-color:#E1E1E1;margin-top:20px;">
<div class="divTableWithFloatingHeader attendance-users-table" style="width:45%;float:left;margin:0px;padding:0px;">
<table class="tableWithFloatingHeader data_table" width="100%">
@ -264,15 +261,19 @@ if (api_is_allowed_to_edit(null, true) ||
echo '<table class="tableWithFloatingHeader data_table" width="100%">';
echo '<thead>';
$result = null;
if (count($attendant_calendar) > 0 ) {
if (count($attendant_calendar) > 0) {
foreach ($attendant_calendar as $calendar) {
$date = $calendar['date'];
$time = $calendar['time'];
$datetime = '<div class="grey">'. $date . ' - ' . $time . '</div>';
$img_lock = Display::return_icon('lock-closed.png',get_lang('DateUnLock'),array('class'=>'img_lock','id'=>'datetime_column_'.$calendar['id']));
$img_lock = Display::return_icon(
'lock-closed.png',
get_lang('DateUnLock'),
array('class' => 'img_lock', 'id' => 'datetime_column_'.$calendar['id'])
);
if (!empty($calendar['done_attendance'])){
if (!empty($calendar['done_attendance'])) {
$datetime = '<div class="blue">' . $date . ' - ' . $time . '</div>';
}
$disabled_check = 'disabled = "true"';
@ -319,7 +320,7 @@ if (api_is_allowed_to_edit(null, true) ||
}
echo '<tr class="'.$class.'">';
if (count($attendant_calendar) > 0 ) {
if (count($attendant_calendar) > 0) {
foreach ($attendant_calendar as $calendar) {
$checked = 'checked';
$presence = -1;
@ -343,10 +344,11 @@ if (api_is_allowed_to_edit(null, true) ||
$style_td = '';
if ($next_attendance_calendar_id == $calendar['id']) {
if ($i%2==0)
if ($i % 2 == 0) {
$style_td = 'background-color:#eee;';
else
} else {
$style_td = 'background-color:#dcdcdc;';
}
$disabled = '';
}
@ -363,10 +365,10 @@ if (api_is_allowed_to_edit(null, true) ||
} else {
switch ($presence) {
case 1:
echo Display::return_icon('accept.png',get_lang('Attended'));
echo Display::return_icon('accept.png', get_lang('Attended'));
break;
case 0:
echo Display::return_icon('exclamation.png',get_lang('NotAttended'));
echo Display::return_icon('exclamation.png', get_lang('NotAttended'));
break;
case -1:
//echo Display::return_icon('warning.png',get_lang('NotAttended'));
@ -397,18 +399,21 @@ if (api_is_allowed_to_edit(null, true) ||
<div class="row">
<div class="col-md-12">
<?php if (!$is_locked_attendance || api_is_platform_admin()) {
if (api_is_allowed_to_edit(null, true)) {
?>
<button type="submit" class="btn btn-primary"><?php echo get_lang('Save') ?></button>
<?php }
}
?> </div>
<?php if (!$is_locked_attendance || api_is_platform_admin()) {
if (api_is_allowed_to_edit(null, true)) { ?>
<button type="submit" class="btn btn-primary"><?php echo get_lang('Save') ?></button>
<?php }
} ?>
</div>
</div>
</form>
<?php
} else {
echo Display::display_warning_message('<a href="'.api_get_path(WEB_CODE_PATH).'user/user.php?'.api_get_cidreq().'">'.get_lang('ThereAreNoRegisteredLearnersInsidetheCourse').'</a>', false);
echo Display::display_warning_message(
'<a href="'.api_get_path(WEB_CODE_PATH).'user/user.php?'.api_get_cidreq().'">'.
get_lang('ThereAreNoRegisteredLearnersInsidetheCourse').'</a>',
false
);
}
} else {
echo Display::page_header(get_lang('AttendanceSheetReport'));

@ -60,7 +60,7 @@ if (api_is_allowed_to_edit(null, true)) {
if ($tool['img'] != 'external.gif') {
$tool['link'] = api_get_path(WEB_CODE_PATH).$tool['link'];
}
$tool['image'] = api_get_path(WEB_IMG_PATH).$tool['image'];
$tool['image'] = Display::returnIconPath($tool['image']);
echo "<br /><br /><br />\n";
echo "<table class=\"message\" width=\"70%\" align=\"center\">\n",

@ -1,5 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This file allows creating audio files from a text.
*
@ -10,7 +11,6 @@
* @todo clean all file
*/
/* INIT SECTION */
require_once '../inc/global.inc.php';
$_SESSION['whereami'] = 'document/createpaint';
$this_section = SECTION_COURSES;
@ -19,31 +19,33 @@ $nameTools = get_lang('PhotoRetouching');
api_protect_course_script();
api_block_anonymous_users();
$_course = api_get_course_info();
if (api_get_setting('enabled_support_paint') == 'false') {
api_not_allowed(true);
api_not_allowed(true);
}
$document_data = DocumentManager::get_document_data_by_id($_GET['id'], api_get_course_id(), true);
if (empty($document_data)) {
if (api_is_in_group()) {
$group_properties = GroupManager::get_group_properties(api_get_group_id());
$document_id = DocumentManager::get_document_id(api_get_course_info(), $group_properties['directory']);
$document_data = DocumentManager::get_document_data_by_id($document_id, api_get_course_id());
$group_properties = GroupManager::get_group_properties(api_get_group_id());
$document_id = DocumentManager::get_document_id(api_get_course_info(), $group_properties['directory']);
$document_data = DocumentManager::get_document_data_by_id($document_id, api_get_course_id());
}
}
$document_id = $document_data['id'];
$dir = $document_data['path'];
$dir = $document_data['path'];
//$dir = isset($_GET['dir']) ? Security::remove_XSS($_GET['dir']) : Security::remove_XSS($_POST['dir']);
$is_allowed_to_edit = api_is_allowed_to_edit(null, true);
//path for pixlr save
$_SESSION['paint_dir']=Security::remove_XSS($dir);
if ($_SESSION['paint_dir']=='/'){
$_SESSION['paint_dir']='';
$_SESSION['paint_dir'] = Security::remove_XSS($dir);
if ($_SESSION['paint_dir'] == '/') {
$_SESSION['paint_dir'] = '';
}
$_SESSION['paint_file']=get_lang('NewImage');
$_SESSION['paint_file'] = get_lang('NewImage');
// Please, do not modify this dirname formatting
@ -73,56 +75,63 @@ if (!is_dir($filepath)) {
$groupId = api_get_group_id();
if (!empty($groupId)) {
$interbreadcrumb[] = array ("url" => "../group/group_space.php?".api_get_cidreq(), "name" => get_lang('GroupSpace'));
$noPHP_SELF = true;
$group = GroupManager::get_group_properties($groupId);
$path = explode('/', $dir);
if ('/'.$path[1] != $group['directory']) {
api_not_allowed(true);
}
$interbreadcrumb[] = array(
"url" => api_get_path(WEB_CODE_PATH)."group/group_space.php?".api_get_cidreq(),
"name" => get_lang('GroupSpace'),
);
$noPHP_SELF = true;
$group = GroupManager::get_group_properties($groupId);
$path = explode('/', $dir);
if ('/'.$path[1] != $group['directory']) {
api_not_allowed(true);
}
}
$interbreadcrumb[] = array ("url" => "./document.php?curdirpath=".urlencode($dir)."&".api_get_cidreq(), "name" => get_lang('Documents'));
$interbreadcrumb[] = array(
"url" => "./document.php?curdirpath=".urlencode($dir)."&".api_get_cidreq(),
"name" => get_lang('Documents'),
);
if (!$is_allowed_in_course) {
api_not_allowed(true);
api_not_allowed(true);
}
if (!($is_allowed_to_edit || $_SESSION['group_member_with_upload_rights'] ||
DocumentManager::is_my_shared_folder($_user['user_id'], Security::remove_XSS($dir),api_get_session_id()))) {
api_not_allowed(true);
DocumentManager::is_my_shared_folder($_user['user_id'], Security::remove_XSS($dir), api_get_session_id()))
) {
api_not_allowed(true);
}
/* Header */
Event::event_access_tool(TOOL_DOCUMENT);
$display_dir = $dir;
if (isset ($group)) {
$display_dir = explode('/', $dir);
unset ($display_dir[0]);
unset ($display_dir[1]);
$display_dir = implode('/', $display_dir);
$display_dir = explode('/', $dir);
unset ($display_dir[0]);
unset ($display_dir[1]);
$display_dir = implode('/', $display_dir);
}
// Interbreadcrumb for the current directory root path
if (empty($document_data['parents'])) {
$interbreadcrumb[] = array('url' => '#', 'name' => $document_data['title']);
} else {
foreach($document_data['parents'] as $document_sub_data) {
$interbreadcrumb[] = array('url' => $document_sub_data['document_url'], 'name' => $document_sub_data['title']);
}
foreach ($document_data['parents'] as $document_sub_data) {
$interbreadcrumb[] = array('url' => $document_sub_data['document_url'], 'name' => $document_sub_data['title']);
}
}
Display :: display_header($nameTools, 'Doc');
echo '<div class="actions">';
echo '<a href="document.php?id='.$document_id.'">'.
Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'), '', ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
///pixlr
// pixlr
// max size 1 Mb ??
$title = urlencode(utf8_encode(get_lang('NewImage')));//TODO:check
//
$image = api_get_path(WEB_IMG_PATH) . 'canvas1024x768.png';
$image = Display::returnIconPath('canvas1024x768.png');
//
$pixlr_code_translation_table = array('' => 'en', 'pt' => 'pt-Pt', 'sr' => 'sr_latn');
$langpixlr = api_get_language_isocode();
@ -149,13 +158,13 @@ if ($_SERVER['HTTP_HOST']=="localhost") {
</cross-domain-policy>';//more open domain="*"
@file_put_contents($path_and_file, $crossdomain);
}
$credentials="true";
$credentials = "true";
} else {
$credentials="false";
$credentials = "false";
}
$pixlr_url = api_get_protocol().'://pixlr.com/editor/?title='.$title.'&image='.$image.'&loc='.$loc.'&referrer='.$referrer.'&target='.$target.'&exit='.$exit_path.'&locktarget='.$locktarget.'&locktitle='.$locktitle.'&credentials='.$credentials;
?>
<script type="text/javascript">
<script>
document.write ('<iframe id="frame" frameborder="0" scrolling="no" src="<?php echo $pixlr_url; ?>" width="100%" height="100%"><noframes><p>Sorry, your browser does not handle frames</p></noframes></iframe></div>');
function resizeIframe() {
@ -168,9 +177,7 @@ function resizeIframe() {
};
document.getElementById('frame').onload = resizeIframe;
window.onresize = resizeIframe;
</script>
<?php
echo '<noscript>';

@ -87,7 +87,8 @@ if ($slide_id != 'all') {
if ($slide > 0) {
echo '<a href="slideshow.php?slide_id='.$previous_slide.'&curdirpath='.$pathurl.'">';
}
echo '<img src="'.api_get_path(WEB_IMG_PATH).$imgp.'" title="'.get_lang('Previous').'" alt="'.get_lang('Previous').'">';
echo Display::return_icon($imgp, get_lang('Previous'));
if ($slide > 0) {
echo '</a>';
}
@ -101,12 +102,14 @@ if ($slide_id != 'all') {
}
if ($slide == $total_slides - 1) {
$imgn = 'action_next_na.png';
$last = '<img src="'.api_get_path(WEB_IMG_PATH).'action_last_na.png" title="'.get_lang('LastSlide').'" alt="'.get_lang('LastSlide').'">';
$last = Display::return_icon('action_last_na.png', get_lang('LastSlide'));
} else {
$imgn = 'action_next.png';
$last = '<a href="slideshow.php?slide_id='.($total_slides-1).'&curdirpath='.$pathurl.'"><img src="'.api_get_path(WEB_IMG_PATH).'action_last.png" title="'.get_lang('LastSlide').'" alt="'.get_lang('LastSlide').'"></a>';
$last = '<a href="slideshow.php?slide_id='.($total_slides-1).'&curdirpath='.$pathurl.'">
'.Display::return_icon('action_last.png', get_lang('LastSlide')).'
</a>';
}
echo '<img src="'.api_get_path(WEB_IMG_PATH).$imgn.'" title="'.get_lang('Next').'" alt="'.get_lang('Next').'">';
echo Display::return_icon($imgn, get_lang('Next'));
if ($slide > 0) {
echo '</a>';
}
@ -130,12 +133,9 @@ if ($slide_id != 'all') {
}
// Slideshow options
echo '<a href="slideshowoptions.php?curdirpath='.$pathurl.'&'.api_get_cidreq().'">'.
Display::return_icon('settings.png',get_lang('SetSlideshowOptions'),'',ICON_SIZE_MEDIUM).'</a>';
?>
</div>
Display::return_icon('settings.png', get_lang('SetSlideshowOptions'),'',ICON_SIZE_MEDIUM).'</a>';
<?php
echo '</div>';
echo '<br />';
/* TREATING THE POST DATA FROM SLIDESHOW OPTIONS */

@ -119,7 +119,9 @@ class CourseHome
}
}
if (api_get_session_id() != 0 && in_array($tool['name'], array('course_maintenance', 'course_setting'))) {
if (api_get_session_id() != 0 &&
in_array($tool['name'], array('course_maintenance', 'course_setting'))
) {
continue;
}
@ -143,10 +145,13 @@ class CourseHome
}
// Setting the actual image url
$tool['img'] = api_get_path(WEB_IMG_PATH).$tool['img'];
$tool['img'] = Display::returnIconPath($tool['img']);
// VISIBLE
if (($tool['visibility'] || ((api_is_coach() || api_is_course_tutor()) && $tool['name'] == TOOL_TRACKING)) || $cat == 'courseAdmin' || $cat == 'platformAdmin') {
if (($tool['visibility'] ||
((api_is_coach() || api_is_course_tutor()) && $tool['name'] == TOOL_TRACKING)) ||
$cat == 'courseAdmin' || $cat == 'platformAdmin'
) {
if (strpos($tool['name'], 'visio_') !== false) {
$cell_content .= '<a href="javascript: void(0);" onclick="javascript: window.open(\''.$tool['link'].$link_annex.'\',\'window_visio'.$_SESSION['_cid'].'\',config=\'height=\'+730+\', width=\'+1020+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')" target="'.$tool['target'].'"><img src="'.$tool['img'].'" title="'.$tool_name.'" alt="'.$tool_name.'" align="absmiddle" border="0">'.$tool_name.'</a>';
} elseif (strpos($tool['name'], 'chat') !== false && api_get_course_setting('allow_open_chat_window')) {

@ -698,7 +698,7 @@ class Display
/**
* Gets the path of an icon
*
*
* @param string $icon
* @return string
*/
@ -2203,7 +2203,7 @@ class Display
if ( $col == 2 && $i == 1 ) {
if ($right === true) {
$html .= '<div class="pull-right">';
$html .= (isset($content[$i])?$content[$i]:'');
$html .= (isset($content[$i]) ? $content[$i] : '');
$html .= '</div>';
} else {
$html .= $content[$i];

@ -3470,7 +3470,6 @@ class DocumentManager
);
$return .= $write_result;
$img_path = api_get_path(WEB_IMG_PATH);
if ($lp_id == false) {
$url = api_get_path(WEB_AJAX_PATH).'lp.ajax.php?a=get_documents&url='.$overwrite_url.'&lp_id='.$lp_id.'&cidReq='.$course_info['code'];
$return .= "<script>
@ -3516,12 +3515,12 @@ class DocumentManager
if (image.hasClass('open')) {
image.removeClass('open');
image.attr('src', '" . $img_path . "nolines_plus.gif');
image.attr('src', '" . Display::returnIconPath('nolines_plus.gif')."');
$('#'+id).show();
$('#'+tempId).hide();
} else {
image.addClass('open');
image.attr('src', '" . $img_path . "nolines_minus.gif');
image.attr('src', '" . Display::returnIconPath('nolines_minus.gif') . "');
$('#'+id).hide();
$('#'+tempId).show();
@ -3568,7 +3567,6 @@ class DocumentManager
$target,
$overwrite_url
) {
$img_path = api_get_path(WEB_IMG_PATH);
$img_sys_path = api_get_path(SYS_CODE_PATH) . 'img/';
$web_code_path = api_get_path(WEB_CODE_PATH);
@ -3595,7 +3593,7 @@ class DocumentManager
// Show the "image name" not the filename of the image.
if ($lp_id) {
//LP URL
// LP URL
$url = api_get_path(WEB_CODE_PATH).'newscorm/lp_controller.php?'.api_get_cidreq().'&amp;action=add_item&amp;type=' . TOOL_DOCUMENT . '&amp;file=' . $documentId . '&amp;lp_id=' . $lp_id;
if (!empty($overwrite_url)) {
$url = $overwrite_url . '&cidReq=' . $course_info['code'] . '&id_session=' . $session_id . '&document_id=' . $documentId.'';
@ -3608,9 +3606,9 @@ class DocumentManager
}
}
$img = $img_path . $icon;
$img = Display::returnIconPath($icon);
if (!file_exists($img_sys_path . $icon)) {
$img = $img_path . 'icons/16/default_small.gif';
$img = Display::returnIconPath('default_small.gif');
}
$link = Display::url(
@ -3654,8 +3652,6 @@ class DocumentManager
$title = isset($resource['title']) ? $resource['title'] : null;
$path = isset($resource['path']) ? $resource['path'] : null;
$img_path = api_get_path(WEB_IMG_PATH);
if (empty($path)) {
$num = 0;
} else {
@ -3707,13 +3703,12 @@ class DocumentManager
$return .= '<li class="doc_folder '.$folder_class_hidden.'" id="doc_id_' . $resource['id'] . '" style="margin-left:' . ($num * 18) . 'px; ">';
$image = $img_path.'nolines_plus.gif';
$image = Display::returnIconPath('nolines_plus.gif');
if (empty($path)) {
$image = $img_path.'nolines_minus.gif';
$image = Display::returnIconPath('nolines_minus.gif');
}
$return .= '<img style="cursor: pointer;" src="'.$image.'" align="absmiddle" id="img_'.$resource['id'] . '" '.$onclick.'>';
$return .= '<img alt="" src="' . $img_path . 'lp_folder.gif" title="" align="absmiddle" />&nbsp;';
$return .= Display::returnIconPath('lp_folder.gif').'&nbsp;';
$return .= '<span '.$onclick.' style="cursor: pointer;" >'.$title.'</span>';
$return .= '</li>';

@ -873,19 +873,18 @@ EOT;
$xajax_upload = new xajax(api_get_path(WEB_LIBRARY_PATH) . 'upload.xajax.php');
$xajax_upload->registerFunction('updateProgress');
// IMPORTANT : must be the first element of the form
$el = $this->insertElementBefore(FormValidator::createElement('html', '<input type="hidden" name="UPLOAD_IDENTIFIER" value="' . $upload_id . '" />'), $element_after);
$this->addElement('html', '<br />');
// Add div-element where the progress bar is to be displayed
$this->addElement('html', '
<div id="dynamic_div_container" style="display:none">
$this->addElement(
'html',
'<div id="dynamic_div_container" style="display:none">
<div id="dynamic_div_label">' . get_lang('UploadFile') . '</div>
<div id="dynamic_div_frame" style="width:214px; height:12px; border:1px solid grey; background-image:url(' . Display::returnIconPath('real_upload_frame.gif').');">
<div id="dynamic_div_filled" style="width:0%;height:100%;background-image:url(' . api_get_path(WEB_IMG_PATH) . 'real_upload_step.gif);background-repeat:repeat-x;background-position:center;"></div>
<div id="dynamic_div_filled" style="width:0%;height:100%;background-image:url(' . Display::returnIconPath('real_upload_step.gif').');background-repeat:repeat-x;background-position:center;"></div>
</div>
</div>'
);

@ -6384,15 +6384,16 @@ class TrackingCourseLog
$user['survey'] = (isset($survey_user_list[$user['user_id']]) ? $survey_user_list[$user['user_id']] : 0) .' / '.$total_surveys;
}
$user['link'] = '<center><a href="../mySpace/myStudents.php?student='.$user['user_id'].'&details=true&course='.$course_code.'&origin=tracking_course&id_session='.$session_id.'"><img src="'.api_get_path(WEB_IMG_PATH).'icons/22/2rightarrow.png" border="0" /></a></center>';
$user['link'] = '<center>
<a href="../mySpace/myStudents.php?student='.$user['user_id'].'&details=true&course='.$course_code.'&origin=tracking_course&id_session='.$session_id.'">
'.Display::return_icon('2rightarrow.png').'
</a>
</center>';
// store columns in array $users
$is_western_name_order = api_is_western_name_order();
$user_row = array();
$user_row[]= $user['official_code']; //0
if ($is_western_name_order) {
$user_row[]= $user['firstname'];
$user_row[]= $user['lastname'];

Loading…
Cancel
Save