Scrutinizer Auto-Fixes

This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
pull/2487/head
Scrutinizer Auto-Fixer 8 years ago
parent 06541ca20e
commit ddf46f7fca
  1. 30
      main/admin/access_url_edit_users_to_url.php
  2. 12
      main/document/slideshowoptions.php
  3. 114
      main/exercise/export/qti2/qti2_classes.php
  4. 30
      main/exercise/hotpotatoes_exercise_result.class.php
  5. 10
      main/exercise/hotspot_actionscript_admin.as.php
  6. 4
      main/exercise/hotspot_answers.as.php
  7. 12
      main/forum/editthread.php
  8. 14
      main/forum/reply.php
  9. 48
      main/forum/viewthread.php
  10. 4
      main/inc/lib/access_url_edit_courses_to_url_functions.lib.php
  11. 20
      main/inc/lib/events.lib.php
  12. 4
      main/inc/lib/fileManage.lib.php
  13. 22
      main/inc/lib/formvalidator/FormValidator.class.php
  14. 128
      main/install/install.lib.php
  15. 36
      main/lp/lp_controller.php
  16. 60
      main/lp/openoffice_document.class.php
  17. 14
      main/lp/openoffice_presentation.class.php
  18. 44
      main/permissions/blog_permissions.inc.php
  19. 22
      main/reports/modules/quiz.php
  20. 4
      main/social/friends.php
  21. 30
      main/timeline/index.php
  22. 24
      plugin/bbb/listing.php
  23. 54
      plugin/buycourses/src/buy_course_plugin.class.php
  24. 6
      plugin/buycourses/src/process.php
  25. 10
      plugin/buycourses/src/sales_report.php
  26. 4
      plugin/buycourses/src/service_sales_report.php
  27. 26
      plugin/openmeetings/lib/openmeetings_rest_service.php
  28. 6
      plugin/vchamilo/views/syncparams.php
  29. 2
      src/Chamilo/CoreBundle/Component/Editor/Connector.php
  30. 2
      src/Chamilo/CourseBundle/Component/CourseCopy/Resources/Wiki.php

