Scrutinizer Auto-Fixes

This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
pull/2487/head
Scrutinizer Auto-Fixer 9 years ago
parent a0bfc2a5cc
commit b8f1505d5e
  1. 4
      main/admin/course_request_review.php
  2. 4
      main/admin/skill_badge.php
  3. 6
      main/admin/skill_badge_list.php
  4. 2
      main/admin/teacher_time_report.php
  5. 6
      main/badge/class.php
  6. 2
      main/badge/criteria.php
  7. 2
      main/calendar/agenda_js.php
  8. 4
      main/course_info/maintenance_coach.php
  9. 4
      main/dashboard/index.php
  10. 6
      main/document/edit_odf.php
  11. 12
      main/gradebook/gradebook_add_eval.php
  12. 26
      main/gradebook/gradebook_scoring_system.php
  13. 8
      main/gradebook/lib/be/evallink.class.php
  14. 20
      main/gradebook/lib/fe/catform.class.php
  15. 2
      main/gradebook/my_certificates.php
  16. 26
      main/gradebook/user_stats.php
  17. 20
      main/social/group_members.php
  18. 8
      main/work/add_user.php
  19. 4
      main/work/edit_work.php
  20. 6
      plugin/add_shibboleth_login_button/index.php
  21. 14
      plugin/advanced_subscription/ajax/advanced_subscription.ajax.php
  22. 8
      plugin/advanced_subscription/src/HookAdvancedSubscription.php
  23. 5
      plugin/advanced_subscription/src/admin_view.php
  24. 2
      plugin/advanced_subscription/src/open_session.php
  25. 2
      plugin/advanced_subscription/src/render_mail.php
  26. 2
      plugin/advanced_subscription/src/scripts/insert_session_fields.php
  27. 2
      plugin/advanced_subscription/src/scripts/insert_sessions_categories.php
  28. 4
      plugin/before_login/index.php
  29. 4
      plugin/before_login/plugin.php
  30. 2
      plugin/buycourses/config.php
  31. 8
      plugin/buycourses/src/expresscheckout.php
  32. 4
      plugin/buycourses/src/success.php
  33. 2
      plugin/buycourses/uninstall.php
  34. 2
      plugin/courselegal/CourseLegalPlugin.php
  35. 2
      plugin/courselegal/install.php
  36. 2
      plugin/courselegal/start.php
  37. 4
      plugin/courselegal/user_list.php
  38. 2
      plugin/createdrupaluser/index.php
  39. 2
      plugin/createdrupaluser/install.php
  40. 4
      plugin/createdrupaluser/src/HookCreateDrupalUser.php
  41. 2
      plugin/createdrupaluser/uninstall.php
  42. 22
      plugin/dashboard/block_student/block_student.class.php
  43. 28
      plugin/dashboard/block_teacher_graph/block_teacher_graph.class.php
  44. 2
      plugin/show_user_info/lang/spanish.php
  45. 4
      plugin/tour/ajax/save.ajax.php
  46. 2
      plugin/tour/install.php
  47. 2
      plugin/tour/uninstall.php
  48. 2
      src/Chamilo/CoreBundle/Component/Editor/Driver/HomeDriver.php
  49. 4
      src/Chamilo/CoreBundle/Entity/Repository/SequenceRepository.php

