Minor - format code

pull/2487/head
Julio 8 years ago
parent dbfd35b21d
commit 28e2fab848
  1. 5
      main/coursecopy/import_backup.php
  2. 8
      main/inc/lib/groupmanager.lib.php
  3. 9
      main/inc/lib/plugin.class.php

@ -60,7 +60,9 @@ if (Security::check_token('post') && (
Security::clear_token();
$error = false;
if (isset($_POST['action']) && $_POST['action'] == 'course_select_form') {
if (isset($_POST['action']) &&
$_POST['action'] == 'course_select_form'
) {
// Partial backup here we recover the documents posted
// This gets $_POST['course']. Beware that when using Suhosin,
// the post.max_value_length limit might get in the way of the
@ -282,7 +284,6 @@ if (Security::check_token('post') && (
$token = Security::get_token();
$form->addElement('hidden', 'sec_token');
$form->setConstants(array('sec_token' => $token));
$form->display();
}

@ -1526,7 +1526,7 @@ class GroupManager
}
}
$result = self::number_of_students($group_id) < self:: maximum_number_of_students($groupIid);
$result = self::number_of_students($group_id) < self::maximum_number_of_students($groupIid);
if ($result == false) {
return false;
@ -1657,15 +1657,15 @@ class GroupManager
public static function subscribe_users($user_ids, $groupInfo, $course_id = null)
{
$user_ids = is_array($user_ids) ? $user_ids : array($user_ids);
$course_id = isset($course_id) && !empty($course_id) ? intval($course_id) : api_get_course_int_id();
$course_id = empty($course_id) ? api_get_course_int_id() : (int) $course_id;
$group_id = $groupInfo['id'];
$table_group_user = Database::get_course_table(TABLE_GROUP_USER);
$table = Database::get_course_table(TABLE_GROUP_USER);
if (!empty($user_ids)) {
foreach ($user_ids as $user_id) {
if (self::can_user_subscribe($user_id, $groupInfo)) {
$user_id = intval($user_id);
$sql = "INSERT INTO ".$table_group_user." (c_id, user_id, group_id)
$sql = "INSERT INTO ".$table." (c_id, user_id, group_id)
VALUES ('$course_id', '".$user_id."', '".$group_id."')";
Database::query($sql);
}

@ -364,15 +364,19 @@ class Plugin
// Check whether the language strings for the plugin have already been
// loaded. If so, no need to load them again.
if (is_null($this->strings)) {
global $language_interface;
$language_interface = api_get_interface_language();
$root = api_get_path(SYS_PLUGIN_PATH);
$plugin_name = $this->get_name();
$interfaceLanguageId = api_get_language_id($language_interface);
if (empty($interfaceLanguageId)) {
$language_interface = api_get_setting('platformLanguage');
$interfaceLanguageId = api_get_language_id($language_interface);
}
$interfaceLanguageInfo = api_get_language_info($interfaceLanguageId);
$languageParentId = !empty($interfaceLanguageInfo['parent_id']) ? (int) $interfaceLanguageInfo['parent_id'] : 0;
//1. Loading english if exists
// 1. Loading english if exists
$english_path = $root.$plugin_name."/lang/english.php";
if (is_readable($english_path)) {
@ -405,7 +409,6 @@ class Plugin
}
}
}
if (isset($this->strings[$name])) {
return $this->strings[$name];
}

Loading…
Cancel
Save