Skip to content

Commit

Permalink
MDL-25637 Fixed whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Hemelryk committed Jan 24, 2011
1 parent 2b9ce62 commit 80c1289
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 28 deletions.
6 changes: 3 additions & 3 deletions auth/shibboleth/logout.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// Find out whether host supports https
$protocol = 'http://';
if ( isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on'){
$protocol = 'https://';
$protocol = 'https://';
}

// Front channel logout
Expand Down Expand Up @@ -201,8 +201,8 @@ function unserializesession($serialized_string) {
$variables = array();
$a = preg_split("/(\w+)\|/", $serialized_string, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
$counta = count($a);
for($i = 0; $i < $counta; $i=$i+2) {
for ($i = 0; $i < $counta; $i = $i+2) {
$variables[$a[$i]] = unserialize($a[$i+1]);
}
return($variables);
return $variables;
}
4 changes: 2 additions & 2 deletions backup/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function delete_dir_contents ($dir,$excludeddir="") {
}

// Loop through all directory entries, and construct two temporary arrays containing files and sub directories
while(false !== ($entry = readdir($handle))) {
while (false !== ($entry = readdir($handle))) {
if (is_dir($dir. $slash .$entry) && $entry != ".." && $entry != "." && $entry != $excludeddir) {
$dir_subdirs[] = $dir. $slash .$entry;
}
Expand All @@ -130,7 +130,7 @@ function delete_dir_contents ($dir,$excludeddir="") {

// Delete all files in the curent directory return false and halt if a file cannot be removed
$countdirfiles = count($dir_files);
for($i=0; $i<$countdirfiles; $i++) {
for ($i=0; $i<$countdirfiles; $i++) {
chmod($dir_files[$i], $CFG->directorypermissions);
if (((unlink($dir_files[$i]))) == FALSE) {
return false;
Expand Down
2 changes: 1 addition & 1 deletion backup/restorelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ function restore_create_blogs($restore,$xml_file) {
//Iterate over tags
$tags = array();
$sizetagsarr = sizeof($tagsarr);
for($i = 0; $i < $sizetagsarr; $i++) {
for ($i = 0; $i < $sizetagsarr; $i++) {
$tag_info = $tagsarr[$i];
///traverse_xmlize($tag_info); //Debug
///print_object ($GLOBALS['traverse_array']); //Debug
Expand Down
8 changes: 4 additions & 4 deletions mod/feedback/item/info/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ function get_printval($item, $value) {
function print_analysed($item, $itemnr = '', $groupid = false, $courseid = false) {
$analysed_item = $this->get_analysed($item, $groupid, $courseid);
$data = $analysed_item->data;
if(is_array($data)) {
if (is_array($data)) {
echo '<tr><th colspan="2" align="left">'. $itemnr . '&nbsp;('. $item->label .') ' . $item->name .'</th></tr>';
$sizeofdata = sizeof($data);
for($i = 0; $i < $sizeofdata; $i++) {
for ($i = 0; $i < $sizeofdata; $i++) {
echo '<tr><td colspan="2" valign="top" align="left">-&nbsp;&nbsp;' . str_replace("\n", '<br />', $data[$i]->show) . '</td></tr>';
}
}
Expand All @@ -145,12 +145,12 @@ function excelprint_item(&$worksheet, $rowOffset, $xlsFormats, $item, $groupid,
$worksheet->write_string($rowOffset, 0, $item->label, $xlsFormats->head2);
$worksheet->write_string($rowOffset, 1, $item->name, $xlsFormats->head2);
$data = $analysed_item->data;
if(is_array($data)) {
if (is_array($data)) {
// $worksheet->setFormat("<l><ro2><vo>");
$worksheet->write_string($rowOffset, 2, $data[0]->show, $xlsFormats->value_bold);
$rowOffset++;
$sizeofdata = sizeof($data);
for($i = 1; $i < $sizeofdata; $i++) {
for ($i = 1; $i < $sizeofdata; $i++) {
// $worksheet->setFormat("<l><vo>");
$worksheet->write_string($rowOffset, 2, $data[$i]->show, $xlsFormats->default);
$rowOffset++;
Expand Down
38 changes: 20 additions & 18 deletions mod/feedback/item/multichoice/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,14 @@ function get_analysed($item, $groupid = false, $courseid = false) {
$analysedAnswer = array();
if($info->subtype == 'c') {
$sizeofanswers = sizeof($answers);
for($i = 1; $i <= $sizeofanswers; $i++) {
for ($i = 1; $i <= $sizeofanswers; $i++) {
$ans = null;
$ans->answertext = $answers[$i-1];
$ans->answercount = 0;
foreach($values as $value) {
foreach ($values as $value) {
//ist die Antwort gleich dem index der Antworten + 1?
$vallist = explode(FEEDBACK_MULTICHOICE_LINE_SEP, $value->value);
foreach($vallist as $val) {
foreach ($vallist as $val) {
if ($val == $i) {
$ans->answercount++;
}
Expand All @@ -138,11 +138,11 @@ function get_analysed($item, $groupid = false, $courseid = false) {
}
}else {
$sizeofanswers = sizeof($answers);
for($i = 1; $i <= $sizeofanswers; $i++) {
for ($i = 1; $i <= $sizeofanswers; $i++) {
$ans = null;
$ans->answertext = $answers[$i-1];
$ans->answercount = 0;
foreach($values as $value) {
foreach ($values as $value) {
//ist die Antwort gleich dem index der Antworten + 1?
if ($value->value == $i) {
$ans->answercount++;
Expand All @@ -161,28 +161,30 @@ function get_printval($item, $value) {

$printval = '';

if(!isset($value->value)) return $printval;
if (!isset($value->value)) {
return $printval;
}

// @list($presentation) = explode(FEEDBACK_RADIO_ADJUST_SEP, $item->presentation); //remove the adjustment-info

$presentation = explode (FEEDBACK_MULTICHOICE_LINE_SEP, $info->presentation);

if($info->subtype == 'c') {
if ($info->subtype == 'c') {
$vallist = array_values(explode (FEEDBACK_MULTICHOICE_LINE_SEP, $value->value));
$sizeofvallist = sizeof($vallist);
for($i = 0; $i < $sizeofvallist; $i++) {
$sizeofpresentation = sizeof($presentation);
for($k = 0; $k < $sizeofpresentation; $k++) {
if($vallist[$i] == ($k + 1)) {//Die Werte beginnen bei 1, das Array aber mit 0
$sizeofpresentation = sizeof($presentation);
for ($i = 0; $i < $sizeofvallist; $i++) {
for ($k = 0; $k < $sizeofpresentation; $k++) {
if ($vallist[$i] == ($k + 1)) {//Die Werte beginnen bei 1, das Array aber mit 0
$printval .= trim($presentation[$k]) . chr(10);
break;
}
}
}
}else {
} else {
$index = 1;
foreach($presentation as $pres){
if($value->value == $index){
if ($value->value == $index){
$printval = $pres;
break;
}
Expand Down Expand Up @@ -235,9 +237,9 @@ function excelprint_item(&$worksheet, $rowOffset, $xlsFormats, $item, $groupid,
//frage schreiben
$worksheet->write_string($rowOffset, 0, $item->label, $xlsFormats->head2_green);
$worksheet->write_string($rowOffset, 1, $analysed_item[1], $xlsFormats->head2_green);
if(is_array($data)) {
if (is_array($data)) {
$sizeofdata = sizeof($data);
for($i = 0; $i < $sizeofdata; $i++) {
for ($i = 0; $i < $sizeofdata; $i++) {
$aData = $data[$i];

// $worksheet->setFormat("<l><f><ro2><vo><c:blue>");
Expand All @@ -249,7 +251,7 @@ function excelprint_item(&$worksheet, $rowOffset, $xlsFormats, $item, $groupid,
$worksheet->write_number($rowOffset + 2, $i + 2, $aData->quotient, $xlsFormats->procent);
}
}
$rowOffset +=3 ;
$rowOffset += 3;
return $rowOffset;
}

Expand Down Expand Up @@ -565,15 +567,15 @@ function get_info($item) {
}

function item_arrayToString($value) {
if(!is_array($value)) {
if (!is_array($value)) {
return $value;
}
$retval = '';
$arrvals = array_values($value);
$arrvals = clean_param($arrvals, PARAM_INT); //prevent sql-injection
$retval = $arrvals[0];
$sizeofarrvals = sizeof($arrvals);
for($i = 1; $i < $sizeofarrvals; $i++) {
for ($i = 1; $i < $sizeofarrvals; $i++) {
$retval .= FEEDBACK_MULTICHOICE_LINE_SEP.$arrvals[$i];
}
return $retval;
Expand Down

0 comments on commit 80c1289

Please sign in to comment.