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


PHP ExtraFieldValue::getAllValuesForAnItem方法代码示例

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


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

示例1: CoursesController

        }
    }
    $courses[] = ['course' => $sessionCourse, 'description' => $courseDescription, 'tags' => $courseTags, 'objectives' => $courseObjectives, 'topics' => $courseTopics, 'coaches' => $coachesData, 'extra_fields' => $courseValues->getAllValuesForAnItem($sessionCourse->getId())];
}
$sessionDates = SessionManager::parseSessionDates(['display_start_date' => $session->getDisplayStartDate(), 'display_end_date' => $session->getDisplayEndDate(), 'access_start_date' => $session->getAccessStartDate(), 'access_end_date' => $session->getAccessEndDate(), 'coach_access_start_date' => $session->getCoachAccessStartDate(), 'coach_access_end_date' => $session->getCoachAccessEndDate()]);
$sessionRequirements = $sequenceResourceRepo->getRequirements($session->getId(), SequenceResource::SESSION_TYPE);
$hasRequirements = false;
foreach ($sessionRequirements as $sequence) {
    if (!empty($sequence['requirements'])) {
        $hasRequirements = true;
        break;
    }
}
$courseController = new CoursesController();
/* View */
//$template = new Template($session->getName(), true, true, false, true, false);
$template = \Chamilo\CoreBundle\Framework\Container::getTwig();
$template->addGlobal('show_tutor', api_get_setting('session.show_session_coach') === 'true' ? true : false);
$template->addGlobal('pageUrl', api_get_path(WEB_PATH) . "session/{$session->getId()}/about/");
$template->addGlobal('session', $session);
$template->addGlobal('session_date', $sessionDates);
$template->addGlobal('is_subscribed', SessionManager::isUserSubscribedAsStudent($session->getId(), api_get_user_id()));
$template->addGlobal('subscribe_button', $courseController->getRegisteredInSessionButton($session->getId(), $session->getName(), $hasRequirements));
$template->addGlobal('courses', $courses);
$template->addGlobal('essence', \Essence\Essence::instance());
$template->addGlobal('session_extra_fields', $sessionValues->getAllValuesForAnItem($session->getId(), true));
$template->addGlobal('has_requirements', $hasRequirements);
$template->addGlobal('sequences', $sessionRequirements);
//$templateFolder = api_get_configuration_value('default_template');
echo $template->render('@template_style/session/about.html.twig');
//$template->assign('header', $session->getName());
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:31,代码来源:about.php

示例2: api_get_user_info

/**
 * Finds all the information about a user.
 * If no parameter is passed you find all the information about the current user.
 * @param int  $user_id
 * @param bool $checkIfUserOnline
 * @param bool $showPassword
 * @param bool $loadExtraData
 * @param bool $loadOnlyVisibleExtraData Get the user extra fields that are visible
 * @return array $user_info user_id, lastname, firstname, username, email, etc
 * @author Patrick Cool <patrick.cool@UGent.be>
 * @author Julio Montoya
 * @version 21 September 2004
 */
function api_get_user_info($user_id = 0, $checkIfUserOnline = false, $showPassword = false, $loadExtraData = false, $loadOnlyVisibleExtraData = false)
{
    if (empty($user_id)) {
        $userFromSession = Session::read('_user');
        if (isset($userFromSession)) {
            return _api_format_user($userFromSession);
        }
        // @todo trigger an exception here
        return false;
    }
    $sql = "SELECT * FROM " . Database::get_main_table(TABLE_MAIN_USER) . "\n            WHERE id='" . intval($user_id) . "'";
    $result = Database::query($sql);
    if (Database::num_rows($result) > 0) {
        $result_array = Database::fetch_array($result);
        if ($checkIfUserOnline) {
            $use_status_in_platform = UserManager::user_is_online($user_id);
            $result_array['user_is_online'] = $use_status_in_platform;
            $user_online_in_chat = 0;
            if ($use_status_in_platform) {
                $user_status = UserManager::get_extra_user_data_by_field($user_id, 'user_chat_status', false, true);
                if (intval($user_status['user_chat_status']) == 1) {
                    $user_online_in_chat = 1;
                }
            }
            $result_array['user_is_online_in_chat'] = $user_online_in_chat;
        }
        if ($loadExtraData) {
            $fieldValue = new ExtraFieldValue('user');
            $result_array['extra'] = $fieldValue->getAllValuesForAnItem($user_id, $loadOnlyVisibleExtraData);
        }
        $user = _api_format_user($result_array, $showPassword);
        return $user;
    }
    return false;
}
开发者ID:feroli1000,项目名称:chamilo-lms,代码行数:48,代码来源:api.lib.php


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