本文整理汇总了PHP中EfrontUser::isOptionVisible方法的典型用法代码示例。如果您正苦于以下问题:PHP EfrontUser::isOptionVisible方法的具体用法?PHP EfrontUser::isOptionVisible怎么用?PHP EfrontUser::isOptionVisible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EfrontUser
的用法示例。
在下文中一共展示了EfrontUser::isOptionVisible方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: smarty_outputfilter_eF_template_loginToMessageLink
/**
* Replaces occurences of the form #filter:user_login-xxxxx# with a personal message link
*/
function smarty_outputfilter_eF_template_loginToMessageLink($compiled, &$smarty)
{
$access = false;
if (!$GLOBALS['currentUser']->coreAccess['personal_messages'] || $GLOBALS['currentUser']->coreAccess['personal_messages'] == 'change') {
$access = true;
}
if (!EfrontUser::isOptionVisible('messages_student') && $_SESSION['s_type'] == "student") {
$access = false;
}
if (!EfrontUser::isOptionVisible('messages')) {
$access = false;
}
if ($access) {
$new = preg_replace("/#filter:user_login-(.*)#/U", "<span style = \"white-space:nowrap;font-weight:bold\"><a href = \"" . basename($_SERVER['PHP_SELF']) . "?ctg=messages&add=1&recipient=\$1&popup=1\" onclick = \"eF_js_showDivPopup(event, '" . _NEWMESSAGE . "', 2)\" title=\"\\1\" target = \"POPUP_FRAME\">#filter:login-\$1#</a></span>", $compiled);
$new = preg_replace("/#filter:user_loginNoIcon-(.*)#/U", "<a href = \"" . basename($_SERVER['PHP_SELF']) . "?ctg=messages&add=1&recipient=\$1&popup=1\" onclick = \"eF_js_showDivPopup(event, '" . _NEWMESSAGE . "', 2)\" title=\"\\1\" target = \"POPUP_FRAME\">#filter:login-\\1#</a>", $new);
$compiled = $new;
} else {
$new = preg_replace("/#filter:user_login-(.*)#/U", "<span style = \"white-space:nowrap\"><a href = \"javascript:void(0)\" title=\"\\1\">#filter:login-\$1#</a></span>", $compiled);
$new = preg_replace("/#filter:user_loginNoIcon-(.*)#/U", "<a href = \"javascript:void(0)\" title=\"\\1\">\\1</a>", $new);
$compiled = $new;
}
// $compiled = preg_replace_callback("/#filter:user_login-(.*)#/U", 'formatLogin', $compiled);
// $compiled = preg_replace_callback("/#filter:user_loginNoIcon-(.*)#/U", 'formatLogin', $compiled);
return $compiled;
}
示例2: getFirstVisitableNode
public function getFirstVisitableNode($iterator = false)
{
if (!$iterator) {
if (EfrontUser::isOptionVisible('tests')) {
$iterator = new EfrontVisitableAndEmptyFilterIterator(new EfrontNodeFilterIterator(new RecursiveIteratorIterator(new RecursiveArrayIterator($this->tree), RecursiveIteratorIterator::SELF_FIRST)));
//Create a new iterator, so that the internal iterator pointer is not reset
} else {
$iterator = new EfrontVisitableAndEmptyFilterIterator(new EfrontNoTestsFilterIterator(new EfrontNodeFilterIterator(new RecursiveIteratorIterator(new RecursiveArrayIterator($this->tree), RecursiveIteratorIterator::SELF_FIRST))));
//Create a new iterator, so that the internal iterator pointer is not reset
}
}
$iterator->rewind();
//Initialize iterator
return $iterator->current();
}
示例3: HTML_QuickForm_Renderer_ArraySmarty
}
}
$renderer = new HTML_QuickForm_Renderer_ArraySmarty($smarty);
$form->setJsWarnings(_BEFOREJAVASCRIPTERROR, _AFTERJAVASCRIPTERROR);
$form->setRequiredNote(_REQUIREDNOTE);
$form->accept($renderer);
$smarty->assign('T_COMMENTS_FORM', $renderer->toArray());
$smarty->assign("T_HEADER_LOAD_SCRIPTS", array());
$smarty->assign("T_HEADER_EDITOR", $load_editor);
$smarty->assign("T_MESSAGE", $message);
$smarty->assign("T_MESSAGE_TYPE", $message_type);
}
/********************* PEOPLE PAGE ******************/
} else {
if ($_GET['op'] == "people") {
if (EfrontUser::isOptionVisible('func_people') === false) {
eF_redirect(basename($_SERVER['PHP_SELF']) . "?ctg=personal&user=" . $_SESSION['s_login'] . "&op=dashboard&message=" . urlencode(_UNPRIVILEGEDATTEMPT) . "&message_type=failure");
}
if (isset($_GET['ajax'])) {
isset($_GET['limit']) && eF_checkParameter($_GET['limit'], 'uint') ? $limit = $_GET['limit'] : ($limit = 10);
if (isset($_GET['sort']) && eF_checkParameter($_GET['sort'], 'text')) {
$sort = $_GET['sort'];
isset($_GET['order']) && $_GET['order'] == 'desc' ? $order = 'desc' : ($order = 'asc');
} else {
$sort = 'timestamp';
$order = 'asc';
}
if ($_GET['display'] == 2) {
$all_related_users = $currentLesson->getUsers();
$all_related_users = array_keys($all_related_users);
foreach ($all_related_users as $key => $user) {
示例4: getProfileComments
/**
* Get the user profile's comments list
*
* <br/>Example:
* <code>
* $commentsList = $user -> getProfileComments(); //Returns an array with pairs [groups id] => [employee specification for this group]
* </code>
*
* @return array A sorted according to timestamp array of [comment id] => [timestamp, authors_LOGIN, authors_name, authors_surname, data] pairs, or an array of comments
* @since 3.6.0
* @access public
*/
public function getProfileComments()
{
if (EfrontUser::isOptionVisible('func_comments')) {
$result = eF_getTableData("profile_comments JOIN users ON authors_LOGIN = users.login", "profile_comments.id, profile_comments.timestamp, authors_LOGIN, users.name, users.surname, users.avatar, data", "users_LOGIN = '" . $this->user['login'] . "'", "timestamp DESC");
$comments = array();
foreach ($result as $comment) {
$comments[$comment['id']] = $comment;
}
return $comments;
} else {
return array();
}
}
示例5: getMainScripts
$mainScripts = getMainScripts();
$smarty->assign("T_HEADER_MAIN_SCRIPTS", implode(",", $mainScripts));
//Operation/file specific scripts
$loadScripts = array_diff($loadScripts, $mainScripts);
//Clear out duplicates
$smarty->assign("T_HEADER_LOAD_SCRIPTS", implode(",", array_unique($loadScripts)));
//array_unique, so it doesn't send duplicate entries
if (in_array('news', array_merge($positions['leftList'], $positions['rightList'], $positions['centerList']))) {
$smarty->assign("T_NEWS", news::getNews(0, true));
}
if (G_VERSIONTYPE == 'enterprise') {
#cpp#ifdef ENTERPRISE
require_once "../libraries/module_hcd_tools.php";
}
#cpp#endif
if (EfrontUser::isOptionVisible('online_users') && in_array('online', array_merge($positions['leftList'], $positions['rightList'], $positions['centerList']))) {
$smarty->assign("T_ONLINE_USERS_LIST", EfrontUser::getUsersOnline($GLOBALS['configuration']['autologout_time'] * 60));
}
$smarty->assign("T_CURRENT_USER", $currentUser);
$smarty->load_filter('output', 'eF_template_setEditorOffset');
$smarty->display('index.tpl');
} else {
$smarty->load_filter('output', 'eF_template_setEditorOffset');
$smarty->display('index.tpl');
}
$benchmark->set('smarty');
$benchmark->stop();
$output = $benchmark->display();
if (G_DEBUG) {
echo $output;
}
示例6: array
$options['account'] = array('image' => '16x16/user.png', 'title' => _ACCOUNT, 'link' => basename($_SERVER['PHP_SELF']) . '?ctg=personal&user=' . $editedUser->user['login'] . "&op=profile", 'selected' => isset($_GET['op']) && in_array($_GET['op'], $accountOperations) ? true : false);
//administrators don't have a learning aspect
if ($editedUser->user['user_type'] != 'administrator') {
$options['learning'] = array('image' => '16x16/courses.png', 'title' => _LEARNING, 'link' => basename($_SERVER['PHP_SELF']) . '?ctg=personal&user=' . $editedUser->user['login'] . "&op=user_courses", 'selected' => isset($_GET['op']) && in_array($_GET['op'], $learningOperations) ? true : false);
}
if (G_VERSIONTYPE == 'enterprise') {
#cpp#ifdef ENTERPRISE
if ($currentUser->coreAccess['organization'] != 'hidden') {
$options['organization'] = array('image' => '16x16/enterprise.png', 'title' => _MYROLE, 'link' => basename($_SERVER['PHP_SELF']) . '?ctg=personal&user=' . $editedUser->user['login'] . "&op=placements", 'selected' => isset($_GET['op']) && in_array($_GET['op'], $enterpriseOperations) ? true : false);
}
if ($currentUser->user['login'] == $editedUser->user['login'] || $currentUser->user['user_type'] == 'administrator' || $currentEmployee->supervisesEmployee($editedUser->user['login'])) {
$options['files'] = array('image' => '16x16/folder.png', 'title' => _FILES, 'link' => basename($_SERVER['PHP_SELF']) . '?ctg=personal&user=' . $editedUser->user['login'] . "&op=files", 'selected' => isset($_GET['op']) && $_GET['op'] == 'files' ? true : false);
}
}
#cpp#endif
if (!isset($_GET['add_user']) && !$_GET['popup'] && (!isset($_SESSION['missing_fields']) || $currentUser->user['login'] != $editedUser->user['login'])) {
//When inside a popup, we don't want the menu
$smarty->assign("T_TABLE_OPTIONS", $options);
}
// Set facebook template variables
if ($GLOBALS['configuration']['social_modules_activated'] & FB_FUNC_CONNECT) {
if (isset($_SESSION['facebook_user']) && $_SESSION['facebook_user']) {
$smarty->assign("T_OPEN_FACEBOOK_SESSION", 1);
$smarty->assign("T_FACEBOOK_API_KEY", $GLOBALS['configuration']['facebook_api_key']);
$smarty->assign("T_FACEBOOK_SHOULD_UPDATE_STATUS", $_SESSION['facebook_can_update']);
}
$smarty->assign("T_FACEBOOK_ENABLED", 1);
}
if (EfrontUser::isOptionVisible('func_userstatus')) {
$smarty->assign("T_SHOW_USERSTATUS", 1);
}
示例7: getEvents
/**
* Get all events related with this lesson
*
* This function is used to acquire all events related for this lesson,
* according to a topical timeline
*
* <br/>Example:
* <code>
* $lesson -> getEvents(); // Get all events of this lessons from the most recent to the oldest
* </code>
*
* @param $topic_ID the id of the topic to which the return events for the timeline should belong
* @param $returnObjects whether to return event objects or not
* @param $avatarSize the normalization size for the avatar images
* @param $limit maximum number of events to return
* @return boolean true/false
* @since 3.6.0
* @access public
*/
public function getEvents($topic_ID = false, $returnObjects = false, $avatarSize = 0, $limit = false)
{
if (!EfrontUser::isOptionVisible('lessons_timeline')) {
return array();
}
if ($topic_ID) {
// only current lesson users
$users = $this->getUsers();
$users_logins = array_keys($users);
if ($_SESSION['s_type'] != 'administrator' && $_SESSION['s_current_branch']) {
//this applies to supervisors only
// don't mix with course events - with courses_ID = $this->lesson['id']
$related_events = eF_getTableData("events, module_hcd_employee_works_at_branch ewb", "events.*", "ewb.branch_ID= " . $_SESSION['s_current_branch'] . " and events.users_LOGIN=ewb.users_login and type = '" . EfrontEvent::NEW_POST_FOR_LESSON_TIMELINE_TOPIC . "' AND entity_ID = '" . $topic_ID . "' AND lessons_ID = '" . $this->lesson['id'] . "' AND events.users_LOGIN IN ('" . implode("','", $users_logins) . "') AND (type < 50 OR type >74)", "timestamp desc", "", $limit ? $limit * 5 : null);
} else {
// don't mix with course events - with courses_ID = $this->lesson['id']
$related_events = eF_getTableData("events, module_hcd_employee_works_at_branch ewb", "events.*", "ewb.branch_ID= " . $_SESSION['s_current_branch'] . " and events.users_LOGIN=ewb.users_login and type = '" . EfrontEvent::NEW_POST_FOR_LESSON_TIMELINE_TOPIC . "' AND entity_ID = '" . $topic_ID . "' AND lessons_ID = '" . $this->lesson['id'] . "' AND events.users_LOGIN IN ('" . implode("','", $users_logins) . "') AND (type < 50 OR type >74)", "timestamp desc", "", $limit ? $limit * 5 : null);
}
} else {
// only current lesson users
$users = $this->getUsers();
$users_logins = array_keys($users);
// if ($limit) {
// $related_events = eF_getTableData("events", "*", "lessons_ID = '". $this->lesson['id']."' AND users_LOGIN IN ('".implode("','", $users_logins)."')", "timestamp desc LIMIT " . $limit);
//
// } else {
if ($_SESSION['s_type'] != 'administrator' && $_SESSION['s_current_branch']) {
//this applies to supervisors only
$related_events = eF_getTableData("events, module_hcd_employee_works_at_branch ewb", "events.*", "ewb.branch_ID= " . $_SESSION['s_current_branch'] . " and events.users_LOGIN=ewb.users_login and lessons_ID = '" . $this->lesson['id'] . "' AND events.users_LOGIN IN ('" . implode("','", $users_logins) . "') AND (type < 50 OR type >74)\t", "timestamp desc", "", $limit ? $limit * 5 : null);
} else {
$related_events = eF_getTableData("events", "events.*", "lessons_ID = '" . $this->lesson['id'] . "' AND events.users_LOGIN IN ('" . implode("','", $users_logins) . "') AND (type < 50 OR type >74)\t", "timestamp desc", "", $limit ? $limit * 5 : null);
}
// }
}
if (!isset($avatarSize) || $avatarSize <= 0) {
$avatarSize = 25;
}
$prev_event = false;
$count = 0;
$filtered_related_events = array();
foreach ($related_events as $key => $event) {
$user = $users[$event['users_LOGIN']];
$filtered_related_events[$key] = $event;
try {
$file = new EfrontFile($user['avatar']);
$filtered_related_events[$key]['avatar'] = $user['avatar'];
list($filtered_related_events[$key]['avatar_width'], $filtered_related_events[$key]['avatar_height']) = eF_getNormalizedDims($file['path'], $avatarSize, $avatarSize);
} catch (EfrontfileException $e) {
$filtered_related_events[$key]['avatar'] = G_SYSTEMAVATARSPATH . "unknown_small.png";
$filtered_related_events[$key]['avatar_width'] = $avatarSize;
$filtered_related_events[$key]['avatar_height'] = $avatarSize;
}
// Logical combination of events
if ($prev_event) {
// since we have decreasing chronological order we now that $event['timestamp'] < $prev_event['timestamp']
if ($event['users_LOGIN'] == $prev_event['event']['users_LOGIN'] && $event['type'] == $prev_event['event']['type'] && $prev_event['event']['timestamp'] - $event['timestamp'] < EfrontEvent::SAME_USER_INTERVAL) {
unset($filtered_related_events[$prev_event['key']]);
$count--;
}
}
$prev_event = array("key" => $key, "event" => $event);
if ($limit && ++$count == $limit) {
break;
}
}
if ($returnObjects) {
$eventObjects = array();
foreach ($filtered_related_events as $event) {
$eventObjects[] = new EfrontEvent($event);
}
return $eventObjects;
} else {
return $filtered_related_events;
}
}
示例8: explode
$pdfId = explode("=", $matches[0]);
if (isset($pdfId[1])) {
$options[] = array('text' => _VIEWPDFINIOS, 'image' => "others/ios.png", 'href' => "javascript:void(0)", 'onclick' => "window.open('view_file.php?file=" . $pdfId[1] . "')");
} else {
preg_match("#content/lessons/.*\\.pdf#", $currentUnit['data'], $matches);
$options[] = array('text' => _VIEWPDFINIOS, 'image' => "others/ios.png", 'href' => "javascript:void(0)", 'onclick' => "window.open('view_file.php?file=" . $matches[0] . "')");
//pr($matches);
}
}
if ($_student_ && $currentLesson->options['content_report'] && $ruleCheck) {
$options[] = array('text' => _CONTENTREPORT, 'image' => "16x16/warning.png", 'href' => "content_report.php?" . http_build_query($_GET), 'onclick' => "eF_js_showDivPopup(event, '" . _CONTENTREPORT . "', 1)", "target" => "POPUP_FRAME");
}
if ($currentLesson->options['bookmarking'] && EfrontUser::isOptionVisible('bookmarks') && $ruleCheck) {
$options[] = array('text' => _ADDTHISPAGETOYOURBOOKMARKS, 'image' => "16x16/bookmark_add.png", 'onclick' => "addBookmark(this)");
}
if (EfrontUser::isOptionVisible('comments') && $ruleCheck) {
$options[] = array('text' => _ADDCOMMENT, 'image' => "16x16/comment_add.png", 'href' => basename($_SERVER['PHP_SELF']) . "?ctg=comments&view_unit=" . $_GET['view_unit'] . "&add=1&popup=1", 'onclick' => "eF_js_showDivPopup(event, '" . _ADDCOMMENT . "', 1)", "target" => "POPUP_FRAME");
}
//$options[] = array('text' => "open window", 'image' => "16x16/add.png", 'href' => basename($_SERVER['PHP_SELF'])."?ctg=content&view_unit=".$_GET['view_unit']."&bare=1&popup=1", 'onclick' => "window.open('about:blank', 'testme', 'width=800, height=600')", "target" => "testme");
if (G_VERSIONTYPE != 'community') {
#cpp#ifndef COMMUNITY
if (G_VERSIONTYPE != 'standard') {
#cpp#ifndef STANDARD
$scorm2004 = in_array($currentUnit['scorm_version'], EfrontContentTreeSCORM::$scorm2004Versions);
if ($scorm2004) {
//This means that the content will not start automatically, so a handle must appear to prompt for user selection
if ($scormState['start'] == 'disabled') {
$smarty->assign("T_NO_START", true);
unset($treeOptions['selectedNode']);
//$treeOptions['expand'] = true;
$treeOptions['show_hide'] = false;
示例9: EfrontBranch
<?php
if (str_replace(DIRECTORY_SEPARATOR, "/", __FILE__) == $_SERVER['SCRIPT_FILENAME']) {
exit;
}
if (!$currentUser->coreAccess['forum'] || $currentUser->coreAccess['forum'] == 'change') {
$_change_ = 1;
}
try {
if ($_SESSION['s_type'] != 'administrator' && $_SESSION['s_current_branch']) {
//this applies to supervisors only
$currentBranch = new EfrontBranch($_SESSION['s_current_branch']);
}
if (!EfrontUser::isOptionVisible('forum')) {
eF_redirect(basename($_SERVER['PHP_SELF']) . "?ctg=control_panel&message=" . urlencode(_UNAUTHORIZEDACCESS) . "&message_type=failure");
}
$loadScripts[] = 'includes/forum';
$roles = EfrontUser::getRoles(true);
$smarty->assign("T_USERROLES", $roles);
$forums = f_forums::getAll("f_forums");
foreach ($forums as $value) {
$forums_to_lessons[$value['lessons_ID']] = $value['id'];
}
$lessons = EFrontLesson::getLessons(false, true);
$res = eF_getTableData("lessons", "id,options");
foreach ($res as $value) {
$options = unserialize($value['options']);
if (!empty($options) && !$options['forum']) {
unset($forums[$forums_to_lessons[$value['id']]]);
}
}
示例10: basename
<?php
//This file cannot be called directly, only included.
if (str_replace(DIRECTORY_SEPARATOR, "/", __FILE__) == $_SERVER['SCRIPT_FILENAME']) {
exit;
}
$load_editor = true;
if (!EfrontUser::isOptionVisible('news')) {
eF_redirect("" . basename($_SERVER['PHP_SELF']) . "?ctg=control_panel&message=" . urlencode(_UNAUTHORIZEDACCESS) . "&message_type=failure");
}
//Create shorthands for user access rights, to avoid long variable names
!isset($currentUser->coreAccess['news']) || $currentUser->coreAccess['news'] == 'change' ? $_change_ = 1 : ($_change_ = 0);
if (isset($_GET['lessons_ID'])) {
if ($currentUser->user['user_type'] != 'administrator') {
$eligibleLessons = $currentUser->getEligibleLessons();
}
if (in_array($_GET['lessons_ID'], array_keys($eligibleLessons)) || $currentUser->user['user_type'] == 'administrator') {
$lessonId = $_GET['lessons_ID'];
} else {
$lessonId = array_keys($eligibleLessons);
}
} else {
$lessonId = $currentLesson->lesson['id'];
}
if ($_admin_) {
$news = news::getNews(0);
} else {
if ($_professor_ || $_student_) {
$news = news::getNews(0, true);
if ($_professor_) {
$lessonNews = news::getNews($lessonId, false);
示例11: elseif
$_student_ = $_professor_ = $_admin_ = 0;
if ($_SESSION['s_lesson_user_type'] == 'student') {
$_student_ = 1;
} else {
if ($_SESSION['s_lesson_user_type'] == 'professor') {
$_professor_ = 1;
}
}
//Create shorthands for user access rights, to avoid long variable names
$_change_ = $_hidden_ = 0;
if (!isset($currentUser->coreAccess['content']) || $currentUser->coreAccess['content'] == 'change') {
$_change_ = 1;
} elseif (isset($currentUser->coreAccess['content']) && $currentUser->coreAccess['content'] == 'hidden') {
$_hidden_ = 1;
}
if (!EfrontUser::isOptionVisible('projects')) {
eF_redirect(basename($_SERVER['PHP_SELF']) . "?ctg=control_panel&message=" . urlencode(_UNAUTHORIZEDACCESS) . "&message_type=failure");
}
if (!$currentLesson) {
eF_redirect("" . basename($_SERVER['PHP_SELF']));
}
if ($_hidden_) {
eF_redirect("" . basename($_SERVER['PHP_SELF']) . "?ctg=control_panel&message=" . urlencode(_UNAUTHORIZEDACCESS) . "&message_type=failure");
}
try {
$_professor_ ? $projects = $currentLesson->getProjects(true) : ($projects = $currentLesson->getProjects(true, $currentUser->user['login']));
} catch (Exception $e) {
$smarty->assign("T_EXCEPTION_TRACE", $e->getTraceAsString());
$message = _SOMEPROBLEMOCCURED . ': ' . $e->getMessage() . ' (' . $e->getCode() . ') <a href = "javascript:void(0)" onclick = "eF_js_showDivPopup(event, \'' . _ERRORDETAILS . '\', 2, \'error_details\')">' . _MOREINFO . '</a>';
$message_type = 'failure';
}
示例12: array
if ($GLOBALS['configuration']['time_reports']) {
$tag = _ACTIVETIMEINLESSON;
$val = $user['active_time_in_lesson']['time_string'];
} else {
$tag = _TIMEINLESSON;
$val = $user['time_in_lesson']['time_string'];
}
$data[] = array(_USER => formatLogin($user['login']), $tag => $val, _REGISTRATIONDATE => formatTimestamp($user['timestamp']), _CONTENT => formatScore($user['overall_progress']['percentage']) . "%", _TESTS => formatScore($user['test_status']['mean_score']) . "%", _PROJECTS => formatScore($user['project_status']['mean_score']) . "%", _COMPLETED => $user['completed'] ? _YES . ', ' . _ON . ' ' . formatTimestamp($user['timestamp_completed']) : _NO, _SCORE => formatScore($user['score']) . "%", _LASTLOGIN => formatTimestamp($user['last_login'], true));
}
$pdf->printDataSection(_USERSINFO, $data, $formatting);
$data = array();
foreach ($professors as $user) {
$data[] = array(_USER => formatLogin($user['login']), _REGISTRATIONDATE => formatTimestamp($user['timestamp']));
}
$pdf->printDataSection(_PROFESSORSINFO, $data, $formatting);
if (EfrontUser::isOptionVisible('tests')) {
$formatting = array(_USER => array('width' => '25%', 'fill' => false), _SCORE => array('width' => '15%', 'fill' => false));
foreach ($testsInfo as $id => $info) {
$data = array();
foreach ($info['done'] as $results) {
$avgScore[] = $results['active_score'] ? $results['active_score'] : $results['score'];
$data[] = array(_USER => formatLogin($results['users_LOGIN']), _SCORE => formatScore(round($results['active_score'] ? $results['active_score'] : $results['score'], 2)) . "%");
}
if (!empty($data)) {
$data[] = array(_USER => _AVERAGESCORE, _SCORE => formatScore(round(array_sum($avgScore) / sizeof($avgScore), 2)) . "%");
}
$pdf->printDataSection(_TESTSINFORMATION . ': ' . $info['general']['name'], $data, $formatting);
}
if (sizeof($lessonQuestions) > 0) {
$formatting = array(_QUESTION => array('width' => '50%', 'fill' => false), _QUESTIONTYPE => array('width' => '20%', 'fill' => false), _DIFFICULTY => array('width' => '10%', 'fill' => false, 'align' => 'C'), _TIMESDONE => array('width' => '10%', 'fill' => false, 'align' => 'C'), _AVERAGESCORE => array('width' => '10%', 'fill' => false, 'align' => 'C'));
$data = array();
示例13: str_replace
$value = str_replace("\n", "<br />", $value);
switch ($key) {
case 'language':
$GLOBALS['configuration']['onelanguage'] or $tooltipInfo[] = '<div class = "infoEntry"><span>' . _LANGUAGE . "</span><span>: {$languages[$value]}</span></div>";
break;
case 'professors':
$tooltipInfo[] = '<div class = "infoEntry"><span>' . _PROFESSORS . "</span><span>: {$value}</span></div>";
break;
case 'content':
$tooltipInfo[] = '<div class = "infoEntry"><span>' . _CONTENTUNITS . "</span><span>: {$value}</span></div>";
break;
case 'tests':
EfrontUser::isOptionVisible('tests') ? $tooltipInfo[] = '<div class = "infoEntry"><span>' . _TESTS . "</span><span>: {$value}</span></div>" : null;
break;
case 'projects':
EfrontUser::isOptionVisible('projects') ? $tooltipInfo[] = '<div class = "infoEntry"><span>' . _PROJECTS . "</span><span>: {$value}</span></div>" : null;
break;
case 'course_dependency':
$tooltipInfo[] = '<div class = "infoEntry"><span>' . _DEPENDSON . "</span><span>: {$value}</span></div>";
break;
case 'from_timestamp':
$tooltipInfo[] = '<div class = "infoEntry"><span>' . _AVAILABLEFROM . "</span><span>: " . formatTimestamp($value, 'time_nosec') . "</span></div>";
break;
case 'to_timestamp':
$tooltipInfo[] = '<div class = "infoEntry"><span>' . _AVAILABLEUNTIL . "</span><span>: " . formatTimestamp($value, 'time_nosec') . "</span></div>";
break;
case 'general_description':
$tooltipInfo[] = '<div class = "infoEntry"><span>' . _DESCRIPTION . "</span><span>: {$value}</span></div>";
break;
case 'assessment':
$tooltipInfo[] = '<div class = "infoEntry"><span>' . _ASSESSMENT . "</span><span>: {$value}</span></div>";
示例14: HTML_QuickForm
$form = new HTML_QuickForm("complete_lesson_form", "post", basename($_SERVER['PHP_SELF']) . '?ctg=rules&tab=conditions&' . $post_target, "", null, true);
$form->registerRule('checkParameter', 'callback', 'eF_checkParameter');
//Register this rule for checking user input with our function, eF_checkParameter
$form->registerRule('in_array', 'callback', 'in_array');
$testsIterator = new EfrontTestsFilterIterator(new EfrontNodeFilterIterator(new RecursiveIteratorIterator(new RecursiveArrayIterator($currentContent->tree), RecursiveIteratorIterator::SELF_FIRST), array('active' => 1)));
$testUnits = $currentContent->toHTMLSelectOptions($testsIterator);
$contentIterator = new EfrontContentFeedbackFilterIterator(new EfrontNodeFilterIterator(new RecursiveIteratorIterator(new RecursiveArrayIterator($currentContent->tree), RecursiveIteratorIterator::SELF_FIRST), array('active' => 1)));
//Get active units that are anything but tests (false negates both rules)
$noTestUnits = $currentContent->toHTMLSelectOptions($contentIterator);
if (!empty($noTestUnits)) {
$form->addElement('select', 'specific_unit', null, $noTestUnits, 'class = "inputSelect"');
$form->addRule('specific_unit', _INVALIDID, 'numeric', null, 'client');
} else {
unset($condition_types['specific_unit']);
}
if (!empty($testUnits) && EfrontUser::isOptionVisible('tests')) {
$form->addElement('select', 'specific_test', null, $testUnits, 'class = "inputSelect"');
$form->addRule('specific_test', _INVALIDID, 'numeric', null, 'client');
} else {
unset($condition_types['specific_test']);
}
$form->addElement('select', 'condition_types', null, $condition_types, 'class = "inputSelect" onchange = "selectCondition(this)"');
$form->addRule('condition_types', _INVALIDCONDITION, 'in_array', array_keys($condition_types));
$form->addElement('text', 'percentage_units', null, 'style = "width:2.5em"');
$form->setDefaults(array('percentage_units' => 50));
$form->addRule('percentage_units', _THEFIELD . ' ' . _ISMANDATORY, 'required', null, 'client');
$form->addRule('percentage_units', _INVALIDPERCENTAGE, 'numeric');
$form->addElement('text', 'time_in_lesson', _MINUTES, 'style = "width:5em"');
$form->addRule('time_in_lesson', _INVALIDDATA, 'numeric', null, 'client');
$form->addElement('select', 'relation', null, array('and' => _AND, 'or' => _OR));
$form->addElement('submit', 'submit_complete_lesson_condition', _SUBMIT, 'class = "flatButton"');
示例15: urlencode
<?php
if (str_replace(DIRECTORY_SEPARATOR, "/", __FILE__) == $_SERVER['SCRIPT_FILENAME']) {
exit;
}
if (!EfrontUser::isOptionVisible('progress')) {
eF_redirect(basename($_SERVER['PHP_SELF']) . "?ctg=control_panel&message=" . urlencode(_UNAUTHORIZEDACCESS) . "&message_type=failure");
exit;
}
$loadScripts[] = 'includes/progress';
$loadScripts[] = 'includes/datepicker/datepicker';
if ($_student_) {
$currentUser->coreAccess['progress'] = 'view';
$_GET['edit_user'] = $currentUser->user['login'];
$smarty->assign("T_STUDENT_ROLE", true);
}
if (isset($_GET['edit_user']) && eF_checkParameter($_GET['edit_user'], 'login')) {
$editedUser = EfrontUserFactory::factory($_GET['edit_user']);
$load_editor = true;
//$lessonUser = EfrontUserFactory :: factory($_GET['edit_user']);
//Check conditions
$currentContent = new EfrontContentTree($currentLesson);
$seenContent = EfrontStats::getStudentsSeenContent($currentLesson->lesson['id'], $editedUser->user['login']);
$conditions = $currentLesson->getConditions();
foreach ($iterator = new EfrontVisitableFilterIterator(new EfrontNodeFilterIterator(new RecursiveIteratorIterator(new RecursiveArrayIterator($currentContent->tree), RecursiveIteratorIterator::SELF_FIRST))) as $key => $value) {
$visitableContentIds[$key] = $key;
//Get the not-test unit ids for this content
}
foreach ($iterator = new EfrontTestsFilterIterator(new EfrontVisitableFilterIterator(new EfrontNodeFilterIterator(new RecursiveIteratorIterator(new RecursiveArrayIterator($currentContent->tree), RecursiveIteratorIterator::SELF_FIRST)))) as $key => $value) {
$testsIds[$key] = $key;
//Get the not-test unit ids for this content