Minor - format code.

pull/2487/head
jmontoyaa 8 years ago
parent b3f6fa6562
commit 0315d91227
  1. 54
      main/inc/lib/blog.lib.php
  2. 18
      main/lp/learnpathItem.class.php

@ -2649,10 +2649,16 @@ class Blog
// Get tasks for this month
if ($_user['user_id']) {
$sql = " SELECT task_rel_user.*, DAYOFMONTH(target_date) as task_day, task.title, blog.blog_name
$sql = "SELECT
task_rel_user.*,
DAYOFMONTH(target_date) as task_day,
task.title,
blog.blog_name
FROM $tbl_blogs_tasks_rel_user task_rel_user
INNER JOIN $tbl_blogs_tasks task ON task_rel_user.task_id = task.task_id
INNER JOIN $tbl_blogs blog ON task_rel_user.blog_id = blog.blog_id
INNER JOIN $tbl_blogs_tasks task
ON task_rel_user.task_id = task.task_id
INNER JOIN $tbl_blogs blog
ON task_rel_user.blog_id = blog.blog_id
WHERE
task_rel_user.c_id = $course_id AND
task.c_id = $course_id AND
@ -2722,11 +2728,7 @@ class Blog
if (isset($tasks[$curday]) && is_array($tasks[$curday])) {
// Add tasks to calendar
foreach ($tasks[$curday] as $task) {
$html .= '<a href="blog.php?action=execute_task&blog_id='.$task['blog_id'].'&task_id='.stripslashes(
$task['task_id']
).'" title="'.$task['title'].' : '.get_lang(
'InBlog'
).' : '.$task['blog_name'].' - '.get_lang('ExecuteThisTask').'">';
$html .= '<a href="blog.php?action=execute_task&blog_id='.$task['blog_id'].'&task_id='.stripslashes($task['task_id']).'" title="'.$task['title'].' : '.get_lang('InBlog').' : '.$task['blog_name'].' - '.get_lang('ExecuteThisTask').'">';
$html .= Display::return_icon('blog_task.gif', get_lang('ExecuteThisTask'));
$html .= '</a>';
}
@ -2752,11 +2754,14 @@ class Blog
*/
public static function displayBlogCreateForm()
{
$form = new FormValidator('add_blog', 'post', 'blog_admin.php?action=add');
$form = new FormValidator(
'add_blog',
'post',
'blog_admin.php?action=add'
);
$form->addElement('header', get_lang('AddBlog'));
$form->addElement('text', 'blog_name', get_lang('Title'));
$form->addElement('textarea', 'blog_subtitle', get_lang('SubTitle'));
$form->addElement('hidden', 'new_blog_submit', 'true');
$form->addButtonSave(get_lang('SaveProject'));
@ -2791,11 +2796,14 @@ class Blog
$blog['blog_subtitle'] = Security::remove_XSS($_POST['blog_subtitle']);
}
$form = new FormValidator('edit_blog', 'post', 'blog_admin.php?action=edit&blog_id='.intval($_GET['blog_id']));
$form = new FormValidator(
'edit_blog',
'post',
'blog_admin.php?action=edit&blog_id='.intval($_GET['blog_id'])
);
$form->addElement('header', get_lang('EditBlog'));
$form->addElement('text', 'blog_name', get_lang('Title'));
$form->addElement('textarea', 'blog_subtitle', get_lang('SubTitle'));
$form->addElement('hidden', 'edit_blog_submit', 'true');
$form->addElement('hidden', 'blog_id', $blog['blog_id']);
$form->addButtonSave(get_lang('Save'));
@ -2916,8 +2924,10 @@ class Blog
$course_id = api_get_course_int_id();
$sql = "SELECT path, filename, comment FROM $blog_table_attachment
WHERE c_id = $course_id AND blog_id = $blog_id $where";
$sql = "SELECT path, filename, comment
FROM $blog_table_attachment
WHERE c_id = $course_id AND blog_id = $blog_id
$where";
$result = Database::query($sql);
if (Database::num_rows($result) != 0) {
@ -3012,12 +3022,13 @@ class Blog
if (Database::num_rows($result) != 0) {
while ($row = Database::fetch_array($result)) {
$return_data .= '<div class="clear"></div><br />';
$return_data .= '<div class="actions" style="margin-left:5px;margin-right:5px;">'.Display::return_icon(
$return_data .= '<div class="actions" style="margin-left:5px;margin-right:5px;">'.
Display::return_icon(
'blog_article.png',
get_lang('BlogPosts')
).' '.$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='.$courseCode.' " >'.get_lang(
'SeeBlog'
).'</a></div></div>';
).' '.
$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='.$courseCode.' " >'.
get_lang('SeeBlog').'</a></div></div>';
$return_data .= '<br / >';
$return_data .= $row['full_text'];
$return_data .= '<br /><br />';
@ -3056,9 +3067,9 @@ class Blog
if (Database::num_rows($result) != 0) {
while ($row = Database::fetch_array($result)) {
$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(
$courseCode
).' " >'.get_lang('SeeBlog').'</a></div></div>';
$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($courseCode).' " >'.
get_lang('SeeBlog').'</a></div></div>';
$return_data .= '<br / >';
$return_data .= $row['comment'];
$return_data .= '<br />';
@ -3107,4 +3118,3 @@ class Blog
return api_htmlentities($extract);
}
}

@ -1225,7 +1225,7 @@ class learnpathItem
$in_files_list
);
}
} elseif (strstr($second_part,'..') === 0) {
} elseif (strstr($second_part, '..') === 0) {
// Link is relative but going back in the hierarchy.
$files_list[] = array(
$second_part,
@ -1651,10 +1651,14 @@ class learnpathItem
/**
* @param string $origin
* @param string $time
*
* @return string
*/
public static function getScormTimeFromParameter($origin = 'php', $time = null)
{
public static function getScormTimeFromParameter(
$origin = 'php',
$time = null
) {
$h = get_lang('h');
if (!isset($time)) {
if ($origin == 'js') {
@ -1959,8 +1963,6 @@ class learnpathItem
}*/
// If we don't init start time here, the time is sometimes calculated from the last start time.
$this->current_start_time = time();
//error_log('New LP - reinit blocked by setting', 0);
}
}
@ -2010,7 +2012,6 @@ class learnpathItem
$this->prereq_alert = '';
// First parse all parenthesis by using a sequential loop
// (looking for less-inclusives first).
if ($prereqs_string == '_true_') {
return true;
@ -2132,7 +2133,6 @@ class learnpathItem
}
} else {
// No ANDs found, look for <>
if (self::DEBUG > 1) {
error_log(
'New LP - Didnt find any =, looking for <>',
@ -2206,7 +2206,6 @@ class learnpathItem
}
} else {
// Finally, look for sets/groups
if (self::DEBUG > 1) {
error_log(
'New LP - Didnt find any ~, looking for groups',
@ -2384,7 +2383,7 @@ class learnpathItem
if ($returnstatus) {
//AND origin_lp_item_id = '.$user_id.'
$sql = 'SELECT exe_result, exe_weighting
FROM ' . Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES).'
FROM '.Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES).'
WHERE
exe_exo_id = ' . $items[$refs_list[$prereqs_string]]->path.' AND
exe_user_id = ' . $user_id.' AND
@ -2424,7 +2423,6 @@ class learnpathItem
}
} else {
// 3. for multiple attempts we check that there are minimum 1 item completed.
// Checking in the database.
$sql = 'SELECT exe_result, exe_weighting
FROM ' . Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES).'

Loading…
Cancel
Save