Minor - format code

pull/2487/head
Julio 7 years ago
parent dd7dacfe7f
commit 7f0f5bf4c5
  1. 9
      main/admin/user_edit.php
  2. 2
      main/admin/user_information.php
  3. 2
      main/auth/inscription.php
  4. 1
      main/exercise/question.class.php
  5. 11
      main/inc/lib/usermanager.lib.php
  6. 1
      main/inc/lib/userportal.lib.php

@ -285,7 +285,12 @@ if (!$user_data['platform_admin']) {
$form->addElement('radio', 'radio_expiration_date', get_lang('ExpirationDate'), get_lang('NeverExpires'), 0);
$group = array();
$group[] = $form->createElement('radio', 'radio_expiration_date', null, get_lang('Enabled'), 1);
$group[] = $form->createElement('DateTimePicker', 'expiration_date', null, array('onchange' => 'javascript: enable_expiration_date();'));
$group[] = $form->createElement(
'DateTimePicker',
'expiration_date',
null,
array('onchange' => 'javascript: enable_expiration_date();')
);
$form->addGroup($group, 'max_member_group', null, null, false);
// Active account or inactive account
@ -305,7 +310,7 @@ if ($studentBoss) {
}
}
if ($studentBossList) {
if (!empty($studentBossList)) {
$studentBossList = array_column($studentBossList, 'boss_id');
}

@ -125,7 +125,7 @@ if (api_is_platform_admin()) {
$studentBossList = UserManager::getStudentBossList($userId);
$studentBossListToString = '';
if ($studentBossList) {
if (!empty($studentBossList)) {
$table = new HTML_Table(array('class' => 'data_table'));
$table->setHeaderContents(0, 0, get_lang('User'));
$csvContent[] = [get_lang('StudentBoss')];

@ -827,7 +827,7 @@ if ($form->validate()) {
);
$bossList = UserManager::getStudentBossList($user_id);
if ($bossList) {
if (!empty($bossList)) {
$bossList = array_column($bossList, 'boss_id');
$currentUserInfo = api_get_user_info($user_id);
foreach ($bossList as $bossId) {

@ -1010,7 +1010,6 @@ abstract class Question
if ($exercise->questionFeedbackEnabled) {
$params['feedback'] = $this->feedback;
}
$this->id = Database::insert($TBL_QUESTIONS, $params);
if ($this->id) {

@ -5393,11 +5393,11 @@ class UserManager
/**
* Get the boss user ID from a followed user id
* @param $userId
* @return bool
* @return array
*/
public static function getStudentBossList($userId)
{
$userId = intval($userId);
$userId = (int) $userId;
if ($userId > 0) {
$userRelTable = Database::get_main_table(TABLE_MAIN_USER_REL_USER);
$result = Database::select(
@ -5410,14 +5410,13 @@ class UserManager
USER_RELATION_TYPE_BOSS,
)
)
),
'all'
)
);
return $result;
}
return false;
return [];
}
/**
@ -5430,7 +5429,7 @@ class UserManager
{
$result = false;
$bossList = self::getStudentBossList($studentId);
if ($bossList) {
if (!empty($bossList)) {
$bossList = array_column($bossList, 'boss_id');
if (in_array($bossId, $bossList)) {
$result = true;

@ -1013,7 +1013,6 @@ class IndexManager
// Main navigation section.
// Tabs that are deactivated are added here.
if (!empty($this->tpl->menu_navigation)) {
//$content = '<ul class="nav nav-pills nav-stacked">';
foreach ($this->tpl->menu_navigation as $section => $navigation_info) {
$items [] = [
'icon' => null,

Loading…
Cancel
Save