|
|
|
|
@ -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'].' <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'].' <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'].' <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'].' <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); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|