@ -57,7 +57,7 @@ function add_user_to_url(code, content) {
function send() {
if (document.formulaire.access_url_id.value!=0) {
document.formulaire.form_sent.value=0;
document.formulaire.add_type.value=\'' . $add_type . '\';
document.formulaire.add_type.value=\'' . $add_type.'\';
document.formulaire.submit();
}
}
@ -93,17 +93,17 @@ if (isset($_POST['form_sent']) && $_POST['form_sent']) {
$result = UrlManager::update_urls_rel_user($UserList, $access_url_id);
$url_info = UrlManager::get_url_data_from_id($access_url_id);
if (!empty($result)) {
$message .= 'URL: ' . $url_info['url'] . '<br />';
$message .= 'URL: '.$url_info['url'].'<br />';
}
if (!empty($result['users_added'])) {
$message .= '<h4>' . get_lang('UsersAdded') . ':</h4>';
$message .= '<h4>'.get_lang('UsersAdded').':</h4>';
$i = 1;
$user_added_list = array();
foreach ($result['users_added'] as $user) {
$user_info = api_get_user_info($user);
if (!empty($user_info)) {
$user_added_list[] = $i . '. ' . api_get_person_name($user_info['firstname'], $user_info['lastname'], null, null, null, null, $user_info['username']);
$user_added_list[] = $i.'. '.api_get_person_name($user_info['firstname'], $user_info['lastname'], null, null, null, null, $user_info['username']);
$i++;
}
}
@ -113,13 +113,13 @@ if (isset($_POST['form_sent']) && $_POST['form_sent']) {
}
if (!empty($result['users_deleted'])) {
$message .= '<br /><h4>' . get_lang('UsersDeleted') . ': </h4>';
$message .= '<br /><h4>'.get_lang('UsersDeleted').': </h4>';
$user_deleted_list = array();
$i = 1;
foreach ($result['users_deleted'] as $user) {
$user_info = api_get_user_info($user);
if (!empty($user_info)) {
$user_deleted_list [] = $i . '. ' . api_get_person_name($user_info['firstname'], $user_info['lastname']);
$user_deleted_list [] = $i.'. '.api_get_person_name($user_info['firstname'], $user_info['lastname']);
$i++;
}
}
@ -140,7 +140,7 @@ if (!empty($message)) {
echo '<div class="actions">';
echo Display::url(
Display::return_icon('view_more_stats.gif', get_lang('AddUserToURL'), ''),
api_get_path(WEB_CODE_PATH) . 'admin/access_url_add_users_to_url.php'
api_get_path(WEB_CODE_PATH).'admin/access_url_add_users_to_url.php'
);
echo '</div>';
@ -165,7 +165,7 @@ if ($ajax_search) {
}
$sql = "SELECT u.user_id, lastname, firstname, username
FROM $tbl_user u WHERE status <> " . ANONYMOUS . " " .
FROM $tbl_user u WHERE status <> ".ANONYMOUS." ".
$order_clause;
$result = Database::query($sql);
$Users = Database::store_result($result);
@ -178,11 +178,11 @@ if ($ajax_search) {
}
if ($add_type == 'multiple') {
$link_add_type_unique = '<a href="' . api_get_self() . '?add_type=unique&access_url_id=' . $access_url_id . '">' . get_lang('SessionAddTypeUnique') . '</a>';
$link_add_type_unique = '<a href="'.api_get_self().'?add_type=unique&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeUnique').'</a>';
$link_add_type_multiple = get_lang('SessionAddTypeMultiple');
} else {
$link_add_type_unique = get_lang('SessionAddTypeUnique');
$link_add_type_multiple = '<a href="' . api_get_self() . '?add_type=multiple&access_url_id=' . $access_url_id . '">' . get_lang('SessionAddTypeMultiple') . '</a>';
$link_add_type_multiple = '<a href="'.api_get_self().'?add_type=multiple&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeMultiple').'</a>';
}
$url_list = UrlManager::get_url_data();
?>
@ -194,7 +194,7 @@ $url_list = UrlManager::get_url_data();
<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>" style="margin:0px;" <?php if ($ajax_search) {
echo ' onsubmit="valide();"';
} ?> >
<?php echo get_lang('SelectUrl') . ' : '; ?>
<?php echo get_lang('SelectUrl').' : '; ?>
<select name="access_url_id" onchange="javascript:send();">
<option value="0"> <?php echo get_lang('SelectUrl') ?></option>
<?php
@ -230,7 +230,7 @@ if (!empty($errorMsg)) {
<td>
<h3>
<?php
$total_users = count($nosessionUsersList) + count($sessionUsersList);
$total_users = count($nosessionUsersList) + count($sessionUsersList);
echo get_lang('TotalAvailableUsers').' '.$total_users;
?>
</h3>
@ -240,7 +240,7 @@ if (!empty($errorMsg)) {
<td align="center"><b><?php echo get_lang('UserListInPlatform') ?> : <?php echo count($nosessionUsersList); ?></b>
</td>
<td></td>
<td align="center"><b><?php echo get_lang('UserListIn') . ' ' . $url_selected; ?> : <?php echo count($sessionUsersList); ?></b></td>
<td align="center"><b><?php echo get_lang('UserListIn').' '.$url_selected; ?> : <?php echo count($sessionUsersList); ?></b></td>
</tr>
<tr>
<td align="center">
@ -300,9 +300,9 @@ if (!empty($errorMsg)) {
<br />
<?php
if (isset($_GET['add'])) {
echo '<button class="save" type="button" onclick="valide()" >' . get_lang('AddUsersToURL') . '</button>';
echo '<button class="save" type="button" onclick="valide()" >'.get_lang('AddUsersToURL').'</button>';
} else {
echo '<button class="save" type="button" onclick="valide()" >' . get_lang('EditUsersToURL') . '</button>';
echo '<button class="save" type="button" onclick="valide()" >'.get_lang('EditUsersToURL').'</button>';
}
?>
</td>

@ -39,7 +39,7 @@ $interbreadcrumb[] = array('url' => $url, 'name' => $originaltoolname);
// bypass the $nametools thing and use <b></b> tags in the $interbreadcrump array
$url = 'slideshowoptions.php?curdirpath='.$pathurl;
$originaltoolname = '<b>'.get_lang('SlideshowOptions').'</b>';
$interbreadcrumb[] = array('url' => $url, 'name' => $originaltoolname );
$interbreadcrumb[] = array('url' => $url, 'name' => $originaltoolname);
Display::display_header($originaltoolname, 'Doc');
$image_resizing = isset($_SESSION['image_resizing']) ? $_SESSION['image_resizing'] : null;
@ -63,8 +63,8 @@ window.onload = <?php echo $image_resizing == 'resizing' ? 'enableresizing' : 'd
</script>
<?php
$actions = '<a href="document.php?action=exit_slideshow&curdirpath='.$pathurl.'">'.Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
$actions .= '<a href="slideshow.php?curdirpath='.$pathurl.'">'.Display::return_icon('slideshow.png',get_lang('BackTo').' '.get_lang('SlideShow'),'',ICON_SIZE_MEDIUM).'</a>';
$actions = '<a href="document.php?action=exit_slideshow&curdirpath='.$pathurl.'">'.Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'), '', ICON_SIZE_MEDIUM).'</a>';
$actions .= '<a href="slideshow.php?curdirpath='.$pathurl.'">'.Display::return_icon('slideshow.png', get_lang('BackTo').' '.get_lang('SlideShow'), '', ICON_SIZE_MEDIUM).'</a>';
echo Display::toolbarAction('toolbar-slideshow', [$actions])
?>
<div class="panel panel-default">
@ -79,7 +79,7 @@ echo Display::toolbarAction('toolbar-slideshow', [$actions])
}
?>>
</label>
<?php echo '<b>'. get_lang('NoResizing') . '</b>, ' . get_lang('NoResizingComment') ;?>
<?php echo '<b>'.get_lang('NoResizing').'</b>, '.get_lang('NoResizingComment'); ?>
</div>
<div class="radio">
<label>
@ -89,7 +89,7 @@ echo Display::toolbarAction('toolbar-slideshow', [$actions])
}
?>>
</label>
<?php echo '<b>'. get_lang('ResizingAuto') . '</b>, ' . get_lang('ResizingAutoComment');?>
<?php echo '<b>'.get_lang('ResizingAuto').'</b>, '.get_lang('ResizingAutoComment'); ?>
</div>
<div class="radio">
<label>
@ -101,7 +101,7 @@ echo Display::toolbarAction('toolbar-slideshow', [$actions])
}
?>>
</label>
<?php echo '<b>'. get_lang('Resizing') . '</b>, ' . get_lang('ResizingComment'); ?>
<?php echo '<b>'.get_lang('Resizing').'</b>, '.get_lang('ResizingComment'); ?>
</div>
<div class="form-group">
<label class="col-sm-1 control-label"><?php echo get_lang('Width'); ?></label>

@ -77,21 +77,21 @@ class ImsAnswerMultipleChoice extends Answer
{
// @todo getAnswersList() converts the answers using api_html_entity_decode()
$this->answerList = $this->getAnswersList(true);
$out = ' <choiceInteraction responseIdentifier="' . $questionIdent . '" >' . "\n";
$out .= ' <prompt><![CDATA['.formatExerciseQtiTitle($questionStatment) . ']]></prompt>'. "\n";
$out = ' <choiceInteraction responseIdentifier="'.$questionIdent.'" >'."\n";
$out .= ' <prompt><![CDATA['.formatExerciseQtiTitle($questionStatment).']]></prompt>'."\n";
if (is_array($this->answerList)) {
foreach ($this->answerList as $current_answer) {
$out .= '<simpleChoice identifier="answer_' . $current_answer['id'] . '" fixed="false">
$out .= '<simpleChoice identifier="answer_'.$current_answer['id'].'" fixed="false">
<![CDATA['.formatExerciseQtiTitle($current_answer['answer']).']]>';
if (isset($current_answer['comment']) && $current_answer['comment'] != '') {
$out .= '<feedbackInline identifier="answer_' . $current_answer['id'] . '">
$out .= '<feedbackInline identifier="answer_'.$current_answer['id'].'">
<![CDATA['.formatExerciseQtiTitle($current_answer['comment']).']]>
</feedbackInline>';
}
$out .= '</simpleChoice>'. "\n";
$out .= '</simpleChoice>'."\n";
}
}
$out .= ' </choiceInteraction>'. "\n";
$out .= ' </choiceInteraction>'."\n";
return $out;
}
@ -106,32 +106,32 @@ class ImsAnswerMultipleChoice extends Answer
$type = $this->getQuestionType();
if ($type == MCMA) $cardinality = 'multiple'; else $cardinality = 'single';
$out = ' <responseDeclaration identifier="' . $questionIdent . '" cardinality="' . $cardinality . '" baseType="identifier">' . "\n";
$out = ' <responseDeclaration identifier="'.$questionIdent.'" cardinality="'.$cardinality.'" baseType="identifier">'."\n";
// Match the correct answers.
$out .= ' <correctResponse>'. "\n";
$out .= ' <correctResponse>'."\n";
if (is_array($this->answerList)) {
foreach($this->answerList as $current_answer) {
foreach ($this->answerList as $current_answer) {
if ($current_answer['correct']) {
$out .= ' <value>answer_'. $current_answer['id'] .'</value>'. "\n";
$out .= ' <value>answer_'.$current_answer['id'].'</value>'."\n";
}
}
}
$out .= ' </correctResponse>'. "\n";
$out .= ' </correctResponse>'."\n";
//Add the grading
$out .= ' <mapping>'. "\n";
$out .= ' <mapping>'."\n";
if (is_array($this->answerList)) {
foreach($this->answerList as $current_answer) {
foreach ($this->answerList as $current_answer) {
if (isset($current_answer['grade'])) {
$out .= ' <mapEntry mapKey="answer_'. $current_answer['id'] .'" mappedValue="'.$current_answer['grade'].'" />'. "\n";
$out .= ' <mapEntry mapKey="answer_'.$current_answer['id'].'" mappedValue="'.$current_answer['grade'].'" />'."\n";
}
}
}
$out .= ' </mapping>'. "\n";
$out .= ' </responseDeclaration>'. "\n";
$out .= ' </mapping>'."\n";
$out .= ' </responseDeclaration>'."\n";
return $out;
}
@ -158,7 +158,7 @@ class ImsAnswerFillInBlanks extends Answer
$key = $answer['id'];
$answer = $answer['answer'];
$len = api_strlen($answer);
$text = str_replace('['.$answer.']','<textEntryInteraction responseIdentifier="fill_'.$key.'" expectedLength="'.api_strlen($answer).'"/>', $text);
$text = str_replace('['.$answer.']', '<textEntryInteraction responseIdentifier="fill_'.$key.'" expectedLength="'.api_strlen($answer).'"/>', $text);
}
}
$out = $text;
@ -178,17 +178,17 @@ class ImsAnswerFillInBlanks extends Answer
foreach ($this->answerList as $answer) {
$answerKey = $answer['id'];
$answer = $answer['answer'];
$out .= ' <responseDeclaration identifier="fill_' . $answerKey . '" cardinality="single" baseType="identifier">' . "\n";
$out .= ' <correctResponse>'. "\n";
$out .= ' <value><![CDATA['.formatExerciseQtiTitle($answer).']]></value>'. "\n";
$out .= ' </correctResponse>'. "\n";
$out .= ' <responseDeclaration identifier="fill_'.$answerKey.'" cardinality="single" baseType="identifier">'."\n";
$out .= ' <correctResponse>'."\n";
$out .= ' <value><![CDATA['.formatExerciseQtiTitle($answer).']]></value>'."\n";
$out .= ' </correctResponse>'."\n";
if (isset($this->gradeList[$answerKey])) {
$out .= ' <mapping>'. "\n";
$out .= ' <mapEntry mapKey="'.$answer.'" mappedValue="'.$this->gradeList[$answerKey].'"/>'. "\n";
$out .= ' </mapping>'. "\n";
$out .= ' <mapping>'."\n";
$out .= ' <mapEntry mapKey="'.$answer.'" mappedValue="'.$this->gradeList[$answerKey].'"/>'."\n";
$out .= ' </mapping>'."\n";
}
$out .= ' </responseDeclaration>'. "\n";
$out .= ' </responseDeclaration>'."\n";
}
}
@ -210,11 +210,11 @@ class ImsAnswerMatching extends Answer
$this->answerList = $this->getAnswersList(true);
$maxAssociation = max(count($this->leftList), count($this->rightList));
$out = '<matchInteraction responseIdentifier="' . $questionIdent . '" maxAssociations="'. $maxAssociation .'">'. "\n";
$out = '<matchInteraction responseIdentifier="'.$questionIdent.'" maxAssociations="'.$maxAssociation.'">'."\n";
$out .= $questionStatment;
//add left column
$out .= ' <simpleMatchSet>'. "\n";
$out .= ' <simpleMatchSet>'."\n";
if (is_array($this->leftList)) {
foreach ($this->leftList as $leftKey=>$leftElement) {
$out .= '
@ -224,22 +224,22 @@ class ImsAnswerMatching extends Answer
}
}
$out .= ' </simpleMatchSet>'. "\n";
$out .= ' </simpleMatchSet>'."\n";
//add right column
$out .= ' <simpleMatchSet>'. "\n";
$out .= ' <simpleMatchSet>'."\n";
$i = 0;
if (is_array($this->rightList)) {
foreach($this->rightList as $rightKey=>$rightElement) {
foreach ($this->rightList as $rightKey=>$rightElement) {
$out .= '<simpleAssociableChoice identifier="right_'.$i.'" >
<![CDATA['.formatExerciseQtiTitle($rightElement['answer']).']]>
</simpleAssociableChoice>'. "\n";
$i++;
}
}
$out .= ' </simpleMatchSet>'. "\n";
$out .= '</matchInteraction>'. "\n";
$out .= ' </simpleMatchSet>'."\n";
$out .= '</matchInteraction>'."\n";
return $out;
}
@ -250,31 +250,31 @@ class ImsAnswerMatching extends Answer
public function imsExportResponsesDeclaration($questionIdent)
{
$this->answerList = $this->getAnswersList(true);
$out = ' <responseDeclaration identifier="' . $questionIdent . '" cardinality="single" baseType="identifier">' . "\n";
$out .= ' <correctResponse>' . "\n";
$out = ' <responseDeclaration identifier="'.$questionIdent.'" cardinality="single" baseType="identifier">'."\n";
$out .= ' <correctResponse>'."\n";
$gradeArray = array();
if (isset($this->leftList) && is_array($this->leftList)) {
foreach ($this->leftList as $leftKey => $leftElement) {
$i=0;
$i = 0;
foreach ($this->rightList as $rightKey=>$rightElement) {
if (($leftElement['match'] == $rightElement['code'])) {
$out .= ' <value>left_' . $leftKey . ' right_'.$i.'</value>'. "\n";
$gradeArray['left_' . $leftKey . ' right_'.$i] = $leftElement['grade'];
$out .= ' <value>left_'.$leftKey.' right_'.$i.'</value>'."\n";
$gradeArray['left_'.$leftKey.' right_'.$i] = $leftElement['grade'];
}
$i++;
}
}
}
$out .= ' </correctResponse>'. "\n";
$out .= ' <mapping>' . "\n";
$out .= ' </correctResponse>'."\n";
$out .= ' <mapping>'."\n";
if (is_array($gradeArray)) {
foreach ($gradeArray as $gradeKey=>$grade) {
$out .= ' <mapEntry mapKey="'.$gradeKey.'" mappedValue="'.$grade.'"/>' . "\n";
$out .= ' <mapEntry mapKey="'.$gradeKey.'" mappedValue="'.$grade.'"/>'."\n";
}
}
$out .= ' </mapping>' . "\n";
$out .= ' </responseDeclaration>'. "\n";
$out .= ' </mapping>'."\n";
$out .= ' </responseDeclaration>'."\n";
return $out;
}
@ -290,12 +290,12 @@ class ImsAnswerHotspot extends Answer
* TODO update this to match hot spots instead of copying matching
* Export the question part as a matrix-choice, with only one possible answer per line.
*/
public function imsExportResponses($questionIdent, $questionStatment, $questionDesc='', $questionMedia='')
public function imsExportResponses($questionIdent, $questionStatment, $questionDesc = '', $questionMedia = '')
{
$this->answerList = $this->getAnswersList(true);
$questionMedia = api_get_path(WEB_COURSE_PATH).api_get_course_path().'/document/images/'.$questionMedia;
$mimetype = mime_content_type($questionMedia);
if(empty($mimetype)){
if (empty($mimetype)) {
$mimetype = 'image/jpeg';
}
@ -311,26 +311,26 @@ class ImsAnswerHotspot extends Answer
//coords are transformed according to QTIv2 rules here: http://www.imsproject.org/question/qtiv2p1pd/imsqti_infov2p1pd.html#element10663
$coords = '';
$type = 'default';
switch($answer['hotspot_type']){
switch ($answer['hotspot_type']) {
case 'square':
$type = 'rect';
$res = array();
$coords = preg_match('/^\s*(\d+);(\d+)\|(\d+)\|(\d+)\s*$/',$answer['hotspot_coord'],$res);
$coords = $res[1].','.$res[2].','.((int)$res[1]+(int)$res[3]).",".((int)$res[2]+(int)$res[4]);
$coords = preg_match('/^\s*(\d+);(\d+)\|(\d+)\|(\d+)\s*$/', $answer['hotspot_coord'], $res);
$coords = $res[1].','.$res[2].','.((int) $res[1] + (int) $res[3]).",".((int) $res[2] + (int) $res[4]);
break;
case 'circle':
$type = 'circle';
$res = array();
$coords = preg_match('/^\s*(\d+);(\d+)\|(\d+)\|(\d+)\s*$/',$answer['hotspot_coord'],$res);
$coords = $res[1].','.$res[2].','.sqrt(pow(($res[1]-$res[3]),2)+pow(($res[2]-$res[4])));
$coords = preg_match('/^\s*(\d+);(\d+)\|(\d+)\|(\d+)\s*$/', $answer['hotspot_coord'], $res);
$coords = $res[1].','.$res[2].','.sqrt(pow(($res[1] - $res[3]), 2) + pow(($res[2] - $res[4])));
break;
case 'poly':
$type = 'poly';
$coords = str_replace(array(';','|'),array(',',','),$answer['hotspot_coord']);
$coords = str_replace(array(';', '|'), array(',', ','), $answer['hotspot_coord']);
break;
case 'delineation' :
$type = 'delineation';
$coords = str_replace(array(';','|'),array(',',','),$answer['hotspot_coord']);
$coords = str_replace(array(';', '|'), array(',', ','), $answer['hotspot_coord']);
break;
}
$text .= ' <hotspotChoice shape="'.$type.'" coords="'.$coords.'" identifier="'.$key.'"/>'."\n";
@ -350,18 +350,18 @@ class ImsAnswerHotspot extends Answer
$this->answerList = $this->getAnswersList(true);
$this->gradeList = $this->getGradesList();
$out = '';
$out .= ' <responseDeclaration identifier="hotspot_'.$questionIdent.'" cardinality="ordered" baseType="identifier">' . "\n";
$out .= ' <correctResponse>'. "\n";
$out .= ' <responseDeclaration identifier="hotspot_'.$questionIdent.'" cardinality="ordered" baseType="identifier">'."\n";
$out .= ' <correctResponse>'."\n";
if (is_array($this->answerList)) {
foreach ($this->answerList as $answerKey=>$answer) {
foreach ($this->answerList as $answerKey=>$answer) {
$answerKey = $answer['id'];
$answer = $answer['answer'];
$out .= '<value><![CDATA['.formatExerciseQtiTitle($answerKey).']]></value>';
}
}
$out .= ' </correctResponse>'. "\n";
$out .= ' </responseDeclaration>'. "\n";
$out .= ' </correctResponse>'."\n";
$out .= ' </responseDeclaration>'."\n";
return $out;
}
@ -377,7 +377,7 @@ class ImsAnswerFree extends Answer
* TODO implement
* Export the question part as a matrix-choice, with only one possible answer per line.
*/
public function imsExportResponses($questionIdent, $questionStatment, $questionDesc='', $questionMedia='')
public function imsExportResponses($questionIdent, $questionStatment, $questionDesc = '', $questionMedia = '')
{
return '';
}

@ -30,7 +30,7 @@ class HotpotatoesExerciseResult
$course_id = api_get_course_int_id();
//$user_id = intval($user_id);
$user_id = null;
$session_id_and = ' AND te.session_id = ' . api_get_session_id() . ' ';
$session_id_and = ' AND te.session_id = '.api_get_session_id().' ';
$hotpotato_name = Database::escape_string($hotpotato_name);
if (!empty($exercise_id)) {
@ -54,7 +54,7 @@ class HotpotatoesExerciseResult
$sql = "SELECT '', exe_name, exe_result , exe_weighting, exe_date
FROM $TBL_TRACK_HOTPOTATOES
WHERE
exe_user_id = '" . $user_id . "' AND
exe_user_id = '".$user_id."' AND
c_id = $course_id AND
tth.exe_name = '$hotpotato_name'
ORDER BY c_id ASC, exe_date ASC";
@ -78,7 +78,7 @@ class HotpotatoesExerciseResult
for ($i = 0; $i < sizeof($hpresults); $i++) {
$return[$i] = array();
$title = GetQuizName($hpresults[$i]['exe_name'], $document_path);
if ($title =='') {
if ($title == '') {
$title = basename($hpresults[$i]['exe_name']);
}
if (empty($user_id)) {
@ -87,7 +87,7 @@ class HotpotatoesExerciseResult
$return[$i]['last_name'] = $hpresults[$i]['userpart2'];
}
$return[$i]['title'] = $title;
$return[$i]['exe_date'] = $hpresults[$i]['exe_date'];
$return[$i]['exe_date'] = $hpresults[$i]['exe_date'];
$return[$i]['result'] = $hpresults[$i]['exe_result'];
$return[$i]['max'] = $hpresults[$i]['exe_weighting'];
@ -140,18 +140,18 @@ class HotpotatoesExerciseResult
// Results
foreach ($this->results as $row) {
if (api_is_western_name_order()) {
$data .= str_replace("\r\n",' ',api_html_entity_decode(strip_tags($row['first_name']), ENT_QUOTES, $charset)).';';
$data .= str_replace("\r\n",' ',api_html_entity_decode(strip_tags($row['last_name']), ENT_QUOTES, $charset)).';';
$data .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($row['first_name']), ENT_QUOTES, $charset)).';';
$data .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($row['last_name']), ENT_QUOTES, $charset)).';';
} else {
$data .= str_replace("\r\n",' ',api_html_entity_decode(strip_tags($row['last_name']), ENT_QUOTES, $charset)).';';
$data .= str_replace("\r\n",' ',api_html_entity_decode(strip_tags($row['first_name']), ENT_QUOTES, $charset)).';';
$data .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($row['last_name']), ENT_QUOTES, $charset)).';';
$data .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($row['first_name']), ENT_QUOTES, $charset)).';';
}
$data .= str_replace("\r\n",' ',api_html_entity_decode(strip_tags($row['email']), ENT_QUOTES, $charset)).';';
$data .= str_replace("\r\n",' ',api_html_entity_decode(strip_tags($row['title']), ENT_QUOTES, $charset)).';';
$data .= str_replace("\r\n",' ',$row['exe_date']).';';
$data .= str_replace("\r\n",' ',$row['result']).';';
$data .= str_replace("\r\n",' ',$row['max']).';';
$data .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($row['email']), ENT_QUOTES, $charset)).';';
$data .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($row['title']), ENT_QUOTES, $charset)).';';
$data .= str_replace("\r\n", ' ', $row['exe_date']).';';
$data .= str_replace("\r\n", ' ', $row['result']).';';
$data .= str_replace("\r\n", ' ', $row['max']).';';
$data .= "\n";
}
@ -173,7 +173,7 @@ class HotpotatoesExerciseResult
header('Content-Description: '.$filename);
header('Content-transfer-encoding: binary');
// @todo add this utf-8 header for all csv files
echo "\xEF\xBB\xBF"; // force utf-8 header of csv file
echo "\xEF\xBB\xBF"; // force utf-8 header of csv file
echo $data;
return true;
}
@ -298,7 +298,7 @@ class HotpotatoesExerciseResult
$column++;
if (api_is_western_name_order()) {
$worksheet->setCellValueByColumnAndRow($column, $line,api_html_entity_decode(strip_tags($row['first_name']), ENT_QUOTES, $charset));
$worksheet->setCellValueByColumnAndRow($column, $line, api_html_entity_decode(strip_tags($row['first_name']), ENT_QUOTES, $charset));
$column++;
$worksheet->setCellValueByColumnAndRow($column, $line, api_html_entity_decode(strip_tags($row['last_name']), ENT_QUOTES, $charset));
$column++;

@ -10,7 +10,7 @@ require_once __DIR__.'/../inc/global.inc.php';
api_protect_course_script(false);
$isAllowedToEdit = api_is_allowed_to_edit(null,true);
$isAllowedToEdit = api_is_allowed_to_edit(null, true);
if (!$isAllowedToEdit) {
api_not_allowed(true);
@ -21,7 +21,7 @@ if (!$isAllowedToEdit) {
$questionId = intval($_GET['modifyAnswers']);
$objQuestion = Question::read($questionId);
$_course = api_get_course_info();
$documentPath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
$documentPath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
$picturePath = $documentPath.'/images';
$pictureName = $objQuestion->getPictureFilename();
@ -64,13 +64,13 @@ $answer_type = $objQuestion->type;
$answers = $_SESSION['tmp_answers'];
$nbrAnswers = count($answers['answer']);
for ($i=1;$i <= $nbrAnswers; $i++) {
for ($i = 1; $i <= $nbrAnswers; $i++) {
$hotSpot = [];
$hotSpot['id'] = null;
$hotSpot['answer']= $answers['answer'][$i];
$hotSpot['answer'] = $answers['answer'][$i];
if ($answer_type == HOT_SPOT_DELINEATION) {
if ($i==1) {
if ($i == 1) {
$hotSpot['type'] = 'delineation';
} else {
$hotSpot['type'] = 'oar';

@ -22,9 +22,9 @@ $objExercise = new Exercise(api_get_course_int_id());
$objExercise->read($trackExerciseInfo['exe_exo_id']);
$em = Database::getManager();
$documentPath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
$picturePath = $documentPath . '/images';
$picturePath = $documentPath.'/images';
$pictureName = $objQuestion->getPictureFilename();
$pictureSize = getimagesize($picturePath . '/' . $pictureName);
$pictureSize = getimagesize($picturePath.'/'.$pictureName);
$pictureWidth = $pictureSize[0];
$pictureHeight = $pictureSize[1];
$course_id = api_get_course_int_id();

@ -41,7 +41,7 @@ if (isset($_SESSION['gradebook'])) {
}
if (!empty($gradebook) && $gradebook == 'view') {
$interbreadcrumb[] = array (
$interbreadcrumb[] = array(
'url' => '../gradebook/'.Security::remove_XSS($_SESSION['gradebook_dest']),
'name' => get_lang('ToolGradebook')
);
@ -104,7 +104,7 @@ if (!empty($groupId)) {
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.$cidreq, 'name' => get_lang('Groups'));
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.$cidreq, 'name' => get_lang('GroupSpace').' '.$groupProperties['name']);
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.$cidreq.'&forum='.$forumId, 'name' => $currentForum['forum_title']);
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/newthread.php?'.$cidreq.'&forum='.$forumId,'name' => get_lang('EditThread'));
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/newthread.php?'.$cidreq.'&forum='.$forumId, 'name' => get_lang('EditThread'));
} else {
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.$cidreq, 'name' => $nameTools);
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforumcategory.php?'.$cidreq.'&forumcategory='.$currentForumCategory['cat_id'], 'name' => $currentForumCategory['cat_title']);
@ -153,10 +153,10 @@ $threadData = getThreadInfo($threadId, $cId);
$form = new FormValidator(
'thread',
'post',
api_get_self() . '?' . http_build_query([
api_get_self().'?'.http_build_query([
'forum' => $forumId,
'thread' => $threadId,
]) . '&' . api_get_cidreq()
]).'&'.api_get_cidreq()
);
$form->addElement('header', get_lang('EditThread'));
@ -202,7 +202,7 @@ if ((api_is_course_admin() || api_is_course_coach() || api_is_course_tutor()) &&
$form->addGroup(
$group,
'',
[get_lang('ForumThreadPeerScoring'), get_lang('ForumThreadPeerScoringComment'),]
[get_lang('ForumThreadPeerScoring'), get_lang('ForumThreadPeerScoringComment'), ]
);
$form->addElement('html', '</div>');
}
@ -214,7 +214,7 @@ if ($forumSettings['allow_sticky'] && api_is_allowed_to_edit(null, true)) {
$form->addElement('html', '</div>');
if (!empty($threadData)) {
$defaults['thread_qualify_gradebook'] = ($threadData['threadQualifyMax'] > 0 && empty($_POST)) ? 1 : 0 ;
$defaults['thread_qualify_gradebook'] = ($threadData['threadQualifyMax'] > 0 && empty($_POST)) ? 1 : 0;
$defaults['thread_title'] = prepare4display($threadData['threadTitle']);
$defaults['thread_sticky'] = strval(intval($threadData['threadSticky']));
$defaults['thread_peer_qualify'] = intval($threadData['threadPeerQualify']);

@ -32,8 +32,8 @@ $origin = api_get_origin();
require_once 'forumconfig.inc.php';
require_once 'forumfunction.inc.php';
$forumId = isset($_GET['forum']) ? (int)$_GET['forum'] : 0;
$threadId = isset($_GET['thread']) ? (int)$_GET['thread'] : 0;
$forumId = isset($_GET['forum']) ? (int) $_GET['forum'] : 0;
$threadId = isset($_GET['thread']) ? (int) $_GET['thread'] : 0;
/* MAIN DISPLAY SECTION */
@ -41,8 +41,8 @@ $threadId = isset($_GET['thread']) ? (int)$_GET['thread'] : 0;
// We are getting all the information about the current forum and forum category.
// Note pcool: I tried to use only one sql statement (and function) for this,
// but the problem is that the visibility of the forum AND forum cateogory are stored in the item_property table.
$current_thread = get_thread_information($forumId, $threadId); // Note: This has to be validated that it is an existing thread.
$current_forum = get_forum_information($current_thread['forum_id']); // Note: This has to be validated that it is an existing forum.
$current_thread = get_thread_information($forumId, $threadId); // Note: This has to be validated that it is an existing thread.
$current_forum = get_forum_information($current_thread['forum_id']); // Note: This has to be validated that it is an existing forum.
$current_forum_category = get_forumcategory_information(Security::remove_XSS($current_forum['forum_category']));
/* Is the user allowed here? */
@ -80,12 +80,12 @@ if ($current_forum['forum_of_group'] != 0) {
/* Breadcrumbs */
$gradebook = null;
if (isset($_SESSION['gradebook'])){
if (isset($_SESSION['gradebook'])) {
$gradebook = Security::remove_XSS($_SESSION['gradebook']);
}
if (!empty($gradebook) && $gradebook == 'view') {
$interbreadcrumb[] = array (
$interbreadcrumb[] = array(
'url' => '../gradebook/'.Security::remove_XSS($_SESSION['gradebook_dest']),
'name' => get_lang('ToolGradebook')
);
@ -189,7 +189,7 @@ echo '<div class="forum_title">';
echo '<h1>';
echo Display::url(
prepare4display($current_forum['forum_title']),
'viewforum.php?' . api_get_cidreq() . '&' . http_build_query(['forum' => $current_forum['forum_id']]),
'viewforum.php?'.api_get_cidreq().'&'.http_build_query(['forum' => $current_forum['forum_id']]),
['class' => empty($current_forum['visibility']) ? 'text-muted' : null]
);
echo '</h1>';

@ -7,7 +7,7 @@
*/
require_once __DIR__.'/../inc/global.inc.php';
$current_course_tool = TOOL_FORUM;
$current_course_tool = TOOL_FORUM;
$this_section = SECTION_COURSES;
@ -33,10 +33,10 @@ $gradebook = null;
// Note pcool: I tried to use only one sql statement (and function) for this,
// but the problem is that the visibility of the forum AND forum category are stored in the item_property table.
// Note: This has to be validated that it is an existing thread
$current_thread = get_thread_information($_GET['forum'], $_GET['thread']);
$current_thread = get_thread_information($_GET['forum'], $_GET['thread']);
// Note: This has to be validated that it is an existing forum.
$current_forum = get_forum_information($current_thread['forum_id']);
$current_forum_category = get_forumcategory_information($current_forum['forum_category']);
$current_forum = get_forum_information($current_thread['forum_id']);
$current_forum_category = get_forumcategory_information($current_forum['forum_category']);
$whatsnew_post_info = isset($_SESSION['whatsnew_post_info']) ? $_SESSION['whatsnew_post_info'] : null;
/* Header and Breadcrumbs */
@ -46,8 +46,8 @@ if (!empty($_GET['gradebook']) && $_GET['gradebook'] == 'view') {
}
if (!empty($gradebook) && $gradebook == 'view') {
$interbreadcrumb[] = array (
'url' => '../gradebook/' . $_SESSION['gradebook_dest'],
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'name' => get_lang('ToolGradebook')
);
}
@ -81,15 +81,15 @@ if (!empty($groupId)) {
'name' => get_lang('Groups')
);
$interbreadcrumb[] = array(
'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?' . api_get_cidreq(),
'name' => get_lang('GroupSpace') . ' ' . $group_properties['name']
'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(),
'name' => get_lang('GroupSpace').' '.$group_properties['name']
);
$interbreadcrumb[] = array(
'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?forum=' . intval($_GET['forum']) . '&' . api_get_cidreq(). "&search=" . Security::remove_XSS(urlencode($my_search)),
'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?forum='.intval($_GET['forum']).'&'.api_get_cidreq()."&search=".Security::remove_XSS(urlencode($my_search)),
'name' => Security::remove_XSS($current_forum['forum_title'])
);
$interbreadcrumb[] = array(
'url' => api_get_path(WEB_CODE_PATH).'forum/viewthread.php?forum=' . intval($_GET['forum']) . '&' . api_get_cidreq(). '&thread=' . intval($_GET['thread']),
'url' => api_get_path(WEB_CODE_PATH).'forum/viewthread.php?forum='.intval($_GET['forum']).'&'.api_get_cidreq().'&thread='.intval($_GET['thread']),
'name' => Security::remove_XSS($current_thread['thread_title'])
);
@ -100,15 +100,15 @@ if (!empty($groupId)) {
Display::display_reduced_header();
} else {
$interbreadcrumb[] = array(
'url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.api_get_cidreq().'&search=' . Security::remove_XSS(urlencode($my_search)),
'url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.api_get_cidreq().'&search='.Security::remove_XSS(urlencode($my_search)),
'name' => $nameTools
);
$interbreadcrumb[] = array(
'url' => api_get_path(WEB_CODE_PATH).'forum/viewforumcategory.php?forumcategory='. $current_forum_category['cat_id']. "&search=". Security::remove_XSS(urlencode($my_search)),
'url' => api_get_path(WEB_CODE_PATH).'forum/viewforumcategory.php?forumcategory='.$current_forum_category['cat_id']."&search=".Security::remove_XSS(urlencode($my_search)),
'name' => Security::remove_XSS($current_forum_category['cat_title'])
);
$interbreadcrumb[] = array(
'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.api_get_cidreq().'&forum=' . intval($_GET['forum']). "&search=". Security::remove_XSS(urlencode($my_search)),
'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.api_get_cidreq().'&forum='.intval($_GET['forum'])."&search=".Security::remove_XSS(urlencode($my_search)),
'name' => Security::remove_XSS($current_forum['forum_title'])
);
$interbreadcrumb[] = array(
@ -172,9 +172,9 @@ if ($my_message != 'PostDeletedSpecial') {
echo '<div class="actions">';
echo '<span style="float:right;">'.search_link().'</span>';
if ($origin != 'learnpath') {
echo '<a href="' . $forumUrl . 'viewforum.php?forum='
. intval($_GET['forum']) . '&' . api_get_cidreq() . '">'
. Display::return_icon('back.png', get_lang('BackToForum'), '', ICON_SIZE_MEDIUM) . '</a>';
echo '<a href="'.$forumUrl.'viewforum.php?forum='
. intval($_GET['forum']).'&'.api_get_cidreq().'">'
. Display::return_icon('back.png', get_lang('BackToForum'), '', ICON_SIZE_MEDIUM).'</a>';
}
// The reply to thread link should only appear when the forum_category is
// not locked AND the forum is not locked AND the thread is not locked.
@ -189,9 +189,9 @@ if ($my_message != 'PostDeletedSpecial') {
if ($_user['user_id'] || ($current_forum['allow_anonymous'] == 1 && !$_user['user_id'])) {
// reply link
if (!api_is_anonymous() && api_is_allowed_to_session_edit(false, true)) {
echo '<a href="' . $forumUrl . 'reply.php?' . api_get_cidreq() . '&forum='
. intval($_GET['forum']) . '&thread='
. intval($_GET['thread']) . '&action=replythread">'
echo '<a href="'.$forumUrl.'reply.php?'.api_get_cidreq().'&forum='
. intval($_GET['forum']).'&thread='
. intval($_GET['thread']).'&action=replythread">'
. Display::return_icon('reply_thread.png', get_lang('ReplyToThread'), '', ICON_SIZE_MEDIUM)
. '</a>';
}
@ -214,13 +214,13 @@ if ($my_message != 'PostDeletedSpecial') {
// The different views of the thread.
if ($origin != 'learnpath') {
$my_url = '<a href="' . $forumUrl . 'viewthread.php?' . api_get_cidreq() . '&' . api_get_cidreq()
. '&forum=' . intval($_GET['forum']) . '&thread=' . intval($_GET['thread'])
. '&search=' . Security::remove_XSS(urlencode($my_search));
echo $my_url . '&view=flat">'
$my_url = '<a href="'.$forumUrl.'viewthread.php?'.api_get_cidreq().'&'.api_get_cidreq()
. '&forum='.intval($_GET['forum']).'&thread='.intval($_GET['thread'])
. '&search='.Security::remove_XSS(urlencode($my_search));
echo $my_url.'&view=flat">'
. Display::return_icon('forum_listview.png', get_lang('FlatView'), null, ICON_SIZE_MEDIUM)
. '</a>';
echo $my_url . '&view=nested">'
echo $my_url.'&view=nested">'
. Display::return_icon('forum_nestedview.png', get_lang('NestedView'), null, ICON_SIZE_MEDIUM)
. '</a>';
}

@ -44,10 +44,10 @@ class Accessurleditcoursestourl
' ORDER BY title, code '.
' LIMIT 11';
$rs = Database::query($sql);
$i=0;
$i = 0;
while ($course = Database::fetch_array($rs)) {
$i++;
if ($i<=10) {
if ($i <= 10) {
$return .= '<a href="javascript: void(0);" onclick="javascript: add_user_to_url(\''.addslashes($course['code']).'\',\''.addslashes($course['title']).' ('.addslashes($course['code']).')'.'\')">'.$course['title'].' ('.$course['code'].')</a><br />';
} else {
$return .= '...<br />';

@ -78,9 +78,7 @@ class Event
Database::query($sql);
// Auto subscribe
$user_status = $userInfo['status'] == SESSIONADMIN ? 'sessionadmin' :
$userInfo['status'] == COURSEMANAGER ? 'teacher' :
$userInfo['status'] == DRH ? 'DRH' : 'student';
$user_status = $userInfo['status'] == SESSIONADMIN ? 'sessionadmin' : $userInfo['status'] == COURSEMANAGER ? 'teacher' : $userInfo['status'] == DRH ? 'DRH' : 'student';
$autoSubscribe = api_get_setting($user_status.'_autosubscribe');
if ($autoSubscribe) {
$autoSubscribe = explode('|', $autoSubscribe);
@ -337,7 +335,7 @@ class Event
global $debug;
if ($debug) error_log('Called to update_event_exercice');
if ($debug) error_log('duration:' . $duration);
if ($debug) error_log('duration:'.$duration);
if ($exeid != '') {
/*
@ -385,7 +383,7 @@ class Event
status = '".$status."',
questions_to_check = '".$remind_list."',
data_tracking = '".implode(',', $question_list)."',
user_ip = '" . Database::escape_string(api_get_real_ip()) . "'
user_ip = '" . Database::escape_string(api_get_real_ip())."'
WHERE exe_id = '".Database::escape_string($exeid)."'";
$res = Database::query($sql);
@ -1069,15 +1067,15 @@ class Event
if (!empty($exe_list) && is_array($exe_list) && count($exe_list) > 0) {
$sql = "DELETE FROM $track_e_exercises
WHERE exe_id IN (" . implode(',', $exe_list) . ")";
WHERE exe_id IN (".implode(',', $exe_list).")";
Database::query($sql);
$sql = "DELETE FROM $track_attempts
WHERE exe_id IN (" . implode(',', $exe_list) . ")";
WHERE exe_id IN (".implode(',', $exe_list).")";
Database::query($sql);
$sql = "DELETE FROM $recording_table
WHERE exe_id IN (" . implode(',', $exe_list) . ")";
WHERE exe_id IN (".implode(',', $exe_list).")";
Database::query($sql);
}
@ -1119,7 +1117,7 @@ class Event
self::addEvent(
LOG_EXERCISE_RESULT_DELETE,
LOG_EXERCISE_AND_USER_ID,
$exercise_id . '-' . $user_id,
$exercise_id.'-'.$user_id,
null,
null,
$course_id,
@ -1719,7 +1717,7 @@ class Event
self::addEvent(
LOG_QUESTION_RESULT_DELETE,
LOG_EXERCISE_ATTEMPT_QUESTION_ID,
$exe_id . '-' . $question_id,
$exe_id.'-'.$question_id,
null,
null,
$courseId,
@ -1756,7 +1754,7 @@ class Event
self::addEvent(
LOG_QUESTION_RESULT_DELETE,
LOG_EXERCISE_ATTEMPT_QUESTION_ID,
$exe_id . '-' . $question_id,
$exe_id.'-'.$question_id,
null,
null,
$courseId,

@ -197,11 +197,11 @@ function move($source, $target, $forceMove = true, $moveContent = false)
exec('mv '.$source.' '.$target.'/'.$file_name);
} else {
// Try copying
copy($source, $target . '/' . $file_name);
copy($source, $target.'/'.$file_name);
unlink($source);
}
} else {
copy($source, $target . '/' . $file_name);
copy($source, $target.'/'.$file_name);
unlink($source);
}
return true;

@ -99,7 +99,7 @@ class FormValidator extends HTML_QuickForm
$renderer->setHeaderTemplate('<legend>{header}</legend>');
//Set required field template
$this->setRequiredNote('<span class="form_required">*</span> <small>' . get_lang('ThisFieldIsRequired') . '</small>');
$this->setRequiredNote('<span class="form_required">*</span> <small>'.get_lang('ThisFieldIsRequired').'</small>');
$noteTemplate = <<<EOT
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">{requiredNote}</div>
@ -942,7 +942,7 @@ EOT;
if ($geolocalization) {
$gmapsApiKey = $gMapsPlugin->get('api_key');
$this->addHtml('<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?key='. $gmapsApiKey . '" ></script>');
$this->addHtml('<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?key='.$gmapsApiKey.'" ></script>');
}
$this->addElement(
'text',
@ -980,7 +980,7 @@ EOT;
if (typeof google === "object") {
var address = $("#' . $name . '").val();
var address = $("#' . $name.'").val();
initializeGeo'.$name.'(address, false);
$("#geolocalization_'.$name.'").on("click", function() {
@ -1002,7 +1002,7 @@ EOT;
});
} else {
$("#map_'.$name.'").html("<div class=\"alert alert-info\">' . get_lang('YouNeedToActivateTheGoogleMapsPluginInAdminPlatformToSeeTheMap') . '</div>");
$("#map_'.$name.'").html("<div class=\"alert alert-info\">'.get_lang('YouNeedToActivateTheGoogleMapsPluginInAdminPlatformToSeeTheMap').'</div>");
}
});
@ -1017,7 +1017,7 @@ EOT;
};
var geoError = function(error) {
alert("Geocode ' . get_lang('Error') . ': " + error);
alert("Geocode ' . get_lang('Error').': " + error);
};
var geoOptions = {
@ -1068,11 +1068,11 @@ EOT;
infowindow.open(map_'.$name.', marker);
});
} else {
alert("' . get_lang("NotFound") . '");
alert("' . get_lang("NotFound").'");
}
} else {
alert("Geocode ' . get_lang('Error') . ': ' . get_lang("AddressField") . ' ' . get_lang("NotFound") . '");
alert("Geocode ' . get_lang('Error').': '.get_lang("AddressField").' '.get_lang("NotFound").'");
}
});
}
@ -1107,8 +1107,8 @@ EOT;
$this->with_progress_bar = true;
$id = $this->getAttribute('id');
$this->updateAttributes("onsubmit=\"javascript: addProgress('" . $id . "')\"");
$this->addHtml('<script language="javascript" src="' . api_get_path(WEB_LIBRARY_PATH) . 'javascript/upload.js" type="text/javascript"></script>');
$this->updateAttributes("onsubmit=\"javascript: addProgress('".$id."')\"");
$this->addHtml('<script language="javascript" src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/upload.js" type="text/javascript"></script>');
}
/**
@ -1681,7 +1681,7 @@ EOT;
.attr('target', '_blank')
.prop('href', file.url);
$(data.context.children()[index]).parent().wrap(link);
var successMessage = $('<div class=\"col-sm-3\">').html($('<span class=\"alert alert-success\"/>').text('" . addslashes(get_lang('UplUploadSucceeded')) . "'));
var successMessage = $('<div class=\"col-sm-3\">').html($('<span class=\"alert alert-success\"/>').text('" . addslashes(get_lang('UplUploadSucceeded'))."'));
$(data.context.children()[index]).parent().append(successMessage);
} else if (file.error) {
var error = $('<div class=\"col-sm-3\">').html($('<span class=\"alert alert-danger\"/>').text(file.error));
@ -1691,7 +1691,7 @@ EOT;
$('#dropzone').removeClass('hover');
}).on('fileuploadfail', function (e, data) {
$.each(data.files, function (index) {
var failedMessage = '" . addslashes(get_lang('UplUploadFailed')) . "';
var failedMessage = '" . addslashes(get_lang('UplUploadFailed'))."';
var error = $('<div class=\"col-sm-3\">').html($('<span class=\"alert alert-danger\"/>').text(failedMessage));
$(data.context.children()[index]).parent().append(error);
});

@ -411,7 +411,7 @@ function & get_language_folder_list()
if (!is_array($result)) {
$result = array();
$exceptions = array('.', '..', 'CVS', '.svn');
$search = array('_latin', '_unicode', '_corporate', '_org' , '_KM', '_');
$search = array('_latin', '_unicode', '_corporate', '_org', '_KM', '_');
$replace_with = array(' (Latin)', ' (unicode)', ' (corporate)', ' (org)', ' (KM)', ' ');
$dirname = api_get_path(SYS_LANG_PATH);
$handle = opendir($dirname);
@ -446,9 +446,9 @@ function my_directory_to_array($directory)
if ($handle = opendir($directory)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
if (is_dir($directory. "/" . $file)) {
$array_items = array_merge($array_items, my_directory_to_array($directory. '/' . $file));
$file = $directory . "/" . $file;
if (is_dir($directory."/".$file)) {
$array_items = array_merge($array_items, my_directory_to_array($directory.'/'.$file));
$file = $directory."/".$file;
$array_items[] = preg_replace("/\/\//si", '/', $file);
}
}
@ -493,7 +493,7 @@ function get_config_param($param, $updatePath = '')
// try to recover config file from Chamilo 1.9.x
if (file_exists($updatePath.'main/inc/conf/configuration.php')) {
$updateFromConfigFile = 'main/inc/conf/configuration.php';
} elseif (file_exists($updatePath . 'app/config/configuration.php')) {
} elseif (file_exists($updatePath.'app/config/configuration.php')) {
$updateFromConfigFile = 'app/config/configuration.php';
} else {
// Give up recovering.
@ -654,7 +654,7 @@ function display_language_selection()
<h2><?php get_lang('WelcomeToTheChamiloInstaller'); ?></h2>
<div class="RequirementHeading">
<h2><?php echo display_step_sequence(); ?>
<?php echo get_lang('InstallationLanguage');?>
<?php echo get_lang('InstallationLanguage'); ?>
</h2>
<p><?php echo get_lang('PleaseSelectInstallationProcessLanguage'); ?>:</p>
<form id="lang_form" method="post" action="<?php echo api_get_self(); ?>">
@ -708,14 +708,14 @@ function display_requirements(
}
echo '</div>';
$properlyAccessUrl = checkAccessUrl();
$properlyAccessUrl = checkAccessUrl();
if (!$properlyAccessUrl) {
echo '
<div class="alert alert-danger">
' . Display::return_icon('error.png', get_lang('Error'), [], ICON_SIZE_MEDIUM, true, false, true) .
' ' .
sprintf(get_lang('InstallMultiURLDetectedNotMainURL'), api_get_configuration_value('root_web')) . '
' . Display::return_icon('error.png', get_lang('Error'), [], ICON_SIZE_MEDIUM, true, false, true).
' '.
sprintf(get_lang('InstallMultiURLDetectedNotMainURL'), api_get_configuration_value('root_web')).'
</div>
';
}
@ -747,7 +747,7 @@ function display_requirements(
if (phpversion() < REQUIRED_PHP_VERSION) {
echo '<strong><font color="red">'.get_lang('PHPVersionError').'</font></strong>';
} else {
echo '<strong><font color="green">'.get_lang('PHPVersionOK'). ' '.phpversion().'</font></strong>';
echo '<strong><font color="green">'.get_lang('PHPVersionOK').' '.phpversion().'</font></strong>';
}
echo '</td>
</tr>
@ -1105,9 +1105,9 @@ function display_requirements(
}
$deprecated = [
api_get_path(SYS_CODE_PATH) . 'exercice/',
api_get_path(SYS_CODE_PATH) . 'newscorm/',
api_get_path(SYS_PLUGIN_PATH) . 'ticket/'
api_get_path(SYS_CODE_PATH).'exercice/',
api_get_path(SYS_CODE_PATH).'newscorm/',
api_get_path(SYS_PLUGIN_PATH).'ticket/'
];
$deprecatedToRemove = [];
@ -1217,7 +1217,7 @@ function display_license_agreement()
function get_contact_registration_form()
{
$html ='
$html = '
<div class="form-horizontal">
<div class="panel panel-default">
<div class="panel-body">
@ -1314,7 +1314,7 @@ function get_contact_registration_form()
<div class="col-sm-9">
<div class="radio">
<label>
<input type="radio" name="financial_decision" id="financial_decision1" value="1" checked /> ' . get_lang('Yes') . '
<input type="radio" name="financial_decision" id="financial_decision1" value="1" checked /> ' . get_lang('Yes').'
</label>
</div>
<div class="radio">
@ -1373,8 +1373,8 @@ function displayDatabaseParameter(
echo '<input type="hidden" name="'.$formFieldName.'" id="'.$formFieldName.'" value="'.api_htmlentities($parameterValue).'" />';
echo api_htmlentities($parameterValue);
} else {
echo '<div class="col-sm-5"><input type="' . $inputType . '" class="form-control" size="' . DATABASE_FORM_FIELD_DISPLAY_LENGTH . '" maxlength="' . $maxLength . '" name="' . $formFieldName . '" id="' . $formFieldName . '" value="' . api_htmlentities($parameterValue) . '" />' . "</div>";
echo '<div class="col-sm-3">' . $extra_notice . '</div>';
echo '<div class="col-sm-5"><input type="'.$inputType.'" class="form-control" size="'.DATABASE_FORM_FIELD_DISPLAY_LENGTH.'" maxlength="'.$maxLength.'" name="'.$formFieldName.'" id="'.$formFieldName.'" value="'.api_htmlentities($parameterValue).'" />'."</div>";
echo '<div class="col-sm-3">'.$extra_notice.'</div>';
}
}
}
@ -1408,12 +1408,12 @@ function display_database_settings_form(
$dbNameForm = $_configuration['main_database'];
$dbPortForm = isset($_configuration['db_port']) ? $_configuration['db_port'] : '';
echo '<div class="RequirementHeading"><h2>' . display_step_sequence() .get_lang('DBSetting') . '</h2></div>';
echo '<div class="RequirementHeading"><h2>'.display_step_sequence().get_lang('DBSetting').'</h2></div>';
echo '<div class="RequirementContent">';
echo get_lang('DBSettingUpgradeIntro');
echo '</div>';
} else {
echo '<div class="RequirementHeading"><h2>' . display_step_sequence() .get_lang('DBSetting') . '</h2></div>';
echo '<div class="RequirementHeading"><h2>'.display_step_sequence().get_lang('DBSetting').'</h2></div>';
echo '<div class="RequirementContent">';
echo get_lang('DBSettingIntro');
echo '</div>';
@ -1423,12 +1423,12 @@ function display_database_settings_form(
<div class="panel-body">
<div class="form-group">
<label class="col-sm-4"><?php echo get_lang('DBHost'); ?> </label>
<?php if ($installType == 'update'){ ?>
<?php if ($installType == 'update') { ?>
<div class="col-sm-5">
<input type="hidden" name="dbHostForm" value="<?php echo htmlentities($dbHostForm); ?>" /><?php echo $dbHostForm; ?>
</div>
<div class="col-sm-3"></div>
<?php }else{ ?>
<?php } else { ?>
<div class="col-sm-5">
<input type="text" class="form-control" size="25" maxlength="50" name="dbHostForm" value="<?php echo htmlentities($dbHostForm); ?>" />
</div>
@ -1437,12 +1437,12 @@ function display_database_settings_form(
</div>
<div class="form-group">
<label class="col-sm-4"><?php echo get_lang('DBPort'); ?> </label>
<?php if ($installType == 'update'){ ?>
<?php if ($installType == 'update') { ?>
<div class="col-sm-5">
<input type="hidden" name="dbPortForm" value="<?php echo htmlentities($dbPortForm); ?>" /><?php echo $dbPortForm; ?>
</div>
<div class="col-sm-3"></div>
<?php }else{ ?>
<?php } else { ?>
<div class="col-sm-5">
<input type="text" class="form-control" size="25" maxlength="50" name="dbPortForm" value="<?php echo htmlentities($dbPortForm); ?>" />
</div>
@ -1468,7 +1468,7 @@ function display_database_settings_form(
<?php
//Database Name fix replace weird chars
if ($installType != INSTALL_TYPE_UPDATE) {
$dbNameForm = str_replace(array('-','*', '$', ' ', '.'), '', $dbNameForm);
$dbNameForm = str_replace(array('-', '*', '$', ' ', '.'), '', $dbNameForm);
}
displayDatabaseParameter(
@ -1561,7 +1561,7 @@ function panel($content = null, $title = null, $id = null, $style = null) {
if (!empty($title)) {
$panelTitle = Display::div($title, array('class' => 'panel-heading'));
$panelBody = Display::div($content, array('class' => 'panel-body'));
$panelParent = Display::div($panelTitle . $panelBody, array('id' => $id, 'class' => 'panel panel-'.$style));
$panelParent = Display::div($panelTitle.$panelBody, array('id' => $id, 'class' => 'panel panel-'.$style));
} else {
$panelBody = Display::div($html, array('class' => 'panel-body'));
$panelParent = Display::div($panelBody, array('id' => $id, 'class' => 'panel panel-'.$style));
@ -1587,9 +1587,9 @@ function display_configuration_parameter(
$displayWhenUpdate = 'true'
) {
$html = '<div class="form-group">';
$html .= '<label class="col-sm-6 control-label">' . $parameterName . '</label>';
$html .= '<label class="col-sm-6 control-label">'.$parameterName.'</label>';
if ($installType == INSTALL_TYPE_UPDATE && $displayWhenUpdate) {
$html .= '<input type="hidden" name="' . $formFieldName . '" value="'. api_htmlentities($parameterValue, ENT_QUOTES). '" />' . $parameterValue;
$html .= '<input type="hidden" name="'.$formFieldName.'" value="'.api_htmlentities($parameterValue, ENT_QUOTES).'" />'.$parameterValue;
} else {
$html .= '<div class="col-sm-6"><input class="form-control" type="text" size="'.FORM_FIELD_DISPLAY_LENGTH.'" maxlength="'.MAX_FORM_FIELD_LENGTH.'" name="'.$formFieldName.'" value="'.api_htmlentities($parameterValue, ENT_QUOTES).'" />'."</div>";
}
@ -1637,7 +1637,7 @@ function display_configuration_settings_form(
$languageForm = $_SESSION['install_language'];
}
echo '<div class="RequirementHeading">';
echo "<h2>" . display_step_sequence() . get_lang("CfgSetting") . "</h2>";
echo "<h2>".display_step_sequence().get_lang("CfgSetting")."</h2>";
echo '</div>';
echo '<p>'.get_lang('ConfigSettingsInfo').' <strong>app/config/configuration.php</strong></p>';
@ -1655,14 +1655,14 @@ function display_configuration_settings_form(
// Parameters 3 and 4: administrator's names
$html .= display_configuration_parameter($installType, get_lang('AdminFirstName'), 'adminFirstName', $adminFirstName);
$html .= display_configuration_parameter($installType, get_lang('AdminLastName'), 'adminLastName', $adminLastName);
$html .= display_configuration_parameter($installType, get_lang('AdminFirstName'), 'adminFirstName', $adminFirstName);
$html .= display_configuration_parameter($installType, get_lang('AdminLastName'), 'adminLastName', $adminLastName);
//Parameter 3: administrator's email
$html .= display_configuration_parameter($installType, get_lang('AdminEmail'), 'emailForm', $emailForm);
$html .= display_configuration_parameter($installType, get_lang('AdminEmail'), 'emailForm', $emailForm);
//Parameter 6: administrator's telephone
$html .= display_configuration_parameter($installType, get_lang('AdminPhone'), 'adminPhoneForm', $adminPhoneForm);
$html .= display_configuration_parameter($installType, get_lang('AdminPhone'), 'adminPhoneForm', $adminPhoneForm);
echo panel($html, get_lang('Administrator'), 'administrator');
@ -1681,12 +1681,12 @@ function display_configuration_settings_form(
$html .= display_language_selection_box('languageForm', $languageForm);
$html .= '</div>';
}
$html.= "</div>";
$html .= "</div>";
//Second parameter: Chamilo URL
$html .= '<div class="form-group">';
$html .= '<label class="col-sm-6 control-label">'.get_lang('ChamiloURL') .get_lang('ThisFieldIsRequired').'</label>';
$html .= '<label class="col-sm-6 control-label">'.get_lang('ChamiloURL').get_lang('ThisFieldIsRequired').'</label>';
@ -1710,34 +1710,34 @@ function display_configuration_settings_form(
$html .= '<div class="form-group">
<label class="col-sm-6 control-label">' . get_lang("EncryptMethodUserPass") . '</label>
<label class="col-sm-6 control-label">' . get_lang("EncryptMethodUserPass").'</label>
<div class="col-sm-6">';
if ($installType == 'update') {
$html .= '<input type="hidden" name="encryptPassForm" value="'. $encryptPassForm .'" />'. $encryptPassForm;
$html .= '<input type="hidden" name="encryptPassForm" value="'.$encryptPassForm.'" />'.$encryptPassForm;
} else {
$html .= '<div class="checkbox">
<label>
<input type="radio" name="encryptPassForm" value="bcrypt" id="encryptPass1" '. ($encryptPassForm == 'bcrypt' ? 'checked="checked" ':'') .'/> bcrypt
<input type="radio" name="encryptPassForm" value="bcrypt" id="encryptPass1" '. ($encryptPassForm == 'bcrypt' ? 'checked="checked" ' : '').'/> bcrypt
</label>';
$html .= '<label>
<input type="radio" name="encryptPassForm" value="sha1" id="encryptPass1" '. ($encryptPassForm == 'sha1' ? 'checked="checked" ':'') .'/> sha1
<input type="radio" name="encryptPassForm" value="sha1" id="encryptPass1" '. ($encryptPassForm == 'sha1' ? 'checked="checked" ' : '').'/> sha1
</label>';
$html .= '<label>
<input type="radio" name="encryptPassForm" value="md5" id="encryptPass0" '. ($encryptPassForm == 'md5' ? 'checked="checked" ':'') .'/> md5
<input type="radio" name="encryptPassForm" value="md5" id="encryptPass0" '. ($encryptPassForm == 'md5' ? 'checked="checked" ' : '').'/> md5
</label>';
$html .= '<label>
<input type="radio" name="encryptPassForm" value="none" id="encryptPass2" '. ($encryptPassForm == 'none' ? 'checked="checked" ':'') .'/>'. get_lang('None').'
<input type="radio" name="encryptPassForm" value="none" id="encryptPass2" '. ($encryptPassForm == 'none' ? 'checked="checked" ' : '').'/>'.get_lang('None').'
</label>';
$html .= '</div>';
}
$html .= '</div></div>';
$html .= '<div class="form-group">
<label class="col-sm-6 control-label">' . get_lang('AllowSelfReg') . '</label>
<label class="col-sm-6 control-label">' . get_lang('AllowSelfReg').'</label>
<div class="col-sm-6">';
if ($installType == 'update') {
if ($allowSelfReg == 'true') {
@ -1747,17 +1747,17 @@ function display_configuration_settings_form(
} else {
$label = get_lang('AfterApproval');
}
$html .= '<input type="hidden" name="allowSelfReg" value="'. $allowSelfReg .'" />'. $label;
$html .= '<input type="hidden" name="allowSelfReg" value="'.$allowSelfReg.'" />'.$label;
} else {
$html .= '<div class="control-group">';
$html .= '<label class="checkbox-inline">
<input type="radio" name="allowSelfReg" value="true" id="allowSelfReg1" '. ($allowSelfReg == 'true' ? 'checked="checked" ' : '') . ' /> '. get_lang('Yes') .'
<input type="radio" name="allowSelfReg" value="true" id="allowSelfReg1" '. ($allowSelfReg == 'true' ? 'checked="checked" ' : '').' /> '.get_lang('Yes').'
</label>';
$html .= '<label class="checkbox-inline">
<input type="radio" name="allowSelfReg" value="false" id="allowSelfReg0" '. ($allowSelfReg == 'false' ? '' : 'checked="checked" ') .' /> '. get_lang('No') .'
<input type="radio" name="allowSelfReg" value="false" id="allowSelfReg0" '. ($allowSelfReg == 'false' ? '' : 'checked="checked" ').' /> '.get_lang('No').'
</label>';
$html .= '<label class="checkbox-inline">
<input type="radio" name="allowSelfReg" value="approval" id="allowSelfReg2" '. ($allowSelfReg == 'approval' ? '' : 'checked="checked" ') .' /> '. get_lang('AfterApproval') .'
<input type="radio" name="allowSelfReg" value="approval" id="allowSelfReg2" '. ($allowSelfReg == 'approval' ? '' : 'checked="checked" ').' /> '.get_lang('AfterApproval').'
</label>';
$html .= '</div>';
}
@ -1765,7 +1765,7 @@ function display_configuration_settings_form(
$html .= '</div>';
$html .= '<div class="form-group">';
$html .= '<label class="col-sm-6 control-label">'. get_lang('AllowSelfRegProf') .'</label>
$html .= '<label class="col-sm-6 control-label">'.get_lang('AllowSelfRegProf').'</label>
<div class="col-sm-6">';
if ($installType == 'update') {
if ($allowSelfRegProf == 'true') {
@ -1773,16 +1773,16 @@ function display_configuration_settings_form(
} else {
$label = get_lang('No');
}
$html .= '<input type="hidden" name="allowSelfRegProf" value="'. $allowSelfRegProf.'" />'. $label;
$html .= '<input type="hidden" name="allowSelfRegProf" value="'.$allowSelfRegProf.'" />'.$label;
} else {
$html .= '<div class="control-group">
<label class="checkbox-inline">
<input type="radio" name="allowSelfRegProf" value="1" id="allowSelfRegProf1" '. ($allowSelfRegProf ? 'checked="checked" ' : '') .'/>
' . get_lang('Yes') .'
<input type="radio" name="allowSelfRegProf" value="1" id="allowSelfRegProf1" '. ($allowSelfRegProf ? 'checked="checked" ' : '').'/>
' . get_lang('Yes').'
</label>';
$html .= '<label class="checkbox-inline">
<input type="radio" name="allowSelfRegProf" value="0" id="allowSelfRegProf0" '. ($allowSelfRegProf ? '' : 'checked="checked" ') .' />
'. get_lang('No') .'
<input type="radio" name="allowSelfRegProf" value="0" id="allowSelfRegProf0" '. ($allowSelfRegProf ? '' : 'checked="checked" ').' />
'. get_lang('No').'
</label>';
$html .= '</div>';
}
@ -1847,7 +1847,7 @@ function get_countries_list_from_array($combo = false)
"Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia", "Moldova", "Monaco", "Mongolia", "Morocco", "Mozambique", "Myanmar",
"Namibia", "Nauru", "Nepa", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway",
"Oman",
"Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland","Portugal",
"Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal",
"Qatar",
"Romania", "Russia", "Rwanda",
"Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia and Montenegro", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "Spain", "Sri Lanka", "Sudan", "Suriname", "Swaziland", "Sweden", "Switzerland", "Syria",
@ -1894,11 +1894,11 @@ function updateDirAndFilesPermissions()
$permissions_for_new_directories = isset($_SESSION['permissions_for_new_directories']) ? $_SESSION['permissions_for_new_directories'] : 0770;
$permissions_for_new_files = isset($_SESSION['permissions_for_new_files']) ? $_SESSION['permissions_for_new_files'] : 0660;
// use decoct() to store as string
$sql = "UPDATE $table SET selected_value = '0" . decoct($permissions_for_new_directories) . "'
$sql = "UPDATE $table SET selected_value = '0".decoct($permissions_for_new_directories)."'
WHERE variable = 'permissions_for_new_directories'";
Database::query($sql);
$sql = "UPDATE $table SET selected_value = '0" . decoct($permissions_for_new_files) . "' WHERE variable = 'permissions_for_new_files'";
$sql = "UPDATE $table SET selected_value = '0".decoct($permissions_for_new_files)."' WHERE variable = 'permissions_for_new_files'";
Database::query($sql);
if (isset($_SESSION['permissions_for_new_directories'])) {
@ -1918,8 +1918,8 @@ function updateDirAndFilesPermissions()
function compare_setting_values($current_value, $wanted_value)
{
$current_value_string = $current_value;
$current_value = (float)$current_value;
$wanted_value = (float)$wanted_value;
$current_value = (float) $current_value;
$wanted_value = (float) $wanted_value;
if ($current_value >= $wanted_value) {
return Display::label($current_value_string, 'success');
@ -1983,7 +1983,7 @@ function check_course_script_interpretation($course_dir, $course_attempt_name, $
fwrite($fp, $out);
while (!feof($fp)) {
$result = str_replace("\r\n", '',fgets($fp, 128));
$result = str_replace("\r\n", '', fgets($fp, 128));
if (!empty($result) && $result == '123') {
$output = true;
}
@ -2006,7 +2006,7 @@ function check_course_script_interpretation($course_dir, $course_attempt_name, $
curl_setopt($ch, CURLOPT_URL, $url);
//curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec ($ch);
$result = curl_exec($ch);
if (!empty($result) && $result == '123') {
$output = true;
}
@ -2860,12 +2860,12 @@ function finishInstallation(
$adminPhoneForm,
'', //$picture_uri = '',
PLATFORM_AUTH_SOURCE,
'',//$expirationDate,
'', //$expirationDate,
1,
0,
null,
'',
false, //$send_mail = false,
false, //$send_mail = false,
true //$isAdmin = false
);
@ -2887,7 +2887,7 @@ function finishInstallation(
0,
null,
'',
false, //$send_mail = false,
false, //$send_mail = false,
false //$isAdmin = false
);
@ -2922,7 +2922,7 @@ function finishInstallation(
Database::query($sql);
foreach ($files as $version) {
$version = str_replace(['Version', '.php' ], '', $version->getFilename());
$version = str_replace(['Version', '.php'], '', $version->getFilename());
$sql = "INSERT INTO version (version) VALUES ('$version')";
Database::query($sql);
}
@ -2968,7 +2968,7 @@ function installProfileSettings($installationProfile = '')
SET selected_value = '".$param->selected_value."'
WHERE variable = '".$param->variable."'";
if (!empty($param->subkey)) {
$sql .= " AND subkey='" . $param->subkey . "'";
$sql .= " AND subkey='".$param->subkey."'";
}
Database::query($sql);
}

@ -27,7 +27,7 @@ if (isset($_GET['action'])) {
// Including the global initialization file.
require_once __DIR__.'/../inc/global.inc.php';
$current_course_tool = TOOL_LEARNPATH;
$current_course_tool = TOOL_LEARNPATH;
$_course = api_get_course_info();
$glossaryExtraTools = api_get_setting('show_glossary_in_extra_tools');
@ -39,11 +39,11 @@ if ($showGlossary) {
) {
$htmlHeadXtra[] = '<script>
<!--
var jQueryFrameReadyConfigPath = \'' . api_get_jquery_web_path() . '\';
var jQueryFrameReadyConfigPath = \'' . api_get_jquery_web_path().'\';
-->
</script>';
$htmlHeadXtra[] = '<script src="' . api_get_path(WEB_LIBRARY_PATH) . 'javascript/jquery.frameready.js" type="text/javascript" language="javascript"></script>';
$htmlHeadXtra[] = '<script src="' . api_get_path(WEB_LIBRARY_PATH) . 'javascript/jquery.highlight.js" type="text/javascript" language="javascript"></script>';
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.frameready.js" type="text/javascript" language="javascript"></script>';
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.highlight.js" type="text/javascript" language="javascript"></script>';
}
}
@ -248,7 +248,7 @@ if (isset($_SESSION['lpobject'])) {
$course_id = api_get_course_int_id();
if ($debug>0) error_log('New LP - Passed data remains check', 0);
if ($debug > 0) error_log('New LP - Passed data remains check', 0);
if (!$lp_found || (!empty($_REQUEST['lp_id']) && $_SESSION['oLP']->get_id() != $_REQUEST['lp_id'])) {
if ($debug > 0) error_log('New LP - oLP is not object, has changed or refresh been asked, getting new', 0);
@ -272,7 +272,7 @@ if (!$lp_found || (!empty($_REQUEST['lp_id']) && $_SESSION['oLP']->get_id() != $
if (Database::num_rows($res)) {
$row = Database::fetch_array($res);
$type = $row['lp_type'];
if ($debug > 0) error_log('New LP - found row - type '.$type. ' - Calling constructor with '.api_get_course_id().' - '.$lp_id.' - '.api_get_user_id(), 0);
if ($debug > 0) error_log('New LP - found row - type '.$type.' - Calling constructor with '.api_get_course_id().' - '.$lp_id.' - '.api_get_user_id(), 0);
switch ($type) {
case 1:
if ($debug > 0) error_log('New LP - found row - type dokeos - Calling constructor with '.api_get_course_id().' - '.$lp_id.' - '.api_get_user_id(), 0);
@ -707,8 +707,8 @@ switch ($action) {
$editPrerequisite = $_SESSION['oLP']->edit_item_prereq(
$_GET['id'],
$_POST['prerequisites'],
$_POST['min_' . $_POST['prerequisites']],
$_POST['max_' . $_POST['prerequisites']]
$_POST['min_'.$_POST['prerequisites']],
$_POST['max_'.$_POST['prerequisites']]
);
if ($editPrerequisite) {
@ -968,7 +968,7 @@ switch ($action) {
$_SESSION['oLP']->setAccumulateScormTime($accumulateScormTime);
if (isset($_REQUEST['activate_start_date_check']) && $_REQUEST['activate_start_date_check'] == 1) {
$publicated_on = $_REQUEST['publicated_on'];
$publicated_on = $_REQUEST['publicated_on'];
} else {
$publicated_on = null;
}
@ -1148,8 +1148,8 @@ switch ($action) {
error_log('New LP - No learnpath given for view', 0);
require 'lp_list.php';
} else {
if ($debug > 0) {error_log('New LP - Trying to set current item to ' . $_REQUEST['item_id'], 0); }
if ( !empty($_REQUEST['item_id']) ) {
if ($debug > 0) {error_log('New LP - Trying to set current item to '.$_REQUEST['item_id'], 0); }
if (!empty($_REQUEST['item_id'])) {
$_SESSION['oLP']->set_current_item($_REQUEST['item_id']);
}
require 'lp_view.php';
@ -1231,7 +1231,7 @@ switch ($action) {
break;
*/
case 'switch_attempt_mode':
if(!$lp_found){ error_log('New LP - No learnpath given for switch',0); require 'lp_list.php'; }
if (!$lp_found) { error_log('New LP - No learnpath given for switch', 0); require 'lp_list.php'; }
$_SESSION['refresh'] = 1;
$_SESSION['oLP']->switch_attempt_mode();
require 'lp_list.php';
@ -1276,8 +1276,8 @@ switch ($action) {
error_log('New LP - No learnpath given for view', 0);
require 'lp_list.php';
} else {
if ($debug > 0) {error_log('New LP - Trying to impress this LP item to ' . $_REQUEST['item_id'], 0); }
if (!empty($_REQUEST['item_id']) ) {
if ($debug > 0) {error_log('New LP - Trying to impress this LP item to '.$_REQUEST['item_id'], 0); }
if (!empty($_REQUEST['item_id'])) {
$_SESSION['oLP']->set_current_item($_REQUEST['item_id']);
}
require 'lp_impress.php';
@ -1337,7 +1337,7 @@ switch ($action) {
$_SESSION['oLP']->lp_session_id
);
$forumCategoryId = !empty($forumCategory) ? $forumCategory['cat_id']: 0;
$forumCategoryId = !empty($forumCategory) ? $forumCategory['cat_id'] : 0;
if (empty($forumCategoryId)) {
$forumCategoryId = store_forumcategory(
@ -1369,7 +1369,7 @@ switch ($action) {
}
}
header('Location:' . api_get_self() . '?' . http_build_query([
header('Location:'.api_get_self().'?'.http_build_query([
'action' => 'add_item',
'type' => 'step',
'lp_id' => $_SESSION['oLP']->lp_id
@ -1409,7 +1409,7 @@ switch ($action) {
}
}
header('Location:' . api_get_self() . '?' . http_build_query([
header('Location:'.api_get_self().'?'.http_build_query([
'action' => 'add_item',
'type' => 'step',
'lp_id' => $_SESSION['oLP']->lp_id
@ -1429,7 +1429,7 @@ switch ($action) {
}
$_SESSION['oLP']->getFinalItemForm();
$redirectTo = api_get_self() . '?' . api_get_cidreq().'&'.http_build_query([
$redirectTo = api_get_self().'?'.api_get_cidreq().'&'.http_build_query([
'action' => 'add_item',
'type' => 'step',
'lp_id' => intval($_SESSION['oLP']->lp_id)

@ -58,9 +58,9 @@ abstract class OpenofficeDocument extends learnpath
///learning_path/ppt_dirname directory
$this->created_dir = $result['dir'];
if (substr($this->created_dir, -1, 1) == '/') {
$this->file_path = $this->created_dir . api_replace_dangerous_char($file['name']);
$this->file_path = $this->created_dir.api_replace_dangerous_char($file['name']);
} else {
$this->file_path = $this->created_dir . '/' . api_replace_dangerous_char($file['name']);
$this->file_path = $this->created_dir.'/'.api_replace_dangerous_char($file['name']);
}
//var_dump($this->file_name, $this->file_path, $this->base_work_dir, $this->created_dir);
@ -104,18 +104,18 @@ abstract class OpenofficeDocument extends learnpath
$perm = api_get_setting('permissions_for_new_files');
if (IS_WINDOWS_OS) { // IS_WINDOWS_OS has been defined in main_api.lib.php
$converter_path = str_replace('/', '\\', api_get_path(SYS_PATH) . 'main/inc/lib/ppt2png');
$class_path = $converter_path . ';' . $converter_path . '/jodconverter-2.2.2.jar;' . $converter_path . '/jodconverter-cli-2.2.2.jar';
$converter_path = str_replace('/', '\\', api_get_path(SYS_PATH).'main/inc/lib/ppt2png');
$class_path = $converter_path.';'.$converter_path.'/jodconverter-2.2.2.jar;'.$converter_path.'/jodconverter-cli-2.2.2.jar';
//$cmd = 'java -cp "'.$class_path.'" DokeosConverter';
$cmd = 'java -Dfile.encoding=UTF-8 -cp "' . $class_path . '" DokeosConverter';
$cmd = 'java -Dfile.encoding=UTF-8 -cp "'.$class_path.'" DokeosConverter';
} else {
$converter_path = api_get_path(SYS_PATH) . 'main/inc/lib/ppt2png';
$converter_path = api_get_path(SYS_PATH).'main/inc/lib/ppt2png';
//$class_path = '-cp .:jodconverter-2.2.1.jar:jodconverter-cli-2.2.1.jar';
$class_path = ' -Dfile.encoding=UTF-8 -cp .:jodconverter-2.2.2.jar:jodconverter-cli-2.2.2.jar';
$cmd = 'cd ' . $converter_path . ' && java ' . $class_path . ' DokeosConverter';
$cmd = 'cd '.$converter_path.' && java '.$class_path.' DokeosConverter';
}
$cmd .= ' -p ' . api_get_setting('service_ppt2lp', 'port');
$cmd .= ' -p '.api_get_setting('service_ppt2lp', 'port');
// Call to the function implemented by child.
$cmd .= $this->add_command_parameters();
// To allow openoffice to manipulate docs.
@ -124,7 +124,7 @@ abstract class OpenofficeDocument extends learnpath
@chmod($this->base_work_dir.$this->file_path, 0777);
$locale = $this->original_locale; // TODO: Improve it because we're not sure this locale is present everywhere.
putenv('LC_ALL=' . $locale);
putenv('LC_ALL='.$locale);
$files = array();
$return = 0;
@ -153,12 +153,12 @@ abstract class OpenofficeDocument extends learnpath
$result = $this->_get_remote_ppt2lp_files($file, $size);
$result = unserialize($result);
// Save remote images to server
chmod($this->base_work_dir . $this->created_dir, api_get_permissions_for_new_directories());
chmod($this->base_work_dir.$this->created_dir, api_get_permissions_for_new_directories());
if (!empty($result['images'])) {
foreach ($result['images'] as $image => $img_data) {
$image_path = $this->base_work_dir.$this->created_dir;
@file_put_contents($image_path . '/' . $image, base64_decode($img_data));
@chmod($image_path . '/' . $image, 0777);
@file_put_contents($image_path.'/'.$image, base64_decode($img_data));
@chmod($image_path.'/'.$image, 0777);
}
}
@ -202,7 +202,7 @@ abstract class OpenofficeDocument extends learnpath
$uri = '';
$result = preg_match('/^([a-zA-Z0-9]*):\/\/([^\/]*)\//', $ppt2lp_host, $matches);
if ($result) {
$uri = $matches[1] . '://' . $matches[2] . '/';
$uri = $matches[1].'://'.$matches[2].'/';
} else {
$uri = $ppt2lp_host;
}
@ -221,7 +221,7 @@ abstract class OpenofficeDocument extends learnpath
'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | 9,
);
if (substr($ppt2lp_host, 0, 5) === 'https') {
$options['ssl_method'] = SOAP_SSL_METHOD_TLS;
$options['ssl_method'] = SOAP_SSL_METHOD_TLS;
// If using SSL, please note that *not* supporting the SSLv2
// (broken in terms of security), the server tends to generate
// the following issue:
@ -246,7 +246,7 @@ abstract class OpenofficeDocument extends learnpath
//error_log('['.time().'] Calling wsConvertPpt webservice on ' . $ppt2lp_host);
$result = $client->__call('wsConvertPpt', array('pptData' => $params));
} catch (Exception $e) {
error_log('['.time().'] Chamilo SOAP call error: ' . $e->getMessage());
error_log('['.time().'] Chamilo SOAP call error: '.$e->getMessage());
}
// Make sure we destroy the SOAP client as it may generate SSL connection
// binding issue (if using SSL)
@ -279,38 +279,38 @@ abstract class OpenofficeDocument extends learnpath
$ppt2lpHost = api_get_setting('service_ppt2lp', 'host');
$permissionFile = api_get_permissions_for_new_files();
$permissionFolder = api_get_permissions_for_new_directories();
if (file_exists($this->base_work_dir . '/' . $this->created_dir)) {
if (file_exists($this->base_work_dir.'/'.$this->created_dir)) {
return $ids;
}
if ($ppt2lpHost == 'localhost') {
if (IS_WINDOWS_OS) { // IS_WINDOWS_OS has been defined in main_api.lib.php
$converterPath = str_replace('/', '\\', api_get_path(SYS_PATH) . 'main/inc/lib/ppt2png');
$classPath = $converterPath . ';' . $converterPath . '/jodconverter-2.2.2.jar;' . $converterPath . '/jodconverter-cli-2.2.2.jar';
$cmd = 'java -Dfile.encoding=UTF-8 -jar "' . $classPath . '/jodconverter-2.2.2.jar"';
$converterPath = str_replace('/', '\\', api_get_path(SYS_PATH).'main/inc/lib/ppt2png');
$classPath = $converterPath.';'.$converterPath.'/jodconverter-2.2.2.jar;'.$converterPath.'/jodconverter-cli-2.2.2.jar';
$cmd = 'java -Dfile.encoding=UTF-8 -jar "'.$classPath.'/jodconverter-2.2.2.jar"';
} else {
$converterPath = api_get_path(SYS_PATH) . 'main/inc/lib/ppt2png';
$converterPath = api_get_path(SYS_PATH).'main/inc/lib/ppt2png';
$classPath = ' -Dfile.encoding=UTF-8 -jar jodconverter-cli-2.2.2.jar';
$cmd = 'cd ' . $converterPath . ' && java ' . $classPath . ' ';
$cmd = 'cd '.$converterPath.' && java '.$classPath.' ';
}
$cmd .= ' -p ' . api_get_setting('service_ppt2lp', 'port');
$cmd .= ' -p '.api_get_setting('service_ppt2lp', 'port');
// Call to the function implemented by child.
$cmd .= ' "' . $this->base_work_dir . '/' . $this->file_path . '" "' . $this->base_work_dir . '/' . $this->created_dir . '"';
$cmd .= ' "'.$this->base_work_dir.'/'.$this->file_path.'" "'.$this->base_work_dir.'/'.$this->created_dir.'"';
// To allow openoffice to manipulate docs.
@chmod($this->base_work_dir, $permissionFolder);
@chmod($this->base_work_dir . '/' . $this->file_path, $permissionFile);
@chmod($this->base_work_dir.'/'.$this->file_path, $permissionFile);
$locale = $this->original_locale; // TODO: Improve it because we're not sure this locale is present everywhere.
putenv('LC_ALL=' . $locale);
putenv('LC_ALL='.$locale);
$files = array();
$return = 0;
$shell = exec($cmd, $files, $return);
// TODO: Chown is not working, root keep user privileges, should be www-data
@chown($this->base_work_dir . '/' . $this->created_dir, 'www-data');
@chmod($this->base_work_dir . '/' . $this->created_dir, $permissionFile);
@chown($this->base_work_dir.'/'.$this->created_dir, 'www-data');
@chmod($this->base_work_dir.'/'.$this->created_dir, $permissionFile);
if ($return != 0) { // If the java application returns an error code.
switch ($return) {
@ -352,14 +352,14 @@ abstract class OpenofficeDocument extends learnpath
*/
}
if (file_exists($this->base_work_dir . '/' . $this->created_dir)) {
if (file_exists($this->base_work_dir.'/'.$this->created_dir)) {
// Register Files to Document tool
$ids[] = add_document(
$_course,
'/' . $this->created_dir,
'/'.$this->created_dir,
'file',
filesize($this->base_work_dir . '/' . $this->created_dir),
filesize($this->base_work_dir.'/'.$this->created_dir),
$convertedTitle,
sprintf(
get_lang('FileConvertedFromXToY'),

@ -98,7 +98,7 @@ class OpenofficePresentation extends OpenofficeDocument
);
// Generating the thumbnail.
$image = $this->base_work_dir.$dir . $file_name;
$image = $this->base_work_dir.$dir.$file_name;
$pattern = '/(\w+)\.png$/';
$replacement = '${1}_thumb.png';
@ -114,7 +114,7 @@ class OpenofficePresentation extends OpenofficeDocument
$my_new_image = new Image($image);
$my_new_image->resize($thumb_width, $thumb_height);
$my_new_image->send_image($this->base_work_dir.$dir . $thumb_name, -1, 'png');
$my_new_image->send_image($this->base_work_dir.$dir.$thumb_name, -1, 'png');
// Adding the thumbnail to documents.
$document_id_thumb = add_document(
@ -140,7 +140,7 @@ class OpenofficePresentation extends OpenofficeDocument
<body>
<img src="'.$slide_src.'" />
</body>
</html>'); // This indentation is to make the generated html files to look well.
</html>'); // This indentation is to make the generated html files to look well.
fclose($fp);
$document_id = add_document(
@ -191,7 +191,7 @@ class OpenofficePresentation 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) {
@ -200,7 +200,7 @@ class OpenofficePresentation extends OpenofficeDocument
}
}
}
$slide_body = $all_specific_terms .' '. $slide_body;
$slide_body = $all_specific_terms.' '.$slide_body;
$ic_slide->addValue('content', $slide_body);
/* FIXME: cidReq:lp_id:doc_id al indexar */
// Add a comment to say terms separated by commas.
@ -212,7 +212,7 @@ class OpenofficePresentation 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);
@ -250,7 +250,7 @@ class OpenofficePresentation extends OpenofficeDocument
$_course = api_get_course_info();
foreach ($files as $file) {
// '||' is used as separator between slide name (with accents) and file name (without accents).
list($slide_name,$file_name) = explode('||',$file);
list($slide_name, $file_name) = explode('||', $file);
$slide_name = api_htmlentities($slide_name, ENT_COMPAT, $this->original_charset);
$slide_name = str_replace('&rsquo;', '\'', $slide_name);
$slide_name = api_convert_encoding($slide_name, api_get_system_encoding(), $this->original_charset);

@ -46,7 +46,7 @@ $course_id = api_get_course_int_id();
$tbl_course_rel_user = $table = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$sql = "SELECT user_id
FROM $tbl_course_rel_user
WHERE status = '1' AND c_id = '" . api_get_course_int_id() . "'";
WHERE status = '1' AND c_id = '".api_get_course_int_id()."'";
$result = Database::query($sql);
while ($user = Database::fetch_assoc($result)) {
unset($blog_users[$user['user_id']]);
@ -110,7 +110,7 @@ if (api_get_setting('group_roles') == 'true') {
}
}
echo "<form method=\"post\" action=\"" . str_replace('&', '&amp;', $_SERVER['REQUEST_URI']) . "\">";
echo "<form method=\"post\" action=\"".str_replace('&', '&amp;', $_SERVER['REQUEST_URI'])."\">";
// ---------------------------------------------------
// DISPLAYING THE ROLES LIST
@ -118,7 +118,7 @@ echo "<form method=\"post\" action=\"" . str_replace('&', '&amp;', $_SERVER['REQ
if (api_get_setting('user_roles') == 'true') {
// the list of the roles for the user
echo '<strong>' . get_lang('UserRoles') . '</strong><br />';
echo '<strong>'.get_lang('UserRoles').'</strong><br />';
$current_user_course_roles = get_roles('user', $user_id);
$current_user_platform_roles = get_roles('user', $user_id, 'platform');
display_role_list($current_user_course_roles, $current_user_platform_roles);
@ -132,24 +132,24 @@ echo "<table class=\"data_table\">\n";
// the header
echo "\t<tr>\n";
echo "\t\t<th rowspan=\"2\">" . get_lang('Module') . "</th>\n";
echo "\t\t<th colspan=\"4\">" . get_lang('ArticleManager') . "</th>\n";
echo "\t\t<th colspan=\"3\">" . get_lang('CommentManager') . "</th>\n";
echo "\t\t<th colspan=\"3\">" . get_lang('BlogManager') . "</th>\n";
echo "\t\t<th rowspan=\"2\">".get_lang('Module')."</th>\n";
echo "\t\t<th colspan=\"4\">".get_lang('ArticleManager')."</th>\n";
echo "\t\t<th colspan=\"3\">".get_lang('CommentManager')."</th>\n";
echo "\t\t<th colspan=\"3\">".get_lang('BlogManager')."</th>\n";
echo "\t</tr>\n";
// Subheader
echo "\t<tr>\n";
echo "\t\t<th align='center'>" . get_lang('Add') . "</th>\n";
echo "\t\t<th align='center'>" . get_lang('Delete') . "</th>\n";
echo "\t\t<th align='center'>" . get_lang('Edit') . "</th>\n";
echo "\t\t<th align='center'>" . get_lang('Rate') . "</th>\n";
echo "\t\t<th align='center'>" . get_lang('Add') . "</th>\n";
echo "\t\t<th align='center'>" . get_lang('Delete') . "</th>\n";
echo "\t\t<th align='center'>" . get_lang('Rate') . "</th>\n";
echo "\t\t<th align='center'>" . get_lang('Tasks') . "</th>\n";
echo "\t\t<th align='center'>" . get_lang('Members') . "</th>\n";
echo "\t\t<th align='center'>" . get_lang('Roles') . "</th>\n";
echo "\t\t<th align='center'>".get_lang('Add')."</th>\n";
echo "\t\t<th align='center'>".get_lang('Delete')."</th>\n";
echo "\t\t<th align='center'>".get_lang('Edit')."</th>\n";
echo "\t\t<th align='center'>".get_lang('Rate')."</th>\n";
echo "\t\t<th align='center'>".get_lang('Add')."</th>\n";
echo "\t\t<th align='center'>".get_lang('Delete')."</th>\n";
echo "\t\t<th align='center'>".get_lang('Rate')."</th>\n";
echo "\t\t<th align='center'>".get_lang('Tasks')."</th>\n";
echo "\t\t<th align='center'>".get_lang('Members')."</th>\n";
echo "\t\t<th align='center'>".get_lang('Roles')."</th>\n";
echo "\t</tr>\n";
// the main area with the checkboxes or images
@ -171,7 +171,7 @@ foreach ($blog_users as $user_id => $user_name) { // $blog_users contains all th
display_image_matrix_for_blogs(
$current_user_permissions,
$user_id,
'BLOG_' . $blog_id,
'BLOG_'.$blog_id,
$value,
(isset($inherited_permissions) ? $inherited_permissions : null),
(isset($course_admin) ? $course_admin : null)
@ -190,7 +190,7 @@ echo "</table>\n";
echo "</form><br />";
// LEGEND
echo '<strong>' . get_lang('Legend') . '</strong><br />';
echo '<img src="../img/wrong.gif" /> ' . get_lang('UserHasPermissionNot') . '<br />';
echo '<img src="../img/checkbox_on2.gif" /> ' . get_lang('UserHasPermission') . '<br />';
echo '<img src="../img/checkbox_on3.gif" /> ' . get_lang('UserHasPermissionByRoleGroup') . '<br />';
echo '<strong>'.get_lang('Legend').'</strong><br />';
echo '<img src="../img/wrong.gif" /> '.get_lang('UserHasPermissionNot').'<br />';
echo '<img src="../img/checkbox_on2.gif" /> '.get_lang('UserHasPermission').'<br />';
echo '<img src="../img/checkbox_on3.gif" /> '.get_lang('UserHasPermissionByRoleGroup').'<br />';

@ -16,10 +16,10 @@ function reports_modules_quiz_init_forEachCourses($course_code, $course_id, $cou
array_push($reports_modules['quiz'],
array(
'keys_query' =>
'select ' . $course_id . ' as course_id, ' .
$reports_modules_quiz_toolid . ' as tool_id, ' .
'q.id as child_id, q.title as child_name, ' .
"'" . $course_code . "'" . ' as course_code from ' . Database::get_course_table(TABLE_QUIZ_TEST) . ' q ',
'select '.$course_id.' as course_id, '.
$reports_modules_quiz_toolid.' as tool_id, '.
'q.id as child_id, q.title as child_name, '.
"'".$course_code."'".' as course_code from '.Database::get_course_table(TABLE_QUIZ_TEST).' q ',
'values_query_function' => 'reports_modules_quiz_quizVal'
));
}
@ -30,12 +30,12 @@ function reports_modules_quiz_quizVal($quiz, $key_id)
return array(
'type' => 'sql',
'sql' =>
'select ' . $key_id . ', exe_user_id as uid, ' .
'session_id, -1 as attempt, exe_result as score, ' .
REPORTS_PROGRESS_COMPLETED . ' as progress, ' .
'exe_duration as time, exe_date as ts from ' .
Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES) .
' where c_id = ' . $courseId .
' and exe_exo_id=' . $quiz['child_id']
'select '.$key_id.', exe_user_id as uid, '.
'session_id, -1 as attempt, exe_result as score, '.
REPORTS_PROGRESS_COMPLETED.' as progress, '.
'exe_duration as time, exe_date as ts from '.
Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES).
' where c_id = '.$courseId.
' and exe_exo_id='.$quiz['child_id']
);
}

@ -118,8 +118,8 @@ if (count($friends) == 0) {
while ($j < $number_friends) {
if (isset($friends[$j])) {
$friend = $friends[$j];
$toolBar = '<button class="btn btn-danger" onclick="delete_friend(this)" id=img_' . $friend['friend_user_id'] . '>
' . get_lang('Delete') . '
$toolBar = '<button class="btn btn-danger" onclick="delete_friend(this)" id=img_'.$friend['friend_user_id'].'>
' . get_lang('Delete').'
</button>';
$url = api_get_path(WEB_PATH).'main/social/profile.php?u='.$friend['friend_user_id'];
$friend['user_info']['complete_name'] = Display::url($friend['user_info']['complete_name'], $url);

@ -23,19 +23,19 @@ $token = Security::get_token();
switch ($action) {
case 'add':
$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('Timeline'));
$interbreadcrumb[]=array('url' => '#','name' => get_lang('Add'));
$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('Timeline'));
$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Add'));
break;
case 'edit':
$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('Timeline'));
$interbreadcrumb[]=array('url' => '#','name' => get_lang('Edit'));
$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('Timeline'));
$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Edit'));
break;
case 'add_item':
$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('Timeline'));
$interbreadcrumb[]=array('url' => '#','name' => get_lang('TimelineItem'));
$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('Timeline'));
$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('TimelineItem'));
break;
default:
$interbreadcrumb[]=array('url' => '#','name' => get_lang('Timeline'));
$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Timeline'));
}
//jqgrid will use this URL to do the selects
@ -46,8 +46,8 @@ $columns = array(get_lang('Name'), get_lang('Actions'));
//Column config
$column_model = array(
array('name'=>'name', 'index'=>'name', 'width'=>'120', 'align'=>'left'),
array('name'=>'actions', 'index'=>'actions', 'width'=>'100', 'align'=>'left', 'sortable'=>'false')
array('name'=>'name', 'index'=>'name', 'width'=>'120', 'align'=>'left'),
array('name'=>'actions', 'index'=>'actions', 'width'=>'100', 'align'=>'left', 'sortable'=>'false')
);
//Autowidth
$extra_params['autowidth'] = 'true';
@ -55,11 +55,11 @@ $extra_params['autowidth'] = 'true';
$extra_params['height'] = 'auto';
//With this function we can add actions to the jgrid (edit, delete, etc)
$htmlHeadXtra[] ='
$htmlHeadXtra[] = '
<script>
$(function() {
// grid definition see the $timeline->display() function
'.Display::grid_js('timelines', $url,$columns,$column_model,$extra_params, array(), null,true).'
'.Display::grid_js('timelines', $url, $columns, $column_model, $extra_params, array(), null, true).'
});
</script>';
$toolbarAction = '';
@ -80,12 +80,12 @@ switch ($action) {
$values = $form->exportValues();
$res = $timeline->save($values);
if ($res) {
$message = Display::return_message(get_lang('ItemAdded'),'success');
$message = Display::return_message(get_lang('ItemAdded'), 'success');
}
}
$content = $timeline->listing();
} else {
$actions .= '<a href="'.api_get_self().'">'.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>';
$actions .= '<a href="'.api_get_self().'">'.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
$form->addElement('hidden', 'sec_token');
$form->setConstants(array('sec_token' => $token));
$content = $form->return_form();
@ -106,7 +106,7 @@ switch ($action) {
}
$timeline->display();
} else {
$actions = '<a href="'.api_get_self().'">'.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>';
$actions = '<a href="'.api_get_self().'">'.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
$form->addElement('hidden', 'sec_token');
$form->setConstants(array('sec_token' => $token));
$content = $form->return_form();
@ -128,7 +128,7 @@ switch ($action) {
}
$timeline->display();
} else {
$actions = '<a href="'.api_get_self().'">'.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>';
$actions = '<a href="'.api_get_self().'">'.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
$form->addElement('hidden', 'sec_token');
$form->setConstants(array('sec_token' => $token));
$content = $form->return_form();

@ -11,14 +11,14 @@ $plugin = BBBPlugin::create();
$tool_name = $plugin->get_lang('Videoconference');
$htmlHeadXtra[] = api_get_js_simple(
api_get_path(WEB_PLUGIN_PATH) . 'bbb/resources/utils.js'
api_get_path(WEB_PLUGIN_PATH).'bbb/resources/utils.js'
);
$htmlHeadXtra[] = "<script>var _p = {web_plugin: '" . api_get_path(WEB_PLUGIN_PATH). "'}</script>";
$htmlHeadXtra[] = "<script>var _p = {web_plugin: '".api_get_path(WEB_PLUGIN_PATH)."'}</script>";
$tpl = new Template($tool_name);
$isGlobal = isset($_GET['global']) ? true : false;
$isGlobalPerUser = isset($_GET['user_id']) ? (int) $_GET['user_id']: false;
$isGlobalPerUser = isset($_GET['user_id']) ? (int) $_GET['user_id'] : false;
$bbb = new bbb('', '', $isGlobal, $isGlobalPerUser);
$action = isset($_GET['action']) ? $_GET['action'] : null;
@ -80,22 +80,22 @@ if ($conferenceManager) {
case 'end':
$bbb->endMeeting($_GET['id']);
$message = Display::return_message(
$plugin->get_lang('MeetingClosed') . '<br />' . $plugin->get_lang(
$plugin->get_lang('MeetingClosed').'<br />'.$plugin->get_lang(
'MeetingClosedComment'
),
'success',
false
);
if (file_exists(__DIR__ . '/config.vm.php')) {
require __DIR__ . '/../../vendor/autoload.php';
if (file_exists(__DIR__.'/config.vm.php')) {
require __DIR__.'/../../vendor/autoload.php';
require __DIR__ . '/lib/vm/AbstractVM.php';
require __DIR__ . '/lib/vm/VMInterface.php';
require __DIR__ . '/lib/vm/DigitalOceanVM.php';
require __DIR__ . '/lib/VM.php';
require __DIR__.'/lib/vm/AbstractVM.php';
require __DIR__.'/lib/vm/VMInterface.php';
require __DIR__.'/lib/vm/DigitalOceanVM.php';
require __DIR__.'/lib/VM.php';
$config = require __DIR__ . '/config.vm.php';
$config = require __DIR__.'/config.vm.php';
$vm = new VM($config);
$vm->resizeToMinLimit();
@ -191,7 +191,7 @@ $content = $tpl->fetch($listing_tpl);
if (api_is_platform_admin()) {
$actionLinks = Display::toolbarButton(
$plugin->get_lang('AdminView'),
api_get_path(WEB_PLUGIN_PATH) . 'bbb/admin.php',
api_get_path(WEB_PLUGIN_PATH).'bbb/admin.php',
'list',
'primary'
);

@ -125,7 +125,7 @@ class BuyCoursesPlugin extends Plugin
return false;
}
require_once api_get_path(SYS_PLUGIN_PATH) . 'buycourses/database.php';
require_once api_get_path(SYS_PLUGIN_PATH).'buycourses/database.php';
}
/**
@ -174,10 +174,10 @@ class BuyCoursesPlugin extends Plugin
$item = $this->getItemByProduct(intval($productId), $productType);
$return['html'] = '<div class="buycourses-price">';
if ($item) {
$return['html'] .= '<span class="label label-primary"><b>'. $item['iso_code'] .' ' . $item['price'] . '</b></span>';
$return['html'] .= '<span class="label label-primary"><b>'.$item['iso_code'].' '.$item['price'].'</b></span>';
$return['verificator'] = true;
} else {
$return['html'] .= '<span class="label label-primary"><b>'. $this->get_lang('Free'). '</b></span>';
$return['html'] .= '<span class="label label-primary"><b>'.$this->get_lang('Free').'</b></span>';
$return['verificator'] = false;
}
$return['html'] .= '</div>';
@ -196,15 +196,15 @@ class BuyCoursesPlugin extends Plugin
*/
public function returnBuyCourseButton($productId, $productType)
{
$url = api_get_path(WEB_PLUGIN_PATH) .
'buycourses/src/process.php?i=' .
intval($productId) .
'&t=' .
$url = api_get_path(WEB_PLUGIN_PATH).
'buycourses/src/process.php?i='.
intval($productId).
'&t='.
$productType
;
$html = ' <a class="btn btn-success btn-sm" title="' . $this->get_lang('Buy') . '" href="' . $url . '">' .
Display::returnFontAwesomeIcon('fa fa-shopping-cart') . '</a>';
$html = ' <a class="btn btn-success btn-sm" title="'.$this->get_lang('Buy').'" href="'.$url.'">'.
Display::returnFontAwesomeIcon('fa fa-shopping-cart').'</a>';
return $html;
}
@ -749,7 +749,7 @@ class BuyCoursesPlugin extends Plugin
);
if (!empty($sessionImage)) {
$sessionInfo['image'] = api_get_path(WEB_UPLOAD_PATH) . $sessionImage['value'];
$sessionInfo['image'] = api_get_path(WEB_UPLOAD_PATH).$sessionImage['value'];
}
$sessionCourses = $session->getCourses();
@ -1202,7 +1202,7 @@ class BuyCoursesPlugin extends Plugin
$str = '';
srand((double)microtime() * 1000000);
srand((double) microtime() * 1000000);
for ($i = 0; $i < $length; $i++) {
$numbers = rand(0, strlen($salt) - 1);
@ -1544,8 +1544,8 @@ class BuyCoursesPlugin extends Plugin
*/
public function getPayouts($status = self::PAYOUT_STATUS_PENDING, $payoutId = false, $userId = false)
{
$condition = ($payoutId) ? 'AND p.id = '. intval($payoutId) : '';
$condition2 = ($userId) ? ' AND p.user_id = ' . intval($userId) : '';
$condition = ($payoutId) ? 'AND p.id = '.intval($payoutId) : '';
$condition2 = ($userId) ? ' AND p.user_id = '.intval($userId) : '';
$typeResult = ($condition) ? 'first' : 'all';
$payoutsTable = Database::get_main_table(self::TABLE_PAYPAL_PAYOUTS);
$saleTable = Database::get_main_table(self::TABLE_SALE);
@ -1572,14 +1572,14 @@ class BuyCoursesPlugin extends Plugin
INNER JOIN $saleTable s ON s.id = p.sale_id
INNER JOIN $currencyTable c ON s.currency_id = c.id
LEFT JOIN $extraFieldValues efv ON p.user_id = efv.item_id
AND field_id = " . intval($paypalExtraField['id']) . "
AND field_id = ".intval($paypalExtraField['id'])."
";
$payouts = Database::select(
"p.* , u.firstname, u.lastname, efv.value as paypal_account, s.reference as sale_reference, s.price as item_price, c.iso_code",
"$payoutsTable p $innerJoins",
[
'where' => ['p.status = ? '.$condition . ' ' .$condition2 => $status]
'where' => ['p.status = ? '.$condition.' '.$condition2 => $status]
],
$typeResult
);
@ -1642,7 +1642,7 @@ class BuyCoursesPlugin extends Plugin
$platformCommission = $this->getPlatformCommission();
$sale = $this->getSale($saleId);
$teachersCommission = number_format((floatval($sale['price']) * intval($platformCommission['commission']))/100, 2);
$teachersCommission = number_format((floatval($sale['price']) * intval($platformCommission['commission'])) / 100, 2);
$beneficiaries = $this->getBeneficiariesBySale($saleId);
@ -1654,7 +1654,7 @@ class BuyCoursesPlugin extends Plugin
'payout_date' => getdate(),
'sale_id' => intval($saleId),
'user_id' => $beneficiary['user_id'],
'commission' => number_format((floatval($teachersCommission) * intval($beneficiary['commissions']))/100, 2),
'commission' => number_format((floatval($teachersCommission) * intval($beneficiary['commissions'])) / 100, 2),
'status' => self::PAYOUT_STATUS_PENDING
]
);
@ -2252,17 +2252,17 @@ class BuyCoursesPlugin extends Plugin
*/
public function getPath($var)
{
$pluginPath = api_get_path(WEB_PLUGIN_PATH) . 'buycourses/';
$pluginPath = api_get_path(WEB_PLUGIN_PATH).'buycourses/';
$paths = [
'SERVICE_IMAGES' => $pluginPath . 'uploads/services/images/',
'SRC' => $pluginPath . 'src/',
'VIEW' => $pluginPath . 'view/',
'UPLOADS' => $pluginPath . 'uploads/',
'LANGUAGES' => $pluginPath . 'lang/',
'RESOURCES' => $pluginPath . 'resources/',
'RESOURCES_IMG' => $pluginPath . 'resources/img/',
'RESOURCES_CSS' => $pluginPath . 'resources/css/',
'RESOURCES_JS' => $pluginPath . 'resources/js/',
'SERVICE_IMAGES' => $pluginPath.'uploads/services/images/',
'SRC' => $pluginPath.'src/',
'VIEW' => $pluginPath.'view/',
'UPLOADS' => $pluginPath.'uploads/',
'LANGUAGES' => $pluginPath.'lang/',
'RESOURCES' => $pluginPath.'resources/',
'RESOURCES_IMG' => $pluginPath.'resources/img/',
'RESOURCES_CSS' => $pluginPath.'resources/css/',
'RESOURCES_JS' => $pluginPath.'resources/js/',
];
return $paths[$var];

@ -33,7 +33,7 @@ if (!isset($_REQUEST['t'], $_REQUEST['i'])) {
$buyingCourse = intval($_REQUEST['t']) === BuyCoursesPlugin::PRODUCT_TYPE_COURSE;
$buyingSession = intval($_REQUEST['t']) === BuyCoursesPlugin::PRODUCT_TYPE_SESSION;
$queryString = 'i=' . intval($_REQUEST['i']) . '&t=' . intval($_REQUEST['t']);
$queryString = 'i='.intval($_REQUEST['i']).'&t='.intval($_REQUEST['t']);
if ($buyingCourse) {
$courseInfo = $plugin->getCourseInfo($_REQUEST['i']);
@ -54,7 +54,7 @@ if ($form->validate()) {
Display::addFlash(
Display::return_message($plugin->get_lang('NeedToSelectPaymentType'), 'error', false)
);
header('Location:' . api_get_self() . '?' . $queryString);
header('Location:'.api_get_self().'?'.$queryString);
exit;
}
@ -62,7 +62,7 @@ if ($form->validate()) {
if ($saleId !== false) {
$_SESSION['bc_sale_id'] = $saleId;
header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/process_confirm.php');
header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/process_confirm.php');
}
exit;

@ -25,7 +25,7 @@ if (isset($_GET['order'])) {
api_not_allowed(true);
}
$urlToRedirect = api_get_self() . '?';
$urlToRedirect = api_get_self().'?';
switch ($_GET['action']) {
case 'confirm':
@ -94,10 +94,10 @@ $form->addRadio(
get_lang('Filter'),
[$plugin->get_lang('ByStatus'), $plugin->get_lang('ByUser')]
);
$form->addHtml('<div id="report-by-status" ' . ($selectedFilterType !== '0' ? 'style="display:none"' : '') . '>');
$form->addHtml('<div id="report-by-status" '.($selectedFilterType !== '0' ? 'style="display:none"' : '').'>');
$form->addSelect('status', $plugin->get_lang('OrderStatus'), $saleStatuses);
$form->addHtml('</div>');
$form->addHtml('<div id="report-by-user" ' . ($selectedFilterType !== '1' ? 'style="display:none"' : '') . '>');
$form->addHtml('<div id="report-by-user" '.($selectedFilterType !== '1' ? 'style="display:none"' : '').'>');
$form->addText('user', get_lang('UserName'), false);
$form->addHtml('</div>');
$form->addButtonFilter(get_lang('Search'));
@ -142,7 +142,7 @@ $template = new Template($templateName);
if ($paypalEnable == "true" && $commissionsEnable == "true") {
$toolbar = Display::toolbarButton(
$plugin->get_lang('PaypalPayoutCommissions'),
api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/paypal_payout.php',
api_get_path(WEB_PLUGIN_PATH).'buycourses/src/paypal_payout.php',
'paypal',
'primary',
['title' => $plugin->get_lang('PaypalPayoutCommissions')]
@ -157,7 +157,7 @@ if ($paypalEnable == "true" && $commissionsEnable == "true") {
if ($commissionsEnable == "true") {
$toolbar = Display::toolbarButton(
$plugin->get_lang('PayoutReport'),
api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/payout_report.php',
api_get_path(WEB_PLUGIN_PATH).'buycourses/src/payout_report.php',
'money',
'info',
['title' => $plugin->get_lang('PayoutReport')]

@ -54,7 +54,7 @@ $template = new Template($templateName);
if ($paypalEnable == 'true' && $commissionsEnable == 'true') {
$toolbar = Display::toolbarButton(
$plugin->get_lang('PaypalPayoutCommissions'),
api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/paypal_payout.php',
api_get_path(WEB_PLUGIN_PATH).'buycourses/src/paypal_payout.php',
'paypal',
'primary',
['title' => $plugin->get_lang('PaypalPayoutCommissions')]
@ -69,7 +69,7 @@ if ($paypalEnable == 'true' && $commissionsEnable == 'true') {
if ($commissionsEnable == 'true') {
$toolbar = Display::toolbarButton(
$plugin->get_lang('PayoutReport'),
api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/payout_report.php',
api_get_path(WEB_PLUGIN_PATH).'buycourses/src/payout_report.php',
'money',
'info',
['title' => $plugin->get_lang('PayoutReport')]

@ -40,31 +40,31 @@ class OpenMeetingsRestService
// $request
// Initialize the session by passing the request as a parameter
$session = curl_init ( $request );
$session = curl_init($request);
// Set curl options by passing session and flags
// CURLOPT_HEADER allows us to receive the HTTP header
curl_setopt ( $session, CURLOPT_HEADER, true );
curl_setopt($session, CURLOPT_HEADER, true);
// CURLOPT_RETURNTRANSFER will return the response
curl_setopt ( $session, CURLOPT_RETURNTRANSFER, true );
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
// Make the request
$response = curl_exec ( $session );
$response = curl_exec($session);
// Close the curl session
curl_close ( $session );
curl_close($session);
// Confirm that the request was transmitted to the OpenMeetings! Image Search Service
if (! $response) {
die ( "Request OpenMeetings! OpenMeetings Service failed and no response was returned in ".__CLASS__.'::'.__FUNCTION__.'()' );
if (!$response) {
die ("Request OpenMeetings! OpenMeetings Service failed and no response was returned in ".__CLASS__.'::'.__FUNCTION__.'()');
}
// Create an array to store the HTTP response codes
$status_code = array ();
$status_code = array();
// Use regular expressions to extract the code from the header
preg_match ( '/\d\d\d/', $response, $status_code );
preg_match('/\d\d\d/', $response, $status_code);
$bt = debug_backtrace();
$caller = array_shift($bt);
$extra = ' (from '.$caller['file'].' at line '.$caller['line'].') ';
@ -74,24 +74,24 @@ class OpenMeetingsRestService
// Success
break;
case 503 :
error_log( 'Your call to OpenMeetings Web Services '.$extra.' failed and returned an HTTP status of 503.
error_log('Your call to OpenMeetings Web Services '.$extra.' failed and returned an HTTP status of 503.
That means: Service unavailable. An internal problem prevented us from returning data to you.' );
return false;
break;
case 403 :
error_log( 'Your call to OpenMeetings Web Services '.$extra.' failed and returned an HTTP status of 403.
error_log('Your call to OpenMeetings Web Services '.$extra.' failed and returned an HTTP status of 403.
That means: Forbidden. You do not have permission to access this resource, or are over your rate limit.' );
return false;
break;
case 400 :
// You may want to fall through here and read the specific XML error
error_log( 'Your call to OpenMeetings Web Services '.$extra.' failed and returned an HTTP status of 400.
error_log('Your call to OpenMeetings Web Services '.$extra.' failed and returned an HTTP status of 400.
That means: Bad request. The parameters passed to the service did not match as expected.
The exact error is returned in the XML response.' );
return false;
break;
default:
error_log( 'Your call to OpenMeetings Web Services '.$extra.' returned an unexpected HTTP status of: ' . $status_code [0] . " Request " . $request );
error_log('Your call to OpenMeetings Web Services '.$extra.' returned an unexpected HTTP status of: '.$status_code [0]." Request ".$request);
return false;
}

@ -46,7 +46,7 @@ foreach ($settings as $param) {
isset($param['subkey']) && !empty($param['subkey']) ? $param['variable'].' ['.$param['subkey'].']' : $param['variable'],
$param['category'],
$param['access_url'],
'<input type="text" disabled name="value_'.$param['id'].'" value="'.htmlspecialchars($param['selected_value'], ENT_COMPAT, 'UTF-8' ).'" />'.
'<input type="text" disabled name="value_'.$param['id'].'" value="'.htmlspecialchars($param['selected_value'], ENT_COMPAT, 'UTF-8').'" />'.
'<br />Master value: '.$param['selected_value'],
$syncButton,
);
@ -56,8 +56,8 @@ foreach ($settings as $param) {
$content = '<form name="settingsform" action="'.$thisurl.'">';
$content .= '<input type="hidden" name="what" value="" />';
$content .= $table->toHtml();
$content .= '</form>';
$content .= $table->toHtml();
$content .= '</form>';
Display::addFlash(Display::return_message($plugin->get_lang('Sync your master settings to all instances.')));

@ -328,7 +328,7 @@ class Connector
{
return strpos(basename($path), '.') === 0 // if file/folder begins with '.' (dot)
? !($attr == 'read' || $attr == 'write') // set read+write to false, other (locked+hidden) set to true
: null; // else elFinder decide it itself
: null; // else elFinder decide it itself
}
/**

@ -63,6 +63,6 @@ class Wiki extends Resource
public function show()
{
parent::show();
echo $this->reflink.' ('. (empty($this->group_id) ? get_lang('Everyone') : get_lang('Group') . ' ' . $this->group_id) .') ' . '<i>(' . $this->dtime . ')</i>';
echo $this->reflink.' ('.(empty($this->group_id) ? get_lang('Everyone') : get_lang('Group').' '.$this->group_id).') '.'<i>('.$this->dtime.')</i>';
}
}

Loading…
Cancel
Save