|
@@ -138,7 +138,7 @@ switch ($action) {
|
|
|
}
|
|
|
echo $friend_html;
|
|
|
break;
|
|
|
- case 'delete_friend':
|
|
|
+ case 'delete_friend':
|
|
|
|
|
|
if (api_is_anonymous()){
|
|
|
echo '';
|
|
@@ -162,86 +162,86 @@ switch ($action) {
|
|
|
}*/
|
|
|
break;
|
|
|
|
|
|
- case 'toogle_course':
|
|
|
-
|
|
|
- require_once api_get_path(LIBRARY_PATH).'blog.lib.php';
|
|
|
- require_once api_get_path(SYS_CODE_PATH).'forum/forumfunction.inc.php';
|
|
|
- require_once api_get_path(LIBRARY_PATH).'course.lib.php';
|
|
|
-
|
|
|
- $user_id = intval($_SESSION['social_user_id']);
|
|
|
- if ($_POST['action']) {$action = $_POST['action'];}
|
|
|
-
|
|
|
- switch($action) {
|
|
|
-
|
|
|
- case 'load_course' :
|
|
|
- $course_db = $_POST['course_code'];
|
|
|
- // @todo goto the course link
|
|
|
- //echo '<a href="'.api_get_path(WEB_COURSE_PATH).$course_directory.'/?id_session='.$my_course['id_session'].'">'.get_lang('GotoCourse').'</a>';
|
|
|
- $course_id=CourseManager::get_course_id_by_database_name($course_db);
|
|
|
-
|
|
|
- if (api_is_user_of_course($course_id,api_get_user_id())) {
|
|
|
-
|
|
|
- $table_forums = Database :: get_course_table(TABLE_FORUM,$course_db);
|
|
|
- $table_threads = Database :: get_course_table(TABLE_FORUM_THREAD,$course_db);
|
|
|
- $table_posts = Database :: get_course_table(TABLE_FORUM_POST,$course_db);
|
|
|
- $table_item_property = Database :: get_course_table(TABLE_ITEM_PROPERTY,$course_db);
|
|
|
- $table_users = Database :: get_main_table(TABLE_MAIN_USER);
|
|
|
+ case 'toogle_course':
|
|
|
|
|
|
- //------Forum messages
|
|
|
+ require_once api_get_path(LIBRARY_PATH).'blog.lib.php';
|
|
|
+ require_once api_get_path(SYS_CODE_PATH).'forum/forumfunction.inc.php';
|
|
|
+ require_once api_get_path(LIBRARY_PATH).'course.lib.php';
|
|
|
|
|
|
- $forum_result = get_all_post_from_user($user_id, $course_db);
|
|
|
- $all_result_data = 0;
|
|
|
- if ($forum_result !='') {
|
|
|
- api_display_tool_title(get_lang('Forum'));
|
|
|
- echo '<div class="social-background-content" style="background:#FAF9F6; padding:0px;" >';
|
|
|
- echo api_xml_http_response_encode($forum_result);
|
|
|
- echo '</div>';
|
|
|
- echo '<br />';
|
|
|
- $all_result_data++;
|
|
|
- }
|
|
|
+ $user_id = intval($_SESSION['social_user_id']);
|
|
|
+ if ($_POST['action']) {$action = $_POST['action'];}
|
|
|
|
|
|
- //------Blog posts
|
|
|
- $result = get_blog_post_from_user($course_db, $user_id);
|
|
|
- if (!empty($result)) {
|
|
|
- api_display_tool_title(api_xml_http_response_encode(get_lang('Blog')));
|
|
|
- echo '<div class="social-background-content" style="background:#FAF9F6; padding:0px;">';
|
|
|
- echo api_xml_http_response_encode($result);
|
|
|
- echo '</div>';
|
|
|
- echo '<br />';
|
|
|
- $all_result_data++;
|
|
|
- }
|
|
|
-
|
|
|
- //------Blog comments
|
|
|
- $result = get_blog_comment_from_user($course_db, $user_id);
|
|
|
- if (!empty($result)) {
|
|
|
- echo '<div class="social-background-content" style="background:#FAF9F6; padding-left:10px;">';
|
|
|
- api_display_tool_title(api_xml_http_response_encode(get_lang('BlogComments')));
|
|
|
- echo api_xml_http_response_encode($result);
|
|
|
- echo '</div>';
|
|
|
- echo '<br />';
|
|
|
- $all_result_data++;
|
|
|
- }
|
|
|
- if ($all_result_data == 0) {
|
|
|
- echo api_xml_http_response_encode(get_lang('NoDataAvailable'));
|
|
|
- }
|
|
|
-
|
|
|
- } else {
|
|
|
- echo '<div class="clear"></div><br />';
|
|
|
- api_display_tool_title(api_xml_http_response_encode(get_lang('Details')));
|
|
|
- echo '<div class="social-background-content" style="background:#FAF9F6; padding:0px;">';
|
|
|
- echo api_xml_http_response_encode(get_lang('UserNonRegisteredAtTheCourse'));
|
|
|
- echo '<div class="clear"></div><br />';
|
|
|
- echo '</div>';
|
|
|
- echo '<div class="clear"></div><br />';
|
|
|
+ switch($action) {
|
|
|
+
|
|
|
+ case 'load_course' :
|
|
|
+ $course_db = $_POST['course_code'];
|
|
|
+ // @todo goto the course link
|
|
|
+ //echo '<a href="'.api_get_path(WEB_COURSE_PATH).$course_directory.'/?id_session='.$my_course['id_session'].'">'.get_lang('GotoCourse').'</a>';
|
|
|
+ $course_id=CourseManager::get_course_id_by_database_name($course_db);
|
|
|
+
|
|
|
+ if (api_is_user_of_course($course_id,api_get_user_id())) {
|
|
|
+
|
|
|
+ $table_forums = Database :: get_course_table(TABLE_FORUM,$course_db);
|
|
|
+ $table_threads = Database :: get_course_table(TABLE_FORUM_THREAD,$course_db);
|
|
|
+ $table_posts = Database :: get_course_table(TABLE_FORUM_POST,$course_db);
|
|
|
+ $table_item_property = Database :: get_course_table(TABLE_ITEM_PROPERTY,$course_db);
|
|
|
+ $table_users = Database :: get_main_table(TABLE_MAIN_USER);
|
|
|
+
|
|
|
+ //------Forum messages
|
|
|
+
|
|
|
+ $forum_result = get_all_post_from_user($user_id, $course_db);
|
|
|
+ $all_result_data = 0;
|
|
|
+ if ($forum_result !='') {
|
|
|
+ api_display_tool_title(get_lang('Forum'));
|
|
|
+ echo '<div class="social-background-content" style="background:#FAF9F6; padding:0px;" >';
|
|
|
+ echo api_xml_http_response_encode($forum_result);
|
|
|
+ echo '</div>';
|
|
|
+ echo '<br />';
|
|
|
+ $all_result_data++;
|
|
|
}
|
|
|
- break;
|
|
|
- case 'unload_course' :
|
|
|
- //echo 'load2';
|
|
|
- break;
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
- break;
|
|
|
+
|
|
|
+ //------Blog posts
|
|
|
+ $result = get_blog_post_from_user($course_db, $user_id);
|
|
|
+ if (!empty($result)) {
|
|
|
+ api_display_tool_title(api_xml_http_response_encode(get_lang('Blog')));
|
|
|
+ echo '<div class="social-background-content" style="background:#FAF9F6; padding:0px;">';
|
|
|
+ echo api_xml_http_response_encode($result);
|
|
|
+ echo '</div>';
|
|
|
+ echo '<br />';
|
|
|
+ $all_result_data++;
|
|
|
+ }
|
|
|
+
|
|
|
+ //------Blog comments
|
|
|
+ $result = get_blog_comment_from_user($course_db, $user_id);
|
|
|
+ if (!empty($result)) {
|
|
|
+ echo '<div class="social-background-content" style="background:#FAF9F6; padding-left:10px;">';
|
|
|
+ api_display_tool_title(api_xml_http_response_encode(get_lang('BlogComments')));
|
|
|
+ echo api_xml_http_response_encode($result);
|
|
|
+ echo '</div>';
|
|
|
+ echo '<br />';
|
|
|
+ $all_result_data++;
|
|
|
+ }
|
|
|
+ if ($all_result_data == 0) {
|
|
|
+ echo api_xml_http_response_encode(get_lang('NoDataAvailable'));
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ echo '<div class="clear"></div><br />';
|
|
|
+ api_display_tool_title(api_xml_http_response_encode(get_lang('Details')));
|
|
|
+ echo '<div class="social-background-content" style="background:#FAF9F6; padding:0px;">';
|
|
|
+ echo api_xml_http_response_encode(get_lang('UserNonRegisteredAtTheCourse'));
|
|
|
+ echo '<div class="clear"></div><br />';
|
|
|
+ echo '</div>';
|
|
|
+ echo '<div class="clear"></div><br />';
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 'unload_course' :
|
|
|
+ //echo 'load2';
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ break;
|
|
|
default:
|
|
|
echo '';
|
|
|
}
|