当前位置: 首页>>代码示例>>PHP>>正文


PHP EfrontLesson::getInformation方法代码示例

本文整理汇总了PHP中EfrontLesson::getInformation方法的典型用法代码示例。如果您正苦于以下问题:PHP EfrontLesson::getInformation方法的具体用法?PHP EfrontLesson::getInformation怎么用?PHP EfrontLesson::getInformation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EfrontLesson的用法示例。


在下文中一共展示了EfrontLesson::getInformation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: EfrontLesson

<?php

session_cache_limiter('none');
session_start();
$path = "../libraries/";
include_once $path . "configuration.php";
header("Cache-Control: no-cache, must-revalidate");
// HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// Date in the past
try {
    $languages = EfrontSystem::getLanguages(true);
    if (isset($_GET['lessons_ID']) && eF_checkParameter($_GET['lessons_ID'], 'id')) {
        $lesson = new EfrontLesson($_GET['lessons_ID']);
        $lessonInformation = $lesson->getInformation();
        //$lessonInformation['language'] = $languages[$lesson -> lesson['languages_NAME']];
        if ($lessonInformation['professors']) {
            foreach ($lessonInformation['professors'] as $value) {
                $professorsString[] = formatLogin($value['login']);
            }
            $lessonInformation['professors'] = implode(", ", $professorsString);
        }
        $lesson->lesson['price'] ? $priceString = formatPrice($lesson->lesson['price'], array($lesson->options['recurring'], $lesson->options['recurring_duration']), true) : ($priceString = false);
        $lessonInformation['price_string'] = $priceString;
        if ($lesson->lesson['max_users']) {
            $lessonInformation['max_users'] = $lesson->lesson['max_users'];
            $lessonInformation['seats_remaining'] = $lesson->lesson['max_users'] - sizeof($lesson->getStudentUsers());
            $lessonInformation['seats_remaining'] >= 0 or $lessonInformation['seats_remaining'] = 0;
        }
        //    if (!$lessonInformation['price']) {
        //        unset($lessonInformation['price_string']);
开发者ID:jiangjunt,项目名称:efront_open_source,代码行数:31,代码来源:ask_information.php

示例2: askInformation

function askInformation()
{
    try {
        if (isset($_GET['lessons_ID']) && eF_checkParameter($_GET['lessons_ID'], 'id')) {
            $lesson = new EfrontLesson($_GET['lessons_ID']);
            $lessonInformation = $lesson->getInformation();
            $languages = EfrontSystem::getLanguages(true);
            //$lessonInformation['language'] = $languages[$lesson -> lesson['languages_NAME']];
            if ($lessonInformation['professors']) {
                foreach ($lessonInformation['professors'] as $value) {
                    $professorsString[] = $value['name'] . ' ' . $value['surname'];
                }
                $lessonInformation['professors'] = implode(", ", $professorsString);
            }
            $lesson->lesson['price'] ? $priceString = formatPrice($lesson->lesson['price'], array($lesson->options['recurring'], $lesson->options['recurring_duration']), true) : ($priceString = false);
            $lessonInformation['price_string'] = $priceString;
            //    if (!$lessonInformation['price']) {
            //        unset($lessonInformation['price_string']);
            //    }
            try {
                if ($_GET['from_course']) {
                    $course = new EfrontCourse($_GET['from_course']);
                    $schedule = $course->getLessonScheduleInCourse($lesson);
                    if ($schedule['start_date'] || $schedule['end_date']) {
                        $lessonInformation['from_timestamp'] = $schedule['start_date'];
                        $lessonInformation['to_timestamp'] = $schedule['end_date'];
                    } else {
                        $lessonInformation['from_timestamp'] = $schedule['active_in_lesson'] + 24 * 60 * 60 * $schedule['start_period'];
                        $lessonInformation['to_timestamp'] = $lessonInformation['from_timestamp'] + 24 * 60 * 60 * $schedule['end_period'];
                    }
                }
            } catch (Exception $e) {
            }
            foreach ($lessonInformation as $key => $value) {
                if ($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>";
                            break;
                        case 'objectives':
                            $tooltipInfo[] = '<div class = "infoEntry"><span>' . _OBJECTIVES . "</span><span>: {$value}</span></div>";
                            break;
                        case 'lesson_topics':
                            $tooltipInfo[] = '<div class = "infoEntry"><span>' . _LESSONTOPICS . "</span><span>: {$value}</span></div>";
                            break;
                        case 'resources':
                            $tooltipInfo[] = '<div class = "infoEntry"><span>' . _RESOURCES . "</span><span>: {$value}</span></div>";
                            break;
                        case 'other_info':
                            $tooltipInfo[] = '<div class = "infoEntry"><span>' . _OTHERINFO . "</span><span>: {$value}</span></div>";
                            break;
                        case 'price_string':
                            !$lesson->lesson['course_only'] ? $tooltipInfo[] = '<div class = "infoEntry"><span>' . _PRICE . "</span><span>: {$value}</span></div>" : null;
                            break;
                        default:
                            break;
                    }
                }
            }
            if ($string = implode("", $tooltipInfo)) {
                echo $string;
            } else {
                echo _NODATAFOUND;
            }
        }
        if (isset($_GET['courses_ID']) && eF_checkParameter($_GET['courses_ID'], 'id')) {
            $course = new EfrontCourse($_GET['courses_ID']);
            $courseInformation = $course->getInformation();
            $languages = EfrontSystem::getLanguages(true);
            if ($courseInformation['professors']) {
                foreach ($courseInformation['professors'] as $value) {
                    $professorsString[] = $value['name'] . ' ' . $value['surname'];
                }
//.........这里部分代码省略.........
开发者ID:bqq1986,项目名称:efront,代码行数:101,代码来源:ask.php


注:本文中的EfrontLesson::getInformation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。