Minor - Code conventions - refs #7611

1.10.x
Angel Fernando Quiroz Campos 10 years ago
parent faad0a8535
commit 577afc98a5
  1. 4
      composer.json
  2. 2
      main/exercice/MatchingDraggable.php
  3. 2
      main/exercice/answer.class.php
  4. 21
      main/inc/lib/display.lib.php

@ -53,7 +53,7 @@
"symfony/validator": "2.6.4",
"gedmo/doctrine-extensions": "~2.3",
"sonata-project/user-bundle": "~2.2",
"ramsey/array_column": "~1.1",
"ramsey/array_column": "~1.1",
"patchwork/utf8": "~1.2",
"ddeboer/data-import": "@stable",
"phpoffice/phpexcel": "~1.8",
@ -70,7 +70,7 @@
"bower-asset/mediaelement": "@stable",
"bower-asset/modernizr": "2.8.*",
"bower-asset/jqueryui-timepicker-addon": "@stable",
"bower-asset/imageMap-resizer": "0.5.3"
"bower-asset/imageMap-resizer": "0.5.3"
},
"require-dev": {
"behat/behat": "2.5.*@stable",

@ -204,7 +204,7 @@ class MatchingDraggable extends Question
}
/**
*
* Process the creation of answers
* @param type $form
*/
public function processAnswersCreation($form)

@ -761,7 +761,7 @@ class Answer
}
/**
* Get the necessary JavaScript for some ansers
* Get the necessary JavaScript for some answers
* @return string
*/
public function getJs() {

@ -946,17 +946,18 @@ class Display
$extra_attributes = array(),
$show_blank_item = true,
$blank_item_text = null
) {
)
{
$html = '';
$extra = '';
$default_id = 'id="'.$name.'" ';
foreach($extra_attributes as $key=>$parameter) {
$default_id = 'id="' . $name . '" ';
foreach ($extra_attributes as $key => $parameter) {
if ($key == 'id') {
$default_id = '';
}
$extra .= $key.'="'.$parameter.'" ';
$extra .= $key . '="' . $parameter . '" ';
}
$html .= '<select name="'.$name.'" '.$default_id.' '.$extra.'>';
$html .= '<select name="' . $name . '" ' . $default_id . ' ' . $extra . '>';
if ($show_blank_item) {
if (empty($blank_item_text)) {
@ -964,17 +965,17 @@ class Display
} else {
$blank_item_text = Security::remove_XSS($blank_item_text);
}
$html .= self::tag('option', '-- '.$blank_item_text.' --', array('value'=>'-1'));
$html .= self::tag('option', '-- ' . $blank_item_text . ' --', array('value' => '-1'));
}
if ($values) {
foreach ($values as $key => $value) {
if(is_array($value) && isset($value['name'])) {
if (is_array($value) && isset($value['name'])) {
$value = $value['name'];
}
$html .= '<option value="'.$key.'"';
$html .= '<option value="' . $key . '"';
if (is_array($default)) {
foreach($default as $item) {
foreach ($default as $item) {
if ($item == $key) {
$html .= ' selected="selected"';
break;
@ -986,7 +987,7 @@ class Display
}
}
$html .= '>'.$value.'</option>';
$html .= '>' . $value . '</option>';
}
}
$html .= '</select>';

Loading…
Cancel
Save