本文整理汇总了PHP中Display::img方法的典型用法代码示例。如果您正苦于以下问题:PHP Display::img方法的具体用法?PHP Display::img怎么用?PHP Display::img使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Display
的用法示例。
在下文中一共展示了Display::img方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Certificate
$certificate = new Certificate();
$text = $certificate->parse_certificate_variables($content_html['variables']);
$result = $certificate->generate_qr($text, $qr_code_filename);
$new_content_html = $content_html['content'];
$path_image = api_get_path(WEB_COURSE_PATH) . api_get_course_path() . '/document/images/gallery';
$new_content_html = str_replace('../images/gallery', $path_image, $new_content_html);
$path_image_in_default_course = api_get_path(WEB_CODE_PATH) . 'default_course_document';
$new_content_html = str_replace('/main/default_course_document', $path_image_in_default_course, $new_content_html);
$new_content_html = str_replace(SYS_CODE_PATH . 'img/', api_get_path(WEB_IMG_PATH), $new_content_html);
Display::display_reduced_header();
echo '<style>body {background:none;}</style>
<style media="print" type="text/css"> #print_div { visibility:hidden; } </style>';
echo '<a href="javascript:window.print();" style="float:right; padding:4px;" id="print_div">
<img src="../img/printmgr.gif" alt="' . get_lang('Print') . '"/>' . get_lang('Print') . '</a>';
if (is_file($qr_code_filename) && is_readable($qr_code_filename)) {
$new_content_html = str_replace('((certificate_barcode))', Display::img($qr_code_web_filename), $new_content_html);
}
print_r($new_content_html);
exit;
}
}
// Is the document tool visible?
// Check whether the tool is actually visible
/*$table_course_tool = Database::get_course_table(TABLE_TOOL_LIST);
$course_id = api_get_course_int_id();
$tool_sql = 'SELECT visibility FROM '.$table_course_tool.'
WHERE c_id = '.$course_id.' AND name = "'.TOOL_DOCUMENT.'"
LIMIT 1';
$tool_result = Database::query($tool_sql);
$tool_row = Database::fetch_array($tool_result);
$tool_visibility = $tool_row['visibility'];*/
示例2: array
$result = ArrayClass::msort($result, 'skills_acquired', 'asc');
$skills_in_course = array();
if (!empty($result)) {
foreach ($result as &$item) {
$user_info = api_get_user_info($item['user_id']);
$personal_course_list = UserManager::get_personal_session_course_list($item['user_id']);
$count_skill_by_course = array();
foreach ($personal_course_list as $course_item) {
if (!isset($skills_in_course[$course_item['code']])) {
$count_skill_by_course[$course_item['code']] = $skill->get_count_skills_by_course($course_item['code']);
$skills_in_course[$course_item['code']] = $count_skill_by_course[$course_item['code']];
} else {
$count_skill_by_course[$course_item['code']] = $skills_in_course[$course_item['code']];
}
}
$item['photo'] = Display::img($user_info['avatar_small'], $user_info['complete_name'], [], false);
$item['currently_learning'] = !empty($count_skill_by_course) ? array_sum($count_skill_by_course) : 0;
}
}
break;
case 'get_course_announcements':
$columns = array('title', 'username', 'insert_date', 'actions');
$titleToSearch = isset($_REQUEST['title_to_search']) ? $_REQUEST['title_to_search'] : '';
$userIdToSearch = isset($_REQUEST['user_id_to_search']) ? $_REQUEST['user_id_to_search'] : 0;
$result = AnnouncementManager::getAnnouncements(null, null, false, $start, $limit, $sidx, $sord, $titleToSearch, $userIdToSearch);
break;
case 'get_work_teacher':
$columns = array('type', 'title', 'sent_date', 'expires_on', 'amount', 'actions');
$result = getWorkListTeacher($start, $limit, $sidx, $sord, $whereCondition);
break;
case 'get_work_student':
示例3: returnBreadcrumb
/**
* Return breadcrumb
* @return string
*/
public function returnBreadcrumb()
{
$interbreadcrumb = $this->app['breadcrumb'];
$session_id = api_get_session_id();
$session_name = api_get_session_name($session_id);
$_course = api_get_course_info();
$user_id = api_get_user_id();
$course_id = api_get_course_id();
/* Plugins for banner section */
$web_course_path = api_get_path(WEB_COURSE_PATH);
/* If the user is a coach he can see the users who are logged in its session */
$navigation = array();
// part 1: Course Homepage. If we are in a course then the first breadcrumb is a link to the course homepage
// hide_course_breadcrumb the parameter has been added to hide the name of the course, that appeared in the default $interbreadcrumb
$session_name = Text::cut($session_name, MAX_LENGTH_BREADCRUMB);
$my_session_name = is_null($session_name) ? '' : ' (' . $session_name . ')';
if (!empty($_course) && !isset($_GET['hide_course_breadcrumb'])) {
$navigation_item['url'] = $web_course_path . $_course['path'] . '/index.php' . (!empty($session_id) ? '?id_session=' . $session_id : '');
$course_title = Text::cut($_course['name'], MAX_LENGTH_BREADCRUMB);
switch (api_get_setting('breadcrumbs_course_homepage')) {
case 'get_lang':
$navigation_item['title'] = Display::img(api_get_path(WEB_CSS_PATH) . 'home.png', get_lang('CourseHomepageLink')) . ' ' . get_lang('CourseHomepageLink');
break;
case 'course_code':
$navigation_item['title'] = Display::img(api_get_path(WEB_CSS_PATH) . 'home.png', $_course['official_code']) . ' ' . $_course['official_code'];
break;
case 'session_name_and_course_title':
$navigation_item['title'] = Display::img(api_get_path(WEB_CSS_PATH) . 'home.png', $_course['name'] . $my_session_name) . ' ' . $course_title . $my_session_name;
break;
default:
if (api_get_session_id() != -1) {
$navigation_item['title'] = Display::img(api_get_path(WEB_CSS_PATH) . 'home.png', $_course['name'] . $my_session_name) . ' ' . $course_title . $my_session_name;
} else {
$navigation_item['title'] = Display::img(api_get_path(WEB_CSS_PATH) . 'home.png', $_course['name']) . ' ' . $course_title;
}
break;
}
$navigation[] = $navigation_item;
}
// Part 2: breadcrumbs.
// If there is an array $interbreadcrumb defined then these have to appear before the last breadcrumb
// (which is the tool itself)
if (isset($interbreadcrumb) && is_array($interbreadcrumb)) {
foreach ($interbreadcrumb as $breadcrumb_step) {
if ($breadcrumb_step['url'] != '#') {
$sep = strrchr($breadcrumb_step['url'], '?') ? '&' : '?';
$navigation_item['url'] = $breadcrumb_step['url'] . $sep . api_get_cidreq();
} else {
$navigation_item['url'] = '#';
}
$navigation_item['title'] = $breadcrumb_step['name'];
// titles for shared folders
if ($breadcrumb_step['name'] == 'shared_folder') {
$navigation_item['title'] = get_lang('UserFolders');
} elseif (strstr($breadcrumb_step['name'], 'shared_folder_session_')) {
$navigation_item['title'] = get_lang('UserFolders');
} elseif (strstr($breadcrumb_step['name'], 'sf_user_')) {
$userinfo = api_get_user_info(substr($breadcrumb_step['name'], 8));
$navigation_item['title'] = $userinfo['complete_name'];
} elseif ($breadcrumb_step['name'] == 'chat_files') {
$navigation_item['title'] = get_lang('ChatFiles');
} elseif ($breadcrumb_step['name'] == 'images') {
$navigation_item['title'] = get_lang('Images');
} elseif ($breadcrumb_step['name'] == 'video') {
$navigation_item['title'] = get_lang('Video');
} elseif ($breadcrumb_step['name'] == 'audio') {
$navigation_item['title'] = get_lang('Audio');
} elseif ($breadcrumb_step['name'] == 'flash') {
$navigation_item['title'] = get_lang('Flash');
} elseif ($breadcrumb_step['name'] == 'gallery') {
$navigation_item['title'] = get_lang('Gallery');
}
// Fixes breadcrumb title now we applied the Security::remove_XSS and we cut the string depending of the MAX_LENGTH_BREADCRUMB value
$navigation_item['title'] = Text::cut($navigation_item['title'], MAX_LENGTH_BREADCRUMB);
$navigation_item['title'] = Security::remove_XSS($navigation_item['title']);
$navigation[] = $navigation_item;
}
}
// part 3: The tool itself. If we are on the course homepage we do not want to display the title of the course because this
// is the same as the first part of the breadcrumbs (see part 1)
$final_navigation = array();
$counter = 0;
foreach ($navigation as $index => $navigation_info) {
if (!empty($navigation_info['title'])) {
if ($navigation_info['url'] == '#') {
$final_navigation[$index] = $navigation_info['title'];
} else {
$final_navigation[$index] = '<a href="' . $navigation_info['url'] . '" class="" target="_top">' . $navigation_info['title'] . '</a>';
}
$counter++;
}
}
$html = '';
if (!empty($final_navigation)) {
$lis = '';
$i = 0;
//.........这里部分代码省略.........
示例4: build_document_icon_tag
/**
* Builds an img html tag for the file type
*
* @param string $type (file/folder)
* @param string $path
* @return string img html tag
*/
public static function build_document_icon_tag($type, $path)
{
$basename = basename($path);
$current_session_id = api_get_session_id();
$is_allowed_to_edit = api_is_allowed_to_edit(null, true);
$user_image = false;
if ($type == 'file') {
$icon = choose_image($basename);
if (preg_match('/_chnano_.wav$/i', $basename)) {
$icon = "jplayer_play.png";
$basename = 'wav' . ' ' . '(Nanogong)';
} else {
$basename = substr(strrchr($basename, '.'), 1);
}
} else {
if ($path == '/shared_folder') {
$icon = 'folder_users.gif';
if ($is_allowed_to_edit) {
$basename = get_lang('HelpUsersFolder');
} else {
$basename = get_lang('UserFolders');
}
} elseif (strstr($basename, 'sf_user_')) {
$userinfo = api_get_user_info(substr($basename, 8));
$icon = $userinfo['avatar_small'];
$basename = get_lang('UserFolder') . ' ' . $userinfo['complete_name'];
$user_image = true;
} elseif (strstr($path, 'shared_folder_session_')) {
if ($is_allowed_to_edit) {
$basename = '***(' . api_get_session_name($current_session_id) . ')*** ' . get_lang('HelpUsersFolder');
} else {
$basename = get_lang('UserFolders') . ' (' . api_get_session_name($current_session_id) . ')';
}
$icon = 'folder_users.gif';
} else {
$icon = 'folder_document.gif';
if ($path == '/audio') {
$icon = 'folder_audio.gif';
if (api_is_allowed_to_edit()) {
$basename = get_lang('HelpDefaultDirDocuments');
} else {
$basename = get_lang('Audio');
}
} elseif ($path == '/flash') {
$icon = 'folder_flash.gif';
if (api_is_allowed_to_edit()) {
$basename = get_lang('HelpDefaultDirDocuments');
} else {
$basename = get_lang('Flash');
}
} elseif ($path == '/images') {
$icon = 'folder_images.gif';
if (api_is_allowed_to_edit()) {
$basename = get_lang('HelpDefaultDirDocuments');
} else {
$basename = get_lang('Images');
}
} elseif ($path == '/video') {
$icon = 'folder_video.gif';
if (api_is_allowed_to_edit()) {
$basename = get_lang('HelpDefaultDirDocuments');
} else {
$basename = get_lang('Video');
}
} elseif ($path == '/images/gallery') {
$icon = 'folder_gallery.gif';
if (api_is_allowed_to_edit()) {
$basename = get_lang('HelpDefaultDirDocuments');
} else {
$basename = get_lang('Gallery');
}
} elseif ($path == '/chat_files') {
$icon = 'folder_chat.png';
if (api_is_allowed_to_edit()) {
$basename = get_lang('HelpFolderChat');
} else {
$basename = get_lang('ChatFiles');
}
} elseif ($path == '/learning_path') {
$icon = 'folder_learningpath.gif';
if (api_is_allowed_to_edit()) {
$basename = get_lang('HelpFolderLearningPaths');
} else {
$basename = get_lang('LearningPaths');
}
}
}
}
if ($user_image) {
return Display::img($icon, $basename, array(), false);
}
return Display::return_icon($icon, $basename, array());
}
示例5: getUserProfileLinkWithPicture
/**
* Displays the name of the user and makes the link to the user profile
*
* @param $userInfo
*
* @return string
*/
public static function getUserProfileLinkWithPicture($userInfo)
{
return Display::url(Display::img($userInfo['avatar']), $userInfo['profile_url']);
}
示例6: getDataAndFormattedValues
/**
* Get the extra fields and their formatted values
* @param int|string $itemId The item ID (It could be a session_id, course_id or user_id)
* @return array The extra fields data
*/
public function getDataAndFormattedValues($itemId)
{
$valuesData = array();
$fields = $this->get_all();
foreach ($fields as $field) {
if ($field['visible'] != '1') {
continue;
}
$fieldValue = new ExtraFieldValue($this->type);
$valueData = $fieldValue->get_values_by_handler_and_field_id($itemId, $field['id'], true);
if (!$valueData) {
continue;
}
$displayedValue = get_lang('None');
switch ($field['field_type']) {
case ExtraField::FIELD_TYPE_CHECKBOX:
if ($valueData !== false && $valueData['value'] == '1') {
$displayedValue = get_lang('Yes');
} else {
$displayedValue = get_lang('No');
}
break;
case ExtraField::FIELD_TYPE_DATE:
if ($valueData !== false && !empty($valueData['value'])) {
$displayedValue = api_format_date($valueData['value'], DATE_FORMAT_LONG_NO_DAY);
}
break;
case ExtraField::FIELD_TYPE_FILE_IMAGE:
if ($valueData === false || empty($valueData['value'])) {
break;
}
if (!file_exists(api_get_path(SYS_UPLOAD_PATH) . $valueData['value'])) {
break;
}
$image = Display::img(api_get_path(WEB_UPLOAD_PATH) . $valueData['value'], $field['display_text'], array('width' => '300'));
$displayedValue = Display::url($image, api_get_path(WEB_UPLOAD_PATH) . $valueData['value'], array('target' => '_blank'));
break;
case ExtraField::FIELD_TYPE_FILE:
if ($valueData === false || empty($valueData['value'])) {
break;
}
if (!file_exists(api_get_path(SYS_UPLOAD_PATH) . $valueData['value'])) {
break;
}
$displayedValue = Display::url(get_lang('Download'), api_get_path(WEB_UPLOAD_PATH) . $valueData['value'], array('title' => $field['display_text'], 'target' => '_blank'));
break;
default:
$displayedValue = $valueData['value'];
break;
}
$valuesData[] = array('text' => $field['display_text'], 'value' => $displayedValue);
}
return $valuesData;
}
示例7: showQuestion
//.........这里部分代码省略.........
}
$s .= '</div></div>';
}
if (in_array($answerType, [MATCHING, MATCHING_DRAGGABLE])) {
$s .= '</div>';
}
$s .= '</div>';
// destruction of the Answer object
unset($objAnswerTmp);
// destruction of the Question object
unset($objQuestionTmp);
if ($origin != 'export') {
echo $s;
} else {
return $s;
}
} elseif ($answerType == HOT_SPOT || $answerType == HOT_SPOT_DELINEATION) {
// Question is a HOT_SPOT
//checking document/images visibility
if (api_is_platform_admin() || api_is_course_admin()) {
$course = api_get_course_info();
$doc_id = DocumentManager::get_document_id($course, '/images/' . $pictureName);
if (is_numeric($doc_id)) {
$images_folder_visibility = api_get_item_visibility($course, 'document', $doc_id, api_get_session_id());
if (!$images_folder_visibility) {
//This message is shown only to the course/platform admin if the image is set to visibility = false
Display::display_warning_message(get_lang('ChangeTheVisibilityOfTheCurrentImage'));
}
}
}
$questionName = $objQuestionTmp->selectTitle();
$questionDescription = $objQuestionTmp->selectDescription();
if ($freeze) {
echo Display::img($objQuestionTmp->selectPicturePath());
return;
}
// Get the answers, make a list
$objAnswerTmp = new Answer($questionId);
$nbrAnswers = $objAnswerTmp->selectNbrAnswers();
// get answers of hotpost
$answers_hotspot = array();
for ($answerId = 1; $answerId <= $nbrAnswers; $answerId++) {
$answers = $objAnswerTmp->selectAnswerByAutoId($objAnswerTmp->selectAutoId($answerId));
$answers_hotspot[$answers['id']] = $objAnswerTmp->selectAnswer($answerId);
}
// display answers of hotpost order by id
$answer_list = '<div style="padding: 10px; margin-left: 0px; border: 1px solid #A4A4A4; height: 408px; width: 200px;"><b>' . get_lang('HotspotZones') . '</b><dl>';
if (!empty($answers_hotspot)) {
ksort($answers_hotspot);
foreach ($answers_hotspot as $key => $value) {
$answer_list .= '<dt>' . $key . '.- ' . $value . '</dt><br />';
}
}
$answer_list .= '</dl></div>';
if ($answerType == HOT_SPOT_DELINEATION) {
$answer_list = '';
$swf_file = 'hotspot_delineation_user';
$swf_height = 405;
} else {
$swf_file = 'hotspot_user';
$swf_height = 436;
}
if (!$only_questions) {
if ($show_title) {
TestCategory::displayCategoryAndTitle($objQuestionTmp->id);
echo '<div class="question_title">' . $current_item . '. ' . $questionName . '</div>';
示例8: generate
/**
* Generates an HTML Certificate and fills the path_certificate field in the DB
**/
public function generate($params = array())
{
//The user directory should be set
if (empty($this->certification_user_path) && $this->force_certificate_generation == false) {
return false;
}
require_once api_get_path(SYS_CODE_PATH) . 'gradebook/lib/be.inc.php';
require_once api_get_path(SYS_CODE_PATH) . 'gradebook/lib/gradebook_functions.inc.php';
require_once api_get_path(SYS_CODE_PATH) . 'gradebook/lib/scoredisplay.class.php';
$params['hide_print_button'] = isset($params['hide_print_button']) ? true : false;
$my_category = Category::load($this->certificate_data['cat_id']);
if (isset($my_category[0]) && $my_category[0]->is_certificate_available($this->user_id)) {
$user = api_get_user_info($this->user_id);
$scoredisplay = ScoreDisplay::instance();
$scorecourse = $my_category[0]->calc_score($this->user_id);
$scorecourse_display = isset($scorecourse) ? $scoredisplay->display_score($scorecourse, SCORE_AVERAGE) : get_lang('NoResultsAvailable');
// Prepare all necessary variables:
$organization_name = api_get_setting('Institution');
//$portal_name = api_get_setting('siteName');
$stud_fn = $user['firstname'];
$stud_ln = $user['lastname'];
//@todo this code is not needed
$certif_text = sprintf(get_lang('CertificateWCertifiesStudentXFinishedCourseYWithGradeZ'), $organization_name, $stud_fn . ' ' . $stud_ln, $my_category[0]->get_name(), $scorecourse_display);
$certif_text = str_replace("\\n", "\n", $certif_text);
//If the gradebook is related to skills we added the skills to the user
$skill = new Skill();
$skill->add_skill_to_user($this->user_id, $this->certificate_data['cat_id']);
if (is_dir($this->certification_user_path)) {
if (!empty($this->certificate_data)) {
$new_content_html = get_user_certificate_content($this->user_id, $my_category[0]->get_course_code(), false, $params['hide_print_button']);
if ($my_category[0]->get_id() == strval(intval($this->certificate_data['cat_id']))) {
$name = $this->certificate_data['path_certificate'];
$my_path_certificate = $this->certification_user_path . basename($name);
if (file_exists($my_path_certificate) && !empty($name) && !is_dir($my_path_certificate) && $this->force_certificate_generation == false) {
//Seems that the file was already generated
return true;
} else {
// Creating new name
$name = md5($this->user_id . $this->certificate_data['cat_id']) . '.html';
$my_path_certificate = $this->certification_user_path . $name;
$path_certificate = '/' . $name;
//Getting QR filename
$file_info = pathinfo($path_certificate);
$qr_code_filename = $this->certification_user_path . $file_info['filename'] . '_qr.png';
$my_new_content_html = str_replace('((certificate_barcode))', Display::img($this->certification_web_user_path . $file_info['filename'] . '_qr.png', 'QR'), $new_content_html['content']);
$my_new_content_html = mb_convert_encoding($my_new_content_html, 'UTF-8', api_get_system_encoding());
$result = @file_put_contents($my_path_certificate, $my_new_content_html);
if ($result) {
//Updating the path
self::update_user_info_about_certificate($this->certificate_data['cat_id'], $this->user_id, $path_certificate);
$this->certificate_data['path_certificate'] = $path_certificate;
if ($this->html_file_is_generated()) {
if (!empty($file_info)) {
$text = $this->parse_certificate_variables($new_content_html['variables']);
$this->generate_qr($text, $qr_code_filename);
}
}
}
return $result;
}
}
}
}
}
return false;
}
示例9: return_logo
function return_logo($theme)
{
$_course = api_get_course_info();
$html = '';
$logoBase = api_get_path(SYS_CSS_PATH) . 'themes/' . $theme . '/images/header-logo.';
$site_name = api_get_setting('platform.site_name');
$attributes = array('title' => $site_name, 'class' => 'img-responsive');
$testServer = api_get_setting('server_type');
if ($testServer == 'test' && is_file($logoBase . 'svg')) {
$logo = $logoBase . 'svg';
$attributes['width'] = '245';
$attributes['height'] = '68';
$image_url = api_get_path(WEB_CSS_PATH) . 'themes/' . $theme . '/images/header-logo.svg';
} else {
$logo = $logoBase . 'png';
$image_url = api_get_path(WEB_CSS_PATH) . 'themes/' . $theme . '/images/header-logo.png';
}
if (file_exists($logo)) {
$site_name = api_get_setting('platform.institution') . ' - ' . $site_name;
$logo = Display::img($image_url, $site_name, $attributes);
$html .= Display::url($logo, api_get_path(WEB_PATH) . 'index.php');
} else {
$html .= '<a href="' . api_get_path(WEB_PATH) . 'index.php" target="_top">' . $site_name . '</a>';
$iurl = api_get_setting('platform.institution_url');
$iname = api_get_setting('platform.institution');
if (!empty($iname)) {
$html .= '- <a href="' . $iurl . '" target="_top">' . $iname . '</a>';
}
// External link section a.k.a Department - Department URL
if (isset($_course['extLink']) && $_course['extLink']['name'] != '') {
$html .= '<span class="extLinkSeparator"> - </span>';
if ($_course['extLink']['url'] != '') {
$html .= '<a class="extLink" href="' . $_course['extLink']['url'] . '" target="_top">';
$html .= $_course['extLink']['name'];
$html .= '</a>';
} else {
$html .= $_course['extLink']['name'];
}
}
}
return $html;
}
示例10: indexAction
//.........这里部分代码省略.........
}
break;
case 'get_user_course_report':
$columns = array('course', 'user', 'time', 'certificate', 'progress_100', 'progress');
$column_names = array(get_lang('Course'), get_lang('User'), get_lang('ManHours'), get_lang('CertificateGenerated'), get_lang('Approved'), get_lang('CourseAdvance'));
$extra_fields = \UserManager::get_extra_fields(0, 100, null, null, true, true);
if (!empty($extra_fields)) {
foreach ($extra_fields as $extra) {
$columns[] = $extra['1'];
$column_names[] = $extra['3'];
}
}
$result = \CourseManager::get_user_list_from_course_code(null, null, "LIMIT {$start}, {$limit}", " {$sidx} {$sord}", null, null, true);
break;
case 'get_user_skill_ranking':
$columns = array('photo', 'firstname', 'lastname', 'skills_acquired', 'currently_learning', 'rank');
$result = $skill->get_user_list_skill_ranking($start, $limit, $sidx, $sord, $where_condition);
$result = \ArrayClass::msort($result, 'skills_acquired', 'asc');
$skills_in_course = array();
if (!empty($result)) {
//$counter = 1;
foreach ($result as &$item) {
$user_info = api_get_user_info($item['user_id']);
$personal_course_list = \UserManager::get_personal_session_course_list($item['user_id']);
$count_skill_by_course = array();
foreach ($personal_course_list as $course_item) {
if (!isset($skills_in_course[$course_item['code']])) {
$count_skill_by_course[$course_item['code']] = $skill->get_count_skills_by_course($course_item['code']);
$skills_in_course[$course_item['code']] = $count_skill_by_course[$course_item['code']];
} else {
$count_skill_by_course[$course_item['code']] = $skills_in_course[$course_item['code']];
}
}
$item['photo'] = \Display::img($user_info['avatar_small']);
$item['currently_learning'] = !empty($count_skill_by_course) ? array_sum($count_skill_by_course) : 0;
}
}
break;
case 'get_work_user_list':
if (isset($type) && $type == 'simple') {
$columns = array('type', 'firstname', 'lastname', 'username', 'title', 'qualification', 'sent_date', 'qualificator_id', 'actions');
} else {
$columns = array('type', 'firstname', 'lastname', 'username', 'title', 'sent_date', 'actions');
}
$result = get_work_user_list($start, $limit, $sidx, $sord, $work_id, $where_condition);
break;
case 'get_exercise_results':
$course = api_get_course_info();
//used inside get_exam_results_data()
$documentPath = api_get_path(SYS_COURSE_PATH) . $course['path'] . "/document";
if ($is_allowedToEdit) {
$columns = array('firstname', 'lastname', 'username', 'group_name', 'exe_duration', 'start_date', 'exe_date', 'score', 'status', 'lp', 'actions');
} else {
//$columns = array('exe_duration', 'start_date', 'exe_date', 'score', 'status', 'actions');
}
$result = \ExerciseLib::get_exam_results_data($start, $limit, $sidx, $sord, $exercise_id, $where_condition);
break;
case 'get_hotpotatoes_exercise_results':
$course = api_get_course_info();
//used inside get_exam_results_data()
$documentPath = api_get_path(SYS_COURSE_PATH) . $course['path'] . "/document";
$columns = array('firstname', 'lastname', 'username', 'group_name', 'exe_date', 'score', 'actions');
$result = ExerciseLib::get_exam_results_hotpotatoes_data($start, $limit, $sidx, $sord, $hotpot_path, $where_condition);
//get_exam_results_data($start, $limit, $sidx, $sord, $exercise_id, $where_condition);
break;
case 'get_sessions':
示例11: api_get_session_id
}
break;
case 'list':
default:
$toolList = CourseHome::toolsIconsAction(api_get_course_int_id(), api_get_session_id());
$iconsTools = '<div id="custom-icons">';
$iconsTools .= Display::page_header(get_lang('CustomizeIcons'), null, 'h4');
$iconsTools .= '<div class="row">';
foreach ($toolList as $tool) {
$toolIconName = 'Tool' . api_underscore_to_camel_case($tool['name']);
$toolIconName = isset(${$toolIconName}) ? get_lang($toolIconName) : $tool['name'];
$iconsTools .= '<div class="col-md-2">';
$iconsTools .= '<div class="items-tools">';
if (!empty($tool['custom_icon'])) {
$image = getCustomWebIconPath() . $tool['custom_icon'];
$icon = Display::img($image, $toolIconName);
} else {
$image = substr($tool['image'], 0, strpos($tool['image'], '.')) . '.png';
$icon = Display::return_icon($image, $toolIconName, array('id' => 'tool_' . $tool['id']), ICON_SIZE_BIG, false);
}
$delete = !empty($tool['custom_icon']) ? "<a class=\"btn btn-default\" onclick=\"javascript:\n if(!confirm('" . addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)) . "')) return false;\" href=\"" . api_get_self() . '?action=delete_icon&id=' . $tool['iid'] . '&' . api_get_cidreq() . "\">\n <em class=\"fa fa-trash-o\"></em></a>" : "";
$edit = '<a class="btn btn-default" href="' . api_get_self() . '?action=edit_icon&id=' . $tool['iid'] . '&' . api_get_cidreq() . '"><em class="fa fa-pencil"></em></a>';
$iconsTools .= '<div class="icon-tools">' . $icon . '</div>';
$iconsTools .= '<div class="name-tools">' . $toolIconName . '</div>';
$iconsTools .= '<div class="toolbar">' . $edit . $delete . '</div>';
$iconsTools .= '</div>';
$iconsTools .= '</div>';
}
$iconsTools .= '</div>';
$iconsTools .= '</div>';
$content = $iconsTools;
示例12: get_lang
return $list;
}
/**
* Just display the form needed to upload a SCORM and give its settings
*/
$nameTools = get_lang("FileUpload");
$interbreadcrumb[] = array("url" => "../newscorm/lp_controller.php?action=list", "name" => get_lang("ToolLearnpath"));
Display::display_header($nameTools, "Path");
require_once '../newscorm/content_makers.inc.php';
require_once api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php';
echo '<div class="actions">';
echo '<a href="../newscorm/lp_controller.php?cidReq=' . $_course['sysCode'] . '">' . Display::return_icon('back.png', get_lang('ReturnToLearningPaths'), '', ICON_SIZE_MEDIUM) . '</a>';
echo '</div>';
$form = new FormValidator('', 'POST', 'upload.php', '', array('id' => "upload_form", 'enctype' => "multipart/form-data"));
$form->addElement('header', $nameTools);
$form->addLabel(null, Display::img(api_get_path(WEB_IMG_PATH) . 'scorm_logo.jpg'));
$form->addElement('hidden', 'curdirpath', $path);
$form->addElement('hidden', 'tool', $my_tool);
$form->addElement('file', 'user_file', get_lang('FileToUpload'));
$form->add_real_progress_bar('uploadScorm', 'user_file');
$form->addRule('user_file', get_lang('ThisFieldIsRequired'), 'required');
unset($content_origins[0]);
unset($content_origins[1]);
if (api_get_setting('search_enabled') == 'true') {
$form->addElement('checkbox', 'index_document', '', get_lang('SearchFeatureDoIndexDocument'));
$specific_fields = get_specific_field_list();
foreach ($specific_fields as $specific_field) {
$form->addElement('text', $specific_field['code'], $specific_field['name'] . ' : ');
}
}
if (api_is_platform_admin()) {
示例13: show_tools_category
//.........这里部分代码省略.........
}
$tool_link_params = array();
//@todo this visio stuff should be removed
if (strpos($tool['name'], 'visio_') !== false) {
$tool_link_params = array('id' => 'tooldesc_' . $tool["id"], 'href' => '"javascript: void(0);"', 'class' => $class, 'onclick' => 'javascript: window.open(\'' . $tool['link'] . '\',\'window_visio' . $_SESSION['_cid'] . '\',config=\'height=\'+730+\', width=\'+1020+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')', 'target' => $tool['target']);
} elseif (strpos($tool['name'], 'chat') !== false && api_get_course_setting('allow_open_chat_window')) {
$tool_link_params = array('id' => 'tooldesc_' . $tool["id"], 'class' => $class, 'href' => 'javascript: void(0);', 'onclick' => 'javascript: window.open(\'' . $tool['link'] . '\',\'window_chat' . $_SESSION['_cid'] . '\',config=\'height=\'+380+\', width=\'+625+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')', 'target' => $tool['target']);
} else {
if (count(explode('type=classroom', $tool['link'])) == 2 || count(explode('type=conference', $tool['link'])) == 2) {
$tool_link_params = array('id' => 'tooldesc_' . $tool["id"], 'href' => $tool['link'], 'class' => $class, 'target' => '_blank');
} else {
$tool_link_params = array('id' => 'tooldesc_' . $tool["id"], 'href' => $tool['link'], 'class' => $class, 'target' => $tool['target']);
}
}
$tool_name = self::translate_tool_name($tool);
$toolTip = $tool_name;
if (!empty($tool['description'])) {
$toolTip = $tool['description'];
}
$tool_link_params['data-original-title'] = $toolTip;
$tool_link_params['data-toggle'] = 'tooltip';
//$tool_link_params['title'] = $toolTip;
// Including Courses Plugins
// Creating title and the link
if (isset($tool['category']) && $tool['category'] == 'plugin') {
$plugin_info = $app_plugin->get_plugin_info($tool['name']);
if (isset($plugin_info) && isset($plugin_info['title'])) {
$tool_name = $plugin_info['title'];
}
$tool_link_params['href'] = api_get_path(WEB_PLUGIN_PATH) . $tool['original_link'] . '?' . api_get_cidreq();
}
if (!empty($tool['custom_icon'])) {
//self::getCustomIconPath($courseInfo)
$icon = Display::img($tool['image'], null, array('class' => 'tool-icon', 'id' => 'toolimage_' . $tool['id']));
} else {
$image = substr($tool['image'], 0, strpos($tool['image'], '.')) . '.png';
$icon = Display::return_icon($image, null, array('class' => 'tool-icon', 'id' => 'toolimage_' . $tool['id']), ICON_SIZE_BIG, false);
}
$userInfo = api_get_user_info();
$userStatus = isset($userInfo['status']) ? $userInfo['status'] : null;
// Validation when belongs to a session
$session_img = api_get_session_image($tool['session_id'], $userStatus);
$item['url_params'] = $tool_link_params;
$item['icon'] = Display::url($icon, $tool_link_params['href'], $tool_link_params);
$item['tool'] = $tool;
$item['name'] = $tool_name;
$tool_link_params['id'] = 'is' . $tool_link_params['id'];
$item['link'] = Display::url($tool_name . $session_img, $tool_link_params['href'], $tool_link_params);
$items[] = $item;
}
// end of foreach
}
$i = 0;
$html = '';
$counter = 0;
if (!empty($items)) {
foreach ($items as $item) {
switch ($theme) {
case 'activity_big':
$data = '';
if ($counter == 0) {
$html .= $rowDiv;
}
$html .= '<div class="col-xs-4 col-md-4 course-tool">';
$image = substr($item['tool']['image'], 0, strpos($item['tool']['image'], '.')) . '.png';
if (!empty($item['tool']['custom_icon'])) {
示例14: array
$template->assign('gamification_mode', $gamificationMode);
$template->assign('breadcrumb', $breadcrumb);
$template->assign('button_home_url', $buttonHomeUrl);
$template->assign('button_home_text', $buttonHomeText);
$template->assign('navigation_bar', $navigation_bar);
$template->assign('progress_bar', $progress_bar);
$template->assign('show_audio_player', $show_audioplayer);
$template->assign('media_player', $mediaplayer);
$template->assign('toc_list', $get_toc_list);
$template->assign('teacher_toc_buttons', $get_teacher_buttons);
$template->assign('iframe_src', $src);
$template->assign('navigation_bar_bottom', $navigation_bar_bottom);
if ($gamificationMode == 1) {
$template->assign('gamification_stars', $_SESSION['oLP']->getCalculateStars($sessionId));
$template->assign('gamification_points', $_SESSION['oLP']->getCalculateScore($sessionId));
}
$template->assign('lp_preview_image', Display::img($lpPreviewImagePath, $_SESSION['oLP']->name, array('class' => 'img-circle'), ICON_SIZE_BIG));
$template->assign('lp_author', $_SESSION['oLP']->get_author());
$template->assign('lp_mode', $_SESSION['oLP']->mode);
$template->assign('lp_title_scorm', $_SESSION['oLP']->name);
$template->assign('lp_html_toc', $_SESSION['oLP']->get_html_toc($get_toc_list));
$template->assign('lp_id', $_SESSION['oLP']->lp_id);
$template->assign('lp_current_item_id', $_SESSION['oLP']->get_current_item_id());
$content = $template->fetch('default/learnpath/view.tpl');
$template->assign('content', $content);
$template->display_no_layout_template();
// Restore a global setting.
$_setting['show_navigation_menu'] = $save_setting;
if ($debug) {
error_log(' ------- end lp_view.php ------');
}
示例15: showQuestion
//.........这里部分代码省略.........
} else {
if ($answerType == MATCHING || $answerType == UNIQUE_ANSWER_NO_OPTION || $answerType == MULTIPLE_ANSWER_TRUE_FALSE || $answerType == MULTIPLE_ANSWER_COMBINATION_TRUE_FALSE) {
$s .= '</table>';
}
}
$s .= '</div>';
// destruction of the Answer object
unset($objAnswerTmp);
// destruction of the Question object
unset($objQuestionTmp);
if ($origin != 'export') {
echo $s;
} else {
return $s;
}
} elseif ($answerType == HOT_SPOT || $answerType == HOT_SPOT_DELINEATION) {
// Question is a HOT_SPOT
//checking document/images visibility
if (api_is_platform_admin() || api_is_course_admin()) {
require_once api_get_path(LIBRARY_PATH) . 'document.lib.php';
$course = api_get_course_info();
$doc_id = DocumentManager::get_document_id($course, '/images/' . $pictureName);
if (is_numeric($doc_id)) {
$images_folder_visibility = api_get_item_visibility($course, 'document', $doc_id, api_get_session_id());
if (!$images_folder_visibility) {
//This message is shown only to the course/platform admin if the image is set to visibility = false
Display::display_warning_message(get_lang('ChangeTheVisibilityOfTheCurrentImage'));
}
}
}
$questionName = $objQuestionTmp->selectTitle();
$questionDescription = $objQuestionTmp->selectDescription();
if ($freeze) {
echo Display::img($objQuestionTmp->selectPicturePath());
return;
}
// Get the answers, make a list
$objAnswerTmp = new Answer($questionId);
$nbrAnswers = $objAnswerTmp->selectNbrAnswers();
// get answers of hotpost
$answers_hotspot = array();
for ($answerId = 1; $answerId <= $nbrAnswers; $answerId++) {
$answers = $objAnswerTmp->selectAnswerByAutoId($objAnswerTmp->selectAutoId($answerId));
$answers_hotspot[$answers['id']] = $objAnswerTmp->selectAnswer($answerId);
}
// display answers of hotpost order by id
$answer_list = '<div style="padding: 10px; margin-left: 0px; border: 1px solid #A4A4A4; height: 408px; width: 200px;"><b>' . get_lang('HotspotZones') . '</b><dl>';
if (!empty($answers_hotspot)) {
ksort($answers_hotspot);
foreach ($answers_hotspot as $key => $value) {
$answer_list .= '<dt>' . $key . '.- ' . $value . '</dt><br />';
}
}
$answer_list .= '</dl></div>';
if ($answerType == HOT_SPOT_DELINEATION) {
$answer_list = '';
$swf_file = 'hotspot_delineation_user';
$swf_height = 405;
} else {
$swf_file = 'hotspot_user';
$swf_height = 436;
}
if (!$only_questions) {
if ($show_title) {
Testcategory::displayCategoryAndTitle($objQuestionTmp->id);
echo '<div class="question_title">' . $current_item . '. ' . $questionName . '</div>';