Minor - format code.

1.9.x
Julio Montoya 11 years ago
parent b6fab01f85
commit 1e8784125e
  1. 41
      main/group/group_space.php

@ -9,8 +9,6 @@
* @todo Display error message if no group ID specified * @todo Display error message if no group ID specified
*/ */
/* INIT SECTION */
// Name of the language file that needs to be included // Name of the language file that needs to be included
$language_file = 'group'; $language_file = 'group';
@ -21,7 +19,6 @@ $current_course_tool = TOOL_GROUP;
api_protect_course_script(true); api_protect_course_script(true);
/* Libraries & config files */ /* Libraries & config files */
require_once api_get_path(SYS_CODE_PATH).'forum/forumfunction.inc.php'; require_once api_get_path(SYS_CODE_PATH).'forum/forumfunction.inc.php';
require_once api_get_path(SYS_CODE_PATH).'forum/forumconfig.inc.php'; require_once api_get_path(SYS_CODE_PATH).'forum/forumconfig.inc.php';
@ -79,7 +76,9 @@ Display::display_introduction_section(TOOL_GROUP);
/* /*
* User wants to register in this group * User wants to register in this group
*/ */
if (!empty($_GET['selfReg']) && GroupManager :: is_self_registration_allowed($user_id, $current_group['id'])) { if (!empty($_GET['selfReg']) &&
GroupManager :: is_self_registration_allowed($user_id, $current_group['id'])
) {
GroupManager :: subscribe_users($user_id, $current_group['id']); GroupManager :: subscribe_users($user_id, $current_group['id']);
Display :: display_normal_message(get_lang('GroupNowMember')); Display :: display_normal_message(get_lang('GroupNowMember'));
} }
@ -87,13 +86,17 @@ if (!empty($_GET['selfReg']) && GroupManager :: is_self_registration_allowed($us
/* /*
* User wants to unregister from this group * User wants to unregister from this group
*/ */
if (!empty($_GET['selfUnReg']) && GroupManager :: is_self_unregistration_allowed($user_id, $current_group['id'])) { if (!empty($_GET['selfUnReg']) &&
GroupManager :: is_self_unregistration_allowed($user_id, $current_group['id'])
) {
GroupManager :: unsubscribe_users($user_id, $current_group['id']); GroupManager :: unsubscribe_users($user_id, $current_group['id']);
Display::display_normal_message(get_lang('StudentDeletesHimself')); Display::display_normal_message(get_lang('StudentDeletesHimself'));
} }
echo '<div class="actions">'; echo '<div class="actions">';
echo '<a href="group.php">'.Display::return_icon('back.png',get_lang('BackToGroupList'),'',ICON_SIZE_MEDIUM).'</a>'; echo '<a href="group.php">'.
Display::return_icon('back.png',get_lang('BackToGroupList'),'',ICON_SIZE_MEDIUM).
'</a>';
/* /*
* Register to group * Register to group
@ -381,7 +384,8 @@ $table->display();
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
* @version April 2008 * @version April 2008
*/ */
function get_number_of_group_users() { function get_number_of_group_users()
{
global $current_group; global $current_group;
$course_id = api_get_course_int_id(); $course_id = api_get_course_int_id();
@ -389,7 +393,8 @@ function get_number_of_group_users() {
$table_group_user = Database :: get_course_table(TABLE_GROUP_USER); $table_group_user = Database :: get_course_table(TABLE_GROUP_USER);
// Query // Query
$sql = "SELECT count(id) AS number_of_users FROM ".$table_group_user." $sql = "SELECT count(id) AS number_of_users
FROM ".$table_group_user."
WHERE c_id = $course_id AND group_id='".Database::escape_string($current_group['id'])."'"; WHERE c_id = $course_id AND group_id='".Database::escape_string($current_group['id'])."'";
$result = Database::query($sql); $result = Database::query($sql);
$return = Database::fetch_array($result,'ASSOC'); $return = Database::fetch_array($result,'ASSOC');
@ -408,7 +413,8 @@ function get_number_of_group_users() {
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
* @version April 2008 * @version April 2008
*/ */
function get_group_user_data($from, $number_of_items, $column, $direction) { function get_group_user_data($from, $number_of_items, $column, $direction)
{
global $current_group; global $current_group;
// Database table definition // Database table definition
@ -476,11 +482,12 @@ function get_group_user_data($from, $number_of_items, $column, $direction) {
} }
/** /**
* Returns a mailto-link * Returns a mailto-link
* @param string $email An email-address * @param string $email An email-address
* @return string HTML-code with a mailto-link * @return string HTML-code with a mailto-link
*/ */
function email_filter($email) { function email_filter($email)
{
return Display :: encrypted_mailto_link($email, $email); return Display :: encrypted_mailto_link($email, $email);
} }
@ -493,7 +500,8 @@ function email_filter($email) {
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
* @version April 2008 * @version April 2008
*/ */
function user_icon_filter($user_id) { function user_icon_filter($user_id)
{
global $origin; global $origin;
$userinfo = api_get_user_info($user_id); $userinfo = api_get_user_info($user_id);
$image_path = UserManager::get_user_picture_path_by_id($user_id, 'web', false, true); $image_path = UserManager::get_user_picture_path_by_id($user_id, 'web', false, true);
@ -513,7 +521,8 @@ function user_icon_filter($user_id) {
* @param array Row of the "sortable table" as it is at the time of function call - we extract the user ID from there * @param array Row of the "sortable table" as it is at the time of function call - we extract the user ID from there
* @return string HTML link * @return string HTML link
*/ */
function user_name_filter($name, $url_params, $row) { function user_name_filter($name, $url_params, $row)
{
$tab_user_info = api_get_user_info($row[0]); $tab_user_info = api_get_user_info($row[0]);
$username = api_htmlentities(sprintf(get_lang('LoginX'), $tab_user_info['username']), ENT_QUOTES); $username = api_htmlentities(sprintf(get_lang('LoginX'), $tab_user_info['username']), ENT_QUOTES);
return '<a href="../user/userInfo.php?uInfo='.$row[0].'&amp;'.$url_params.'" title="'.$username.'">'.$name.'</a>'; return '<a href="../user/userInfo.php?uInfo='.$row[0].'&amp;'.$url_params.'" title="'.$username.'">'.$name.'</a>';

Loading…
Cancel
Save