';
@@ -517,8 +517,8 @@ class DisplayGradebook
return '';
}
- $catcourse = Category :: load($categoryId);
- $scoredisplay = ScoreDisplay :: instance();
+ $catcourse = Category::load($categoryId);
+ $scoredisplay = ScoreDisplay::instance();
// generating the total score for a course
$allevals = $catcourse[0]->get_evaluations($userId, true, api_get_course_id());
diff --git a/main/gradebook/lib/fe/evalform.class.php b/main/gradebook/lib/fe/evalform.class.php
index 8cc17acba2..8f8f6bb9d4 100755
--- a/main/gradebook/lib/fe/evalform.class.php
+++ b/main/gradebook/lib/fe/evalform.class.php
@@ -53,25 +53,25 @@ class EvalForm extends FormValidator
$this->extra = $extra1;
}
switch ($form_type) {
- case self :: TYPE_EDIT:
+ case self::TYPE_EDIT:
$this->build_editing_form();
break;
- case self :: TYPE_ADD:
+ case self::TYPE_ADD:
$this->build_add_form();
break;
- case self :: TYPE_MOVE:
+ case self::TYPE_MOVE:
$this->build_editing_form();
break;
- case self :: TYPE_RESULT_ADD:
+ case self::TYPE_RESULT_ADD:
$this->build_result_add_form();
break;
- case self :: TYPE_RESULT_EDIT:
+ case self::TYPE_RESULT_EDIT:
$this->build_result_edit_form();
break;
- case self :: TYPE_ALL_RESULTS_EDIT:
+ case self::TYPE_ALL_RESULTS_EDIT:
$this->build_all_results_edit_form();
break;
- case self :: TYPE_ADD_USERS_TO_EVAL:
+ case self::TYPE_ADD_USERS_TO_EVAL:
$this->build_add_user_to_eval();
break;
}
@@ -398,12 +398,12 @@ class EvalForm extends FormValidator
*/
protected function build_editing_form()
{
- $parent_cat = Category :: load($this->evaluation_object->get_category_id());
+ $parent_cat = Category::load($this->evaluation_object->get_category_id());
//@TODO $weight_mask is replaced?
if ($parent_cat[0]->get_parent_id() == 0) {
$weight_mask = $this->evaluation_object->get_weight();
} else {
- $cat = Category :: load($parent_cat[0]->get_parent_id());
+ $cat = Category::load($parent_cat[0]->get_parent_id());
$global_weight = $cat[0]->get_weight();
$weight_mask = $global_weight * $this->evaluation_object->get_weight() / $parent_cat[0]->get_weight();
}
@@ -565,12 +565,12 @@ class EvalForm extends FormValidator
function display()
{
- parent :: display();
+ parent::display();
}
function setDefaults($defaults = array(), $filter = null)
{
- parent :: setDefaults($defaults, $filter);
+ parent::setDefaults($defaults, $filter);
}
/**
@@ -586,7 +586,7 @@ class EvalForm extends FormValidator
$opendocurl_end = '';
// evaluation's origin is a link
if ($this->evaluation_object->get_category_id() < 0) {
- $link = LinkFactory :: get_evaluation_link($this->evaluation_object->get_id());
+ $link = LinkFactory::get_evaluation_link($this->evaluation_object->get_id());
$doc_url = $link->get_view_url($id);
if ($doc_url != null) {
$opendocurl_start .= '
';
diff --git a/main/gradebook/lib/fe/linkaddeditform.class.php b/main/gradebook/lib/fe/linkaddeditform.class.php
index 2fe4378749..56ec66d835 100755
--- a/main/gradebook/lib/fe/linkaddeditform.class.php
+++ b/main/gradebook/lib/fe/linkaddeditform.class.php
@@ -25,7 +25,7 @@ class LinkAddEditForm extends FormValidator
$form_name,
$action = null
) {
- parent :: __construct($form_name, 'post', $action);
+ parent::__construct($form_name, 'post', $action);
// set or create link object
if (isset($link_object)) {
@@ -44,7 +44,7 @@ class LinkAddEditForm extends FormValidator
}
// ELEMENT: name
- if ($form_type == self :: TYPE_ADD || $link->is_allowed_to_change_name()) {
+ if ($form_type == self::TYPE_ADD || $link->is_allowed_to_change_name()) {
if ($link->needs_name_and_description()) {
$this->addText('name', get_lang('Name'), true, array('size'=>'40', 'maxlength'=>'40'));
} else {
@@ -119,12 +119,12 @@ class LinkAddEditForm extends FormValidator
$this->addElement('hidden', 'weight');
- if ($form_type == self :: TYPE_EDIT) {
- $parent_cat = Category :: load($link->get_category_id());
+ if ($form_type == self::TYPE_EDIT) {
+ $parent_cat = Category::load($link->get_category_id());
if ($parent_cat[0]->get_parent_id() == 0) {
$values['weight'] = $link->get_weight();
} else {
- $cat = Category :: load($parent_cat[0]->get_parent_id());
+ $cat = Category::load($parent_cat[0]->get_parent_id());
//$global_weight = $cat[0]->get_weight();
//$values['weight'] = $link->get_weight()/$parent_cat[0]->get_weight()*$global_weight;
//var_dump($global_weight, $link->get_weight(), $parent_cat[0]->get_weight());
@@ -138,7 +138,7 @@ class LinkAddEditForm extends FormValidator
}
// ELEMENT: max
if ($link->needs_max()) {
- if ($form_type == self :: TYPE_EDIT && $link->has_results()) {
+ if ($form_type == self::TYPE_EDIT && $link->has_results()) {
$this->addText(
'max',
get_lang('QualificationNumeric'),
@@ -154,7 +154,7 @@ class LinkAddEditForm extends FormValidator
$this->addRule('max', get_lang('OnlyNumbers'), 'numeric');
$this->addRule('max', get_lang('NegativeValue'), 'compare', '>=');
}
- if ($form_type == self :: TYPE_EDIT) {
+ if ($form_type == self::TYPE_EDIT) {
$defaults['max'] = $link->get_max();
}
}
@@ -167,30 +167,30 @@ class LinkAddEditForm extends FormValidator
get_lang('Description'),
array('rows' => '3', 'cols' => '34')
);
- if ($form_type == self :: TYPE_EDIT) {
+ if ($form_type == self::TYPE_EDIT) {
$defaults['description'] = $link->get_description();
}
}
// ELEMENT: visible
- $visible = ($form_type == self :: TYPE_EDIT && $link->is_visible()) ? '1' : '0';
+ $visible = ($form_type == self::TYPE_EDIT && $link->is_visible()) ? '1' : '0';
$this->addElement('checkbox', 'visible', null, get_lang('Visible'), $visible);
- if ($form_type == self :: TYPE_EDIT) {
+ if ($form_type == self::TYPE_EDIT) {
$defaults['visible'] = $link->is_visible();
}
// ELEMENT: add results
- if ($form_type == self :: TYPE_ADD && $link->needs_results()) {
+ if ($form_type == self::TYPE_ADD && $link->needs_results()) {
$this->addElement('checkbox', 'addresult', get_lang('AddResult'));
}
// submit button
- if ($form_type == self :: TYPE_ADD) {
+ if ($form_type == self::TYPE_ADD) {
$this->addButtonCreate(get_lang('CreateLink'));
} else {
$this->addButtonUpdate(get_lang('LinkMod'));
}
- if ($form_type == self :: TYPE_ADD) {
+ if ($form_type == self::TYPE_ADD) {
$setting = api_get_setting('tool_visible_by_default_at_creation');
$visibility_default = 1;
if (isset($setting['gradebook']) && $setting['gradebook'] == 'false') {
diff --git a/main/gradebook/lib/fe/usertable.class.php b/main/gradebook/lib/fe/usertable.class.php
index 4e7609ff63..b2c257dfe4 100755
--- a/main/gradebook/lib/fe/usertable.class.php
+++ b/main/gradebook/lib/fe/usertable.class.php
@@ -18,7 +18,7 @@ class UserTable extends SortableTable
*/
public function __construct($userid, $evals = array(), $links = array(), $addparams = null)
{
- parent :: __construct('userlist', null, null, 0);
+ parent::__construct('userlist', null, null, 0);
$this->userid = $userid;
$this->datagen = new UserDataGenerator($userid, $evals, $links);
if (isset($addparams)) {
@@ -32,7 +32,7 @@ class UserTable extends SortableTable
$this->set_header($column++, get_lang('EvaluationAverage'));
$this->set_header($column++, get_lang('Result'));
- $scoredisplay = ScoreDisplay :: instance();
+ $scoredisplay = ScoreDisplay::instance();
if ($scoredisplay->is_custom()) {
$this->set_header($column++, get_lang('Display'));
}
@@ -51,37 +51,37 @@ class UserTable extends SortableTable
*/
public function get_table_data($from = 1, $per_page = null, $column = null, $direction = null, $sort = null)
{
- $scoredisplay = ScoreDisplay :: instance();
+ $scoredisplay = ScoreDisplay::instance();
// determine sorting type
switch ($this->column) {
// Type
case 0:
- $sorting = UserDataGenerator :: UDG_SORT_TYPE;
+ $sorting = UserDataGenerator::UDG_SORT_TYPE;
break;
case 1:
- $sorting = UserDataGenerator :: UDG_SORT_NAME;
+ $sorting = UserDataGenerator::UDG_SORT_NAME;
break;
case 2:
- $sorting = UserDataGenerator :: UDG_SORT_COURSE;
+ $sorting = UserDataGenerator::UDG_SORT_COURSE;
break;
case 3:
- $sorting = UserDataGenerator :: UDG_SORT_CATEGORY;
+ $sorting = UserDataGenerator::UDG_SORT_CATEGORY;
break;
case 4:
- $sorting = UserDataGenerator :: UDG_SORT_AVERAGE;
+ $sorting = UserDataGenerator::UDG_SORT_AVERAGE;
break;
case 5:
- $sorting = UserDataGenerator :: UDG_SORT_SCORE;
+ $sorting = UserDataGenerator::UDG_SORT_SCORE;
break;
case 6:
- $sorting = UserDataGenerator :: UDG_SORT_MASK;
+ $sorting = UserDataGenerator::UDG_SORT_MASK;
break;
}
if ($this->direction == 'DESC') {
- $sorting |= UserDataGenerator :: UDG_SORT_DESC;
+ $sorting |= UserDataGenerator::UDG_SORT_DESC;
} else {
- $sorting |= UserDataGenerator :: UDG_SORT_ASC;
+ $sorting |= UserDataGenerator::UDG_SORT_ASC;
}
$data_array = $this->datagen->get_data($sorting, $from, $this->per_page);
// generate the data to display
diff --git a/main/inc/lib/TicketManager.php b/main/inc/lib/TicketManager.php
index 993c6d4a52..a47634e96e 100644
--- a/main/inc/lib/TicketManager.php
+++ b/main/inc/lib/TicketManager.php
@@ -322,7 +322,7 @@ class TicketManager
if (!empty($category_id)) {
if (empty($assignedUserId)) {
- $usersInCategory = TicketManager::getUsersInCategory($category_id);
+ $usersInCategory = self::getUsersInCategory($category_id);
if (!empty($usersInCategory) && count($usersInCategory) > 0) {
$userCategoryInfo = $usersInCategory[0];
if (isset($userCategoryInfo['user_id'])) {
@@ -481,7 +481,7 @@ class TicketManager
$admins = UserManager::get_all_administrators();
foreach ($admins as $userId => $data) {
if ($data['active']) {
- TicketManager::send_message_simple(
+ self::send_message_simple(
$userId,
$warningSubject,
$helpDeskMessage
@@ -490,13 +490,13 @@ class TicketManager
}
}
} else {
- $categoryInfo = TicketManager::getCategory($category_id);
- $usersInCategory = TicketManager::getUsersInCategory($category_id);
+ $categoryInfo = self::getCategory($category_id);
+ $usersInCategory = self::getUsersInCategory($category_id);
$message = ''.get_lang('TicketInformation').'
'.$helpDeskMessage;
if (api_get_setting('ticket_warn_admin_no_user_in_category') === 'true') {
- $usersInCategory = TicketManager::getUsersInCategory($category_id);
+ $usersInCategory = self::getUsersInCategory($category_id);
if (empty($usersInCategory)) {
$subject = sprintf(
get_lang('WarningCategoryXDoesntHaveUsers'),
@@ -516,7 +516,7 @@ class TicketManager
$admins = UserManager::get_all_administrators();
foreach ($admins as $userId => $data) {
if ($data['active']) {
- TicketManager::sendNotification(
+ self::sendNotification(
$ticketId,
$subject,
$message,
@@ -534,7 +534,7 @@ class TicketManager
if (!empty($usersInCategory)) {
foreach ($usersInCategory as $data) {
if ($data['user_id']) {
- TicketManager::sendNotification(
+ self::sendNotification(
$ticketId,
$subject,
$message,
@@ -554,7 +554,7 @@ class TicketManager
);
}
- TicketManager::sendNotification(
+ self::sendNotification(
$ticketId,
$titleCreated,
$helpDeskMessage
@@ -713,7 +713,7 @@ class TicketManager
$file_name = $file_attach['name'];
$table_support_message_attachments = Database::get_main_table(TABLE_TICKET_MESSAGE_ATTACHMENTS);
if (!filter_extension($new_file_name)) {
- Display :: display_error_message(
+ Display::display_error_message(
get_lang('UplUnableToSaveFileFilteredExtension')
);
} else {
@@ -885,7 +885,7 @@ class TicketManager
$sql .= " AND ticket.source = '$keyword_source' ";
}
if ($keyword_course != '') {
- $course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
+ $course_table = Database::get_main_table(TABLE_MAIN_COURSE);
$sql .= " AND ticket.course_id IN (
SELECT id FROM $course_table
WHERE (
@@ -1150,7 +1150,7 @@ class TicketManager
$sql .= " AND ticket.priority_id = '$keyword_priority' ";
}
if ($keyword_course != '') {
- $course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
+ $course_table = Database::get_main_table(TABLE_MAIN_COURSE);
$sql .= " AND ticket.course_id IN ( ";
$sql .= "SELECT id
FROM $course_table
@@ -1734,7 +1734,7 @@ class TicketManager
$sql .= " AND ticket.priority_id = '$keyword_priority' ";
}
if ($keyword_course != '') {
- $course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
+ $course_table = Database::get_main_table(TABLE_MAIN_COURSE);
$sql .= " AND ticket.course_id IN ( ";
$sql .= "SELECT id
FROM $course_table
diff --git a/main/inc/lib/blog.lib.php b/main/inc/lib/blog.lib.php
index 9340c323d7..0af1ce66bf 100755
--- a/main/inc/lib/blog.lib.php
+++ b/main/inc/lib/blog.lib.php
@@ -175,7 +175,7 @@ class Blog
}
// Subscribe the teacher to this blog
- Blog::subscribeUser($this_blog_id, $_user['user_id']);
+ self::subscribeUser($this_blog_id, $_user['user_id']);
}
}
@@ -604,7 +604,7 @@ class Blog
// Delete them recursively
while ($comment = Database::fetch_array($result)) {
- Blog::deleteComment($blog_id, $post_id, $comment['comment_id']);
+ self::deleteComment($blog_id, $post_id, $comment['comment_id']);
}
// Finally, delete the selected comment to
@@ -939,7 +939,7 @@ class Blog
$query_string = '('.implode('OR', $query_string).')';
// Display the posts
- return Blog::getPosts($blog_id, $query_string);
+ return self::getPosts($blog_id, $query_string);
}
/**
@@ -987,7 +987,7 @@ class Blog
$blog_post_comments = Database::fetch_array($tmp);
$fileArray = self::getBlogAttachments($blog_id, $blog_post['post_id'], 0);
- $scoreRanking = Blog::displayRating(
+ $scoreRanking = self::displayRating(
'post',
$blog_id,
$blog_post['post_id']
@@ -1040,7 +1040,7 @@ class Blog
//$date_output = api_format_date($date_output, DATE_FORMAT_LONG);
// Display the posts
//echo '' . get_lang('PostsOf') . ': ' . $date_output . '';
- $list = Blog::getPosts($blog_id, $query_string);
+ $list = self::getPosts($blog_id, $query_string);
return $list;
}
@@ -1088,11 +1088,11 @@ class Blog
// Display comments if there are any
if ($blog_post_comments['number_of_comments'] > 0) {
- $listComments = Blog::getThreadedComments(0, 0, $blog_id, $post_id, $task_id);
+ $listComments = self::getThreadedComments(0, 0, $blog_id, $post_id, $task_id);
}
// Display comment form
if (api_is_allowed('BLOG_'.$blog_id, 'article_comments_add')) {
- $formComments = Blog::displayCommentCreateForm($blog_id, $post_id, $blog_post['title'], false);
+ $formComments = self::displayCommentCreateForm($blog_id, $post_id, $blog_post['title'], false);
}
// Prepare data
$fileArray = self::getBlogAttachments($blog_id, $post_id);
@@ -1115,7 +1115,7 @@ class Blog
$blogActions .= Display::return_icon('delete.png', get_lang('Delete'), null, ICON_SIZE_TINY);
$blogActions .= '';
}
- $scoreRanking = Blog::displayRating('post', $blog_id, $post_id);
+ $scoreRanking = self::displayRating('post', $blog_id, $post_id);
$article = [
'id_blog' => $blog_post['blog_id'],
'c_id' => $blog_post['c_id'],
@@ -1135,7 +1135,7 @@ class Blog
'actions' => $blogActions,
'score_ranking' => (int)$scoreRanking,
'frm_rating' => api_is_allowed('BLOG_'.$blog_id, 'article_rate')
- ? Blog::displayRatingCreateForm('post', $blog_id, $post_id)
+ ? self::displayRatingCreateForm('post', $blog_id, $post_id)
: null
];
@@ -1212,7 +1212,7 @@ class Blog
$commentActions .= '';
}
if (api_is_allowed('BLOG_'.$blog_id, 'article_comments_rate')) {
- $ratingSelect = Blog::displayRatingCreateForm(
+ $ratingSelect = self::displayRatingCreateForm(
'comment',
$blog_id,
$post_id,
@@ -1415,7 +1415,7 @@ class Blog
if ($form->validate()) {
$values = $form->exportValues();
- Blog::createComment(
+ self::createComment(
$values['title'],
$values['comment'],
$values['post_file_comment'],
diff --git a/main/inc/lib/display.lib.php b/main/inc/lib/display.lib.php
index 3f6a6cf56f..20e1d4b076 100755
--- a/main/inc/lib/display.lib.php
+++ b/main/inc/lib/display.lib.php
@@ -713,7 +713,7 @@ class Display
*/
public static function returnIconPath($icon, $size = ICON_SIZE_SMALL)
{
- return Display::return_icon($icon, null, null, $size, null, true, false);
+ return self::return_icon($icon, null, null, $size, null, true, false);
}
/**
@@ -1531,8 +1531,8 @@ class Display
$image = substr($notification['image'], 0, -4).'.png';
- $return .= Display::url(
- Display::return_icon($image, $label),
+ $return .= self::url(
+ self::return_icon($image, $label),
api_get_path(WEB_CODE_PATH).
$notification['link'].'&cidReq='.$course_code.
'&ref='.$notification['ref'].
@@ -1560,8 +1560,8 @@ class Display
$output = array();
$active = false;
if (!$nosession) {
- $main_user_table = Database :: get_main_table(TABLE_MAIN_USER);
- $tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION);
+ $main_user_table = Database::get_main_table(TABLE_MAIN_USER);
+ $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
// Request for the name of the general coach
$sql ='SELECT tu.lastname, tu.firstname, ts.*
FROM '.$tbl_session.' ts
@@ -1729,14 +1729,14 @@ class Display
$labels[]= $point_info['user_vote'] ? get_lang('YourVote').' ['.$point_info['user_vote'].']' : get_lang('YourVote'). ' [?] ';
if (!$add_div_wrapper && api_is_anonymous()) {
- $labels[]= Display::tag('span', get_lang('LoginToVote'), array('class' => 'error'));
+ $labels[]= self::tag('span', get_lang('LoginToVote'), array('class' => 'error'));
}
- $html .= Display::div(implode(' | ', $labels) , array('id' => 'vote_label_'.$id, 'class' => 'vote_label_info'));
- $html .= ' '.Display::span(' ', array('id' => 'vote_label2_'.$id));
+ $html .= self::div(implode(' | ', $labels) , array('id' => 'vote_label_'.$id, 'class' => 'vote_label_info'));
+ $html .= ' '.self::span(' ', array('id' => 'vote_label2_'.$id));
if ($add_div_wrapper) {
- $html = Display::div($html, array('id' => 'rating_wrapper_'.$id));
+ $html = self::div($html, array('id' => 'rating_wrapper_'.$id));
}
return $html;
@@ -2045,7 +2045,7 @@ class Display
';
@@ -2225,7 +2225,7 @@ class Display
$label = ($fixedValue + 1) .' '.chr(97 + $localCounter);
$link_to_show = $link.$fixedValue.'#questionanchor'.$itemId;
}
- $link = Display::url($label.' ', $link_to_show, $linkAttributes);
+ $link = self::url($label.' ', $link_to_show, $linkAttributes);
return '