Scrutinizer Auto-Fixes

This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
remotes/angel/1.11.x
Scrutinizer Auto-Fixer 8 years ago
parent 1dceff2b93
commit d23a5f6a1c
  1. 54
      main/admin/languages.php
  2. 18
      main/admin/statistics/index.php
  3. 10
      main/auth/cas/authcas.php
  4. 4
      main/badge/assertion.php
  5. 6
      main/course_progress/thematic.php
  6. 16
      main/cron/lang/langstats.class.php
  7. 6
      main/cron/user_import/get_data_from_mail.php
  8. 84
      main/document/create_audio.php
  9. 12
      main/exercise/hotpotatoes.lib.php
  10. 8
      main/gradebook/gradebook_edit_result.php
  11. 4
      main/inc/ajax/record_audio_wami.ajax.php
  12. 4
      main/inc/lib/formvalidator/Element/receivers.php
  13. 4
      main/link/link_goto.php
  14. 14
      main/lp/openoffice_text_document.class.php
  15. 2
      main/survey/ch_percentage.php
  16. 10
      main/webservices/test.php
  17. 18
      main/work/work_list.php

@ -32,7 +32,7 @@ if (isset($_POST['sent_http_request'])) {
SubLanguageManager::make_unavailable_language($_POST['id']);
echo 'set_hidden';
} else {
echo 'confirm:' . intval($_POST['id']);
echo 'confirm:'.intval($_POST['id']);
}
}
}
@ -54,21 +54,21 @@ $htmlHeadXtra[] = '<script>
var disabledLang = "'.$disabledLang.'"
if (msgLang == 1) {
$("#id_content_message").html("<div class=\"warning-message alert alert-warning\">' . get_lang('ThereAreUsersUsingThisLanguagesDisableItManually') . ' <br /> " + disabledLang + "</div");
$("#id_content_message").html("<div class=\"warning-message alert alert-warning\">' . get_lang('ThereAreUsersUsingThisLanguagesDisableItManually').' <br /> " + disabledLang + "</div");
}
$("#disable_all_except_default").click(function () {
if(confirm("'. get_lang('ConfirmYourChoice') .'")) {
if(confirm("'. get_lang('ConfirmYourChoice').'")) {
$.ajax({
contentType: "application/x-www-form-urlencoded",
beforeSend: function(objeto) {
$("#id_content_message").html("<div class=\"warning-message alert alert-warning\"><em class=\"fa fa-refresh fa-spin\"></em> ' . get_lang('Loading') . '</div>");
$("#id_content_message").html("<div class=\"warning-message alert alert-warning\"><em class=\"fa fa-refresh fa-spin\"></em> ' . get_lang('Loading').'</div>");
},
type: "GET",
url: "../admin/languages.php",
data: "action=disable_all_except_default",
success: function(datos) {
window.location.href = "' . api_get_self() . '";
window.location.href = "' . api_get_self().'";
}
});
}
@ -104,7 +104,7 @@ $htmlHeadXtra[] = '<script>
$.ajax({
contentType: "application/x-www-form-urlencoded",
beforeSend: function(objeto) {
$("#id_content_message").html("<div class=\"warning-message alert alert-warning\"><em class=\"fa fa-refresh fa-spin\"></em> ' . get_lang('Loading') . '</div>");
$("#id_content_message").html("<div class=\"warning-message alert alert-warning\"><em class=\"fa fa-refresh fa-spin\"></em> ' . get_lang('Loading').'</div>");
},
type: "POST",
url: "../admin/languages.php",
@ -115,26 +115,26 @@ $htmlHeadXtra[] = '<script>
$("#"+id_img_link_tool).attr("src",path_name_of_imglinktool);
if (my_image_tool=="visible.png") {
$("#"+id_img_link_tool).attr("alt","' . get_lang('MakeAvailable', '') . '");
$("#"+id_img_link_tool).attr("title","' . get_lang('MakeAvailable', '') . '");
$("#"+id_img_link_tool).attr("alt","' . get_lang('MakeAvailable', '').'");
$("#"+id_img_link_tool).attr("title","' . get_lang('MakeAvailable', '').'");
} else {
$("#"+id_img_link_tool).attr("alt","' . get_lang('MakeUnavailable', '') . '");
$("#"+id_img_link_tool).attr("title","' . get_lang('MakeUnavailable', '') . '");
$("#"+id_img_link_tool).attr("alt","' . get_lang('MakeUnavailable', '').'");
$("#"+id_img_link_tool).attr("title","' . get_lang('MakeUnavailable', '').'");
}
if (datos=="set_visible") {
$("#id_content_message").html("<div class=\"confirmation-message alert alert-success\">' . get_lang('LanguageIsNowVisible', '') . '</div>");
$("#id_content_message").html("<div class=\"confirmation-message alert alert-success\">' . get_lang('LanguageIsNowVisible', '').'</div>");
}
if (datos=="set_hidden") {
$("#id_content_message").html("<div class=\"confirmation-message alert alert-success\">' . get_lang('LanguageIsNowHidden', '') . '</div>");
$("#id_content_message").html("<div class=\"confirmation-message alert alert-success\">' . get_lang('LanguageIsNowHidden', '').'</div>");
}
}
var action = datos.split(":")[0];
if (action && action == "confirm") {
var id = datos.split(":")[1];
var sure = "<div class=\"warning-message alert alert-warning\">'.get_lang('ThereAreUsersUsingThisLanguageYouWantToDisableThisLanguageAndSetUsersWithTheDefaultPortalLanguage').'<br /><br /><a href=\"languages.php?action=make_unavailable_confirmed&id="+id+"\" class=\"btn btn-default\"><em class=\"fa fa-eye\"></em> ' . get_lang('MakeUnavailable') . '</a></div>";
var sure = "<div class=\"warning-message alert alert-warning\">'.get_lang('ThereAreUsersUsingThisLanguageYouWantToDisableThisLanguageAndSetUsersWithTheDefaultPortalLanguage').'<br /><br /><a href=\"languages.php?action=make_unavailable_confirmed&id="+id+"\" class=\"btn btn-default\"><em class=\"fa fa-eye\"></em> '.get_lang('MakeUnavailable').'</a></div>";
$("#id_content_message").html(sure);
$("html, body").animate({ scrollTop: 0 }, 200);
}
@ -179,7 +179,7 @@ if ($action == 'disable_all_except_default') {
SubLanguageManager::make_unavailable_language($language['id']);
} else {
if (intval(SubLanguageManager::get_platform_language_id()) !== intval($language['id'])) {
$failedDisabledLanguages .= ' - ' .$language['english_name'] . '<br />';
$failedDisabledLanguages .= ' - '.$language['english_name'].'<br />';
$checkFailed = true;
}
}
@ -210,7 +210,7 @@ if (isset($_POST['Submit']) && $_POST['Submit']) {
foreach ($_POST['id'] as $index => $id) {
$ids[] = intval($id);
}
$sql = "UPDATE $tbl_admin_languages SET available='1' WHERE id IN ('" . implode("','", $ids) . "')";
$sql = "UPDATE $tbl_admin_languages SET available='1' WHERE id IN ('".implode("','", $ids)."')";
Database::query($sql);
}
break;
@ -220,7 +220,7 @@ if (isset($_POST['Submit']) && $_POST['Submit']) {
foreach ($_POST['id'] as $index => $id) {
$ids[] = intval($id);
}
$sql = "UPDATE $tbl_admin_languages SET available='0' WHERE id IN ('" . implode("','", $ids) . "')";
$sql = "UPDATE $tbl_admin_languages SET available='0' WHERE id IN ('".implode("','", $ids)."')";
Database::query($sql);
}
break;
@ -249,7 +249,7 @@ if (isset($_GET['action']) && $_GET['action'] == 'make_unavailable_confirmed') {
// displaying the explanation for this tool
Display::display_normal_message(get_lang('PlatformLanguagesExplanation'));
echo '<a id="disable_all_except_default" href="javascript:void(0)" class="btn btn-primary"><em class="fa fa-eye"></em> ' . get_lang('LanguagesDisableAllExceptDefault') . '</a><br /><br />';
echo '<a id="disable_all_except_default" href="javascript:void(0)" class="btn btn-primary"><em class="fa fa-eye"></em> '.get_lang('LanguagesDisableAllExceptDefault').'</a><br /><br />';
// selecting all the languages
$sql_select = "SELECT * FROM $tbl_admin_languages";
@ -270,8 +270,8 @@ while ($row = Database::fetch_array($result_select)) {
$checked = ' checked="checked" ';
}
$row_td[] = '<input type="hidden" name="edit_id" value="' . Security::remove_XSS($_GET['id']) . '" /><input type="text" name="txt_name" value="' . $row['original_name'] . '" /> '
. '<input type="checkbox" ' . $checked . 'name="platformlanguage" id="platformlanguage" value="' . $row['english_name'] . '" /><label for="platformlanguage">' . $row['original_name'] . ' ' . get_lang('AsPlatformLanguage') . '</label> <input type="submit" name="Submit" value="' . get_lang('Ok') . '" /><a name="value" />';
$row_td[] = '<input type="hidden" name="edit_id" value="'.Security::remove_XSS($_GET['id']).'" /><input type="text" name="txt_name" value="'.$row['original_name'].'" /> '
. '<input type="checkbox" '.$checked.'name="platformlanguage" id="platformlanguage" value="'.$row['english_name'].'" /><label for="platformlanguage">'.$row['original_name'].' '.get_lang('AsPlatformLanguage').'</label> <input type="submit" name="Submit" value="'.get_lang('Ok').'" /><a name="value" />';
} else {
$row_td[] = $row['original_name'];
}
@ -285,7 +285,7 @@ while ($row = Database::fetch_array($result_select)) {
if ($row['english_name'] == $row_lang['selected_value']) {
$setplatformlanguage = Display::return_icon('languages.png', get_lang('CurrentLanguagesPortal'), '', ICON_SIZE_SMALL);
} else {
$setplatformlanguage = "<a href=\"javascript:if (confirm('" . addslashes(get_lang('AreYouSureYouWantToSetThisLanguageAsThePortalDefault')) . "')) { location.href='" . api_get_self() . "?action=setplatformlanguage&id=" . $row['id'] . "'; }\">" . Display::return_icon('languages_na.png', get_lang('SetLanguageAsDefault'), '', ICON_SIZE_SMALL) . "</a>";
$setplatformlanguage = "<a href=\"javascript:if (confirm('".addslashes(get_lang('AreYouSureYouWantToSetThisLanguageAsThePortalDefault'))."')) { location.href='".api_get_self()."?action=setplatformlanguage&id=".$row['id']."'; }\">".Display::return_icon('languages_na.png', get_lang('SetLanguageAsDefault'), '', ICON_SIZE_SMALL)."</a>";
}
$allow_delete_sub_language = null;
@ -297,7 +297,7 @@ while ($row = Database::fetch_array($result_select)) {
if ($verified_if_is_sub_language === false) {
$verified_if_is_father = SubLanguageManager::check_if_language_is_father($row['id']);
$allow_use_sub_language = "&nbsp;<a href='sub_language_add.php?action=definenewsublanguage&id=" . $row['id'] . "'>" . Display::return_icon('new_language.png', get_lang('CreateSubLanguage'), array(), ICON_SIZE_SMALL) . "</a>";
$allow_use_sub_language = "&nbsp;<a href='sub_language_add.php?action=definenewsublanguage&id=".$row['id']."'>".Display::return_icon('new_language.png', get_lang('CreateSubLanguage'), array(), ICON_SIZE_SMALL)."</a>";
if ($verified_if_is_father === true) {
//$allow_add_term_sub_language = "&nbsp;<a href='sub_language.php?action=registersublanguage&id=".$row['id']."'>".Display::return_icon('2rightarrow.png', get_lang('AddWordForTheSubLanguage'),array('width'=>ICON_SIZE_SMALL,'height'=>ICON_SIZE_SMALL))."</a>";
$allow_add_term_sub_language = '';
@ -307,8 +307,8 @@ while ($row = Database::fetch_array($result_select)) {
} else {
$allow_use_sub_language = '';
$all_information_of_sub_language = SubLanguageManager::get_all_information_of_language($row['id']);
$allow_add_term_sub_language = "&nbsp;<a href='sub_language.php?action=registersublanguage&id=" . Security::remove_XSS($all_information_of_sub_language['parent_id']) . "&sub_language_id=" . Security::remove_XSS($row['id']) . "'>" . Display::return_icon('2rightarrow.png', get_lang('AddWordForTheSubLanguage'), array('width' => ICON_SIZE_SMALL, 'height' => ICON_SIZE_SMALL)) . "</a>";
$allow_delete_sub_language = "&nbsp;<a href='sub_language_add.php?action=deletesublanguage&id=" . Security::remove_XSS($all_information_of_sub_language['parent_id']) . "&sub_language_id=" . Security::remove_XSS($row['id']) . "'>" . Display::return_icon('delete.png', get_lang('DeleteSubLanguage'), array('width' => ICON_SIZE_SMALL, 'height' => ICON_SIZE_SMALL)) . "</a>";
$allow_add_term_sub_language = "&nbsp;<a href='sub_language.php?action=registersublanguage&id=".Security::remove_XSS($all_information_of_sub_language['parent_id'])."&sub_language_id=".Security::remove_XSS($row['id'])."'>".Display::return_icon('2rightarrow.png', get_lang('AddWordForTheSubLanguage'), array('width' => ICON_SIZE_SMALL, 'height' => ICON_SIZE_SMALL))."</a>";
$allow_delete_sub_language = "&nbsp;<a href='sub_language_add.php?action=deletesublanguage&id=".Security::remove_XSS($all_information_of_sub_language['parent_id'])."&sub_language_id=".Security::remove_XSS($row['id'])."'>".Display::return_icon('delete.png', get_lang('DeleteSubLanguage'), array('width' => ICON_SIZE_SMALL, 'height' => ICON_SIZE_SMALL))."</a>";
}
} else {
$allow_use_sub_language = '';
@ -316,13 +316,13 @@ while ($row = Database::fetch_array($result_select)) {
}
if ($row['english_name'] == $row_lang['selected_value']) {
$row_td[] = Display::return_icon('visible.png', get_lang('Visible'))."<a href='" . api_get_self() . "?action=edit&id=" . $row['id'] . "#value'>" . Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL) . "</a>
&nbsp;" . $setplatformlanguage . $allow_use_sub_language . $allow_add_term_sub_language . $allow_delete_sub_language;
$row_td[] = Display::return_icon('visible.png', get_lang('Visible'))."<a href='".api_get_self()."?action=edit&id=".$row['id']."#value'>".Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL)."</a>
&nbsp;" . $setplatformlanguage.$allow_use_sub_language.$allow_add_term_sub_language.$allow_delete_sub_language;
} else {
if ($row['available'] == 1) {
$row_td[] = "<a class=\"make_visible_and_invisible\" id=\"linktool_" . $row['id'] . "\" href='" . api_get_self() . "?action=makeunavailable&id=" . $row['id'] . "'>" . Display::return_icon('visible.png', get_lang('MakeUnavailable'), array('id' => 'imglinktool_' . $row['id']), ICON_SIZE_SMALL) . "</a> <a href='" . api_get_self() . "?action=edit&id=" . $row['id'] . "#value'>" . Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL) . "</a>&nbsp;" . $setplatformlanguage . $allow_use_sub_language . $allow_add_term_sub_language . $allow_delete_sub_language;
$row_td[] = "<a class=\"make_visible_and_invisible\" id=\"linktool_".$row['id']."\" href='".api_get_self()."?action=makeunavailable&id=".$row['id']."'>".Display::return_icon('visible.png', get_lang('MakeUnavailable'), array('id' => 'imglinktool_'.$row['id']), ICON_SIZE_SMALL)."</a> <a href='".api_get_self()."?action=edit&id=".$row['id']."#value'>".Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL)."</a>&nbsp;".$setplatformlanguage.$allow_use_sub_language.$allow_add_term_sub_language.$allow_delete_sub_language;
} else {
$row_td[] = "<a class=\"make_visible_and_invisible\" id=\"linktool_" . $row['id'] . "\" href='" . api_get_self() . "?action=makeavailable&id=" . $row['id'] . "'>" . Display::return_icon('invisible.png', get_lang('MakeAvailable'), array('id' => 'imglinktool_' . $row['id']), ICON_SIZE_SMALL) . "</a> <a href='" . api_get_self() . "?action=edit&id=" . $row['id'] . "#value'>" . Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL) . "</a>&nbsp;" . $setplatformlanguage . $allow_use_sub_language . $allow_add_term_sub_language . $allow_delete_sub_language;
$row_td[] = "<a class=\"make_visible_and_invisible\" id=\"linktool_".$row['id']."\" href='".api_get_self()."?action=makeavailable&id=".$row['id']."'>".Display::return_icon('invisible.png', get_lang('MakeAvailable'), array('id' => 'imglinktool_'.$row['id']), ICON_SIZE_SMALL)."</a> <a href='".api_get_self()."?action=edit&id=".$row['id']."#value'>".Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL)."</a>&nbsp;".$setplatformlanguage.$allow_use_sub_language.$allow_add_term_sub_language.$allow_delete_sub_language;
}
}
$language_data[] = $row_td;

@ -20,7 +20,7 @@ if ($report) {
<script>
$(document).ready(function() {
$.ajax({
url: "'. api_get_path(WEB_CODE_PATH) .'inc/ajax/statistics.ajax.php?a=recentlogins",
url: "'. api_get_path(WEB_CODE_PATH).'inc/ajax/statistics.ajax.php?a=recentlogins",
type: "POST",
success: function(data) {
Chart.defaults.global.responsive = true;
@ -50,10 +50,10 @@ $tools[$strCourse]['report=coursebylanguage'] = get_lang('CountCourseByLanguage'
// users ...
$tools[$strUsers]['report=users'] = get_lang('CountUsers');
$tools[$strUsers]['report=recentlogins'] = get_lang('Logins');
$tools[$strUsers]['report=logins&amp;type=month'] = get_lang('Logins') . ' (' . get_lang('PeriodMonth') . ')';
$tools[$strUsers]['report=logins&amp;type=day'] = get_lang('Logins') . ' (' . get_lang('PeriodDay') . ')';
$tools[$strUsers]['report=logins&amp;type=hour'] = get_lang('Logins') . ' (' . get_lang('PeriodHour') . ')';
$tools[$strUsers]['report=pictures'] = get_lang('CountUsers') . ' (' . get_lang('UserPicture') . ')';
$tools[$strUsers]['report=logins&amp;type=month'] = get_lang('Logins').' ('.get_lang('PeriodMonth').')';
$tools[$strUsers]['report=logins&amp;type=day'] = get_lang('Logins').' ('.get_lang('PeriodDay').')';
$tools[$strUsers]['report=logins&amp;type=hour'] = get_lang('Logins').' ('.get_lang('PeriodHour').')';
$tools[$strUsers]['report=pictures'] = get_lang('CountUsers').' ('.get_lang('UserPicture').')';
$tools[$strUsers]['report=no_login_users'] = get_lang('StatsUsersDidNotLoginInLastPeriods');
$tools[$strUsers]['report=zombies'] = get_lang('Zombies');
@ -68,10 +68,10 @@ $tools[$strSocial]['report=friends'] = get_lang('CountFriends');
echo '<table><tr>';
foreach ($tools as $section => $items) {
echo '<td style="vertical-align:top;">';
echo '<h3>' . $section . '</h3>';
echo '<h3>'.$section.'</h3>';
echo '<ul>';
foreach ($items as $key => $value) {
echo '<li><a href="index.php?' . $key . '">' . $value . '</a></li>';
echo '<li><a href="index.php?'.$key.'">'.$value.'</a></li>';
}
echo '</ul>';
echo '</td>';
@ -79,7 +79,7 @@ foreach ($tools as $section => $items) {
echo '</tr></table>';
$course_categories = Statistics::getCourseCategories();
echo '<br/><br/>';//@todo: spaces between elements should be handled in the css, br should be removed if only there for presentation
echo '<br/><br/>'; //@todo: spaces between elements should be handled in the css, br should be removed if only there for presentation
switch ($report) {
case 'courses':
@ -121,7 +121,7 @@ switch ($report) {
Statistics::printStats(get_lang('Students'), $students);
break;
case 'recentlogins':
echo '<h2>'. sprintf(get_lang('LastXDays'), '15') . '</h2>';
echo '<h2>'.sprintf(get_lang('LastXDays'), '15').'</h2>';
echo '<canvas class="col-md-12" id="canvas" height="100px" style="margin-bottom: 20px"></canvas>';
Statistics::printRecentLoginStats();
Statistics::printRecentLoginStats(true);

@ -5,9 +5,9 @@
* Gets all the info via the ldap module (ldap has to work)
*/
require_once api_get_path(SYS_PATH) . 'main/auth/cas/cas_var.inc.php';
require_once api_get_path(SYS_PATH) . 'main/auth/external_login/ldap.inc.php';
require_once api_get_path(SYS_PATH) . 'main/auth/external_login/functions.inc.php';
require_once api_get_path(SYS_PATH).'main/auth/cas/cas_var.inc.php';
require_once api_get_path(SYS_PATH).'main/auth/external_login/ldap.inc.php';
require_once api_get_path(SYS_PATH).'main/auth/external_login/functions.inc.php';
/**
* @return true if cas is configured
@ -187,14 +187,14 @@ function cas_logout($uinfo = null, $location = null)
*/
function get_cas_direct_URL($in_course_code)
{
return api_get_path(WEB_PATH) . 'main/auth/cas/logincas.php?firstpage=' . $in_course_code;
return api_get_path(WEB_PATH).'main/auth/cas/logincas.php?firstpage='.$in_course_code;
}
function getCASLogoHTML()
{
$out_res = "";
if (api_get_setting("casLogoURL") != "") {
$out_res = "<img src='" . api_get_setting("casLogoURL") . "' alt='CAS Logo' />";
$out_res = "<img src='".api_get_setting("casLogoURL")."' alt='CAS Logo' />";
}
return $out_res;
}

@ -42,10 +42,10 @@ $json = array(
'identity' => $user['email']
),
'issuedOn' => strtotime($userSkill['acquired_skill_at']),
'badge' => api_get_path(WEB_CODE_PATH) . "badge/class.php?id=$skillId",
'badge' => api_get_path(WEB_CODE_PATH)."badge/class.php?id=$skillId",
'verify' => array(
'type' => 'hosted',
'url' => api_get_path(WEB_CODE_PATH) . "badge/assertion.php?" . http_build_query(array(
'url' => api_get_path(WEB_CODE_PATH)."badge/assertion.php?".http_build_query(array(
'user' => $userId,
'skill' => $skillId,
'course' => $courseId,

@ -46,7 +46,7 @@ if (api_is_allowed_to_edit(null, true)) {
Display::return_icon('new_course_progress.png', get_lang('NewThematicSection'), '', ICON_SIZE_MEDIUM).'</a>';
}
$toolbar= Display::toolbarAction('thematic-bar', array($actionLeft));
$toolbar = Display::toolbarAction('thematic-bar', array($actionLeft));
}
@ -133,12 +133,12 @@ if ($action == 'thematic_list') {
if ($thematic['display_order'] > 1) {
$toolbarThematic .= ' <a class="btn btn-default" href="'.api_get_self().'?action=moveup&'.api_get_cidreq().'&thematic_id='.$my_thematic_id.$params.$url_token.'">'.Display::return_icon('up.png', get_lang('Up'), '', ICON_SIZE_TINY).'</a>';
} else {
$toolbarThematic .= '<div class="btn btn-default">'.Display::return_icon('up_na.png', '&nbsp;', '', ICON_SIZE_TINY) . '</div>';
$toolbarThematic .= '<div class="btn btn-default">'.Display::return_icon('up_na.png', '&nbsp;', '', ICON_SIZE_TINY).'</div>';
}
if (isset($thematic['max_thematic_item']) && $thematic['display_order'] < $thematic['max_thematic_item']) {
$toolbarThematic .= ' <a class="btn btn-default" href="'.api_get_self().'?action=movedown&a'.api_get_cidreq().'&thematic_id='.$my_thematic_id.$params.$url_token.'">'.Display::return_icon('down.png', get_lang('Down'), '', ICON_SIZE_TINY).'</a>';
} else {
$toolbarThematic .= '<div class="btn btn-default">'.Display::return_icon('down_na.png', '&nbsp;', '', ICON_SIZE_TINY) . '</div>';
$toolbarThematic .= '<div class="btn btn-default">'.Display::return_icon('down_na.png', '&nbsp;', '', ICON_SIZE_TINY).'</div>';
}
}
if (api_get_session_id() == $thematic['session_id']) {

@ -30,7 +30,7 @@ class langstats
return false; //cannot use if sqlite not installed
}
if (empty($file)) {
$file = api_get_path(SYS_ARCHIVE_PATH) . '/langstasdb';
$file = api_get_path(SYS_ARCHIVE_PATH).'/langstasdb';
}
if (is_file($file) && is_writeable($file)) {
$this->db = new SQLite3($file, SQLITE3_OPEN_READWRITE);
@ -39,7 +39,7 @@ class langstats
$this->db = new SQLite3($file);
} catch (Exception $e) {
$this->error = 'DatabaseCreateError';
error_log('Exception: ' . $e->getMessage());
error_log('Exception: '.$e->getMessage());
return false;
}
$err = $this->db->exec(
@ -104,7 +104,7 @@ class langstats
$num = $row[3];
$num++;
$res = $this->db->query(
'UPDATE lang_freq SET term_count = ' . $num . ' WHERE id = ' . $row[0]
'UPDATE lang_freq SET term_count = '.$num.' WHERE id = '.$row[0]
);
if ($res === false) {
$this->error = 'CouldNotUpdateTerm';
@ -136,7 +136,7 @@ class langstats
public function get_popular_terms($num = 1000)
{
$res = $this->db->query(
'SELECT * FROM lang_freq ORDER BY term_count DESC LIMIT ' . $num
'SELECT * FROM lang_freq ORDER BY term_count DESC LIMIT '.$num
);
$list = array();
while ($row = $res->fetchArray()) {
@ -163,16 +163,16 @@ class langstats
*/
public function get_variables_origin()
{
$path = api_get_path(SYS_LANG_PATH) . 'english/';
$path = api_get_path(SYS_LANG_PATH).'english/';
$vars = array();
$priority = array('trad4all');
foreach ($priority as $file) {
$list = SubLanguageManager::get_all_language_variable_in_file(
$path . $file . '.inc.php',
$path.$file.'.inc.php',
true
);
foreach ($list as $var => $trad) {
$vars[$var] = $file . '.inc.php';
$vars[$var] = $file.'.inc.php';
}
}
$files = scandir($path);
@ -181,7 +181,7 @@ class langstats
continue;
}
$list = SubLanguageManager::get_all_language_variable_in_file(
$path . $file,
$path.$file,
true
);
foreach ($list as $var => $trad) {

@ -18,12 +18,12 @@ die();
$list = file('input.txt');
require_once '../../inc/global.inc.php';
$users = Database::get_main_table(TABLE_MAIN_USER);
$string='';
$string = '';
foreach ($list as $mail) {
$mail = trim($mail);
$sql = "SELECT user_id, official_code, firstname, lastname, email FROM $users WHERE email = '$mail'\n";
$res = Database::query($sql);
if ($res === false) { die(mysql_error());}
if ($res === false) { die(mysql_error()); }
if (Database::num_rows($res) == 0) {
$string .= 'No encontrado;'.$row['email'];
} else {
@ -32,4 +32,4 @@ foreach ($list as $mail) {
}
}
echo $string;
file_put_contents('/tmp/list.txt',$string);
file_put_contents('/tmp/list.txt', $string);

@ -66,35 +66,35 @@ if ($dir[0] == '.') {
}
if ($dir[0] != '/') {
$dir = '/' . $dir;
$dir = '/'.$dir;
}
if ($dir[strlen($dir) - 1] != '/') {
$dir .= '/';
}
$filepath = api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/document' . $dir;
$filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'.$dir;
if (!is_dir($filepath)) {
$filepath = api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/document/';
$filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/';
$dir = '/';
}
//groups //TODO: clean
if (!empty($groupId)) {
$interbreadcrumb[] = array(
"url" => "../group/group_space.php?" . api_get_cidreq(),
"url" => "../group/group_space.php?".api_get_cidreq(),
"name" => get_lang('GroupSpace')
);
$group = GroupManager:: get_group_properties($groupId);
$path = explode('/', $dir);
if ('/' . $path[1] != $group['directory']) {
if ('/'.$path[1] != $group['directory']) {
api_not_allowed(true);
}
}
$interbreadcrumb[] = array(
"url" => "./document.php?curdirpath=" . urlencode($dir) . "&" . api_get_cidreq(),
"url" => "./document.php?curdirpath=".urlencode($dir)."&".api_get_cidreq(),
"name" => get_lang('Documents')
);
@ -130,11 +130,11 @@ $array_len = count($dir_array);
$dir_acum = '';
for ($i = 0; $i < $array_len; $i++) {
$url_dir = 'document.php?&curdirpath=' . $dir_acum . $dir_array[$i];
$url_dir = 'document.php?&curdirpath='.$dir_acum.$dir_array[$i];
//Max char 80
$url_to_who = cut($dir_array[$i], 80);
$interbreadcrumb[] = array('url' => $url_dir, 'name' => $url_to_who);
$dir_acum .= $dir_array[$i] . '/';
$dir_acum .= $dir_array[$i].'/';
}
$service = isset($_GET['service']) ? $_GET['service'] : 'pediaphon';
@ -142,15 +142,15 @@ $service = isset($_GET['service']) ? $_GET['service'] : 'pediaphon';
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>';
echo '<a href="document.php?id='.$document_id.'">'.
Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'), '',
ICON_SIZE_MEDIUM).'</a>';
echo '<a href="create_audio.php?' . api_get_cidreq() . '&id=' . $document_id . '&service=pediaphon">' .
Display::return_icon('pediaphon.png', get_lang('Pediaphon'), '', ICON_SIZE_MEDIUM) . '</a>';
echo '<a href="create_audio.php?'.api_get_cidreq().'&id='.$document_id.'&service=pediaphon">'.
Display::return_icon('pediaphon.png', get_lang('Pediaphon'), '', ICON_SIZE_MEDIUM).'</a>';
echo '<a href="create_audio.php?' . api_get_cidreq() . '&id=' . $document_id . '&service=google">' .
Display::return_icon('google.png', get_lang('GoogleAudio'), '', ICON_SIZE_MEDIUM) . '</a>';
echo '<a href="create_audio.php?'.api_get_cidreq().'&id='.$document_id.'&service=google">'.
Display::return_icon('google.png', get_lang('GoogleAudio'), '', ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
?>
<!-- javascript and styles for textareaCounter-->
@ -215,14 +215,14 @@ $options = $options_pedia = array();
$selected_language = null;
while ($row = Database::fetch_array($result_select)) {
$options[$row['isocode']] = $row['original_name'] . ' (' . $row['english_name'] . ')';
$options[$row['isocode']] = $row['original_name'].' ('.$row['english_name'].')';
if (in_array($row['isocode'], array('de', 'en', 'es', 'fr'))) {
$options_pedia[$row['isocode']] = $row['original_name'] . ' (' . $row['english_name'] . ')';
$options_pedia[$row['isocode']] = $row['original_name'].' ('.$row['english_name'].')';
}
}
if ($service == 'google') {
$selected_language = api_get_language_isocode();//lang default is the course language
$selected_language = api_get_language_isocode(); //lang default is the course language
$form = new FormValidator('form1', 'post', api_get_self().'?'.api_get_cidreq(), '', array('id' => 'form1'));
$form->addHeader(get_lang('HelpText2Audio'));
@ -274,16 +274,16 @@ if ($service == 'pediaphon') {
var voices = new Array()
<!--German -->
voices['de'] = ["<?php echo get_lang('Female') . ' (de1)'; ?>|de1", "<?php echo get_lang('Male') . ' (de2)'; ?>|de2", "<?php echo get_lang('Female') . ' (de3)'; ?>|de3", "<?php echo get_lang('Male') . ' (de4)'; ?>|de4", "<?php echo get_lang('Female') . ' (de5)'; ?>|de5", "<?php echo get_lang('Male') . ' (de6)'; ?>|de6", "<?php echo get_lang('Female') . ' (de7)'; ?>|de7", "<?php echo get_lang('Female') . ' (de8 HQ)'; ?>|de8"]
voices['de'] = ["<?php echo get_lang('Female').' (de1)'; ?>|de1", "<?php echo get_lang('Male').' (de2)'; ?>|de2", "<?php echo get_lang('Female').' (de3)'; ?>|de3", "<?php echo get_lang('Male').' (de4)'; ?>|de4", "<?php echo get_lang('Female').' (de5)'; ?>|de5", "<?php echo get_lang('Male').' (de6)'; ?>|de6", "<?php echo get_lang('Female').' (de7)'; ?>|de7", "<?php echo get_lang('Female').' (de8 HQ)'; ?>|de8"]
<!--English -->
voices['en'] = ["<?php echo get_lang('Male') . ' (en1)'; ?>|en1", "<?php echo get_lang('Male') . ' (en2 HQ)'; ?>|en2", "<?php echo get_lang('Female') . ' (us1)'; ?>|us1", "<?php echo get_lang('Male') . ' (us2)'; ?>|us2", "<?php echo get_lang('Male') . ' (us3)'; ?>|us3", "<?php echo get_lang('Female') . '(us4 HQ)'; ?>|us4"]
voices['en'] = ["<?php echo get_lang('Male').' (en1)'; ?>|en1", "<?php echo get_lang('Male').' (en2 HQ)'; ?>|en2", "<?php echo get_lang('Female').' (us1)'; ?>|us1", "<?php echo get_lang('Male').' (us2)'; ?>|us2", "<?php echo get_lang('Male').' (us3)'; ?>|us3", "<?php echo get_lang('Female').'(us4 HQ)'; ?>|us4"]
<!--Spanish -->
voices['es'] = ["<?php echo get_lang('Male') . ' (es5 HQ)'; ?>|es5"]
voices['es'] = ["<?php echo get_lang('Male').' (es5 HQ)'; ?>|es5"]
<!--French -->
voices['fr'] = ["<?php echo get_lang('Female') . ' (fr8 HQ)'; ?>|fr8"]
voices['fr'] = ["<?php echo get_lang('Female').' (fr8 HQ)'; ?>|fr8"]
$(document).ready(function () {
$('.lang').on('change', function () {
@ -314,11 +314,11 @@ Display:: display_footer();
*/
function downloadMP3_google($filepath, $dir)
{
$location = 'create_audio.php?' . api_get_cidreq() . '&id=' . intval($_POST['id']) . '&service=google';
$location = 'create_audio.php?'.api_get_cidreq().'&id='.intval($_POST['id']).'&service=google';
//security
if (!isset($_POST['lang']) && !isset($_POST['text']) && !isset($_POST['title']) && !isset($filepath) && !isset($dir)) {
echo '<script>window.location.href="' . $location . '"</script>';
echo '<script>window.location.href="'.$location.'"</script>';
return;
}
@ -363,7 +363,7 @@ function downloadMP3_google($filepath, $dir)
$proxySettings = api_get_configuration_value('proxy_settings');
$key = api_get_configuration_value('translate_app_google_key');
$url = "https://www.googleapis.com/language/translate/v2?key=$key&" . $clean_lang . "&target=$clean_lang&q=" . urlencode($clean_text) . "";
$url = "https://www.googleapis.com/language/translate/v2?key=$key&".$clean_lang."&target=$clean_lang&q=".urlencode($clean_text)."";
if (empty($proxySettings)) {
$content = file_get_contents($url);
@ -383,7 +383,7 @@ function downloadMP3_google($filepath, $dir)
$relativeUrlPath = $dir;
$doc_id = add_document(
$_course,
$relativeUrlPath . $audio_filename,
$relativeUrlPath.$audio_filename,
'file',
filesize($documentPath),
$audio_title
@ -402,7 +402,7 @@ function downloadMP3_google($filepath, $dir)
);
Display::display_confirmation_message(get_lang('DocumentCreated'));
//return to location
echo '<script>window.location.href="' . $location . '"</script>';
echo '<script>window.location.href="'.$location.'"</script>';
}
/**
@ -415,10 +415,10 @@ function downloadMP3_google($filepath, $dir)
*/
function downloadMP3_pediaphon($filepath, $dir)
{
$location = 'create_audio.php?' . api_get_cidreq() . '&id=' . intval($_POST['id']) . '&service=pediaphon';
$location = 'create_audio.php?'.api_get_cidreq().'&id='.intval($_POST['id']).'&service=pediaphon';
//security
if (!isset($_POST['lang']) && !isset($_POST['text']) && !isset($_POST['title']) && !isset($filepath) && !isset($dir)) {
echo '<script>window.location.href="' . $location . '"</script>';
echo '<script>window.location.href="'.$location.'"</script>';
return;
}
$_course = api_get_course_info();
@ -428,33 +428,33 @@ function downloadMP3_pediaphon($filepath, $dir)
$clean_text = trim($_POST['text']);
$clean_voices = Security::remove_XSS($_POST['voices']);
if (empty($clean_title) || empty($clean_text) || empty($clean_voices)) {
echo '<script>window.location.href="' . $location . '"</script>';
echo '<script>window.location.href="'.$location.'"</script>';
return;
}
$clean_title = Security::remove_XSS($clean_title);
$clean_title = Database::escape_string($clean_title);
$clean_title = str_replace(' ', '_', $clean_title);//compound file names
$clean_title = str_replace(' ', '_', $clean_title); //compound file names
$clean_text = Security::remove_XSS($clean_text);
$clean_lang = Security::remove_XSS($_POST['lang']);
$clean_speed = Security::remove_XSS($_POST['speed']);
$extension = 'mp3';
$audio_filename = $clean_title . '.' . $extension;
$audio_filename = $clean_title.'.'.$extension;
$audio_title = str_replace('_', ' ', $clean_title);
//prevent duplicates
if (file_exists($filepath . '/' . $clean_title . '.' . $extension)) {
if (file_exists($filepath.'/'.$clean_title.'.'.$extension)) {
$i = 1;
while (file_exists($filepath . '/' . $clean_title . '_' . $i . '.' . $extension)) {
while (file_exists($filepath.'/'.$clean_title.'_'.$i.'.'.$extension)) {
$i++;
}
$audio_filename = $clean_title . '_' . $i . '.' . $extension;
$audio_title = $clean_title . '_' . $i . '.' . $extension;
$audio_filename = $clean_title.'_'.$i.'.'.$extension;
$audio_title = $clean_title.'_'.$i.'.'.$extension;
$audio_title = str_replace('_', ' ', $audio_title);
}
$documentPath = $filepath . '/' . $audio_filename;
$documentPath = $filepath.'/'.$audio_filename;
$clean_text = api_replace_dangerous_char($clean_text);
//adding the file
@ -463,17 +463,17 @@ function downloadMP3_pediaphon($filepath, $dir)
$url_pediaphon = 'http://www.pediaphon.org/~bischoff/radiopedia/sprich_multivoice.cgi';
$find_t2v = '/http\:\/\/www\.pediaphon\.org\/\~bischoff\/radiopedia\/mp3\/(.*)\.mp3\"/';
} else {
$url_pediaphon = 'http://www.pediaphon.org/~bischoff/radiopedia/sprich_multivoice_' . $clean_lang . '.cgi';//en, es, fr
$find_t2v = '/http\:\/\/www\.pediaphon\.org\/\~bischoff\/radiopedia\/mp3\/' . $clean_lang . '\/(.*)\.mp3\"/';
$url_pediaphon = 'http://www.pediaphon.org/~bischoff/radiopedia/sprich_multivoice_'.$clean_lang.'.cgi'; //en, es, fr
$find_t2v = '/http\:\/\/www\.pediaphon\.org\/\~bischoff\/radiopedia\/mp3\/'.$clean_lang.'\/(.*)\.mp3\"/';
}
$data = "stimme=" . $clean_voices . "&inputtext=" . $clean_text . "&speed=" . $clean_speed . "&go=speak";
$data = "stimme=".$clean_voices."&inputtext=".$clean_text."&speed=".$clean_speed."&go=speak";
$opts = array(
'http' =>
array(
'method' => 'POST',
'header' => "Content-Type: application/x-www-form-urlencoded\r\n",
"Content-Length: " . strlen($data) . "\r\n",
"Content-Length: ".strlen($data)."\r\n",
'content' => $data
)
);
@ -517,5 +517,5 @@ function downloadMP3_pediaphon($filepath, $dir)
);
Display::display_confirmation_message(get_lang('DocumentCreated'));
//return to location
echo '<script>window.location.href="' . $location . '"</script>';
echo '<script>window.location.href="'.$location.'"</script>';
}

@ -66,7 +66,7 @@ function GetQuizName($fname, $fpath)
if ($title == '') {
$title = basename($fname);
}
return (string)$title;
return (string) $title;
}
/**
@ -177,7 +177,7 @@ function GetImgName($imgtag)
if ($src == '') {
return '';
} else {
$tmp_src = basename($src) ;
$tmp_src = basename($src);
if ($tmp_src == '') {
return $src;
} else {
@ -199,7 +199,7 @@ function GetSrcName($imgtag)
{
// Select src tag from img tag.
$match = array();
preg_match("|(src=\".*\" )|U", $imgtag, $match); //src
preg_match("|(src=\".*\" )|U", $imgtag, $match); //src
list($key, $srctag) = each($match);
$src = substr($srctag, 5, (strlen($srctag) - 7));
if (stristr($src, 'http') === false) {
@ -231,8 +231,8 @@ function GetImgParams($fname, $fpath, &$imgparams, &$imgcount)
while (list($key, $imgtag) = each($match)) {
$imgname = GetImgName($imgtag);
if ($imgname != '' && !in_array($imgname, $imgparams)) {
array_push($imgparams, $imgname); // name (+ type) of the images in the html test
$imgcount = $imgcount + 1; // number of images in the html test
array_push($imgparams, $imgname); // name (+ type) of the images in the html test
$imgcount = $imgcount + 1; // number of images in the html test
}
}
}
@ -408,7 +408,7 @@ function CheckSubFolder($path)
if ($file != '..') {
$full_name = $folder.'/'.$file;
if (is_dir($full_name)) {
$dflag = 1; // first directory
$dflag = 1; // first directory
}
}
}

@ -8,7 +8,7 @@
require_once __DIR__.'/../inc/global.inc.php';
api_block_anonymous_users();
GradebookUtils::block_students();
$select_eval=Security::remove_XSS($_GET['selecteval']);
$select_eval = Security::remove_XSS($_GET['selecteval']);
if (empty($select_eval)) {
api_not_allowed();
}
@ -34,7 +34,7 @@ if ($edit_result_form->validate()) {
/** @var Result $result */
$result = $resultedit[0];
if (empty($score)){
if (empty($score)) {
$score = 0;
}
$result->set_score(api_number_format($score, api_get_setting('gradebook_number_decimals')));
@ -47,11 +47,11 @@ if ($edit_result_form->validate()) {
$table = $edit_result_form->toHtml();
$interbreadcrumb[] = array (
$interbreadcrumb[] = array(
'url' => $_SESSION['gradebook_dest'],
'name' => get_lang('Gradebook')
);
$interbreadcrumb[]= array (
$interbreadcrumb[] = array(
'url' => 'gradebook_view_result.php?selecteval='.$select_eval.'&'.api_get_cidreq(),
'name' => get_lang('ViewResult')
);

@ -50,7 +50,7 @@ if ($ext != 'wav') {
// Do not use here check Fileinfo method because return: text/plain
$dirBaseDocuments = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
$saveDir = $dirBaseDocuments . $wamidir;
$saveDir = $dirBaseDocuments.$wamidir;
if (!is_dir($saveDir)) {
DocumentManager::createDefaultAudioFolder($_course);
@ -90,7 +90,7 @@ $output = true;
ob_start();
// Strangely the file path changes with a double extension
copy($documentPath, $documentPath . '.wav');
copy($documentPath, $documentPath.'.wav');
$documentData = DocumentManager::upload_document(
$file,

@ -43,9 +43,9 @@ class HTML_QuickForm_receivers extends HTML_QuickForm_group
*/
function _createElements()
{
$this->_elements[] = new HTML_QuickForm_Radio('receivers', '', get_lang('Everybody'), '0', array ('onclick' => 'javascript:receivers_hide(\'receivers_to\')'));
$this->_elements[] = new HTML_QuickForm_Radio('receivers', '', get_lang('Everybody'), '0', array('onclick' => 'javascript:receivers_hide(\'receivers_to\')'));
$this->_elements[0]->setChecked(true);
$this->_elements[] = new HTML_QuickForm_Radio('receivers', '', get_lang('SelectGroupsUsers'), '1', array ('onclick' => 'javascript:receivers_show(\'receivers_to\')'));
$this->_elements[] = new HTML_QuickForm_Radio('receivers', '', get_lang('SelectGroupsUsers'), '1', array('onclick' => 'javascript:receivers_show(\'receivers_to\')'));
$this->_elements[] = new HTML_QuickForm_advmultiselect('to', '', $this->receivers);
$this->_elements[2]->setSelected($this->receivers_selected);
}

@ -25,8 +25,8 @@ $linkUrl = html_entity_decode(Security::remove_XSS($linkInfo['url']));
// Launch event
Event::event_link($linkId);
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0
header("Pragma: no-cache"); // HTTP/1.0
header("Location: $linkUrl");
exit;

@ -121,7 +121,7 @@ class OpenOfficeTextDocument extends OpenofficeDocument {
$intro_content = api_substr($content, 0, api_strpos($content, $matches[0][0]));
$items_to_create[get_lang('Introduction')] = $intro_content;
for ($i = 0; $i<count($matches[0]); $i++) {
for ($i = 0; $i < count($matches[0]); $i++) {
if (empty($matches[1][$i]))
continue;
@ -195,7 +195,7 @@ class OpenOfficeTextDocument extends OpenofficeDocument {
$first_item = 0;
foreach($pages as $key => $page_content) {
foreach ($pages as $key => $page_content) {
// For every pages, we create a new file.
$key += 1;
@ -249,7 +249,7 @@ class OpenOfficeTextDocument extends OpenofficeDocument {
foreach ($specific_fields as $specific_field) {
if (isset($_REQUEST[$specific_field['code']])) {
$sterms = trim($_REQUEST[$specific_field['code']]);
$all_specific_terms .= ' '. $sterms;
$all_specific_terms .= ' '.$sterms;
if (!empty($sterms)) {
$sterms = explode(',', $sterms);
foreach ($sterms as $sterm) {
@ -258,7 +258,7 @@ class OpenOfficeTextDocument extends OpenofficeDocument {
}
}
}
$page_content = $all_specific_terms .' '. $page_content;
$page_content = $all_specific_terms.' '.$page_content;
$ic_slide->addValue('content', $page_content);
// Add a comment to say terms separated by commas.
$courseid = api_get_course_id();
@ -269,7 +269,7 @@ class OpenOfficeTextDocument extends OpenofficeDocument {
SE_COURSE_ID => $courseid,
SE_TOOL_ID => TOOL_LEARNPATH,
SE_DATA => array('lp_id' => $lp_id, 'lp_item' => $previous, 'document_id' => $document_id),
SE_USER => (int)api_get_user_id(),
SE_USER => (int) api_get_user_id(),
);
$ic_slide->xapian_data = serialize($xapian_data);
$di->addChunk($ic_slide);
@ -312,7 +312,7 @@ class OpenOfficeTextDocument extends OpenofficeDocument {
$content = '<body><div style="width:'.$max_width.'">'.$content;
}
$content = preg_replace('|</body>|i','</div>\\0', $content, -1, $count);
$content = preg_replace('|</body>|i', '</div>\\0', $content, -1, $count);
if ($count < 1) {
$content = $content.'</div></body>';
}
@ -340,7 +340,7 @@ class OpenOfficeTextDocument extends OpenofficeDocument {
}
} elseif ($img_width > $max_width - 10) {
$picture_resized = str_ireplace('width='.$img_width, 'width="'.($max_width-10).'"', $images[0][$key]);
$picture_resized = str_ireplace('width='.$img_width, 'width="'.($max_width - 10).'"', $images[0][$key]);
$content = str_replace($images[0][$key], $picture_resized, $content);
}
}

@ -21,7 +21,7 @@ class ch_percentage extends survey_question
$options[$key] = $value;
}
$name = 'question' . $questionData['question_id'];
$name = 'question'.$questionData['question_id'];
$form->addSelect(
$name, null, $options

@ -15,13 +15,13 @@ $serversys = api_get_path(SYS_CODE_PATH).'webservices/';
$script = isset($_POST['script']) ? $_POST['script'] : false;
$function = isset($_POST['function']) ? $_POST['function'] : false;
$contact= $server.$script.'?wsdl';
$contact = $server.$script.'?wsdl';
$client = new nusoap_client($contact);
$err = $client->getError();
if ($err) {
// Display the error
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
echo '<h2>Constructor error</h2><pre>'.$err.'</pre>';
// At this point, you know the call that follows will fail
}
$response = array();
@ -37,8 +37,8 @@ if (!empty($function)) {
$list = scandir($serversys);
$scripts = array();
foreach ($list as $item) {
if (substr($item,0,1) == '.') { continue; }
if (substr($item,-8)=='soap.php') {
if (substr($item, 0, 1) == '.') { continue; }
if (substr($item, -8) == 'soap.php') {
$scripts[] = $item;
}
}
@ -55,7 +55,7 @@ foreach ($scripts as $script) {
?>
</select><br />
<label for="function">Function</label>
<input type="text" name="function" value="<?php echo $function;?>"></input><br />
<input type="text" name="function" value="<?php echo $function; ?>"></input><br />
<label for="param[0]">Param 0</label>
<input type="text" name="param[0]" ></input><br />
<input type="submit" name="submit" value="Send"/>

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */
require_once __DIR__.'/../inc/global.inc.php';
$current_course_tool = TOOL_STUDENTPUBLICATION;
$current_course_tool = TOOL_STUDENTPUBLICATION;
api_protect_course_script(true);
@ -74,7 +74,7 @@ if (api_is_allowed_to_session_edit(false, true) && !empty($workId) && !api_is_in
get_lang('UploadMyAssignment'),
null,
ICON_SIZE_MEDIUM
) . get_lang('UploadMyAssignment'),
).get_lang('UploadMyAssignment'),
$url,
array('class'=>'btn-toolbar')
);
@ -125,10 +125,10 @@ if (!api_is_invitee()) {
);
$column_model = array(
array('name'=>'type', 'index'=>'file', 'width'=>'5', 'align'=>'left', 'search' => 'false', 'sortable' => 'false'),
array('name'=>'title', 'index'=>'title', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'wrap_cell' => 'true'),
array('name'=>'type', 'index'=>'file', 'width'=>'5', 'align'=>'left', 'search' => 'false', 'sortable' => 'false'),
array('name'=>'title', 'index'=>'title', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'wrap_cell' => 'true'),
array('name'=>'qualification', 'index'=>'qualification', 'width'=>'30', 'align'=>'center', 'search' => 'true'),
array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'30', 'align'=>'left', 'search' => 'true', 'wrap_cell' => 'true'),
array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'30', 'align'=>'left', 'search' => 'true', 'wrap_cell' => 'true'),
array('name'=>'qualificator_id', 'index'=>'qualificator_id', 'width'=>'20', 'align'=>'left', 'search' => 'true'),
array('name'=>'actions', 'index'=>'actions', 'width'=>'20', 'align'=>'left', 'search' => 'false', 'sortable'=>'false')
);
@ -144,11 +144,11 @@ if (!api_is_invitee()) {
);
$column_model = array(
array('name'=>'type', 'index'=>'file', 'width'=>'5', 'align'=>'left', 'search' => 'false', 'sortable' => 'false'),
array('name'=>'title', 'index'=>'title', 'width'=>'60', 'align'=>'left', 'search' => 'false', 'wrap_cell' => "true"),
array('name'=>'qualification', 'index'=>'qualification', 'width'=>'30', 'align'=>'center', 'search' => 'true'),
array('name'=>'type', 'index'=>'file', 'width'=>'5', 'align'=>'left', 'search' => 'false', 'sortable' => 'false'),
array('name'=>'title', 'index'=>'title', 'width'=>'60', 'align'=>'left', 'search' => 'false', 'wrap_cell' => "true"),
array('name'=>'qualification', 'index'=>'qualification', 'width'=>'30', 'align'=>'center', 'search' => 'true'),
array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'30', 'align'=>'left', 'search' => 'true', 'wrap_cell' => 'true', 'sortable'=>'false'),
array('name'=>'actions', 'index'=>'actions', 'width'=>'20', 'align'=>'left', 'search' => 'false', 'sortable'=>'false')
array('name'=>'actions', 'index'=>'actions', 'width'=>'20', 'align'=>'left', 'search' => 'false', 'sortable'=>'false')
);
}

Loading…
Cancel
Save