Minor - format code

remotes/angel/1.11.x
jmontoyaa 8 years ago
parent a391923c8a
commit b0133aa6b4
  1. 37
      main/inc/lib/blog.lib.php
  2. 23
      main/work/work.lib.php

@ -65,7 +65,7 @@ class Blog
*
* @param Integer $blog_id
*
* @return Array Returns an array with [userid]=>[username]
* @return array Returns an array with [userid]=>[username]
*/
public static function get_blog_users($blog_id)
{
@ -2604,7 +2604,7 @@ class Blog
* @param the comment's id
* @param integer $blog_id
* @return array with the post info according the parameters
* @author Julio Montoya Dokeos
* @author Julio Montoya
* @version avril 2008, dokeos 1.8.5
*/
function get_blog_attachment($blog_id, $post_id=null,$comment_id=null)
@ -2641,18 +2641,17 @@ function get_blog_attachment($blog_id, $post_id=null,$comment_id=null)
/**
* Delete the all the attachments according the parameters.
* @param the blog's id
* @param the post's id
* @param the comment's id
* @param integer $blog_id
* @param integer $post_id
* @param integer $comment_id
* @author Julio Montoya Dokeos
* @param int $blog_id
* @param int $post_id post's id
* @param int $comment_id the comment's id
* @author Julio Montoya
* @version avril 2008, dokeos 1.8.5
*/
function delete_all_blog_attachment($blog_id,$post_id=null,$comment_id=null)
{
function delete_all_blog_attachment(
$blog_id,
$post_id = null,
$comment_id = null
) {
$_course = api_get_course_info();
$blog_table_attachment = Database::get_course_table(TABLE_BLOGS_ATTACHMENT);
$blog_id = intval($blog_id);
@ -2697,15 +2696,16 @@ function delete_all_blog_attachment($blog_id,$post_id=null,$comment_id=null)
/**
* Gets all the post from a given user id
* @param string db course name
* @param int user id
* @param string $course_code
* @param int $user_id
*/
function get_blog_post_from_user($course_code, $user_id)
{
$tbl_blogs = Database::get_course_table(TABLE_BLOGS);
$tbl_blog_post = Database::get_course_table(TABLE_BLOGS_POSTS);
$course_info = api_get_course_info($course_code);
$course_id = $course_info['real_id'];
$tbl_blogs = Database::get_course_table(TABLE_BLOGS);
$tbl_blog_post = Database::get_course_table(TABLE_BLOGS_POSTS);
$course_info = api_get_course_info($course_code);
$course_id = $course_info['real_id'];
$user_id = intval($user_id);
$sql = "SELECT DISTINCT blog.blog_id, post_id, title, full_text, post.date_creation
FROM $tbl_blogs blog
@ -2760,7 +2760,6 @@ function get_blog_comment_from_user($course_code, $user_id)
$return_data.= '<div class="clear"></div><br />';
$return_data.= '<div class="actions" style="margin-left:5px;margin-right:5px;">'.$row['title'].'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div style="float:right;margin-top:-18px"><a href="../blog/blog.php?blog_id='.$row['blog_id'].'&gidReq=&cidReq='.Security::remove_XSS($course_code).' " >'.get_lang('SeeBlog').'</a></div></div>';
$return_data.= '<br / >';
//$return_data.= '<strong>'.$row['title'].'</strong>'; echo '<br>';*/
$return_data.= $row['comment'];
$return_data.= '<br />';
}

@ -534,9 +534,9 @@ function showStudentWorkGrid()
);
$html = '<script>
$(function() {
'.Display::grid_js('workList', $url, $columns, $columnModel, $params, array(), null, true).'
});
$(function() {
'.Display::grid_js('workList', $url, $columns, $columnModel, $params, array(), null, true).'
});
</script>';
$html .= Display::grid_html('workList');
@ -907,7 +907,6 @@ function updateDirName($work_data, $newPath)
$newPath = disable_dangerous_file($newPath);
if ($oldPath == '/'.$newPath) {
return true;
}
@ -926,10 +925,9 @@ function updateDirName($work_data, $newPath)
* Return an array with all the folder's ids that are in the given path
* @param string Path of the directory
* @return array The list of ids of all the directories in the path
* @author Julio Montoya Dokeos
* @author Julio Montoya
* @version April 2008
*/
function get_parent_directories($id)
{
$course_id = api_get_course_int_id();
@ -955,7 +953,7 @@ function get_parent_directories($id)
* Transform an all directory structure (only directories) in an array
* @param string path of the directory
* @return array the directory structure into an array
* @author Julio Montoya Dokeos
* @author Julio Montoya
* @version April 2008
*/
function directory_to_array($directory)
@ -973,6 +971,7 @@ function directory_to_array($directory)
}
closedir($handle);
}
return $array_items;
}
@ -1002,7 +1001,7 @@ function insert_all_directory_in_course_table($base_work_dir)
$groupIid = $groupInfo['iid'];
}
for($i = 0; $i < count($only_dir); $i++) {
for ($i = 0; $i < count($only_dir); $i++) {
$url = $only_dir[$i];
$params = [
@ -1761,7 +1760,6 @@ function get_work_user_list_from_documents(
$editLink = Display::url($addIcon, $url);
$addLinkShowed = true;
} else {
$row['title'] = $documentToWork['title'];
$row['sent_date'] = $documentToWork['sent_date'];
$newWorkId = $documentToWork['id'];
@ -1781,12 +1779,10 @@ function get_work_user_list_from_documents(
}
$viewLink = null;
if (!empty($itemId)) {
$viewLink = Display::url($viewIcon, $urlView.'&id='.$itemId);
}
//$row['type'] = build_document_icon_tag('file', $row['url']);
$row['type'] = null;
if ($qualificationExists) {
@ -1843,7 +1839,6 @@ function get_work_user_list(
$getCount = false
) {
$work_table = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
$iprop_table = Database::get_course_table(TABLE_ITEM_PROPERTY);
$user_table = Database::get_main_table(TABLE_MAIN_USER);
$session_id = api_get_session_id();
@ -2221,9 +2216,7 @@ function send_reminder_users_without_publication($task_data)
// The body can be as long as you wish, and any combination of text and variables
$content = get_lang('ReminderToSubmitPendingTask')."\n".get_lang('CourseName').' : '.$_course['name']."\n";
$content .= get_lang('WorkName').' : '.$task_title."\n";
$list_users = get_list_users_without_publication($task_id);
$mails_sent_to = array();
foreach ($list_users as $user) {
$name_user = api_get_person_name($user[1], $user[0], null, PERSON_NAME_EMAIL_ADDRESS);
@ -2661,7 +2654,7 @@ function getUserToWork($userId, $workId, $courseId)
* @param int $workId
* @param int $courseId
* @param bool $getCount
* @return array
* @return array|int
*/
function getAllUserToWork($workId, $courseId, $getCount = false)
{

Loading…
Cancel
Save