Minor - format code.

1.9.x
Julio Montoya 12 years ago
parent 0e0d0246dc
commit 7b7a541a75
  1. 2
      main/work/edit_work.php
  2. 20
      main/work/work.lib.php
  3. 5
      main/work/work.php

@ -1,5 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
use ChamiloSession as Session;
$language_file = array('exercice', 'work', 'document', 'admin', 'gradebook');
@ -19,6 +20,7 @@ if (!api_is_allowed_to_edit()) {
}
$courseInfo = api_get_course_info();
$sessionId = api_get_session_id();
$groupId = api_get_group_id();
$workId = isset($_GET['id']) ? intval($_GET['id']) : null;
$workData = get_work_data_by_id($workId);

@ -1655,8 +1655,8 @@ function getWorkListStudent($start, $limit, $column, $direction, $where_conditio
$work['others'] = Display::url(Display::return_icon('group.png', get_lang('Others')), $urlOthers.$work['id']);
$works[] = $work;
}
return $works;
return $works;
}
/**
@ -1679,7 +1679,7 @@ function getWorkListTeacher($start, $limit, $column, $direction, $where_conditio
$group_id = api_get_group_id();
$is_allowed_to_edit = api_is_allowed_to_edit(null, true);
if (!in_array($direction, array('asc','desc'))) {
if (!in_array($direction, array('asc', 'desc'))) {
$direction = 'desc';
}
@ -1719,7 +1719,6 @@ function getWorkListTeacher($start, $limit, $column, $direction, $where_conditio
$workId = $work['id'];
$work['type'] = Display::return_icon('work.png');
$work['expires_on'] = $work['expires_on'] == '0000-00-00 00:00:00' ? null : api_get_local_time($work['expires_on']);
//$work['ends_on'] = $work['ends_on'] == '0000-00-00 00:00:00' ? null : api_get_local_time($work['ends_on']);
$totalUsers = getStudentSubscribedToWork(
$workId,
@ -2860,8 +2859,13 @@ function userIsSubscribedToWork($userId, $workId, $courseId)
* @param bool $getCount Whether we want just the amount or the full result
* @return array|int An integer (if we just asked for the count) or an array of users
*/
function getStudentSubscribedToWork($workId, $courseId, $groupId = null, $sessionId = null, $getCount = false)
{
function getStudentSubscribedToWork(
$workId,
$courseId,
$groupId = null,
$sessionId = null,
$getCount = false
) {
$usersInWork = null;
$usersInCourse = null;
@ -3519,9 +3523,9 @@ function addDir($params, $user_id, $courseInfo, $group_id, $session_id)
$base_work_dir = api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/work';
$course_id = $courseInfo['real_id'];
$directory = replace_dangerous_char($params['new_dir']);
$directory = disable_dangerous_file($directory);
$created_dir = create_unexisting_work_directory($base_work_dir, $directory);
$directory = replace_dangerous_char($params['new_dir']);
$directory = disable_dangerous_file($directory);
$created_dir = create_unexisting_work_directory($base_work_dir, $directory);
if (!empty($created_dir)) {
$dir_name_sql = '/'.$created_dir;

@ -1,11 +1,10 @@
<?php
/* For licensing terms, see /license.txt */
/**
* @package chamilo.work
**/
/* INIT SECTION */
use ChamiloSession as Session;
$language_file = array('exercice', 'work', 'document', 'admin', 'gradebook', 'tracking');
@ -113,7 +112,6 @@ if (!empty($group_id)) {
}
} else {
if ($origin != 'learnpath') {
if (isset($_GET['id']) && !empty($_GET['id']) || $display_upload_form || $action == 'settings' || $action == 'create_dir') {
$interbreadcrumb[] = array ('url' => 'work.php', 'name' => get_lang('StudentPublications'));
} else {
@ -183,7 +181,6 @@ switch ($action) {
$form->addElement('style_submit_button', 'submit', get_lang('CreateDirectory'));
if ($form->validate()) {
$result = addDir($_POST, $user_id, $_course, $group_id, $id_session);
if ($result) {
$message = Display::return_message(get_lang('DirectoryCreated'), 'success');

Loading…
Cancel
Save