Minor - foramt code

pull/3559/head
Julio Montoya 5 years ago
parent 9a6fbade3c
commit 64e1983f6d
  1. 3
      main/admin/settings.lib.php
  2. 13
      main/auth/external_login/functions.inc.php
  3. 1
      main/inc/lib/formvalidator/FormValidator.class.php
  4. 16
      main/inc/lib/social.lib.php

@ -1386,7 +1386,7 @@ function addEditTemplate()
$form->addElement('static', 'file_comment', '', get_lang('TemplateImageComment100x70'));
// Getting all the information of the template when editing a template.
if ($_GET['action'] == 'edit') {
if ($_GET['action'] === 'edit') {
$defaults['template_id'] = $id;
$defaults['template_text'] = $template->getContent();
// Forcing get_lang().
@ -1397,7 +1397,6 @@ function addEditTemplate()
$form->addElement('hidden', 'template_id');
// Adding an extra field: a preview of the image that is currently used.
if (!empty($template->getImage())) {
$form->addElement(
'static',

@ -1,8 +1,7 @@
<?php
//define('USERINFO_TABLE', 'danone_userinfo');
//define('DEFAULT_PASSWORD', 'danonelearning');
//TODO : Please implements this function for this module to work.
/**
* Gets user info from external source.
*
@ -192,7 +191,7 @@ function external_update_user($new_user)
{
$old_user = api_get_user_info($new_user['user_id']);
$u = array_merge($old_user, $new_user);
$updated = UserManager::update_user(
UserManager::update_user(
$u['user_id'],
$u['firstname'],
$u['lastname'],
@ -220,12 +219,4 @@ function external_update_user($new_user)
}
}
}
// Is User Admin ?
//TODO decomments and check that user_is is not already in admin table
/*
if (isset($u['admin']) && $u['admin']){
$table = Database::get_main_table(TABLE_MAIN_ADMIN);
$res = Database::query("SELECT * from $table WHERE user_id = ".$u['user_id']);
} */
}

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
/**

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
use Chamilo\CourseBundle\Entity\CForumPost;
@ -2448,9 +2449,8 @@ class SocialManager extends UserManager
$form->addHtml('</div></div>');
$form->addHtml('</div>');
$form->addHidden('url_content', '');
$html = Display::panel($form->returnForm(), get_lang('SocialWall'));
return $html;
return Display::panel($form->returnForm(), get_lang('SocialWall'));
}
/**
@ -2463,13 +2463,11 @@ class SocialManager extends UserManager
*/
public static function getWallFormPortfolio($urlForm)
{
$userId = isset($_GET['u']) ? (int) $_GET['u'] : '';
$userId = ($userId!=0) ? $userId : api_get_user_id();
$userId = isset($_GET['u']) ? (int) $_GET['u'] : 0;
$userId = $userId !== 0 ? $userId : api_get_user_id();
$user_info = api_get_user_info($userId);
$portfolioName = ' '.$userId;
$friend = true;
if ($userId != api_get_user_id()){
$portfolioName = $user_info['complete_name'];
$friend = self::get_relation_between_contacts(api_get_user_id(), $userId);
}
if ($friend == 0) {
@ -2529,7 +2527,6 @@ class SocialManager extends UserManager
$more_info .= '<div class="social-profile-extended">'.$user_info['teach'].'</div>';
$more_info .= '<br />';
}
//$socialRightInformation .= SocialManager::social_wrapper_div($more_info, 4);
}
$form->addTextarea(
@ -2558,6 +2555,7 @@ class SocialManager extends UserManager
$form->addHtml('</div></div>');
$form->addHtml('</div>');
$form->addHidden('url_content', '');
return Display::panel($more_info, get_lang('Portfolio'));
}
@ -2649,7 +2647,7 @@ class SocialManager extends UserManager
*/
public static function getCountWallMessagesByUser($userId, $groupList = [], $friendList = [], $threadList = [])
{
$count = self::getWallMessages(
return self::getWallMessages(
$userId,
0,
$groupList,
@ -2660,8 +2658,6 @@ class SocialManager extends UserManager
true,
$threadList
);
return $count;
}
/**

Loading…
Cancel
Save