@ -188,8 +188,8 @@ function modify_filter($id)
{ {
$code = CourseRequestManager::get_course_request_code($id); $code = CourseRequestManager::get_course_request_code($id);
$result = '<a href="course_request_edit.php?id='.$id.'&caller=0">'.Display::return_icon('edit.png', get_lang('Edit'), array('style' => 'vertical-align: middle;')).'</a>'. $result = '<a href="course_request_edit.php?id='.$id.'&caller=0">'.Display::return_icon('edit.png', get_lang('Edit'), array('style' => 'vertical-align: middle;')).'</a>'.
'&nbsp;<a href="?accept_course_request='.$id.'">'.Display::return_icon('accept.png', get_lang('AcceptThisCourseRequest'), array('style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('ANewCourseWillBeCreated'), $code), ENT_QUOTES)).'\')) return false;'),16).'</a>'. '&nbsp;<a href="?accept_course_request='.$id.'">'.Display::return_icon('accept.png', get_lang('AcceptThisCourseRequest'), array('style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('ANewCourseWillBeCreated'), $code), ENT_QUOTES)).'\')) return false;'), 16).'</a>'.
'&nbsp;<a href="?reject_course_request='.$id.'">'.Display::return_icon('error.png', get_lang('RejectThisCourseRequest'), array('style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('ACourseRequestWillBeRejected'), $code), ENT_QUOTES)).'\')) return false;'),16).'</a>'; '&nbsp;<a href="?reject_course_request='.$id.'">'.Display::return_icon('error.png', get_lang('RejectThisCourseRequest'), array('style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('ACourseRequestWillBeRejected'), $code), ENT_QUOTES)).'\')) return false;'), 16).'</a>';
if (!CourseRequestManager::additional_info_asked($id)) { if (!CourseRequestManager::additional_info_asked($id)) {
$result .= '&nbsp;<a href="?request_info='.$id.'">'.Display::return_icon('request_info.gif', get_lang('AskAdditionalInfo'), array('style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('AdditionalInfoWillBeAsked'), $code), ENT_QUOTES)).'\')) return false;')).'</a>'; $result .= '&nbsp;<a href="?request_info='.$id.'">'.Display::return_icon('request_info.gif', get_lang('AskAdditionalInfo'), array('style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('AdditionalInfoWillBeAsked'), $code), ENT_QUOTES)).'\')) return false;')).'</a>';
} }

@ -23,14 +23,14 @@ if (strcmp($backpack, $configBackpack) !== 0) {
$interbreadcrumb = array( $interbreadcrumb = array(
array( array(
'url' => api_get_path(WEB_CODE_PATH) . 'admin/index.php', 'url' => api_get_path(WEB_CODE_PATH).'admin/index.php',
'name' => get_lang('Administration') 'name' => get_lang('Administration')
) )
); );
$toolbar = Display::toolbarButton( $toolbar = Display::toolbarButton(
get_lang('ManageSkills'), get_lang('ManageSkills'),
api_get_path(WEB_CODE_PATH) . 'admin/skill_list.php', api_get_path(WEB_CODE_PATH).'admin/skill_list.php',
'list', 'list',
'primary', 'primary',
['title' => get_lang('ManageSkills')] ['title' => get_lang('ManageSkills')]

@ -30,18 +30,18 @@ $skills = $objSkill->get_all();
$interbreadcrumb = array( $interbreadcrumb = array(
array( array(
'url' => api_get_path(WEB_CODE_PATH) . 'admin/index.php', 'url' => api_get_path(WEB_CODE_PATH).'admin/index.php',
'name' => get_lang('Administration') 'name' => get_lang('Administration')
), ),
array( array(
'url' => api_get_path(WEB_CODE_PATH) . 'admin/skill_badge.php', 'url' => api_get_path(WEB_CODE_PATH).'admin/skill_badge.php',
'name' => get_lang('Badges') 'name' => get_lang('Badges')
) )
); );
$toolbar = Display::toolbarButton( $toolbar = Display::toolbarButton(
get_lang('ManageSkills'), get_lang('ManageSkills'),
api_get_path(WEB_CODE_PATH) . 'admin/skill_list.php', api_get_path(WEB_CODE_PATH).'admin/skill_list.php',
'list', 'list',
'primary', 'primary',
['title' => get_lang('ManageSkills')] ['title' => get_lang('ManageSkills')]

@ -294,7 +294,7 @@ $timeReport->sortData($withFilter);
if (isset($_GET['export'])) { if (isset($_GET['export'])) {
$dataToExport = $timeReport->prepareDataToExport($withFilter); $dataToExport = $timeReport->prepareDataToExport($withFilter);
$fileName = get_lang('TeacherTimeReport') . ' ' . api_get_local_time(); $fileName = get_lang('TeacherTimeReport').' '.api_get_local_time();
switch ($_GET['export']) { switch ($_GET['export']) {
case 'pdf': case 'pdf':

@ -18,9 +18,9 @@ $skill = $objSkill->get($skillId);
$json = array( $json = array(
'name' => $skill['name'], 'name' => $skill['name'],
'description' => $skill['description'], 'description' => $skill['description'],
'image' => api_get_path(WEB_UPLOAD_PATH) . "badges/{$skill['icon']}", 'image' => api_get_path(WEB_UPLOAD_PATH)."badges/{$skill['icon']}",
'criteria' => api_get_path(WEB_CODE_PATH) . "badge/criteria.php?id=$skillId", 'criteria' => api_get_path(WEB_CODE_PATH)."badge/criteria.php?id=$skillId",
'issuer' => api_get_path(WEB_CODE_PATH) . "badge/issuer.php", 'issuer' => api_get_path(WEB_CODE_PATH)."badge/issuer.php",
); );
echo json_encode($json); echo json_encode($json);

@ -16,7 +16,7 @@ if (!$skill) {
Display::return_message(get_lang('SkillNotFound'), 'error') Display::return_message(get_lang('SkillNotFound'), 'error')
); );
header('Location: ' . api_get_path(WEB_PATH)); header('Location: '.api_get_path(WEB_PATH));
exit; exit;
} }

@ -36,7 +36,7 @@ if (api_is_platform_admin() && ($type == 'admin' || $type == 'platform')) {
if (isset($_REQUEST['cidReq']) && !empty($_REQUEST['cidReq'])) { if (isset($_REQUEST['cidReq']) && !empty($_REQUEST['cidReq'])) {
if ($_REQUEST['cidReq'] == -1) { if ($_REQUEST['cidReq'] == -1) {
// When is out of the course tool (e.g My agenda) // When is out of the course tool (e.g My agenda)
header('Location: ' . api_get_self()); header('Location: '.api_get_self());
exit; exit;
} else { } else {
$type = 'course'; $type = 'course';

@ -27,12 +27,12 @@ Display :: display_header($nameTools);
echo Display::page_subheader( echo Display::page_subheader(
Display::return_icon( Display::return_icon(
'save_import.gif', get_lang('Backup') 'save_import.gif', get_lang('Backup')
) . '&nbsp;&nbsp;' . get_lang('Backup') ).'&nbsp;&nbsp;'.get_lang('Backup')
); );
$url = api_get_path( $url = api_get_path(
WEB_CODE_PATH WEB_CODE_PATH
) . 'coursecopy/copy_course_session_selected.php?' . api_get_cidreq(); ).'coursecopy/copy_course_session_selected.php?'.api_get_cidreq();
$link = Display::url(get_lang('CopyCourse'), $url); $link = Display::url(get_lang('CopyCourse'), $url);
?> ?>

@ -20,12 +20,12 @@ api_block_anonymous_users();
// current section // current section
$this_section = SECTION_DASHBOARD; $this_section = SECTION_DASHBOARD;
unset($_SESSION['this_section']);//for hmtl editor repository unset($_SESSION['this_section']); //for hmtl editor repository
// get actions // get actions
$actions = array('listing', 'store_user_block', 'disable_block'); $actions = array('listing', 'store_user_block', 'disable_block');
$action = 'listing'; $action = 'listing';
if (isset($_GET['action']) && in_array($_GET['action'],$actions)) { if (isset($_GET['action']) && in_array($_GET['action'], $actions)) {
$action = $_GET['action']; $action = $_GET['action'];
} }

@ -39,7 +39,7 @@ $show_web_odf = false;
$web_odf_supported_files = DocumentManager::get_web_odf_extension_list(); $web_odf_supported_files = DocumentManager::get_web_odf_extension_list();
if (in_array(strtolower($pathinfo['extension']), $web_odf_supported_files)) { if (in_array(strtolower($pathinfo['extension']), $web_odf_supported_files)) {
$show_web_odf = true; $show_web_odf = true;
} }
$file_url_web = api_get_path(WEB_COURSE_PATH).$_course['path'].'/document'.$header_file; $file_url_web = api_get_path(WEB_COURSE_PATH).$_course['path'].'/document'.$header_file;
@ -90,8 +90,8 @@ if (empty($document_data['parents'])) {
echo Display::display_header(''); echo Display::display_header('');
echo '<div class="actions">'; echo '<div class="actions">';
echo '<a href="document.php?id='.$parent_id.'">'.Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>'; echo '<a href="document.php?id='.$parent_id.'">'.Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'), '', ICON_SIZE_MEDIUM).'</a>';
echo '<a href="edit_document.php?'.api_get_cidreq().'&id='.$document_id.$req_gid.'&origin=editodf">'.Display::return_icon('edit.png',get_lang('Rename').'/'.get_lang('Comments'),'',ICON_SIZE_MEDIUM).'</a>'; echo '<a href="edit_document.php?'.api_get_cidreq().'&id='.$document_id.$req_gid.'&origin=editodf">'.Display::return_icon('edit.png', get_lang('Rename').'/'.get_lang('Comments'), '', ICON_SIZE_MEDIUM).'</a>';
echo '</div>'; echo '</div>';
// echo '<div id="odf"></div>'; // echo '<div id="odf"></div>';

@ -30,7 +30,7 @@ $form = new EvalForm(
null, null,
'add_eval_form', 'add_eval_form',
null, null,
api_get_self() . '?selectcat=' . $select_cat.'&'.api_get_cidreq() api_get_self().'?selectcat='.$select_cat.'&'.api_get_cidreq()
); );
if ($form->validate()) { if ($form->validate()) {
@ -69,23 +69,23 @@ if ($form->validate()) {
//header('Location: gradebook_add_user.php?selecteval=' . $eval->get_id()); //header('Location: gradebook_add_user.php?selecteval=' . $eval->get_id());
exit; exit;
} else { } else {
header('Location: ' . Security::remove_XSS($_SESSION['gradebook_dest']) . '?selectcat=' . $eval->get_category_id().'&'.api_get_cidreq()); header('Location: '.Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.$eval->get_category_id().'&'.api_get_cidreq());
exit; exit;
} }
} else { } else {
$val_addresult = isset($values['addresult']) ? $values['addresult'] : null; $val_addresult = isset($values['addresult']) ? $values['addresult'] : null;
if ($val_addresult == 1) { if ($val_addresult == 1) {
header('Location: gradebook_add_result.php?selecteval=' . $eval->get_id().'&'.api_get_cidreq()); header('Location: gradebook_add_result.php?selecteval='.$eval->get_id().'&'.api_get_cidreq());
exit; exit;
} else { } else {
header('Location: ' . Security::remove_XSS($_SESSION['gradebook_dest']) . '?selectcat=' . $eval->get_category_id().'&'.api_get_cidreq()); header('Location: '.Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.$eval->get_category_id().'&'.api_get_cidreq());
exit; exit;
} }
} }
} }
$interbreadcrumb[] = array( $interbreadcrumb[] = array(
'url' => Security::remove_XSS($_SESSION['gradebook_dest']) . '?selectcat=' . $select_cat.'&'.api_get_cidreq(), 'url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.$select_cat.'&'.api_get_cidreq(),
'name' => get_lang('Gradebook')) 'name' => get_lang('Gradebook'))
; ;
$this_section = SECTION_COURSES; $this_section = SECTION_COURSES;
@ -96,7 +96,7 @@ $(document).ready( function() {
$("#hid_category_id option:selected").each(function () { $("#hid_category_id option:selected").each(function () {
var cat_id = $(this).val(); var cat_id = $(this).val();
$.ajax({ $.ajax({
url: "' . api_get_path(WEB_AJAX_PATH) . 'gradebook.ajax.php?a=get_gradebook_weight", url: "' . api_get_path(WEB_AJAX_PATH).'gradebook.ajax.php?a=get_gradebook_weight",
data: "cat_id="+cat_id, data: "cat_id="+cat_id,
success: function(return_value) { success: function(return_value) {
if (return_value != 0 ) { if (return_value != 0 ) {

@ -13,7 +13,7 @@ if (api_get_setting('teachers_can_change_score_settings') != 'true') {
api_not_allowed(); api_not_allowed();
} }
$htmlHeadXtra[]= '<script> $htmlHeadXtra[] = '<script>
function plusItem(item) { function plusItem(item) {
document.getElementById(item).style.display = "inline"; document.getElementById(item).style.display = "inline";
document.getElementById("plus-"+item).style.display = "none"; document.getElementById("plus-"+item).style.display = "none";
@ -45,10 +45,10 @@ $interbreadcrumb[] = array(
); );
$select_cat = intval($_GET['selectcat']); $select_cat = intval($_GET['selectcat']);
$displayscore= ScoreDisplay :: instance(); $displayscore = ScoreDisplay :: instance();
$customdisplays = $displayscore->get_custom_score_display_settings(); $customdisplays = $displayscore->get_custom_score_display_settings();
$nr_items = (count($customdisplays) != '0' )? count($customdisplays) : '1'; $nr_items = (count($customdisplays) != '0') ? count($customdisplays) : '1';
$scoreform = new ScoreDisplayForm( $scoreform = new ScoreDisplayForm(
'scoring_system_form', 'scoring_system_form',
api_get_self().'?selectcat='.$select_cat.'&'.api_get_cidreq() api_get_self().'?selectcat='.$select_cat.'&'.api_get_cidreq()
@ -57,18 +57,18 @@ $scoreform = new ScoreDisplayForm(
if ($scoreform->validate()) { if ($scoreform->validate()) {
$value_export = ''; $value_export = '';
$value_export = $scoreform->exportValues(); $value_export = $scoreform->exportValues();
$value_export = isset($value_export) ? $scoreform->exportValues(): ''; $value_export = isset($value_export) ? $scoreform->exportValues() : '';
$values = $value_export; $values = $value_export;
// create new array of custom display settings // create new array of custom display settings
// this loop also checks if all score ranges are unique // this loop also checks if all score ranges are unique
$scoringdisplay= array (); $scoringdisplay = array();
$ranges_ok = true; $ranges_ok = true;
$endscore= isset($values['endscore']) ? $values['endscore'] : null; $endscore = isset($values['endscore']) ? $values['endscore'] : null;
$displaytext=isset($values['displaytext']) ? $values['displaytext'] : null; $displaytext = isset($values['displaytext']) ? $values['displaytext'] : null;
for ($counter= 1; $ranges_ok && $counter <= 20; $counter++) { for ($counter = 1; $ranges_ok && $counter <= 20; $counter++) {
$setting= array (); $setting = array();
$setting['score'] = $endscore[$counter]; $setting['score'] = $endscore[$counter];
$setting['display'] = $displaytext[$counter]; $setting['display'] = $displaytext[$counter];
if (!empty($setting['score'])) { if (!empty($setting['score'])) {
@ -77,12 +77,12 @@ if ($scoreform->validate()) {
$ranges_ok = false; $ranges_ok = false;
} }
} }
$scoringdisplay[]= $setting; $scoringdisplay[] = $setting;
} }
} }
if (!$ranges_ok) { if (!$ranges_ok) {
header('Location: ' . api_get_self() . '?nouniqueranges=&selectcat=' . $select_cat.'&'.api_get_cidreq()); header('Location: '.api_get_self().'?nouniqueranges=&selectcat='.$select_cat.'&'.api_get_cidreq());
exit; exit;
} }
@ -102,8 +102,8 @@ if ($scoreform->validate()) {
$this_section = SECTION_COURSES; $this_section = SECTION_COURSES;
Display :: display_header(get_lang('ScoreEdit')); Display :: display_header(get_lang('ScoreEdit'));
if (((isset($_GET['isStudentView']) && $_GET['isStudentView']=='false') || if (((isset($_GET['isStudentView']) && $_GET['isStudentView'] == 'false') ||
(isset($_GET['selectcat']) && ($_SESSION['studentview']=='teacherview'))) (isset($_GET['selectcat']) && ($_SESSION['studentview'] == 'teacherview')))
) { ) {
if (isset ($_GET['scoringupdated'])) { if (isset ($_GET['scoringupdated'])) {
Display::display_confirmation_message(get_lang('ScoringUpdated'), false); Display::display_confirmation_message(get_lang('ScoringUpdated'), false);

@ -47,10 +47,10 @@ abstract class EvalLink extends AbstractLink
$eval = $this->get_evaluation(); $eval = $this->get_evaluation();
// course/platform admin can go to the view_results page // course/platform admin can go to the view_results page
if (api_is_allowed_to_edit()) { if (api_is_allowed_to_edit()) {
return 'gradebook_view_result.php?' . api_get_cidreq() . '&selecteval=' . $eval->get_id(); return 'gradebook_view_result.php?'.api_get_cidreq().'&selecteval='.$eval->get_id();
} // students can go to the statistics page (if custom display enabled) } // students can go to the statistics page (if custom display enabled)
elseif (ScoreDisplay :: instance()->is_custom()) { elseif (ScoreDisplay :: instance()->is_custom()) {
return 'gradebook_statistics.php?' . api_get_cidreq() . '&selecteval=' . $eval->get_id(); return 'gradebook_statistics.php?'.api_get_cidreq().'&selecteval='.$eval->get_id();
} else { } else {
return null; return null;
} }
@ -176,8 +176,8 @@ abstract class EvalLink extends AbstractLink
$eval = new Evaluation(); $eval = new Evaluation();
$eval->set_category_id(-1); $eval->set_category_id(-1);
$eval->set_date(api_get_utc_datetime()); // these values will be changed $eval->set_date(api_get_utc_datetime()); // these values will be changed
$eval->set_weight(0); // when the link setter $eval->set_weight(0); // when the link setter
$eval->set_visible(0); // is called $eval->set_visible(0); // is called
$eval->set_id(-1); // a 'real' id will be set when eval is added to db $eval->set_id(-1); // a 'real' id will be set when eval is added to db
$eval->set_user_id($this->get_user_id()); $eval->set_user_id($this->get_user_id());
$eval->set_course_code($this->get_course_code()); $eval->set_course_code($this->get_course_code());

@ -54,15 +54,15 @@ class CatForm extends FormValidator
*/ */
protected function build_move_form() protected function build_move_form()
{ {
$renderer =& $this->defaultRenderer(); $renderer = & $this->defaultRenderer();
$renderer->setCustomElementTemplate('<span>{element}</span> '); $renderer->setCustomElementTemplate('<span>{element}</span> ');
$this->addElement( $this->addElement(
'static', 'static',
null, null,
null, null,
'"' . $this->category_object->get_name() . '" ' '"'.$this->category_object->get_name().'" '
); );
$this->addElement('static', null, null, get_lang('MoveTo') . ' : '); $this->addElement('static', null, null, get_lang('MoveTo').' : ');
$select = $this->addElement('select', 'move_cat', null, null); $select = $this->addElement('select', 'move_cat', null, null);
$line = null; $line = null;
foreach ($this->category_object->get_target_categories() as $cat) { foreach ($this->category_object->get_target_categories() as $cat) {
@ -70,9 +70,9 @@ class CatForm extends FormValidator
$line .= '--'; $line .= '--';
} }
if ($cat[0] != $this->category_object->get_parent_id()) { if ($cat[0] != $this->category_object->get_parent_id()) {
$select->addoption($line . ' ' . $cat[1], $cat[0]); $select->addoption($line.' '.$cat[1], $cat[0]);
} else { } else {
$select->addoption($line . ' ' . $cat[1], $cat[0], 'disabled'); $select->addoption($line.' '.$cat[1], $cat[0], 'disabled');
} }
$line = ''; $line = '';
} }
@ -155,7 +155,7 @@ class CatForm extends FormValidator
$grade_model_id = $this->category_object->get_grade_model_id(); $grade_model_id = $this->category_object->get_grade_model_id();
if (empty($links)) { if (empty($links)) {
$grade_model_id = 0; $grade_model_id = 0;
} }
$category_name = $this->category_object->get_name(); $category_name = $this->category_object->get_name();
@ -244,7 +244,7 @@ class CatForm extends FormValidator
[ [
'id' => 'skills', 'id' => 'skills',
'multiple' => 'multiple', 'multiple' => 'multiple',
'url' => api_get_path(WEB_AJAX_PATH) . 'skill.ajax.php?a=search_skills' 'url' => api_get_path(WEB_AJAX_PATH).'skill.ajax.php?a=search_skills'
] ]
); );
@ -390,14 +390,14 @@ class CatForm extends FormValidator
//only return courses that are not yet created by the teacher //only return courses that are not yet created by the teacher
foreach ($coursecat as $row) { foreach ($coursecat as $row) {
$select->addoption($row[1],$row[0]); $select->addoption($row[1], $row[0]);
} }
$this->setDefaults(array( $this->setDefaults(array(
'hid_user_id' => $this->category_object->get_user_id(), 'hid_user_id' => $this->category_object->get_user_id(),
'hid_parent_id' => $this->category_object->get_parent_id() 'hid_parent_id' => $this->category_object->get_parent_id()
)); ));
$this->addElement('hidden','hid_user_id'); $this->addElement('hidden', 'hid_user_id');
$this->addElement('hidden','hid_parent_id'); $this->addElement('hidden', 'hid_parent_id');
$this->addElement('submit', null, get_lang('Ok')); $this->addElement('submit', null, get_lang('Ok'));
} }

@ -37,7 +37,7 @@ if (api_get_setting('allow_public_certificates') === 'true') {
'actions', 'actions',
Display::toolbarButton( Display::toolbarButton(
get_lang('SearchCertificates'), get_lang('SearchCertificates'),
api_get_path(WEB_CODE_PATH) . "gradebook/search.php", api_get_path(WEB_CODE_PATH)."gradebook/search.php",
'search', 'search',
'info' 'info'
) )

@ -16,7 +16,7 @@ $isDrhOfCourse = CourseManager::isUserSubscribedInCourseAsDrh(
if (!$isDrhOfCourse) { if (!$isDrhOfCourse) {
GradebookUtils::block_students(); GradebookUtils::block_students();
} }
$interbreadcrumb[]= array ( $interbreadcrumb[] = array(
'url' => $_SESSION['gradebook_dest'], 'url' => $_SESSION['gradebook_dest'],
'name' => get_lang('Gradebook' 'name' => get_lang('Gradebook'
)); ));
@ -27,12 +27,12 @@ $allevals = $category[0]->get_evaluations($my_user_id, true);
$alllinks = $category[0]->get_links($my_user_id, true); $alllinks = $category[0]->get_links($my_user_id, true);
if ($_GET['selectcat'] != null) { if ($_GET['selectcat'] != null) {
$addparams= array ( $addparams = array(
'userid' => $my_user_id, 'userid' => $my_user_id,
'selectcat' => Security::remove_XSS($_GET['selectcat']) 'selectcat' => Security::remove_XSS($_GET['selectcat'])
); );
} else { } else {
$addparams= array ( $addparams = array(
'userid' => $my_user_id, 'userid' => $my_user_id,
'selecteval' => Security::remove_XSS($_GET['selecteval']) 'selecteval' => Security::remove_XSS($_GET['selecteval'])
); );
@ -49,7 +49,7 @@ if (isset ($_GET['exportpdf'])) {
$newarray[] = array_slice($data, 1); $newarray[] = array_slice($data, 1);
} }
$userinfo = api_get_user_info($my_user_id); $userinfo = api_get_user_info($my_user_id);
$html .= get_lang('Results').' : '.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).' ('. api_convert_and_format_date(null, DATE_FORMAT_SHORT). ' ' . api_convert_and_format_date(null, TIME_NO_SEC_FORMAT) .')'; $html .= get_lang('Results').' : '.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).' ('.api_convert_and_format_date(null, DATE_FORMAT_SHORT).' '.api_convert_and_format_date(null, TIME_NO_SEC_FORMAT).')';
if ($displayscore->is_custom()) { if ($displayscore->is_custom()) {
$header_names = array( $header_names = array(
@ -95,23 +95,23 @@ if (isset ($_GET['exportpdf'])) {
$actions = '<div class="actions">'; $actions = '<div class="actions">';
if (isset($_GET['selectcat'])) { if (isset($_GET['selectcat'])) {
$interbreadcrumb[]= array ('url' => 'gradebook_flatview.php?selectcat=' . Security::remove_XSS($_GET['selectcat']), 'name' => get_lang('FlatView')); $interbreadcrumb[] = array('url' => 'gradebook_flatview.php?selectcat='.Security::remove_XSS($_GET['selectcat']), 'name' => get_lang('FlatView'));
$actions.= '<a href=gradebook_flatview.php?selectcat=' .Security::remove_XSS($_GET['selectcat']) . '>' . Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('FlatView'),'',ICON_SIZE_MEDIUM).'</a>'; $actions .= '<a href=gradebook_flatview.php?selectcat='.Security::remove_XSS($_GET['selectcat']).'>'.Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('FlatView'), '', ICON_SIZE_MEDIUM).'</a>';
} }
if (isset ($_GET['selecteval'])) { if (isset ($_GET['selecteval'])) {
$interbreadcrumb[]= array ( $interbreadcrumb[] = array(
'url' => 'gradebook_view_result.php?selecteval=' . Security::remove_XSS($_GET['selecteval']), 'url' => 'gradebook_view_result.php?selecteval='.Security::remove_XSS($_GET['selecteval']),
'name' => get_lang('ViewResult' 'name' => get_lang('ViewResult'
)); ));
$actions.= '<a href=gradebook_view_result.php?selecteval=' . Security::remove_XSS($_GET['selecteval']) . '> $actions .= '<a href=gradebook_view_result.php?selecteval='.Security::remove_XSS($_GET['selecteval']).'>
'.Display::return_icon('back.png', get_lang('BackToEvaluation'),'',ICON_SIZE_MEDIUM).'</a>'; '.Display::return_icon('back.png', get_lang('BackToEvaluation'), '', ICON_SIZE_MEDIUM).'</a>';
} }
$actions.= '<a href="' . api_get_self() . '?exportpdf=&userid='.Security::remove_XSS($_GET['userid']).'&selectcat=' . $category[0]->get_id() . '" target="_blank"> $actions .= '<a href="'.api_get_self().'?exportpdf=&userid='.Security::remove_XSS($_GET['userid']).'&selectcat='.$category[0]->get_id().'" target="_blank">
' . Display::return_icon('pdf.png', get_lang('ExportPDF'),'',ICON_SIZE_MEDIUM).'</a>'; ' . Display::return_icon('pdf.png', get_lang('ExportPDF'), '', ICON_SIZE_MEDIUM).'</a>';
$actions.='</div>'; $actions .= '</div>';
Display :: display_header(get_lang('ResultsPerUser')); Display :: display_header(get_lang('ResultsPerUser'));
echo $actions; echo $actions;

@ -117,7 +117,7 @@ $social_avatar_block = SocialManager::show_social_avatar_block(
$group_id $group_id
); );
$social_menu_block = SocialManager::show_social_menu('member_list', $group_id); $social_menu_block = SocialManager::show_social_menu('member_list', $group_id);
$social_right_content = '<h2>' . $group_info['name'] . '</h2>'; $social_right_content = '<h2>'.$group_info['name'].'</h2>';
foreach ($users as $user) { foreach ($users as $user) {
switch ($user['relation_type']) { switch ($user['relation_type']) {
@ -136,24 +136,24 @@ foreach ($users as $user) {
) )
) )
) { ) {
$user['link'] = '<a href="group_members.php?id=' . $group_id . '&u=' . $user['id'] . '&action=delete">' . $user['link'] = '<a href="group_members.php?id='.$group_id.'&u='.$user['id'].'&action=delete">'.
Display::return_icon( Display::return_icon(
'delete.png', 'delete.png',
get_lang('DeleteFromGroup') get_lang('DeleteFromGroup')
) . '</a>' . ).'</a>'.
'<a href="group_members.php?id=' . $group_id . '&u=' . $user['id'] . '&action=set_moderator">' . '<a href="group_members.php?id='.$group_id.'&u='.$user['id'].'&action=set_moderator">'.
Display::return_icon( Display::return_icon(
'social_moderator_add.png', 'social_moderator_add.png',
get_lang('AddModerator') get_lang('AddModerator')
) . '</a>'; ).'</a>';
} }
break; break;
case GROUP_USER_PERMISSION_PENDING_INVITATION: case GROUP_USER_PERMISSION_PENDING_INVITATION:
$user['link'] = '<a href="group_members.php?id=' . $group_id . '&u=' . $user['id'] . '&action=add">' . $user['link'] = '<a href="group_members.php?id='.$group_id.'&u='.$user['id'].'&action=add">'.
Display::return_icon( Display::return_icon(
'pending_invitation.png', 'pending_invitation.png',
get_lang('PendingInvitation') get_lang('PendingInvitation')
) . '</a>'; ).'</a>';
break; break;
case GROUP_USER_PERMISSION_MODERATOR: case GROUP_USER_PERMISSION_MODERATOR:
$user['link'] = Display::return_icon( $user['link'] = Display::return_icon(
@ -162,17 +162,17 @@ foreach ($users as $user) {
); );
//only group admin can manage moderators //only group admin can manage moderators
if ($user_role == GROUP_USER_PERMISSION_ADMIN) { if ($user_role == GROUP_USER_PERMISSION_ADMIN) {
$user['link'] .= '<a href="group_members.php?id=' . $group_id . '&u=' . $user['id'] . '&action=delete_moderator">'. $user['link'] .= '<a href="group_members.php?id='.$group_id.'&u='.$user['id'].'&action=delete_moderator">'.
Display::return_icon( Display::return_icon(
'social_moderator_delete.png', 'social_moderator_delete.png',
get_lang('DeleteModerator') get_lang('DeleteModerator')
) . '</a>'; ).'</a>';
} }
break; break;
} }
$userPicture = UserManager::getUserPicture($user['id']); $userPicture = UserManager::getUserPicture($user['id']);
$user['image'] = '<img src="' . $userPicture . '" width="50px" height="50px" />'; $user['image'] = '<img src="'.$userPicture.'" width="50px" height="50px" />';
$new_member_list[] = $user; $new_member_list[] = $user;
} }
if (count($new_member_list) > 0) { if (count($new_member_list) > 0) {

@ -72,8 +72,8 @@ if (!empty($items)) {
$usersAdded[] = $myUserId; $usersAdded[] = $myUserId;
$userInfo = api_get_user_info($myUserId); $userInfo = api_get_user_info($myUserId);
$url = api_get_path(WEB_CODE_PATH).'work/add_user.php?action=delete&id='.$workId.'&user_id='.$myUserId; $url = api_get_path(WEB_CODE_PATH).'work/add_user.php?action=delete&id='.$workId.'&user_id='.$myUserId;
$link = Display::url('<em class="fa fa-trash"></em> ' . get_lang('Delete'), $url, array('class' => 'btn btn-danger btn-sm')); $link = Display::url('<em class="fa fa-trash"></em> '.get_lang('Delete'), $url, array('class' => 'btn btn-danger btn-sm'));
echo '<li class="list-group-item">' . $userInfo['complete_name_with_username'] . '<div class="pull-right">' . $link . '</div></li>'; echo '<li class="list-group-item">'.$userInfo['complete_name_with_username'].'<div class="pull-right">'.$link.'</div></li>';
} }
echo '</ul>'; echo '</ul>';
} }
@ -106,8 +106,8 @@ if (!empty($userToAddList)) {
foreach ($userToAddList as $user) { foreach ($userToAddList as $user) {
$userName = api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].') '; $userName = api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].') ';
$url = api_get_path(WEB_CODE_PATH).'work/add_user.php?action=add&id='.$workId.'&user_id='.$user['user_id']; $url = api_get_path(WEB_CODE_PATH).'work/add_user.php?action=add&id='.$workId.'&user_id='.$user['user_id'];
$link = Display::url('<em class="fa fa-plus"></em> ' . get_lang('Add'), $url, array('class' => 'btn btn-primary btn-sm')); $link = Display::url('<em class="fa fa-plus"></em> '.get_lang('Add'), $url, array('class' => 'btn btn-primary btn-sm'));
echo '<li class="list-group-item">' . $userName . '<div class="pull-right"> ' . $link . '</div></li>'; echo '<li class="list-group-item">'.$userName.'<div class="pull-right"> '.$link.'</div></li>';
} }
echo '</ul>'; echo '</ul>';
} else { } else {

@ -28,7 +28,7 @@ if (api_is_platform_admin() == false && $locked == true) {
$htmlHeadXtra[] = to_javascript_work(); $htmlHeadXtra[] = to_javascript_work();
$interbreadcrumb[] = array( $interbreadcrumb[] = array(
'url' => api_get_path(WEB_CODE_PATH) . 'work/work.php?' . api_get_cidreq(), 'url' => api_get_path(WEB_CODE_PATH).'work/work.php?'.api_get_cidreq(),
'name' => get_lang('StudentPublications') 'name' => get_lang('StudentPublications')
); );
$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Edit')); $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Edit'));
@ -36,7 +36,7 @@ $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Edit'));
$form = new FormValidator( $form = new FormValidator(
'edit_dir', 'edit_dir',
'post', 'post',
api_get_path(WEB_CODE_PATH) . 'work/edit_work.php?id=' . $workId . '&' . api_get_cidreq() api_get_path(WEB_CODE_PATH).'work/edit_work.php?id='.$workId.'&'.api_get_cidreq()
); );
$form->addElement('header', get_lang('Edit')); $form->addElement('header', get_lang('Edit'));

@ -1,17 +1,17 @@
<?php <?php
// Show the Shibboleth button to login using SHIBBOLETH // Show the Shibboleth button to login using SHIBBOLETH
$_template['show_message'] = false; $_template['show_message'] = false;
if (api_is_anonymous()) { if (api_is_anonymous()) {
$_template['show_message'] = true; $_template['show_message'] = true;
// the default title // the default title
$button_label = "Connexion via Shibboleth"; $button_label = "Connexion via Shibboleth";
if (!empty($plugin_info['settings']['add_shibboleth_login_button_shibboleth_button_label'])) { if (!empty($plugin_info['settings']['add_shibboleth_login_button_shibboleth_button_label'])) {
$button_label = api_htmlentities($plugin_info['settings']['add_shibboleth_login_button_shibboleth_button_label']); $button_label = api_htmlentities($plugin_info['settings']['add_shibboleth_login_button_shibboleth_button_label']);
} }
// the comm // the comm
$comm_label = api_htmlentities($plugin_info['settings']['add_shibboleth_login_button_shibboleth_button_comment']);; $comm_label = api_htmlentities($plugin_info['settings']['add_shibboleth_login_button_shibboleth_button_comment']); ;
// URL of the image // URL of the image
$url_label = $plugin_info['settings']['add_shibboleth_login_button_shibboleth_image_url']; $url_label = $plugin_info['settings']['add_shibboleth_login_button_shibboleth_image_url'];

@ -8,7 +8,7 @@
/** /**
* Init * Init
*/ */
require_once __DIR__ . '/../config.php'; require_once __DIR__.'/../config.php';
$plugin = AdvancedSubscriptionPlugin::create(); $plugin = AdvancedSubscriptionPlugin::create();
// Get validation hash // Get validation hash
@ -120,8 +120,7 @@ if ($verified) {
$isWesternNameOrder = api_is_western_name_order(); $isWesternNameOrder = api_is_western_name_order();
foreach ($adminsArray as &$admin) { foreach ($adminsArray as &$admin) {
$admin['complete_name'] = $isWesternNameOrder ? $admin['complete_name'] = $isWesternNameOrder ?
$admin['firstname'] . ', ' . $admin['lastname'] : $admin['firstname'].', '.$admin['lastname'] : $admin['lastname'].', '.$admin['firstname']
$admin['lastname'] . ', ' . $admin['firstname']
; ;
} }
unset($admin); unset($admin);
@ -140,8 +139,8 @@ if ($verified) {
$res = $plugin->updateQueueStatus($data, ADVANCED_SUBSCRIPTION_QUEUE_STATUS_BOSS_APPROVED); $res = $plugin->updateQueueStatus($data, ADVANCED_SUBSCRIPTION_QUEUE_STATUS_BOSS_APPROVED);
if (!empty($res)) { if (!empty($res)) {
// Prepare admin url // Prepare admin url
$data['admin_view_url'] = api_get_path(WEB_PLUGIN_PATH) . $data['admin_view_url'] = api_get_path(WEB_PLUGIN_PATH).
'advanced_subscription/src/admin_view.php?s=' . $data['sessionId']; 'advanced_subscription/src/admin_view.php?s='.$data['sessionId'];
// Send mails // Send mails
$result['mailIds'] = $plugin->sendMail( $result['mailIds'] = $plugin->sendMail(
$data, $data,
@ -276,8 +275,7 @@ if ($verified) {
$isWesternNameOrder = api_is_western_name_order(); $isWesternNameOrder = api_is_western_name_order();
foreach ($adminsArray as &$admin) { foreach ($adminsArray as &$admin) {
$admin['complete_name'] = $isWesternNameOrder ? $admin['complete_name'] = $isWesternNameOrder ?
$admin['firstname'] . ', ' . $admin['lastname'] : $admin['firstname'].', '.$admin['lastname'] : $admin['lastname'].', '.$admin['firstname']
$admin['lastname'] . ', ' . $admin['firstname']
; ;
} }
unset($admin); unset($admin);
@ -288,7 +286,7 @@ if ($verified) {
$data['session'] = $sessionArray; $data['session'] = $sessionArray;
$data['signature'] = api_get_setting('Institution'); $data['signature'] = api_get_setting('Institution');
$data['admin_view_url'] = api_get_path(WEB_PLUGIN_PATH) $data['admin_view_url'] = api_get_path(WEB_PLUGIN_PATH)
. 'advanced_subscription/src/admin_view.php?s=' . $data['sessionId']; . 'advanced_subscription/src/admin_view.php?s='.$data['sessionId'];
// Check if exist and action in data // Check if exist and action in data
if (empty($data['mailAction'])) { if (empty($data['mailAction'])) {
// set action in data by new status // set action in data by new status

@ -6,7 +6,7 @@
* @package chamilo.plugin.advanced_subscription * @package chamilo.plugin.advanced_subscription
*/ */
require_once __DIR__ . '/../config.php'; require_once __DIR__.'/../config.php';
/** /**
* Class HookAdvancedSubscription extends the HookObserver to implements * Class HookAdvancedSubscription extends the HookObserver to implements
@ -420,7 +420,7 @@ class HookAdvancedSubscription extends HookObserver implements
if ($debug) { if ($debug) {
error_log(__FUNCTION__); error_log(__FUNCTION__);
error_log('Params ' . print_r($params, 1)); error_log('Params '.print_r($params, 1));
} }
if (!WSHelperVerifyKey($params)) { if (!WSHelperVerifyKey($params)) {
@ -471,7 +471,7 @@ class HookAdvancedSubscription extends HookObserver implements
if ($debug) { if ($debug) {
error_log('WSUserSubscribedInCourse'); error_log('WSUserSubscribedInCourse');
error_log('Params ' . print_r($params, 1)); error_log('Params '.print_r($params, 1));
} }
if (!WSHelperVerifyKey($params)) { if (!WSHelperVerifyKey($params)) {
return return_error(WS_ERROR_SECRET_KEY); return return_error(WS_ERROR_SECRET_KEY);
@ -576,7 +576,7 @@ class HookAdvancedSubscription extends HookObserver implements
if ($debug) { if ($debug) {
error_log('WSListSessionsDetailsByCategory'); error_log('WSListSessionsDetailsByCategory');
error_log('Params ' . print_r($params, 1)); error_log('Params '.print_r($params, 1));
} }
$secretKey = $params['secret_key']; $secretKey = $params['secret_key'];

@ -7,7 +7,7 @@
/** /**
* Init * Init
*/ */
require_once __DIR__ . '/../config.php'; require_once __DIR__.'/../config.php';
// protect // protect
api_protect_admin_script(); api_protect_admin_script();
// start plugin // start plugin
@ -85,8 +85,7 @@ if (!empty($sessionId)) {
$data['newStatus'] = ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_DISAPPROVED; $data['newStatus'] = ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_DISAPPROVED;
$student['rejectUrl'] = $plugin->getQueueUrl($data); $student['rejectUrl'] = $plugin->getQueueUrl($data);
$student['complete_name'] = $isWesternNameOrder ? $student['complete_name'] = $isWesternNameOrder ?
$student['firstname'] . ', ' . $student['lastname'] : $student['firstname'].', '.$student['lastname'] : $student['lastname'].', '.$student['firstname'];
$student['lastname'] . ', ' . $student['firstname'];
} }
$tpl->assign('session', $sessionArray); $tpl->assign('session', $sessionArray);
$tpl->assign('students', $studentList['students']); $tpl->assign('students', $studentList['students']);

@ -5,7 +5,7 @@
* @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com> * @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
* @package chamilo.plugin.advanced_subscription * @package chamilo.plugin.advanced_subscription
*/ */
require_once __DIR__ . '/../config.php'; require_once __DIR__.'/../config.php';
$plugin = AdvancedSubscriptionPlugin::create(); $plugin = AdvancedSubscriptionPlugin::create();

@ -8,7 +8,7 @@
/** /**
* Init * Init
*/ */
require_once __DIR__ . '/../config.php'; require_once __DIR__.'/../config.php';
$plugin = AdvancedSubscriptionPlugin::create(); $plugin = AdvancedSubscriptionPlugin::create();
// Get validation hash // Get validation hash

@ -7,7 +7,7 @@
//exit; //exit;
require_once __DIR__ . '/../../config.php'; require_once __DIR__.'/../../config.php';
api_protect_admin_script(); api_protect_admin_script();

@ -4,7 +4,7 @@
* This script generates four session categories. * This script generates four session categories.
* @package chamilo.plugin.advanced_subscription * @package chamilo.plugin.advanced_subscription
*/ */
require_once __DIR__ . '/../../config.php'; require_once __DIR__.'/../../config.php';
api_protect_admin_script(); api_protect_admin_script();

@ -34,7 +34,7 @@ if (api_is_anonymous()) {
$form = new FormValidator('form'); $form = new FormValidator('form');
$renderer =& $form->defaultRenderer(); $renderer = & $form->defaultRenderer();
$renderer->setFormTemplate('<form{attributes}><table border="0" cellpadding="5" cellspacing="0" width="100%">{content}</table></form>'); $renderer->setFormTemplate('<form{attributes}><table border="0" cellpadding="5" cellspacing="0" width="100%">{content}</table></form>');
$renderersetCustomElementTemplate->setCustomElementTemplate('<tr><td>{element}</td></tr>'); $renderersetCustomElementTemplate->setCustomElementTemplate('<tr><td>{element}</td></tr>');
@ -54,7 +54,7 @@ if (api_is_anonymous()) {
$form2 = new FormValidator('form'); $form2 = new FormValidator('form');
if (!empty($option2) && !empty($urlOption2)) { if (!empty($option2) && !empty($urlOption2)) {
$renderer =& $form2->defaultRenderer(); $renderer = & $form2->defaultRenderer();
$renderer->setHeaderTemplate(''); $renderer->setHeaderTemplate('');
$renderer->setFormTemplate('<form{attributes}><table border="0" cellpadding="5" cellspacing="0" width="100%">{content}</table></form>'); $renderer->setFormTemplate('<form{attributes}><table border="0" cellpadding="5" cellspacing="0" width="100%">{content}</table></form>');
$renderer->setCustomElementTemplate('<tr><td>{element}</td></tr>'); $renderer->setCustomElementTemplate('<tr><td>{element}</td></tr>');

@ -41,9 +41,9 @@ $defaults['option2'] = api_get_plugin_setting('before_login', 'option2');
$defaults['option1_url'] = api_get_plugin_setting('before_login', 'option1_url'); $defaults['option1_url'] = api_get_plugin_setting('before_login', 'option1_url');
$defaults['option2_url'] = api_get_plugin_setting('before_login', 'option2_url'); $defaults['option2_url'] = api_get_plugin_setting('before_login', 'option2_url');
$plugin_info['templates'] = array('template.tpl'); $plugin_info['templates'] = array('template.tpl');
if (file_exists(__DIR__.'/custom.template.tpl')) { if (file_exists(__DIR__.'/custom.template.tpl')) {
$plugin_info['templates'] = array( 'custom.template.tpl'); $plugin_info['templates'] = array('custom.template.tpl');
} }
$form->setDefaults($defaults); $form->setDefaults($defaults);

@ -1,4 +1,4 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
require_once __DIR__ . '/../../main/inc/global.inc.php'; require_once __DIR__.'/../../main/inc/global.inc.php';

@ -40,8 +40,8 @@ if ($ack == "SUCCESS" || $ack == "SUCCESSWITHWARNING") {
$ErrorSeverityCode = urldecode($resArray["L_SEVERITYCODE0"]); $ErrorSeverityCode = urldecode($resArray["L_SEVERITYCODE0"]);
echo "SetExpressCheckout API call failed. "; echo "SetExpressCheckout API call failed. ";
echo "Detailed Error Message: " . $ErrorLongMsg; echo "Detailed Error Message: ".$ErrorLongMsg;
echo "Short Error Message: " . $ErrorShortMsg; echo "Short Error Message: ".$ErrorShortMsg;
echo "Error Code: " . $ErrorCode; echo "Error Code: ".$ErrorCode;
echo "Error Severity Code: " . $ErrorSeverityCode; echo "Error Severity Code: ".$ErrorSeverityCode;
} }

@ -56,7 +56,7 @@ if ($form->validate()) {
unset($_SESSION['bc_sale_id']); unset($_SESSION['bc_sale_id']);
header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/index.php'); header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/index.php');
exit; exit;
} }
@ -165,7 +165,7 @@ if ($form->validate()) {
} }
unset($_SESSION['bc_sale_id']); unset($_SESSION['bc_sale_id']);
header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/course_catalog.php'); header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/course_catalog.php');
exit; exit;
} }

@ -10,5 +10,5 @@
/** /**
* Queries * Queries
*/ */
require_once dirname(__FILE__) . '/config.php'; require_once dirname(__FILE__).'/config.php';
BuyCoursesPlugin::create()->uninstall(); BuyCoursesPlugin::create()->uninstall();

@ -421,7 +421,7 @@ class CourseLegalPlugin extends Plugin
array('id = ? ' => $id) array('id = ? ' => $id)
); );
if (!empty($legalData['filename'])) { if (!empty($legalData['filename'])) {
$fileToDelete = $coursePath . '/' . $legalData['filename']; $fileToDelete = $coursePath.'/'.$legalData['filename'];
if (file_exists($fileToDelete)) { if (file_exists($fileToDelete)) {
unlink($fileToDelete); unlink($fileToDelete);
} }

@ -1,7 +1,7 @@
<?php <?php
/* For license terms, see /license.txt */ /* For license terms, see /license.txt */
require_once dirname(__FILE__) . '/config.php'; require_once dirname(__FILE__).'/config.php';
if (!api_is_platform_admin()) { if (!api_is_platform_admin()) {
die ('You must have admin permissions to install plugins'); die ('You must have admin permissions to install plugins');

@ -1,7 +1,7 @@
<?php <?php
/* For license terms, see /license.txt */ /* For license terms, see /license.txt */
require_once dirname(__FILE__) . '/config.php'; require_once dirname(__FILE__).'/config.php';
// Course legal // Course legal
$enabled = api_get_plugin_setting('courselegal', 'tool_enable'); $enabled = api_get_plugin_setting('courselegal', 'tool_enable');

@ -1,6 +1,6 @@
<?php <?php
/* For license terms, see /license.txt */ /* For license terms, see /license.txt */
require_once dirname(__FILE__) . '/config.php'; require_once dirname(__FILE__).'/config.php';
// Course legal // Course legal
$enabled = api_get_plugin_setting('courselegal', 'tool_enable'); $enabled = api_get_plugin_setting('courselegal', 'tool_enable');
@ -19,7 +19,7 @@ $sessionId = api_get_session_id();
$url = api_get_self().'?'.api_get_cidreq(); $url = api_get_self().'?'.api_get_cidreq();
$action = isset($_GET['action']) ? $_GET['action'] : null; $action = isset($_GET['action']) ? $_GET['action'] : null;
switch($action) { switch ($action) {
case 'resend': case 'resend':
if (isset($_GET['user_id'])) { if (isset($_GET['user_id'])) {
$legal->updateMailAgreementLink($_GET['user_id'], $courseId, $sessionId); $legal->updateMailAgreementLink($_GET['user_id'], $courseId, $sessionId);

@ -5,4 +5,4 @@
* @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com> * @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
* @package chamilo.plugin.createDrupalUser * @package chamilo.plugin.createDrupalUser
*/ */
require_once __DIR__ . '/config.php'; require_once __DIR__.'/config.php';

@ -5,6 +5,6 @@
* @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com> * @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
* @package chamilo.plugin.createDrupalUser * @package chamilo.plugin.createDrupalUser
*/ */
require_once __DIR__ . '/config.php'; require_once __DIR__.'/config.php';
CreateDrupalUser::create()->install(); CreateDrupalUser::create()->install();

@ -29,7 +29,7 @@ class HookCreateDrupalUser extends HookObserver implements HookCreateUserObserve
$data = $hook->getEventData(); $data = $hook->getEventData();
$drupalDomain = CreateDrupalUser::create()->get('drupal_domain'); $drupalDomain = CreateDrupalUser::create()->get('drupal_domain');
$drupalDomain = rtrim($drupalDomain, '/') . '/'; $drupalDomain = rtrim($drupalDomain, '/').'/';
if ($data['type'] === HOOK_EVENT_TYPE_POST) { if ($data['type'] === HOOK_EVENT_TYPE_POST) {
$return = $data['return']; $return = $data['return'];
@ -50,7 +50,7 @@ class HookCreateDrupalUser extends HookObserver implements HookCreateUserObserve
); );
$options = array( $options = array(
'location' => $drupalDomain . 'sites/all/modules/chamilo/soap.php?wsdl', 'location' => $drupalDomain.'sites/all/modules/chamilo/soap.php?wsdl',
'uri' => $drupalDomain 'uri' => $drupalDomain
); );

@ -5,6 +5,6 @@
* @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com> * @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
* @package chamilo.plugin.createDrupalUser * @package chamilo.plugin.createDrupalUser
*/ */
require_once __DIR__ . '/config.php'; require_once __DIR__.'/config.php';
CreateDrupalUser::create()->uninstall(); CreateDrupalUser::create()->uninstall();

@ -21,12 +21,12 @@ class BlockStudent extends Block
/** /**
* Constructor * Constructor
*/ */
public function __construct ($user_id) public function __construct($user_id)
{ {
$this->user_id = $user_id; $this->user_id = $user_id;
$this->path = 'block_student'; $this->path = 'block_student';
if ($this->is_block_visible_for_user($user_id)) { if ($this->is_block_visible_for_user($user_id)) {
$this->students = UserManager::get_users_followed_by_drh($user_id, STUDENT); $this->students = UserManager::get_users_followed_by_drh($user_id, STUDENT);
} }
} }
@ -61,7 +61,7 @@ class BlockStudent extends Block
$html = '<div class="panel panel-default" id="intro"> $html = '<div class="panel panel-default" id="intro">
<div class="panel-heading"> <div class="panel-heading">
'.get_lang('StudentsInformationsList').' '.get_lang('StudentsInformationsList').'
<div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'"> <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'">
<em class="fa fa-times"></em> <em class="fa fa-times"></em>
</a> </a>
</div> </div>
@ -102,9 +102,9 @@ class BlockStudent extends Block
$courses_by_user = CourseManager::get_courses_list_by_user_id($student['user_id'], true); $courses_by_user = CourseManager::get_courses_list_by_user_id($student['user_id'], true);
$count_courses = count($courses_by_user); $count_courses = count($courses_by_user);
$rowspan = $count_courses?$count_courses+1:2; $rowspan = $count_courses ? $count_courses + 1 : 2;
if ($i%2 == 0) { if ($i % 2 == 0) {
$style = ' style="background-color:#F2F2F2" '; $style = ' style="background-color:#F2F2F2" ';
} else { } else {
$style = ' style="background-color:#FFF" '; $style = ' style="background-color:#FFF" ';
@ -169,7 +169,7 @@ class BlockStudent extends Block
$student_id = $student['user_id']; $student_id = $student['user_id'];
$firstname = $student['firstname']; $firstname = $student['firstname'];
$lastname = $student['lastname']; $lastname = $student['lastname'];
$username = $student['username']; $username = $student['username'];
// get average of faults in attendances by student // get average of faults in attendances by student
@ -188,7 +188,7 @@ class BlockStudent extends Block
$cats = Category::load(null, null, $course_code, null, null, null, false); $cats = Category::load(null, null, $course_code, null, null, null, false);
$scoretotal = array(); $scoretotal = array();
if (isset($cats) && isset($cats[0])) { if (isset($cats) && isset($cats[0])) {
$scoretotal= $cats[0]->calc_score($student_id, null, $course_code); $scoretotal = $cats[0]->calc_score($student_id, null, $course_code);
} }
if (!empty($scoretotal)) { if (!empty($scoretotal)) {
@ -198,10 +198,10 @@ class BlockStudent extends Block
} }
if (!empty($weight)) { if (!empty($weight)) {
$evaluations_avg = '<a title="'.get_lang('GoToStudentDetails').'" href="'.api_get_path(WEB_CODE_PATH).'mySpace/myStudents.php?student='.$student_id.'">'.round($score,2).'/'.round($weight,2).'('.round(($score / $weight) * 100,2) . ' %)</a>'; $evaluations_avg = '<a title="'.get_lang('GoToStudentDetails').'" href="'.api_get_path(WEB_CODE_PATH).'mySpace/myStudents.php?student='.$student_id.'">'.round($score, 2).'/'.round($weight, 2).'('.round(($score / $weight) * 100, 2).' %)</a>';
} }
if ($i%2 == 0) { if ($i % 2 == 0) {
$class_tr = 'row_odd'; $class_tr = 'row_odd';
} else { } else {
$class_tr = 'row_even'; $class_tr = 'row_even';

@ -29,10 +29,10 @@ class BlockTeacherGraph extends Block
/** /**
* Controller * Controller
*/ */
public function __construct ($user_id) public function __construct($user_id)
{ {
$this->user_id = $user_id; $this->user_id = $user_id;
$this->path = 'block_teacher_graph'; $this->path = 'block_teacher_graph';
if ($this->is_block_visible_for_user($user_id)) { if ($this->is_block_visible_for_user($user_id)) {
$this->teachers = UserManager::get_users_followed_by_drh($user_id, COURSEMANAGER); $this->teachers = UserManager::get_users_followed_by_drh($user_id, COURSEMANAGER);
} }
@ -68,7 +68,7 @@ class BlockTeacherGraph extends Block
$html = ' $html = '
<div class="panel panel-default" id="intro"> <div class="panel panel-default" id="intro">
<div class="panel-heading">'.get_lang('TeachersInformationsGraph').' <div class="panel-heading">'.get_lang('TeachersInformationsGraph').'
<div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'"> <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'">
<em class="fa fa-times"></em> <em class="fa fa-times"></em>
</a></div> </a></div>
</div> </div>
@ -107,7 +107,7 @@ class BlockTeacherGraph extends Block
foreach ($a_last_week as $day) { foreach ($a_last_week as $day) {
// day is received as y-m-d 12:00:00 // day is received as y-m-d 12:00:00
$start_date = api_get_utc_datetime($day); $start_date = api_get_utc_datetime($day);
$end_date = api_get_utc_datetime($day+(3600*24-1)); $end_date = api_get_utc_datetime($day + (3600 * 24 - 1));
$time_on_platform_by_day = Tracking::get_time_spent_on_the_platform($user_id, 'custom', $start_date, $end_date); $time_on_platform_by_day = Tracking::get_time_spent_on_the_platform($user_id, 'custom', $start_date, $end_date);
$hours = floor($time_on_platform_by_day / 3600); $hours = floor($time_on_platform_by_day / 3600);
@ -117,26 +117,26 @@ class BlockTeacherGraph extends Block
$dataSet->addPoints($time_by_days, $username); $dataSet->addPoints($time_by_days, $username);
} }
$last_week = date('Y-m-d',$a_last_week[0]).' '.get_lang('To').' '.date('Y-m-d', $a_last_week[6]); $last_week = date('Y-m-d', $a_last_week[0]).' '.get_lang('To').' '.date('Y-m-d', $a_last_week[6]);
$days_on_week = array(); $days_on_week = array();
foreach ($a_last_week as $weekday) { foreach ($a_last_week as $weekday) {
$days_on_week[] = date('d/m',$weekday); $days_on_week[] = date('d/m', $weekday);
} }
$dataSet->addPoints($days_on_week, 'Days'); $dataSet->addPoints($days_on_week, 'Days');
$dataSet->setAbscissaName($last_week); $dataSet->setAbscissaName($last_week);
$dataSet->setAxisName(0, get_lang('Minutes')); $dataSet->setAxisName(0, get_lang('Minutes'));
$dataSet->setAbscissa('Days'); $dataSet->setAbscissa('Days');
$dataSet->loadPalette(api_get_path(SYS_CODE_PATH) . 'palettes/pchart/default.color', true); $dataSet->loadPalette(api_get_path(SYS_CODE_PATH).'palettes/pchart/default.color', true);
// Cache definition // Cache definition
$cachePath = api_get_path(SYS_ARCHIVE_PATH); $cachePath = api_get_path(SYS_ARCHIVE_PATH);
$myCache = new pCache(array('CacheFolder' => substr($cachePath, 0, strlen($cachePath) - 1))); $myCache = new pCache(array('CacheFolder' => substr($cachePath, 0, strlen($cachePath) - 1)));
$chartHash = $myCache->getHash($dataSet); $chartHash = $myCache->getHash($dataSet);
if ($myCache->isInCache($chartHash)) { if ($myCache->isInCache($chartHash)) {
$imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash; $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash;
$myCache->saveFromCache($chartHash, $imgPath); $myCache->saveFromCache($chartHash, $imgPath);
$imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash; $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash;
} else { } else {
/* Create the pChart object */ /* Create the pChart object */
@ -153,7 +153,7 @@ class BlockTeacherGraph extends Block
$myPicture->drawRectangle(0, 0, $widthSize - 1, $heightSize - 1, array('R' => 0, 'G' => 0, 'B' => 0)); $myPicture->drawRectangle(0, 0, $widthSize - 1, $heightSize - 1, array('R' => 0, 'G' => 0, 'B' => 0));
/* Set the default font */ /* Set the default font */
$myPicture->setFontProperties(array('FontName' => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf', 'FontSize' => 10)); $myPicture->setFontProperties(array('FontName' => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf', 'FontSize' => 10));
/* Do NOT Write the chart title */ /* Do NOT Write the chart title */
@ -189,11 +189,11 @@ class BlockTeacherGraph extends Block
/* Write and save into cache */ /* Write and save into cache */
$myCache->writeToCache($chartHash, $myPicture); $myCache->writeToCache($chartHash, $myPicture);
$imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash; $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash;
$myCache->saveFromCache($chartHash, $imgPath); $myCache->saveFromCache($chartHash, $imgPath);
$imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash; $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash;
} }
$graph = '<img src="' . $imgPath . '" >'; $graph = '<img src="'.$imgPath.'" >';
} else { } else {
$graph = '<p>'.api_convert_encoding(get_lang('GraphicNotAvailable'), 'UTF-8').'</p>'; $graph = '<p>'.api_convert_encoding(get_lang('GraphicNotAvailable'), 'UTF-8').'</p>';
} }

@ -1,3 +1,3 @@
<?php <?php
$strings['WelcomeToChamiloUserX'] = "Bienvenido a Chamilo %s!"; $strings['WelcomeToChamiloUserX'] = "Bienvenido a Chamilo %s!";

@ -8,8 +8,8 @@
/** /**
* Init * Init
*/ */
require_once __DIR__ . '/../../../main/inc/global.inc.php'; require_once __DIR__.'/../../../main/inc/global.inc.php';
require_once __DIR__ . '/../config.php'; require_once __DIR__.'/../config.php';
if (!api_is_anonymous()) { if (!api_is_anonymous()) {
$currentPageClass = isset($_POST['page_class']) ? $_POST['page_class'] : ''; $currentPageClass = isset($_POST['page_class']) ? $_POST['page_class'] : '';

@ -5,6 +5,6 @@
* @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com> * @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
* @package chamilo.plugin.tour * @package chamilo.plugin.tour
*/ */
require_once __DIR__ . '/config.php'; require_once __DIR__.'/config.php';
Tour::create()->install(); Tour::create()->install();

@ -5,6 +5,6 @@
* @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com> * @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
* @package chamilo.plugin.tour * @package chamilo.plugin.tour
*/ */
require_once __DIR__ . '/config.php'; require_once __DIR__.'/config.php';
Tour::create()->uninstall(); Tour::create()->uninstall();

@ -31,7 +31,7 @@ class HomeDriver extends Driver implements DriverInterface
'driver' => 'HomeDriver', 'driver' => 'HomeDriver',
'alias' => get_lang('Portal'), 'alias' => get_lang('Portal'),
'path' => $home, 'path' => $home,
'URL' => api_get_path(WEB_PATH) . 'home', 'URL' => api_get_path(WEB_PATH).'home',
'accessControl' => array($this, 'access'), 'accessControl' => array($this, 'access'),
); );
} }

@ -48,7 +48,7 @@ class SequenceRepository extends EntityRepository
foreach ($from as $subVertex) { foreach ($from as $subVertex) {
$vertexId = $subVertex->getId(); $vertexId = $subVertex->getId();
$sessionInfo = api_get_session_info($vertexId); $sessionInfo = api_get_session_info($vertexId);
$sessionInfo['admin_link'] = '<a href="' . \SessionManager::getAdminPath($vertexId) . '">' . $sessionInfo['name'] . '</a>'; $sessionInfo['admin_link'] = '<a href="'.\SessionManager::getAdminPath($vertexId).'">'.$sessionInfo['name'].'</a>';
$result['requirements'][] = $sessionInfo; $result['requirements'][] = $sessionInfo;
} }
@ -56,7 +56,7 @@ class SequenceRepository extends EntityRepository
foreach ($to as $subVertex) { foreach ($to as $subVertex) {
$vertexId = $subVertex->getId(); $vertexId = $subVertex->getId();
$sessionInfo = api_get_session_info($vertexId); $sessionInfo = api_get_session_info($vertexId);
$sessionInfo['admin_link'] = '<a href="' . \SessionManager::getAdminPath($vertexId) . '">' . $sessionInfo['name'] . '</a>'; $sessionInfo['admin_link'] = '<a href="'.\SessionManager::getAdminPath($vertexId).'">'.$sessionInfo['name'].'</a>';
$result['dependencies'][] = $sessionInfo; $result['dependencies'][] = $sessionInfo;
} }
} }

Loading…
Cancel
Save