Minor - format code, add function visibility

pull/2487/head
jmontoyaa 7 years ago
parent 6555d8f1f2
commit be61e5e11a
  1. 6
      main/exercise/question.class.php
  2. 24
      main/gradebook/lib/fe/catform.class.php
  3. 10
      main/gradebook/lib/fe/usertable.class.php
  4. 1045
      main/inc/lib/xajax/xajaxResponse.inc.php
  5. 6
      src/Chamilo/CourseBundle/Component/CourseCopy/Resources/CourseCopyLearnpath.php
  6. 4
      src/Chamilo/ThemeBundle/Model/MenuItemModel.php

@ -2119,13 +2119,13 @@ abstract class Question
*
* @return array
*/
static function get_course_medias(
public static function get_course_medias(
$course_id,
$start = 0,
$limit = 100,
$sidx = "question",
$sord = "ASC",
$where_condition = array()
$where_condition = []
) {
$table_question = Database::get_course_table(TABLE_QUIZ_QUESTION);
$default_where = array(
@ -2153,7 +2153,7 @@ abstract class Question
*
* @return int
*/
static function get_count_course_medias($course_id)
public static function get_count_course_medias($course_id)
{
$table_question = Database::get_course_table(TABLE_QUIZ_QUESTION);
$result = Database::select(

@ -89,22 +89,6 @@ class CatForm extends FormValidator
//check if we are a root category
//if so, you can only choose between courses
if ($this->category_object->get_parent_id() == '0') {
$coursecat = Category::get_not_created_course_categories(
api_get_user_id()
);
if (count($coursecat) == 0) {
//$select->addoption(get_lang('CourseIndependent'),'COURSEINDEPENDENT','disabled');
} else {
//$select->addoption(get_lang('CourseIndependent'),'COURSEINDEPENDENT');
}
//only return courses that are not yet created by the teacher
if (!empty($coursecat)) {
foreach ($coursecat as $row) {
//$select->addoption($row[1],$row[0]);
}
} else {
//$select->addoption($row[1],$row[0]);
}
$this->setDefaults(
array(
'select_course' => $this->category_object->get_course_code(
@ -214,10 +198,9 @@ class CatForm extends FormValidator
$global_weight = api_get_setting('gradebook_default_weight');
$value = 100;
if (isset($global_weight)) {
$value = $global_weight;
} else {
$value = 100;
}
$this->addFloat(
@ -231,7 +214,6 @@ class CatForm extends FormValidator
);
$skillsDefaults = [];
if (api_is_platform_admin() || api_is_drh()) {
if (Skill::isToolAvailable()) {
$skillSelect = $this->addElement(
@ -401,12 +383,12 @@ class CatForm extends FormValidator
$this->addElement('submit', null, get_lang('Ok'));
}
function display()
public function display()
{
parent::display();
}
function setDefaults($defaults = array(), $filter = null)
public function setDefaults($defaults = array(), $filter = null)
{
parent::setDefaults($defaults, $filter);
}

@ -16,7 +16,7 @@ class UserTable extends SortableTable
/**
* Constructor
*/
public function __construct($userid, $evals = array(), $links = array(), $addparams = null)
public function __construct($userid, $evals = array(), $links = [], $addparams = null)
{
parent::__construct('userlist', null, null, 0);
$this->userid = $userid;
@ -41,7 +41,7 @@ class UserTable extends SortableTable
/**
* Function used by SortableTable to get total number of items in the table
*/
function get_total_number_of_items()
public function get_total_number_of_items()
{
return $this->datagen->get_total_items_count();
}
@ -85,10 +85,10 @@ class UserTable extends SortableTable
}
$data_array = $this->datagen->get_data($sorting, $from, $this->per_page);
// generate the data to display
$sortable_data = array();
$sortable_data = [];
foreach ($data_array as $data) {
if ($data[2] != "") {//filter by course removed
$row = array();
if ($data[2] != '') {//filter by course removed
$row = [];
$row[] = $this->build_type_column($data[0]);
$row[] = $this->build_name_link($data[0]);
$row[] = $data[2];

File diff suppressed because it is too large Load Diff

@ -171,7 +171,7 @@ class CourseCopyLearnpath extends Resource
/**
* Get the items
*/
function get_items()
public function get_items()
{
return $this->items;
}
@ -179,7 +179,7 @@ class CourseCopyLearnpath extends Resource
/**
* Check if a given resource is used as an item in this chapter
*/
function has_item($resource)
public function has_item($resource)
{
foreach ($this->items as $item) {
if ($item['id'] == $resource->get_id() &&
@ -194,7 +194,7 @@ class CourseCopyLearnpath extends Resource
/**
* Show this learnpath
*/
function show()
public function show()
{
parent::show();
echo $this->name;

@ -59,7 +59,7 @@ class MenuItemModel implements MenuItemInterface
*/
protected $parent = null;
function __construct(
public function __construct(
$id,
$label,
$route,
@ -294,7 +294,7 @@ class MenuItemModel implements MenuItemInterface
public function removeChild(MenuItemInterface $child)
{
if (false !== ($key = array_search($child, $this->children))) {
unset ($this->children[$key]);
unset($this->children[$key]);
}
return $this;

Loading…
Cancel
Save