function display_form() { $html = ''; $sessions = SessionManager::get_sessions_list(array(), array('name', 'ASC')); // Actions // Link back to the documents overview $actionsLeft = '<a href="../admin/index.php">' . Display::return_icon('back.png', get_lang('BackTo') . ' ' . get_lang('PlatformAdmin'), '', ICON_SIZE_MEDIUM) . '</a>'; $html .= Display::toolbarAction('toolbar-copysession', array(0 => $actionsLeft)); $html .= Display::return_message(get_lang('CopyCourseFromSessionToSessionExplanation'), 'warning'); $html .= '<form class="form-horizontal" name="formulaire" method="post" action="' . api_get_self() . '" >'; $html .= '<div class="form-group">'; // origin $html .= '<label class="col-sm-2 control-label">' . get_lang('OriginCoursesFromSession') . ': </label>'; $html .= '<div class="col-sm-5">' . make_select_session_list('sessions_list_origin', $sessions, array('onchange' => 'javascript: xajax_search_courses(this.value,\'origin\');')) . '</div>'; $html .= '<div class="col-sm-5" id="ajax_list_courses_origin">'; $html .= '<select id="origin" class="form-control" name="SessionCoursesListOrigin[]" ></select>'; $html .= '</div></div>'; //destination $html .= '<div class="form-group">'; $html .= '<label class="col-sm-2 control-label">' . get_lang('DestinationCoursesFromSession') . ': </label>'; $html .= '<div class="col-sm-5" id="ajax_sessions_list_destination">'; $html .= '<select class="form-control" name="sessions_list_destination" onchange="javascript: xajax_search_courses(this.value,\'destination\');">'; $html .= '<option value = "0">' . get_lang('ThereIsNotStillASession') . '</option></select ></div>'; $html .= '<div class="col-sm-5" id="ajax_list_courses_destination">'; $html .= '<select id="destination" class="form-control" name="SessionCoursesListDestination[]" ></select>'; $html .= '</div></div>'; $options = '<div class="radio"><label><input type="radio" id="copy_option_1" name="copy_option" value="full_copy" checked="checked"/>'; $options .= get_lang('FullCopy') . '</label></div>'; $options .= '<div class="radio"><label><input type="radio" id="copy_option_2" name="copy_option" value="select_items" disabled="disabled"/>'; $options .= ' ' . get_lang('LetMeSelectItems') . '</label></div>'; $options .= '<div class="checkbox"><label><input type="checkbox" id="copy_base_content_id" name="copy_only_session_items" />' . get_lang('CopyOnlySessionItems') . '</label></div>'; $html .= Display::panel($options, get_lang('TypeOfCopy')); $html .= '<div class="form-group"><div class="col-sm-12">'; $html .= '<button class="btn btn-success" type="submit" onclick="javascript:if(!confirm(' . "'" . addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES)) . "'" . ')) return false;"><em class="fa fa-files-o"></em> ' . get_lang('CopyCourse') . '</button>'; // Add Security token $html .= '<input type="hidden" value="' . Security::get_token() . '" name="sec_token">'; $html .= '</div></div>'; $html .= '</form>'; echo $html; }
/** * @return string */ public static function getWallForm($show_full_profile = true) { if ($show_full_profile) { $userId = isset($_GET['u']) ? '?u=' . intval($_GET['u']) : ''; $form = new FormValidator('social_wall_main', 'post', api_get_path(WEB_CODE_PATH) . 'social/profile.php' . $userId, null, array('enctype' => 'multipart/form-data'), FormValidator::LAYOUT_HORIZONTAL); $socialWallPlaceholder = isset($_GET['u']) ? get_lang('SocialWallWriteNewPostToFriend') : get_lang('SocialWallWhatAreYouThinkingAbout'); $form->addTextarea('social_wall_new_msg_main', null, ['placeholder' => $socialWallPlaceholder, 'cols-size' => [1, 10, 1]]); $form->addHidden('url_content', ''); $form->addButtonSend(get_lang('Post'), 'wall_post_button', false, ['cols-size' => [1, 10, 1]]); $html = Display::panel($form->returnForm(), get_lang('SocialWall')); return $html; } }
/** * This function displays a wiki entry * @author Patrick Cool <*****@*****.**>, Ghent University * @author Juan Carlos Raña Trabado * @param string $newtitle * @return string html code **/ public function display_wiki_entry($newtitle) { $tbl_wiki = $this->tbl_wiki; $tbl_wiki_conf = $this->tbl_wiki_conf; $condition_session = $this->condition_session; $groupfilter = $this->groupfilter; $page = $this->page; $session_id = api_get_session_id(); $course_id = api_get_course_int_id(); if ($newtitle) { $pageMIX = $newtitle; //display the page after it is created } else { $pageMIX = $page; //display current page } $filter = null; if (isset($_GET['view']) && $_GET['view']) { $_clean['view'] = Database::escape_string($_GET['view']); $filter = ' AND w.id="' . $_clean['view'] . '"'; } // First, check page visibility in the first page version $sql = 'SELECT * FROM ' . $tbl_wiki . ' WHERE c_id = ' . $course_id . ' AND reflink="' . Database::escape_string($pageMIX) . '" AND ' . $groupfilter . $condition_session . ' ORDER BY id ASC'; $result = Database::query($sql); $row = Database::fetch_array($result, 'ASSOC'); $KeyVisibility = $row['visibility']; // second, show the last version $sql = 'SELECT * FROM ' . $tbl_wiki . ' w INNER JOIN ' . $tbl_wiki_conf . ' wc ON (wc.page_id = w.page_id AND wc.c_id = w.c_id) WHERE w.c_id = ' . $course_id . ' AND w.reflink = "' . Database::escape_string($pageMIX) . '" AND w.session_id = ' . $session_id . ' AND w.' . $groupfilter . ' ' . $filter . ' ORDER BY id DESC'; $result = Database::query($sql); // we do not need a while loop since we are always displaying the last version $row = Database::fetch_array($result, 'ASSOC'); //log users access to wiki (page_id) if (!empty($row['page_id'])) { Event::addEvent(LOG_WIKI_ACCESS, LOG_WIKI_PAGE_ID, $row['page_id']); } //update visits if ($row['id']) { $sql = 'UPDATE ' . $tbl_wiki . ' SET hits=(hits+1) WHERE c_id = ' . $course_id . ' AND id=' . $row['id'] . ''; Database::query($sql); } // if both are empty and we are displaying the index page then we display the default text. if ($row['content'] == '' && $row['title'] == '' && $page == 'index') { if (api_is_allowed_to_edit(false, true) || api_is_platform_admin() || GroupManager::is_user_in_group(api_get_user_id(), api_get_group_id())) { //Table structure for better export to pdf $default_table_for_content_Start = '<table align="center" border="0"><tr><td align="center">'; $default_table_for_content_End = '</td></tr></table>'; $content = $default_table_for_content_Start . sprintf(get_lang('DefaultContent'), api_get_path(WEB_IMG_PATH)) . $default_table_for_content_End; $title = get_lang('DefaultTitle'); } else { return self::setMessage(Display::display_normal_message(get_lang('WikiStandBy'), false, true)); } } else { $content = Security::remove_XSS($row['content']); $title = Security::remove_XSS($row['title']); } //assignment mode: identify page type $icon_assignment = null; if ($row['assignment'] == 1) { $icon_assignment = Display::return_icon('wiki_assignment.png', get_lang('AssignmentDescExtra'), '', ICON_SIZE_SMALL); } elseif ($row['assignment'] == 2) { $icon_assignment = Display::return_icon('wiki_work.png', get_lang('AssignmentWork'), '', ICON_SIZE_SMALL); } //task mode $icon_task = null; if (!empty($row['task'])) { $icon_task = Display::return_icon('wiki_task.png', get_lang('StandardTask'), '', ICON_SIZE_SMALL); } // Show page. Show page to all users if isn't hide page. Mode assignments: if student is the author, can view if ($KeyVisibility == "1" || api_is_allowed_to_edit(false, true) || api_is_platform_admin() || $row['assignment'] == 2 && $KeyVisibility == "0" && api_get_user_id() == $row['user_id']) { $actionsLeft = ''; // menu edit page $editLink = '<a href="index.php?' . api_get_cidreq() . '&action=edit&title=' . api_htmlentities(urlencode($page)) . '"' . self::is_active_navigation_tab('edit') . '>' . Display::return_icon('edit.png', get_lang('EditThisPage'), '', ICON_SIZE_MEDIUM) . '</a>'; if (api_is_allowed_to_edit(false, true)) { $actionsLeft .= $editLink; } else { if ((api_is_allowed_in_course() || GroupManager::is_user_in_group(api_get_user_id(), api_get_group_id())) && $page != 'index') { $actionsLeft .= $editLink; } else { $actionsLeft .= ''; } } $actionsRight = ''; $protect_page = null; $lock_unlock_protect = null; // page action: protecting (locking) the page if (api_is_allowed_to_edit(false, true) || api_is_platform_admin()) { if (self::check_protect_page() == 1) { $protect_page = Display::return_icon('lock.png', get_lang('PageLockedExtra'), '', ICON_SIZE_MEDIUM); $lock_unlock_protect = 'unlock'; } else { $protect_page = Display::return_icon('unlock.png', get_lang('PageUnlockedExtra'), '', ICON_SIZE_MEDIUM); $lock_unlock_protect = 'lock'; } } if ($row['id']) { $actionsRight .= '<a href="index.php?' . api_get_cidreq() . '&action=showpage&actionpage=' . $lock_unlock_protect . '&title=' . api_htmlentities(urlencode($page)) . '">' . $protect_page . '</a>'; } $visibility_page = null; $lock_unlock_visibility = null; //page action: visibility if (api_is_allowed_to_edit(false, true) || api_is_platform_admin()) { if (self::check_visibility_page() == 1) { $visibility_page = Display::return_icon('visible.png', get_lang('ShowPageExtra'), '', ICON_SIZE_MEDIUM); $lock_unlock_visibility = 'invisible'; } else { $visibility_page = Display::return_icon('invisible.png', get_lang('HidePageExtra'), '', ICON_SIZE_MEDIUM); $lock_unlock_visibility = 'visible'; } } if ($row['id']) { $actionsRight .= '<a href="index.php?' . api_get_cidreq() . '&action=showpage&actionpage=' . $lock_unlock_visibility . '&title=' . api_htmlentities(urlencode($page)) . '">' . $visibility_page . '</a>'; } //page action: notification if (api_is_allowed_to_session_edit()) { if (self::check_notify_page($page) == 1) { $notify_page = Display::return_icon('messagebox_info.png', get_lang('NotifyByEmail'), '', ICON_SIZE_MEDIUM); $lock_unlock_notify_page = 'unlocknotify'; } else { $notify_page = Display::return_icon('mail.png', get_lang('CancelNotifyByEmail'), '', ICON_SIZE_MEDIUM); $lock_unlock_notify_page = 'locknotify'; } } // Only available if row['id'] is set if ($row['id']) { if (api_is_allowed_to_session_edit(false, true) && api_is_allowed_to_edit() || GroupManager::is_user_in_group(api_get_user_id(), api_get_group_id())) { // menu discuss page $actionsRight .= '<a href="index.php?' . api_get_cidreq() . '&action=discuss&title=' . api_htmlentities(urlencode($page)) . '" ' . self::is_active_navigation_tab('discuss') . '>' . Display::return_icon('discuss.png', get_lang('DiscussThisPage'), '', ICON_SIZE_MEDIUM) . '</a>'; } //menu history $actionsRight .= '<a href="index.php?' . api_get_cidreq() . '&action=history&title=' . api_htmlentities(urlencode($page)) . '" ' . self::is_active_navigation_tab('history') . '>' . Display::return_icon('history.png', get_lang('ShowPageHistory'), '', ICON_SIZE_MEDIUM) . '</a>'; //menu linkspages $actionsRight .= '<a href="index.php?' . api_get_cidreq() . 'action=links&title=' . api_htmlentities(urlencode($page)) . '" ' . self::is_active_navigation_tab('links') . '>' . Display::return_icon('what_link_here.png', get_lang('LinksPages'), '', ICON_SIZE_MEDIUM) . '</a>'; //menu delete wikipage if (api_is_allowed_to_edit(false, true) || api_is_platform_admin()) { $actionsRight .= '<a href="index.php?action=delete&' . api_get_cidreq() . '&title=' . api_htmlentities(urlencode($page)) . '"' . self::is_active_navigation_tab('delete') . '>' . Display::return_icon('delete.png', get_lang('DeleteThisPage'), '', ICON_SIZE_MEDIUM) . '</a>'; } $actionsRight .= '<a href="index.php?' . api_get_cidreq() . '&action=showpage&actionpage=' . $lock_unlock_notify_page . '&title=' . api_htmlentities(urlencode($page)) . '">' . $notify_page . '</a>'; // Page action: copy last version to doc area if (api_is_allowed_to_edit(false, true) || api_is_platform_admin()) { $actionsRight .= '<a href="index.php?' . api_get_cidreq() . '&action=export2doc&wiki_id=' . $row['id'] . '">' . Display::return_icon('export_to_documents.png', get_lang('ExportToDocArea'), '', ICON_SIZE_MEDIUM) . '</a>'; } $actionsRight .= '<a href="index.php?' . api_get_cidreq() . '&action=export_to_pdf&wiki_id=' . $row['id'] . '">' . Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_MEDIUM) . '</a>'; $unoconv = api_get_configuration_value('unoconv.binaries'); if ($unoconv) { $actionsRight .= '<a href="' . api_get_path(WEB_CODE_PATH) . 'wiki/index.php?action=export_to_doc_file&id=' . $row['id'] . '&' . api_get_cidreq() . '">' . Display::return_icon('export_doc.png', get_lang('ExportToDoc'), array(), ICON_SIZE_MEDIUM) . '</a>'; } //export to print ?> <script> function goprint() { var a = window.open('','','width=800,height=600'); a.document.open("text/html"); a.document.write(document.getElementById('wikicontent').innerHTML); a.document.close(); a.print(); } </script> <?php $actionsRight .= Display::url(Display::return_icon('printer.png', get_lang('Print'), '', ICON_SIZE_MEDIUM), '#', array('onclick' => "javascript: goprint();")); } echo Display::toolbarAction('toolbar-wikistudent', array(0 => $actionsLeft, 1 => $actionsRight)); if (empty($title)) { $pageTitle = get_lang('DefaultTitle'); } if (self::wiki_exist($title)) { $pageTitle = $icon_assignment . ' ' . $icon_task . ' ' . api_htmlentities($title); } else { $pageTitle = api_htmlentities($title); } $pageWiki = self::make_wiki_link_clickable(self::detect_external_link(self::detect_anchor_link(self::detect_mail_link(self::detect_ftp_link(self::detect_irc_link(self::detect_news_link($content))))))); $footerWiki = '<div id="wikifooter">' . get_lang('Progress') . ': ' . $row['progress'] * 10 . '% ' . get_lang('Rating') . ': ' . $row['score'] . ' ' . get_lang('Words') . ': ' . self::word_count($content) . '</div>'; echo Display::panel($pageWiki, $pageTitle, $footerWiki); } //end filter visibility }
/** * @param int $course_id * @param int $session_id * @param int $categoryId * @param string $show * @param null $token */ public static function listLinksAndCategories($course_id, $session_id, $categoryId, $show = 'none', $token = null) { $tbl_link = Database::get_course_table(TABLE_LINK); $_user = api_get_user_info(); $categoryId = intval($categoryId); /* Action Links */ echo '<div class="actions">'; if (api_is_allowed_to_edit(null, true)) { echo '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=addlink&category_id=' . $categoryId . '">' . Display::return_icon('new_link.png', get_lang('LinkAdd'), '', ICON_SIZE_MEDIUM) . '</a>'; echo '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=addcategory&category_id=' . $categoryId . '">' . Display::return_icon('new_folder.png', get_lang('CategoryAdd'), '', ICON_SIZE_MEDIUM) . '</a>'; } $categories = Link::getLinkCategories($course_id, $session_id); $count = count($categories); if (!empty($count)) { echo '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=list&show=none">'; echo Display::return_icon('forum_listview.png', get_lang('FlatView'), '', ICON_SIZE_MEDIUM) . ' </a>'; echo '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=list&show=all">'; echo Display::return_icon('forum_nestedview.png', get_lang('NestedView'), '', ICON_SIZE_MEDIUM) . '</a>'; } echo '</div>'; // Displaying the links which have no category (thus category = 0 or NULL), // if none present this will not be displayed $sql = "SELECT * FROM {$tbl_link}\n WHERE c_id = {$course_id} AND (category_id=0 OR category_id IS NULL)"; $result = Database::query($sql); $count = Database::num_rows($result); if ($count !== 0) { echo Display::panel(Link::showlinksofcategory(0), get_lang('General')); } $counter = 0; foreach ($categories as $myrow) { // Student don't see invisible categories. if (!api_is_allowed_to_edit(null, true)) { if ($myrow['visibility'] == 0) { continue; } } // Validation when belongs to a session $showChildren = $categoryId == $myrow['id'] || $show == 'all'; $session_img = api_get_session_image($myrow['session_id'], $_user['status']); $myrow['description'] = $myrow['description']; $strVisibility = ''; $visibilityClass = null; if ($myrow['visibility'] == '1') { $strVisibility = '<a href="link.php?' . api_get_cidreq() . '&sec_token=' . $token . '&action=invisible&id=' . $myrow['id'] . '&scope=' . TOOL_LINK_CATEGORY . '" title="' . get_lang('Hide') . '">' . Display::return_icon('visible.png', get_lang('Hide'), array(), ICON_SIZE_SMALL) . '</a>'; } elseif ($myrow['visibility'] == '0') { $visibilityClass = 'invisible'; $strVisibility = ' <a href="link.php?' . api_get_cidreq() . '&sec_token=' . $token . '&action=visible&id=' . $myrow['id'] . '&scope=' . TOOL_LINK_CATEGORY . '" title="' . get_lang('Show') . '">' . Display::return_icon('invisible.png', get_lang('Show'), array(), ICON_SIZE_SMALL) . '</a>'; } $header = ''; if ($showChildren) { $header .= '<a class="' . $visibilityClass . '" href="' . api_get_self() . '?' . api_get_cidreq() . '&category_id=">'; $header .= Display::return_icon('forum_nestedview.png'); } else { $header .= '<a class="' . $visibilityClass . '" href="' . api_get_self() . '?' . api_get_cidreq() . '&category_id=' . $myrow['id'] . '">'; $header .= Display::return_icon('forum_listview.png'); } $header .= Security::remove_XSS($myrow['category_title']) . '</a>'; $header .= '<div class="pull-right">'; if (api_is_allowed_to_edit(null, true)) { if ($session_id == $myrow['session_id']) { $header .= $strVisibility; $header .= Link::showCategoryAdminTools($myrow, $counter, count($categories)); } else { $header .= get_lang('EditionNotAvailableFromSession'); } } $childrenContent = ''; if ($showChildren) { $childrenContent = Link::showlinksofcategory($myrow['id']); } echo Display::panel($myrow['description'] . $childrenContent, $header); $counter++; } }
/** * Display the glossary terms in a list * @return bool True * @author Patrick Cool <*****@*****.**>, Ghent University, Belgium * @version januari 2009, dokeos 1.8.6 */ public static function display_glossary_list() { $glossary_data = self::get_glossary_data(0, 1000, 0, 'ASC'); foreach ($glossary_data as $key => $glossary_item) { $actions = ''; if (api_is_allowed_to_edit(null, true)) { $actions = '<div class="pull-right">' . self::actions_filter($glossary_item[2], '', $glossary_item) . '</div>'; } echo Display::panel($glossary_item[1], $glossary_item[0] . ' ' . $actions); } return true; }
/** * @return string */ public static function getWallForm() { $form = new FormValidator('social_wall_main', 'post', api_get_path(WEB_CODE_PATH) . 'social/profile.php', null, array('enctype' => 'multipart/form-data')); $form->addTextarea('social_wall_new_msg_main', null, array('placeholder' => get_lang('SocialWallWhatAreYouThinkingAbout'))); $form->addButtonSend(get_lang('Post')); $html = Display::panel($form->returnForm(), get_lang('SocialWall')); return $html; }
$form -> display(); ?> </td> </tr> </table> </div> </div> */ ?> <!-- PPT2LP --> <div class="chamilo-rapid"> <div class="row"> <div class="col-md-12"> <?php echo Display::panel(get_lang('Ppt2lpDescription') . ' ' . get_lang('Ppt2lpVoiceRecordingNeedsRed5'), get_lang('Ppt2lp')); ?> </div> </div> <div class="row"> <div class="col-md-5"> <?php Display::display_icon('screenshot_ppt2lp.jpg', get_lang('Ppt2lp'), array('class' => 'img-responsive')); ?> </div> <div class="col-md-7"> <form method="POST" class="form-horizontal" action="<?php echo api_get_self(); ?> "> <?php
$social_group_block .= '<div class="list-group-newest">'; $social_group_block .= '<div class="group-title">' . get_lang('Popular') . '</div>'; for ($i = 0; $i < $list; $i++) { $social_group_block .= '<div class="row">'; $social_group_block .= '<div class="col-md-2">' . $groups_pop[$i][0] . '</div>'; $social_group_block .= '<div class="col-md-4">' . $groups_pop[$i][1]; $social_group_block .= $groups_pop[$i][2] . '</div>'; $social_group_block .= "</div>"; } $social_group_block .= "</div>"; } // My friends $friend_html = SocialManager::listMyFriendsBlock($user_id, '', $show_full_profile); //Block Social Sessions $social_session_block = null; $user_info = api_get_user_info($user_id); $sessionList = SessionManager::getSessionsFollowedByUser($user_id, $user_info['status']); if (count($sessionList) > 0) { $social_session_block = $sessionList; } $social_group_block = Display::panel($social_group_block, get_lang('Group')); $tpl = new Template(get_lang('SocialNetwork')); SocialManager::setSocialUserBlock($tpl, api_get_user_id(), 'home'); $tpl->assign('social_menu_block', $social_menu_block); $tpl->assign('social_friend_block', $friend_html); $tpl->assign('sessionList', $social_session_block); $tpl->assign('social_search_block', $social_search_block); $tpl->assign('social_skill_block', SocialManager::getSkillBlock($user_id)); $tpl->assign('social_group_block', $social_group_block); $social_layout = $tpl->get_template('social/home.tpl'); $tpl->display($social_layout);
/** * @return string */ public static function getWallForm() { $form = new FormValidator('social_wall_main', 'post', api_get_path(WEB_CODE_PATH) . 'social/profile.php', null, array('enctype' => 'multipart/form-data')); $form->addTextarea('social_wall_new_msg_main', null, ['placeholder' => get_lang('SocialWallWhatAreYouThinkingAbout'), 'style' => 'width : 100%']); $form->addHtml('<div class="form-group "><div class="url_preview col-md-9 panel-body"></div></div>'); $form->addButtonSend(get_lang('Post')); $form->addHidden('url_content', ''); $html = Display::panel($form->returnForm(), get_lang('SocialWall')); return $html; }
$form->addButtonSave(get_lang('SaveSettings'), 'apply_change'); if ($form->validate()) { $user_data = $form->getSubmitValues(); // upload picture if a new one is provided if ($_FILES['picture']['size']) { if ($new_picture = UserManager::update_user_picture(api_get_user_id(), $_FILES['picture']['name'], $_FILES['picture']['tmp_name'])) { $table_user = Database::get_main_table(TABLE_MAIN_USER); $sql = "UPDATE {$table_user}\n SET picture_uri = '{$new_picture}' WHERE user_id = " . api_get_user_id(); $result = Database::query($sql); } } } } //Block Menu $social_menu_block = SocialManager::show_social_menu('home'); $social_search_block = Display::panel(UserManager::get_search_form(''), get_lang("SearchUsers")); $results = $userGroup->get_groups_by_age(1, false); $groups_newest = array(); if (!empty($results)) { foreach ($results as $result) { $id = $result['id']; $result['description'] = Security::remove_XSS($result['description'], STUDENT, true); $result['name'] = Security::remove_XSS($result['name'], STUDENT, true); if ($result['count'] == 1) { $result['count'] = '1 ' . get_lang('Member'); } else { $result['count'] = $result['count'] . ' ' . get_lang('Members'); } $group_url = "group_view.php?id={$id}"; $result['name'] = '<div class="group-name">' . Display::url(api_ucwords(cut($result['name'], 40, true)), $group_url) . '</div><div class="count-username">' . Display::returnFontAwesomeIcon('user') . $result['count'] . '</div>'; $picture = $userGroup->get_picture_group($id, $result['picture'], 80);
} else { $type = 'complex'; $columns = array(get_lang('FirstName'), get_lang('LastName'), get_lang('Title'), get_lang('Feedback'), get_lang('Date'), get_lang('UploadCorrection'), get_lang('Actions')); $column_model = array(array('name' => 'firstname', 'index' => 'firstname', 'width' => '35', 'align' => 'left', 'search' => 'true'), array('name' => 'lastname', 'index' => 'lastname', 'width' => '35', 'align' => 'left', 'search' => 'true'), array('name' => 'title', 'index' => 'title', 'width' => '40', 'align' => 'left', 'search' => 'false', 'wrap_cell' => "true"), array('name' => 'qualification', 'index' => 'qualification', 'width' => '25', 'align' => 'left', 'search' => 'true'), array('name' => 'sent_date', 'index' => 'sent_date', 'width' => '30', 'align' => 'left', 'search' => 'true', 'wrap_cell' => 'true'), array('name' => 'correction', 'index' => 'correction', 'width' => '30', 'align' => 'left', 'search' => 'false', 'sortable' => 'false'), array('name' => 'actions', 'index' => 'actions', 'width' => '40', 'align' => 'left', 'search' => 'false', 'sortable' => 'false')); } $extra_params = array('autowidth' => 'true', 'height' => 'auto', 'sortname' => 'firstname', 'sortable' => 'false'); $url = api_get_path(WEB_AJAX_PATH) . 'model.ajax.php?a=get_work_user_list_all&work_id=' . $workId . '&type=' . $type . '&' . api_get_cidreq(); ?> <script> $(function() { <?php echo Display::grid_js('results', $url, $columns, $column_model, $extra_params); ?> }); </script> <?php echo $documentsAddedInWork; $tableWork = Display::grid_html('results'); echo Display::panel($tableWork); echo '<div class="list-work-results">'; echo '<div class="panel panel-default">'; echo '<div class="panel-body">'; echo '<table style="display:none; width:100%" class="files data_table"> <tr> <th>' . get_lang('FileName') . '</th> <th>' . get_lang('Size') . '</th> <th>' . get_lang('Status') . '</th> </tr> </table>'; echo '</div></div></div>';
} if (count($pending_invitations) > 0) { $new_invitation = array(); $waitingInvitation = ''; foreach ($pending_invitations as $invitation) { $picture = $userGroup->get_picture_group($invitation['id'], $invitation['picture'], 80); $img = '<img class="social-groups-image" src="' . $picture['file'] . '" />'; $invitation['picture_uri'] = '<a href="group_view.php?id=' . $invitation['id'] . '">' . $img . '</a>'; $invitation['name'] = '<a href="group_view.php?id=' . $invitation['id'] . '">' . cut($invitation['name'], 120, true) . '</a>'; $invitation['description'] = cut($invitation['description'], 220, true); $new_invitation[] = $invitation; $waitingInvitation .= '<div class="well"><div class="row">'; $waitingInvitation .= '<div class="col-md-3">' . $invitation['picture_uri'] . '</div>'; $waitingInvitation .= '<div class="col-md-9">'; $waitingInvitation .= '<h4 class="tittle-profile">' . $invitation['name'] . '</h4>'; $waitingInvitation .= '<div class="description-group">' . $invitation['description'] . '</div>'; $waitingInvitation .= '<div class="btn-group" role="group">'; $waitingInvitation .= '<a class="btn btn-success" href="invitations.php?accept=' . $invitation['id'] . '"><em class="fa fa-check"></em> ' . get_lang('AcceptInvitation') . '</a>'; $waitingInvitation .= '<a class="btn btn-danger" href="invitations.php?deny=' . $invitation['id'] . '"><em class="fa fa-times"></em> ' . get_lang('DenyInvitation') . '</a>'; $waitingInvitation .= '</div>'; $waitingInvitation .= '</div></div>'; } $socialInvitationsBlock .= Display::panel($waitingInvitation, get_lang('GroupsWaitingApproval')); } $tpl = \Chamilo\CoreBundle\Framework\Container::getTwig(); SocialManager::setSocialUserBlock($tpl, api_get_user_id(), 'invitations'); $tpl->addGlobal('social_menu_block', $social_menu_block); $tpl->addGlobal('social_invitations_block', $socialInvitationsBlock); $tpl->addGlobal('message', $show_message); $tpl->addGlobal('content', $content); echo $tpl->render('@template_style/social/invitations.html.twig');
/** * @param string string $update_audio * @param bool $drop_element_here * @return string */ public function return_new_tree($update_audio = 'false', $drop_element_here = false) { $return = ''; $is_allowed_to_edit = api_is_allowed_to_edit(null, true); $course_id = api_get_course_int_id(); $tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM); $sql = "SELECT * FROM {$tbl_lp_item}\n WHERE c_id = {$course_id} AND lp_id = " . $this->lp_id; $result = Database::query($sql); $arrLP = array(); while ($row = Database::fetch_array($result)) { $arrLP[] = array('id' => $row['id'], 'item_type' => $row['item_type'], 'title' => Security::remove_XSS($row['title']), 'path' => $row['path'], 'description' => Security::remove_XSS($row['description']), 'parent_item_id' => $row['parent_item_id'], 'previous_item_id' => $row['previous_item_id'], 'next_item_id' => $row['next_item_id'], 'max_score' => $row['max_score'], 'min_score' => $row['min_score'], 'mastery_score' => $row['mastery_score'], 'prerequisite' => $row['prerequisite'], 'display_order' => $row['display_order'], 'audio' => $row['audio'], 'prerequisite_max_score' => $row['prerequisite_max_score'], 'prerequisite_min_score' => $row['prerequisite_min_score']); } $this->tree_array($arrLP); $arrLP = $this->arrMenu; unset($this->arrMenu); $default_data = null; $default_content = null; $elements = array(); $return_audio = null; for ($i = 0; $i < count($arrLP); $i++) { $title = $arrLP[$i]['title']; $title_cut = cut($arrLP[$i]['title'], 25); //Link for the documents if ($arrLP[$i]['item_type'] == 'document') { $url = api_get_self() . '?' . api_get_cidreq() . '&action=view_item&mode=preview_document&id=' . $arrLP[$i]['id'] . '&lp_id=' . $this->lp_id; $title_cut = Display::url($title_cut, $url, array('class' => 'ajax', 'data-title' => $title_cut)); } if ($i % 2 == 0) { $oddClass = 'row_odd'; } else { $oddClass = 'row_even'; } $return_audio .= '<tr id ="lp_item_' . $arrLP[$i]['id'] . '" class="' . $oddClass . '">'; $icon_name = str_replace(' ', '', $arrLP[$i]['item_type']); $icon = ''; if (file_exists('../img/lp_' . $icon_name . '.png')) { $icon = '<img src="../img/lp_' . $icon_name . '.png" />'; } else { if (file_exists('../img/lp_' . $icon_name . '.gif')) { $icon = '<img src="../img/lp_' . $icon_name . '.gif" />'; } else { $icon = '<img src="../img/folder_document.gif" />'; } } // The audio column. $return_audio .= '<td align="left" style="padding-left:10px;">'; $audio = ''; if (!$update_audio || $update_audio != 'true') { if (!empty($arrLP[$i]['audio'])) { /*$audio .= '<span id="container'.$i.'"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</span>'; $audio .= '<script type="text/javascript" src="../inc/lib/mediaplayer/swfobject.js"></script>'; $audio .= '<script type="text/javascript"> var s1 = new SWFObject("../inc/lib/mediaplayer/player.swf","ply","250","20","9","#FFFFFF"); s1.addParam("allowscriptaccess","always"); s1.addParam("flashvars","file=../../courses/' . $_course['path'] . '/document/audio/' . $arrLP[$i]['audio'] . '"); s1.write("container' . $i . '"); </script>';*/ } else { $audio .= ''; } } else { $types = self::getChapterTypes(); if (!in_array($arrLP[$i]['item_type'], $types)) { $audio .= '<input type="file" name="mp3file' . $arrLP[$i]['id'] . '" id="mp3file" />'; if (!empty($arrLP[$i]['audio'])) { $audio .= '<br />' . Security::remove_XSS($arrLP[$i]['audio']) . '<br /> <input type="checkbox" name="removemp3' . $arrLP[$i]['id'] . '" id="checkbox' . $arrLP[$i]['id'] . '" />' . get_lang('RemoveAudio'); } } } $return_audio .= Display::span($icon . ' ' . $title) . Display::tag('td', $audio, array('style' => '')); $return_audio .= '</td>'; $move_icon = ''; $move_item_icon = ''; $edit_icon = ''; $delete_icon = ''; $audio_icon = ''; $prerequisities_icon = ''; if ($is_allowed_to_edit) { if (!$update_audio || $update_audio != 'true') { $move_icon .= '<a class="moved" href="#">'; $move_icon .= Display::return_icon('move_everywhere.png', get_lang('Move'), array(), ICON_SIZE_TINY); $move_icon .= '</a>'; } // No edit for this item types if (!in_array($arrLP[$i]['item_type'], array('sco', 'asset'))) { if (!in_array($arrLP[$i]['item_type'], array('dokeos_chapter', 'dokeos_module'))) { $edit_icon .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=edit_item&view=build&id=' . $arrLP[$i]['id'] . '&lp_id=' . $this->lp_id . '&path_item=' . $arrLP[$i]['path'] . '">'; $edit_icon .= Display::return_icon('edit.png', get_lang('LearnpathEditModule'), array(), ICON_SIZE_TINY); $edit_icon .= '</a>'; } else { $edit_icon .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=edit_item&id=' . $arrLP[$i]['id'] . '&lp_id=' . $this->lp_id . '&path_item=' . $arrLP[$i]['path'] . '">'; $edit_icon .= Display::return_icon('edit.png', get_lang('LearnpathEditModule'), array(), ICON_SIZE_TINY); $edit_icon .= '</a>'; } } $delete_icon .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=delete_item&id=' . $arrLP[$i]['id'] . '&lp_id=' . $this->lp_id . '" onClick="return confirmation(\'' . addslashes($title) . '\');">'; $delete_icon .= Display::return_icon('delete.png', get_lang('LearnpathDeleteModule'), array(), ICON_SIZE_TINY); $delete_icon .= '</a>'; $url = api_get_self() . '?' . api_get_cidreq() . '&view=build&id=' . $arrLP[$i]['id'] . '&lp_id=' . $this->lp_id; if (!in_array($arrLP[$i]['item_type'], array('dokeos_chapter', 'dokeos_module', 'dir'))) { $prerequisities_icon = Display::url(Display::return_icon('accept.png', get_lang('LearnpathPrerequisites'), array(), ICON_SIZE_TINY), $url . '&action=edit_item_prereq'); $move_item_icon = Display::url(Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_TINY), $url . '&action=move_item'); $audio_icon = Display::url(Display::return_icon('audio.png', get_lang('UplUpload'), array(), ICON_SIZE_TINY), $url . '&action=add_audio'); } } if ($update_audio != 'true') { $row = $move_icon . ' ' . $icon . Display::span($title_cut) . Display::span($audio . $edit_icon . $prerequisities_icon . $move_item_icon . $audio_icon . $delete_icon, array('class' => 'button_actions')); } else { $row = Display::span($title . $icon) . Display::span($audio, array('class' => 'button_actions')); } $parent_id = $arrLP[$i]['parent_item_id']; $default_data[$arrLP[$i]['id']] = $row; $default_content[$arrLP[$i]['id']] = $arrLP[$i]; if (empty($parent_id)) { $elements[$arrLP[$i]['id']]['data'] = $row; $elements[$arrLP[$i]['id']]['type'] = $arrLP[$i]['item_type']; } else { $parent_arrays = array(); if ($arrLP[$i]['depth'] > 1) { //Getting list of parents for ($j = 0; $j < $arrLP[$i]['depth']; $j++) { foreach ($arrLP as $item) { if ($item['id'] == $parent_id) { if ($item['parent_item_id'] == 0) { $parent_id = $item['id']; break; } else { $parent_id = $item['parent_item_id']; if (empty($parent_arrays)) { $parent_arrays[] = intval($item['id']); } $parent_arrays[] = $parent_id; break; } } } } } if (!empty($parent_arrays)) { $parent_arrays = array_reverse($parent_arrays); $val = '$elements'; $x = 0; foreach ($parent_arrays as $item) { if ($x != count($parent_arrays) - 1) { $val .= '["' . $item . '"]["children"]'; } else { $val .= '["' . $item . '"]["children"]'; } $x++; } $val .= ""; $code_str = $val . "[" . $arrLP[$i]['id'] . "][\"load_data\"] = '" . $arrLP[$i]['id'] . "' ; "; eval($code_str); } else { $elements[$parent_id]['children'][$arrLP[$i]['id']]['data'] = $row; $elements[$parent_id]['children'][$arrLP[$i]['id']]['type'] = $arrLP[$i]['item_type']; } } } $list = '<ul id="lp_item_list">'; $tree = self::print_recursive($elements, $default_data, $default_content); if (!empty($tree)) { $list .= $tree; } else { if ($drop_element_here) { $list .= Display::return_message(get_lang("DragAndDropAnElementHere")); } } $list .= '</ul>'; $return .= Display::panel($list, $this->name); if ($update_audio == 'true') { $return = $return_audio; } return $return; }
$html .= '<div id="unhideButtons" class="btn-toolbar">'; $index = 0; $getLangDisplayColumn = get_lang('DisplayColumn'); foreach ($headers as $header) { $html .= Display::toolbarButton($header, '#', 'arrow-right', 'default', ['title' => htmlentities("{$getLangDisplayColumn} \"{$header}\"", ENT_QUOTES), 'class' => 'hide', 'onclick' => "foldup({$index}); return false;"]); $index++; } $html .= "</div>"; // Display the table $html .= "<div id='reporting_table'>"; $html .= $table->return_table(); $html .= "</div>"; } else { $html .= Display::display_warning_message(get_lang('NoUsersInCourse'), true, true); } echo Display::panel($html, $titleSession); // Send the csv file if asked. if ($export_csv) { $csv_headers = array(); $csv_headers[] = get_lang('OfficialCode', ''); if ($is_western_name_order) { $csv_headers[] = get_lang('FirstName', ''); $csv_headers[] = get_lang('LastName', ''); } else { $csv_headers[] = get_lang('LastName', ''); $csv_headers[] = get_lang('FirstName', ''); } $csv_headers[] = get_lang('Login', ''); // $csv_headers[] = get_lang('TrainingTime', ''); $csv_headers[] = get_lang('CourseProgress', '');
} $result = getWorkDateValidationStatus($work_data); echo $result['message']; $check_qualification = intval($my_folder_data['qualification']); if (!api_is_invitee()) { if (!empty($work_data['enable_qualification']) && !empty($check_qualification)) { $type = 'simple'; $columns = array(get_lang('Type'), get_lang('Title'), get_lang('Qualification'), get_lang('Date'), get_lang('Status'), get_lang('Actions')); $column_model = array(array('name' => 'type', 'index' => 'file', 'width' => '5', 'align' => 'left', 'search' => 'false', 'sortable' => 'false'), array('name' => 'title', 'index' => 'title', 'width' => '40', 'align' => 'left', 'search' => 'false', 'wrap_cell' => 'true'), array('name' => 'qualification', 'index' => 'qualification', 'width' => '10', 'align' => 'left', 'search' => 'true'), array('name' => 'sent_date', 'index' => 'sent_date', 'width' => '30', 'align' => 'left', 'search' => 'true', 'wrap_cell' => 'true'), array('name' => 'qualificator_id', 'index' => 'qualificator_id', 'width' => '20', 'align' => 'left', 'search' => 'true'), array('name' => 'actions', 'index' => 'actions', 'width' => '20', 'align' => 'left', 'search' => 'false', 'sortable' => 'false')); } else { $type = 'complex'; $columns = array(get_lang('Type'), get_lang('Title'), get_lang('Feedback'), get_lang('Date'), get_lang('Actions')); $column_model = array(array('name' => 'type', 'index' => 'file', 'width' => '5', 'align' => 'left', 'search' => 'false', 'sortable' => 'false'), array('name' => 'title', 'index' => 'title', 'width' => '60', 'align' => 'left', 'search' => 'false', 'wrap_cell' => "true"), array('name' => 'qualification', 'index' => 'qualification', 'width' => '10', 'align' => 'left', 'search' => 'true'), array('name' => 'sent_date', 'index' => 'sent_date', 'width' => '30', 'align' => 'left', 'search' => 'true', 'wrap_cell' => 'true', 'sortable' => 'false'), array('name' => 'actions', 'index' => 'actions', 'width' => '20', 'align' => 'left', 'search' => 'false', 'sortable' => 'false')); } $extra_params = array('autowidth' => 'true', 'height' => 'auto', 'sortname' => 'firstname'); $url = api_get_path(WEB_AJAX_PATH) . 'model.ajax.php?a=get_work_user_list&work_id=' . $workId . '&type=' . $type; ?> <script> $(function() { <?php echo Display::grid_js('results', $url, $columns, $column_model, $extra_params); ?> }); </script> <?php $html = ''; $tableWork = Display::grid_html('results'); $html = Display::panel($tableWork); echo $html; } Display::display_footer();
/** * Display notes */ public static function display_notes() { $_user = api_get_user_info(); if (!isset($_GET['direction'])) { $sort_direction = 'ASC'; $link_sort_direction = 'DESC'; } elseif ($_GET['direction'] == 'ASC') { $sort_direction = 'ASC'; $link_sort_direction = 'DESC'; } else { $sort_direction = 'DESC'; $link_sort_direction = 'ASC'; } // action links echo '<div class="actions">'; if (!api_is_anonymous()) { if (api_get_session_id() == 0) { echo '<a href="index.php?' . api_get_cidreq() . '&action=addnote">' . Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32') . '</a>'; } elseif (api_is_allowed_to_session_edit(false, true)) { echo '<a href="index.php?' . api_get_cidreq() . '&action=addnote">' . Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32') . '</a>'; } } else { echo '<a href="javascript:void(0)">' . Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32') . '</a>'; } echo '<a href="index.php?' . api_get_cidreq() . '&action=changeview&view=creation_date&direction=' . $link_sort_direction . '">' . Display::return_icon('notes_order_by_date_new.png', get_lang('OrderByCreationDate'), '', '32') . '</a>'; echo '<a href="index.php?' . api_get_cidreq() . '&action=changeview&view=update_date&direction=' . $link_sort_direction . '">' . Display::return_icon('notes_order_by_date_mod.png', get_lang('OrderByModificationDate'), '', '32') . '</a>'; echo '<a href="index.php?' . api_get_cidreq() . '&action=changeview&view=title&direction=' . $link_sort_direction . '">' . Display::return_icon('notes_order_by_title.png', get_lang('OrderByTitle'), '', '32') . '</a>'; echo '</div>'; if (!isset($_SESSION['notebook_view']) || !in_array($_SESSION['notebook_view'], array('creation_date', 'update_date', 'title'))) { $_SESSION['notebook_view'] = 'creation_date'; } // Database table definition $t_notebook = Database::get_course_table(TABLE_NOTEBOOK); $order_by = ""; if ($_SESSION['notebook_view'] == 'creation_date' || $_SESSION['notebook_view'] == 'update_date') { $order_by = " ORDER BY " . $_SESSION['notebook_view'] . " {$sort_direction} "; } else { $order_by = " ORDER BY " . $_SESSION['notebook_view'] . " {$sort_direction} "; } //condition for the session $session_id = api_get_session_id(); $condition_session = api_get_session_condition($session_id); $cond_extra = $_SESSION['notebook_view'] == 'update_date' ? " AND update_date <> '0000-00-00 00:00:00'" : " "; $course_id = api_get_course_int_id(); $sql = "SELECT * FROM {$t_notebook}\n WHERE\n c_id = {$course_id} AND\n user_id = '" . api_get_user_id() . "'\n {$condition_session}\n {$cond_extra} {$order_by}\n "; $result = Database::query($sql); while ($row = Database::fetch_array($result)) { // Validation when belongs to a session $session_img = api_get_session_image($row['session_id'], $_user['status']); $creation_date = api_get_local_time($row['creation_date'], null, date_default_timezone_get()); $update_date = api_get_local_time($row['update_date'], null, date_default_timezone_get()); $updateValue = ''; if ($row['update_date'] != $row['creation_date']) { $updateValue = ', ' . get_lang('UpdateDate') . ': ' . date_to_str_ago($update_date) . ' <span class="dropbox_date">' . $update_date . '</span>'; } $actions = '<a href="' . api_get_self() . '?action=editnote¬ebook_id=' . $row['notebook_id'] . '">' . Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL) . '</a>'; $actions .= '<a href="' . api_get_self() . '?action=deletenote¬ebook_id=' . $row['notebook_id'] . '" onclick="return confirmation(\'' . $row['title'] . '\');">' . Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL) . '</a>'; echo Display::panel($row['description'], $row['title'] . $session_img . ' <div class="pull-right">' . $actions . '</div>', get_lang('CreationDate') . ': ' . date_to_str_ago($creation_date) . ' <span class="dropbox_date">' . $creation_date . $updateValue . "</span>"); } }
if (!empty($my_folder_data['description'])) { $content = '<div>' . get_lang('Description') . ':' . Security::remove_XSS($my_folder_data['description'], STUDENT) . '</div>'; } if (api_is_allowed_to_edit() || api_is_coach()) { // Work list $content .= '<div class="row">'; $content .= '<div class="col-md-12">'; $content .= '<div class="table-responsive">'; $content .= Display::panel(showTeacherWorkGrid()); $content .= '</div>'; $content .= '</div>'; $content .= '<div id="student-list-work" style="display: none" class="table-responsive">'; $content .= '<div class="toolbar"><a id="closed-view-list" href="#"><em class="fa fa-times-circle"></em> ' . get_lang('Close') . '</a></div>'; $content .= showStudentList($work_id); $content .= '</div>'; } else { $content .= Display::panel(showStudentWorkGrid()); } break; } Display::display_header(null); Display::display_introduction_section(TOOL_STUDENTPUBLICATION); if ($origin == 'learnpath') { echo '<div style="height:15px"> </div>'; } display_action_links($work_id, $curdirpath, $action); $message = Session::read('message'); echo $message; Session::erase('message'); echo $content; Display::display_footer();
/** * @param int $courseId * @param int $sessionId * @return string */ public function displayCategories($courseId, $sessionId = 0) { $categories = $this->getCategories($courseId, $sessionId); $html = ''; foreach ($categories as $category) { $tmpobj = new TestCategory($category['id']); $nb_question = $tmpobj->getCategoryQuestionsNumber(); $rowname = self::protectJSDialogQuote($category['title']); $nb_question_label = $nb_question == 1 ? $nb_question . ' ' . get_lang('Question') : $nb_question . ' ' . get_lang('Questions'); //$html .= '<div class="sectiontitle" id="id_cat' . $category['id'] . '">'; $content = "<span style='float:right'>" . $nb_question_label . "</span>"; $content .= '<div class="sectioncomment">'; $content .= $category['description']; $content .= '</div>'; $links = '<a href="' . api_get_self() . '?action=editcategory&category_id=' . $category['id'] . '">' . Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . '</a>'; $links .= ' <a href="' . api_get_self() . '?action=deletecategory&category_id=' . $category['id'] . '" '; $links .= 'onclick="return confirmDelete(\'' . self::protectJSDialogQuote(get_lang('DeleteCategoryAreYouSure') . '[' . $rowname) . '] ?\', \'id_cat' . $category['id'] . '\');">'; $links .= Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>'; $html .= Display::panel($content, $category['title'] . $links); } return $html; }
/** * @return string */ public static function getWallForm() { $form = new FormValidator('social_wall_main', 'post', api_get_path(WEB_CODE_PATH) . 'social/profile.php', null, array('enctype' => 'multipart/form-data'), FormValidator::LAYOUT_HORIZONTAL); $form->addTextarea('social_wall_new_msg_main', null, ['placeholder' => get_lang('SocialWallWhatAreYouThinkingAbout'), 'cols-size' => [1, 10, 1]]); $form->addHidden('url_content', ''); $form->addButtonSend(get_lang('Post'), 'wall_post_button', false, ['cols-size' => [1, 10, 1]]); $html = Display::panel($form->returnForm(), get_lang('SocialWall')); return $html; }
$my_courses .= $value[1]; $i++; } } $social_course_block .= $my_courses; //$social_course_block = Display::panel($my_courses, get_lang('MyCourses')); } //Block Social Sessions if (count($sessionList) > 0) { //$social_session_block = $htmlSessionList; $social_session_block = $sessionList; } // Block Social User Feeds $user_feeds = SocialManager::get_user_feeds($user_id); if (!empty($user_feeds)) { $social_rss_block = Display::panel($user_feeds, get_lang('RSSFeeds')); } // Productions $production_list = UserManager::build_production_list($user_id); // Images uploaded by course $file_list = ''; if (is_array($course_list_code) && count($course_list_code) > 0) { foreach ($course_list_code as $course) { $file_list .= UserManager::get_user_upload_files_by_course($user_id, $course['code'], $resourcetype = 'images'); } } $count_pending_invitations = 0; if (!isset($_GET['u']) || isset($_GET['u']) && $_GET['u'] == api_get_user_id()) { $pending_invitations = SocialManager::get_list_invitation_of_friends_by_user_id(api_get_user_id()); $list_get_path_web = SocialManager::get_list_web_path_user_invitation_by_user_id(api_get_user_id()); $count_pending_invitations = count($pending_invitations);
<table width="100%"> <tr> <td><h3>' . get_lang('ThematicAdvanceHistory') . '</h3></td> <td align="right"><a href="index.php?action=listing">' . Display::return_icon('info.png', get_lang('BackToCourseDesriptionList'), array('style' => 'vertical-align:middle;'), ICON_SIZE_SMALL) . ' ' . get_lang('BackToCourseDesriptionList') . '</a></td></tr></table></div>'; } $user_info = api_get_user_info(); if (isset($descriptions) && count($descriptions) > 0) { foreach ($descriptions as $id => $description) { if (!empty($description)) { $actions = ''; if (api_is_allowed_to_edit(null, true) && !$history) { if (api_get_session_id() == $description['session_id']) { $description['title'] = $description['title'] . ' ' . api_get_session_image(api_get_session_id(), $user_info['status']); // delete $actions .= '<a href="' . api_get_self() . '?id=' . $description['id'] . '&cidReq=' . api_get_course_id() . '&id_session=' . $description['session_id'] . '&action=delete&description_type=' . $description['description_type'] . '" onclick="javascript:if(!confirm(\'' . addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, api_get_system_encoding())) . '\')) return false;">'; $actions .= Display::return_icon('delete.png', get_lang('Delete'), array('style' => 'vertical-align:middle;float:right;'), ICON_SIZE_SMALL); $actions .= '</a> '; // edit $actions .= '<a href="' . api_get_self() . '?id=' . $description['id'] . '&cidReq=' . api_get_course_id() . '&id_session=' . $description['session_id'] . '&action=edit&description_type=' . $description['description_type'] . '">'; $actions .= Display::return_icon('edit.png', get_lang('Edit'), array('style' => 'vertical-align:middle;float:right; padding-right:4px;'), ICON_SIZE_SMALL); $actions .= '</a> '; } else { $actions .= Display::return_icon('edit_na.png', get_lang('EditionNotAvailableFromSession'), array('style' => 'vertical-align:middle;float:right;'), ICON_SIZE_SMALL); } } echo Display::panel($description['content'], $description['title'] . $actions, '', 'info'); } } } else { echo '<em>' . get_lang('ThisCourseDescriptionIsEmpty') . '</em>'; }