Minor - Code style - Use "self" instead of classname within the class and remove spaces around :: operator

pull/2487/head
Yannick Warnier 8 years ago
parent 3bfbeee958
commit fc8fe965b7
  1. 4
      main/attendance/index.php
  2. 2
      main/auth/cas/cas_var.inc.php
  3. 2
      main/auth/cas/lib/CAS.php
  4. 24
      main/exercise/export/exercise_import.php
  5. 4
      main/gradebook/lib/gradebook_data_generator.class.php
  6. 2
      main/inc/lib/access_url_edit_courses_to_url_functions.lib.php
  7. 4
      main/inc/lib/add_many_session_to_category_functions.lib.php
  8. 4
      main/inc/lib/auth.lib.php
  9. 2
      main/inc/lib/certificate.lib.php
  10. 2
      main/inc/lib/formvalidator/Element/receivers.php
  11. 4
      main/inc/lib/groupmanager.lib.php
  12. 3
      main/inc/lib/mp3player/is_autostart.as.php
  13. 2
      main/inc/lib/zombie/zombie_report.class.php
  14. 6
      main/lp/scorm.class.php
  15. 2
      main/session/session_import.php
  16. 2
      main/survey/ch_dropdown.php
  17. 2
      main/survey/ch_multiplechoice.php
  18. 2
      main/survey/ch_multipleresponse.php
  19. 2
      main/tracking/logins_details.php
  20. 2
      main/webservices/cm_webservice_announcements.php
  21. 2
      plugin/dashboard/block_daily/block_daily.class.php
  22. 4
      plugin/dashboard/block_global_info/block_global_info.class.php
  23. 2
      plugin/dashboard/block_student/block_student.class.php
  24. 2
      src/Chamilo/CourseBundle/Component/CourseCopy/CourseRestorer.php
  25. 4
      src/Chamilo/ThemeBundle/Model/TaskModel.php

@ -285,12 +285,16 @@ switch ($action) {
}
break;
case 'calendar_add':
//no break
case 'calendar_edit':
//no break
case 'calendar_all_delete':
//no break
case 'calendar_delete':
if (!api_is_allowed_to_edit(null, true)) {
api_not_allowed();
}
//no break
case 'calendar_list':
$attendanceController->attendance_calendar($action, $attendance_id, $calendar_id);
break;

@ -20,7 +20,7 @@ switch (api_get_setting('cas_protocol')) {
case 'SAML':
$cas_auth_ver = SAML_VERSION_1_1;
break;
default :
default:
$cas_auth_ver = CAS_VERSION_2_0;
break;
}

@ -1013,7 +1013,7 @@ class phpCAS
self::trace('user is not authenticated, redirecting to the CAS server');
$PHPCAS_CLIENT->forceAuthentication();
} else {
self::trace('no need to authenticate (user `' . phpCAS:: getUser() . '\' is already authenticated)');
self::trace('no need to authenticate (user `' . self::getUser() . '\' is already authenticated)');
}
self::traceEnd();

@ -34,20 +34,18 @@ $cmd = (isset($_REQUEST['cmd'])? $_REQUEST['cmd'] : 'show_import');
switch ($cmd) {
case 'show_import':
$display = '<p>'
. get_lang('Imported exercises must consist of a zip or an XML file (IMS-QTI) and be compatible with your Claroline version.') . '<br>'
. '</p>'
. '<form enctype="multipart/form-data" action="" method="post">'
. '<input name="cmd" type="hidden" value="import" />'
. '<input name="uploadedExercise" type="file" /><br><br>'
. get_lang('Import exercise') . ' : '
. '<input value="' . get_lang('Ok') . '" type="submit" /> '
. claro_html_button( $_SERVER['PHP_SELF'], get_lang('Cancel'))
. '<br><br>'
. '<small>' . get_lang('Max file size') . ' : 2&nbsp;MB</small>'
. '</form>';
. get_lang('Imported exercises must consist of a zip or an XML file (IMS-QTI) and be compatible with your Claroline version.') . '<br>'
. '</p>'
. '<form enctype="multipart/form-data" action="" method="post">'
. '<input name="cmd" type="hidden" value="import" />'
. '<input name="uploadedExercise" type="file" /><br><br>'
. get_lang('Import exercise') . ' : '
. '<input value="' . get_lang('Ok') . '" type="submit" /> '
. claro_html_button( $_SERVER['PHP_SELF'], get_lang('Cancel'))
. '<br><br>'
. '<small>' . get_lang('Max file size') . ' : 2&nbsp;MB</small>'
. '</form>';
break;
case 'import':
//include needed librabries for treatment

@ -213,7 +213,7 @@ class GradebookDataGenerator
api_get_session_id()
);
$scoreDisplay = ScoreDisplay :: instance();
$scoreDisplay = ScoreDisplay::instance();
$display = $scoreDisplay->display_score($score, SCORE_DIV_PERCENT_WITH_CUSTOM, SCORE_BOTH, true);
$type = $item->get_item_type();
if ($type == 'L' && get_class($item) == 'ExerciseLink') {
@ -234,7 +234,7 @@ class GradebookDataGenerator
private function buildAverageResultColumn(GradebookItem $item)
{
$score = $item->calc_score(null, 'average');
$scoreDisplay = ScoreDisplay :: instance();
$scoreDisplay = ScoreDisplay::instance();
$display = $scoreDisplay->display_score($score, SCORE_DIV_PERCENT_WITH_CUSTOM, SCORE_BOTH, true);
$type = $item->get_item_type();

@ -45,7 +45,7 @@ class Accessurleditcoursestourl
' LIMIT 11';
$rs = Database::query($sql);
$i=0;
while ($course = Database :: fetch_array($rs)) {
while ($course = Database::fetch_array($rs)) {
$i++;
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 />';

@ -24,7 +24,7 @@ class AddManySessionToCategoryFunctions
*/
function search_courses($needle,$type)
{
$tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION);
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$xajax_response = new xajaxResponse();
$return = '';
if (!empty($needle) && !empty($type)) {
@ -36,7 +36,7 @@ class AddManySessionToCategoryFunctions
$rs = Database::query($sql);
$course_list = array();
$return .= '<select id="origin" name="NoSessionCategoryList[]" multiple="multiple" size="20" style="width:340px;">';
while ($course = Database :: fetch_array($rs)) {
while ($course = Database::fetch_array($rs)) {
$course_list[] = $course['id'];
$return .= '<option value="'.$course['id'].'" title="'.htmlspecialchars($course['name'],ENT_QUOTES).'">'.$course['name'].'</option>';
}

@ -409,8 +409,8 @@ class Auth
public function search_courses($search_term, $limit, $justVisible = false)
{
$courseTable = Database::get_main_table(TABLE_MAIN_COURSE);
$extraFieldTable = Database :: get_main_table(TABLE_EXTRA_FIELD);
$extraFieldValuesTable = Database :: get_main_table(TABLE_EXTRA_FIELD_VALUES);
$extraFieldTable = Database::get_main_table(TABLE_EXTRA_FIELD);
$extraFieldValuesTable = Database::get_main_table(TABLE_EXTRA_FIELD_VALUES);
$limitFilter = CourseCategory::getLimitFilterFromArray($limit);

@ -163,7 +163,7 @@ class Certificate extends Model
$params['hide_print_button'] = isset($params['hide_print_button']) ? true : false;
if (isset($this->certificate_data) && isset($this->certificate_data['cat_id'])) {
$my_category = Category :: load($this->certificate_data['cat_id']);
$my_category = Category::load($this->certificate_data['cat_id']);
}
if (isset($my_category[0]) &&

@ -61,7 +61,7 @@ class HTML_QuickForm_receivers extends HTML_QuickForm_group
$renderer->setElementTemplate('{element}');
$select_boxes = $this->_elements[2];
$select_boxes->setElementTemplate('<div style="margin-left:20px;display:block;" id="receivers_'.$select_boxes->getName().'">'.$select_boxes->_elementTemplate.'</div>');
parent :: accept($renderer);
parent::accept($renderer);
$js = $this->getElementJS();
return $renderer->toHtml().$js;
}

@ -911,7 +911,7 @@ class GroupManager
if (!empty($groups)) {
foreach ($groups as $group) {
GroupManager::set_group_properties(
self::set_group_properties(
$group['id'],
$group['name'],
$group['description'],
@ -2143,7 +2143,7 @@ class GroupManager
$row[] = $this_group['id'];
}
if (GroupManager::userHasAccessToBrowse($user_id, $this_group, $session_id)) {
if (self::userHasAccessToBrowse($user_id, $this_group, $session_id)) {
// Group name
$groupNameClass = null;
if ($this_group['status'] == 0) {

@ -17,9 +17,8 @@ switch ($_SESSION['whereami']) {
case 'document/edit' :
$autostart = 'false';
break;
default :
default:
$autostart = 'true';
}
echo utf8_encode('autostart='.$autostart);
?>

@ -304,7 +304,7 @@ class ZombieReport implements Countable
function format_email($email)
{
return Display :: encrypted_mailto_link($email, $email);
return Display::encrypted_mailto_link($email, $email);
}
function display($return = false)

@ -548,7 +548,7 @@ class scorm extends learnpath
$courseInfo = empty($courseInfo) ? api_get_course_info() : $courseInfo;
$maxFilledSpace = DocumentManager :: get_course_quota($courseInfo['code']);
$maxFilledSpace = DocumentManager::get_course_quota($courseInfo['code']);
$zip_file_path = $zip_file_info['tmp_name'];
$zip_file_name = $zip_file_info['name'];
@ -888,8 +888,8 @@ class scorm extends learnpath
$zip_folder->create($scormfoldername.'/', PCLZIP_OPT_REMOVE_PATH, $scormfoldername.'/');
//This file sending implies removing the default mime-type from php.ini
//DocumentManager :: file_send_for_download($zipfilename, true, $LPnamesafe.'.zip');
DocumentManager :: file_send_for_download($zipfilename, true);
//DocumentManager::file_send_for_download($zipfilename, true, $LPnamesafe.'.zip');
DocumentManager::file_send_for_download($zipfilename, true);
// Delete the temporary zip file and directory in fileManage.lib.php
my_delete($zipfilename);

@ -79,7 +79,7 @@ if (isset($_POST['formSent']) && $_POST['formSent']) {
case 'teacher' :
$status = 1;
break;
default :
default:
$status = 5;
$error_message .= get_lang('StudentStatusWasGivenTo').' : '.$username.'<br />';
}

@ -22,7 +22,7 @@ class ch_dropdown extends survey_question
}
}
parent :: addRemoveButtons($formData);
parent::addRemoveButtons($formData);
}
/**

@ -45,7 +45,7 @@ class ch_multiplechoice extends survey_question
}
}
parent :: addRemoveButtons($formData);
parent::addRemoveButtons($formData);
}
/**

@ -29,7 +29,7 @@ class ch_multipleresponse extends survey_question
}
}
parent :: addRemoveButtons($formData);
parent::addRemoveButtons($formData);
}
/**

@ -124,7 +124,7 @@ $is_allowedToTrackEverybodyInCourse = $is_courseAdmin; // allowed to track all s
[<a href='" . api_get_self() . "?uInfo=$uInfo&view=$view&period=week&reqdate=$nextReqDate' class='specialLink'>" . get_lang('NextWeek') . "</a>]
";
break;
default :
default:
$period = "month";
case "month" :
// previous and next date must be evaluated

@ -63,7 +63,7 @@ class WSCMAnnouncements extends WSCM
$field_table = "content";
$announcements[0][$field_table] = nl2br_revert($announcements[0][$field_table]);
break;
default :
default:
$field_table = "title";
}

@ -221,7 +221,7 @@ class BlockDaily extends Block
}
// Score
$tbl_grade_categories = Database :: get_main_table(
$tbl_grade_categories = Database::get_main_table(
TABLE_MAIN_GRADEBOOK_CATEGORY
);
$sql = "SELECT id from " . $tbl_grade_categories . "

@ -84,7 +84,7 @@ class BlockGlobalInfo extends Block
return $data;
}
/**
/**
* This method return a content html, it's used inside get_block method for showing it inside dashboard interface
* @return string content html
*/
@ -95,7 +95,7 @@ class BlockGlobalInfo extends Block
$content = '<h4>'.get_lang('GlobalPlatformInformation').'</h4>';
$data_table = null;
if (!empty($global_data)) {
$data_table = '<table class="table table-bordered" width:"95%">';
$data_table = '<table class="table table-bordered" width="95%">';
$i = 1;
foreach ($global_data as $data) {
if ($i%2 == 0) {

@ -122,7 +122,7 @@ class BlockStudent extends Block
$courseInfo = api_get_course_info($course_code);
$courseId = $courseInfo['real_id'];
$course_title = $course['title'];
$time = api_time_to_hms(Tracking :: get_time_spent_on_the_course($student['user_id'], $courseId));
$time = api_time_to_hms(Tracking::get_time_spent_on_the_course($student['user_id'], $courseId));
$students_table .= '<tr '.$style.'>
<td align="right">'.$course_title.'</td>
<td align="right">'.$time.'</td>

@ -3236,12 +3236,14 @@ class CourseRestorer
if (!empty($workData)) {
continue;
}
break;
case FILE_OVERWRITE:
// Creating folder.
$workData = get_work_data_by_path(
$path,
$this->destination_course_info['real_id']
);
break;
case FILE_RENAME:
$obj->params['new_dir'] = $obj->params['title'];

@ -42,7 +42,7 @@ class TaskModel implements TaskInterface
/**
* @var string
*/
protected $color = TaskModel::COLOR_AQUA;
protected $color = self::COLOR_AQUA;
/**
* @var null
@ -54,7 +54,7 @@ class TaskModel implements TaskInterface
* @param int $progress
* @param string $color
*/
function __construct($title = null, $progress = 0, $color = TaskModel::COLOR_AQUA)
function __construct($title = null, $progress = 0, $color = self::COLOR_AQUA)
{
$this->color = $color;
$this->progress = $progress;

Loading…
Cancel
Save