本文整理汇总了PHP中get_conf函数的典型用法代码示例。如果您正苦于以下问题:PHP get_conf函数的具体用法?PHP get_conf怎么用?PHP get_conf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_conf函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: renderContent
public function renderContent()
{
global $platformLanguage;
$out = '';
// Last user action
$lastUserAction = isset($_SESSION['last_action']) && $_SESSION['last_action'] != '1970-01-01 00:00:00' ? $_SESSION['last_action'] : date('Y-m-d H:i:s');
$userCommands = array();
// User commands
// 'Create Course Site' command. Only available for teacher.
if (claro_is_allowed_to_create_course()) {
$userCommands[] = '<a href="' . claro_htmlspecialchars(Url::Contextualize(get_path('clarolineRepositoryWeb') . 'course/create.php')) . '" class="userCommandsItem">' . '<img src="' . get_icon_url('courseadd') . '" alt="" /> ' . get_lang('Create a course site') . '</a>' . "\n";
} elseif ($GLOBALS['currentUser']->isCourseCreator) {
$userCommands[] = '<span class="userCommandsItemDisabled">' . '<img src="' . get_icon_url('courseadd') . '" alt="" /> ' . get_lang('Create a course site') . '</span>' . "\n";
}
if (get_conf('allowToSelfEnroll', true)) {
$userCommands[] = '<a href="' . claro_htmlspecialchars(Url::Contextualize(get_path('clarolineRepositoryWeb') . 'auth/courses.php?cmd=rqReg&categoryId=0')) . '" class="userCommandsItem">' . '<img src="' . get_icon_url('enroll') . '" alt="" /> ' . get_lang('Enrol on a new course') . '</a>' . "\n";
$userCommands[] = '<a href="' . claro_htmlspecialchars(Url::Contextualize(get_path('clarolineRepositoryWeb') . 'auth/courses.php?cmd=rqUnreg')) . '" class="userCommandsItem">' . '<img src="' . get_icon_url('unenroll') . '" alt="" /> ' . get_lang('Remove course enrolment') . '</a>' . "\n";
}
$userCommands[] = '<a href="' . claro_htmlspecialchars(Url::Contextualize(get_path('clarolineRepositoryWeb') . 'course/platform_courses.php')) . '" class="userCommandsItem">' . '<img src="' . get_icon_url('course') . '" alt="" /> ' . get_lang('All platform courses') . '</a>' . "\n";
$userCommands[] = '<a href="' . claro_htmlspecialchars(Url::Contextualize(get_path('clarolineRepositoryWeb') . 'notification_date.php')) . '" class="userCommandsItem">' . '<img class="iconDefinitionList" src="' . get_icon_url('hot') . '" alt="' . get_lang('New items') . '" />' . ' ' . get_lang('New items') . ' ' . get_lang('to another date') . (substr($lastUserAction, strlen($lastUserAction) - 8) == '00:00:00' ? ' [' . claro_html_localised_date(get_locale('dateFormatNumeric'), strtotime($lastUserAction)) . ']' : '') . '</a>' . "\n";
$userCourseList = render_user_course_list();
$userCourseListDesactivated = render_user_course_list_desactivated();
$out .= '<div class="userCommands">' . '<h2>' . get_lang('Manage my courses') . '</h2>' . claro_html_list($userCommands) . '</div>' . '<div class="userCourseList">' . '<h2>' . get_lang('My course list') . '</h2>' . $userCourseList;
if (!empty($userCourseListDesactivated)) {
$out .= '<h4>' . get_lang('Deactivated course list') . '</h4>' . $userCourseListDesactivated;
}
$out .= '</div>';
/*'</td>'
. '</tr>'
. '</tbody>'
. '</table>'*/
$this->content = $out;
return $this->content;
}
开发者ID:rhertzog,项目名称:lcs,代码行数:34,代码来源:mycourselist.class.php
示例2: render
/**
* Render content
*/
public function render()
{
CssLoader::getInstance()->load('profile', 'all');
load_kernel_config('user_profile');
$userData = user_get_properties($this->userId);
$pictureUrl = '';
if (get_conf('allow_profile_picture')) {
$picturePath = user_get_picture_path($userData);
if ($picturePath && file_exists($picturePath)) {
$pictureUrl = user_get_picture_url($userData);
} else {
$pictureUrl = get_icon_url('nopicture');
}
}
$userFullName = claro_htmlspecialchars(get_lang('%firstName %lastName', array('%firstName' => $userData['firstname'], '%lastName' => $userData['lastname'])));
$dock = new ClaroDock('userProfileBox');
$template = new CoreTemplate('user_profilebox.tpl.php');
$template->assign('userId', $this->userId);
$template->assign('pictureUrl', $pictureUrl);
$template->assign('userFullName', $userFullName);
$template->assign('dock', $dock);
$template->assign('condensedMode', $this->condensedMode);
$template->assign('userData', $userData);
return $template->render();
}
开发者ID:rhertzog,项目名称:lcs,代码行数:28,代码来源:userprofilebox.lib.php
示例3: db_init
function db_init($db_group = 'default')
{
IS_DB_ACTIVE or show_error('please check your database configration');
//数据库资源
$db = false;
$db_username = '';
$db_passwd = '';
$db_database = '';
$db_host = 'localhost';
$db_port = '3306';
$db_conf = get_conf('db_conf');
$charset = str_replace('-', '', CHARSET);
//将 utf-8 切换为 utf8
if (!$db_conf) {
show_error('none valid database configration!');
} else {
if (!array_key_exists($db_group, $db_conf)) {
show_error("invalid database group '{$db_group}' called!");
} else {
extract($db_conf[$db_group]);
$db = new mysqli($db_host, $db_username, $db_passwd, $db_database, $db_port);
if ($db->connect_errno) {
$error_msg = convert_str('database established error - error code: ' . $db->connect_errno . " | " . 'error msg: ' . $db->connect_error);
show_error($error_msg);
} else {
$db->set_charset($charset);
//由 set names xxx 升级为该行
}
}
}
return $db;
}
开发者ID:laiello,项目名称:whitephp,代码行数:32,代码来源:db.php
示例4: export
public function export()
{
$postsList = $this->loadTopic($this->getTopicId());
$topicInfo = get_topic_settings($this->getTopicId());
$this->createPDF($topicInfo['topic_title']);
$this->pdf->AddPage();
$htmlContent = '<p>' . "\n" . '<table cellspacing="0" cellpadding="2" border="1">' . "\n" . '<tbody>' . "\n" . '<tr>' . "\n" . '<th colspan="2" style="font-weight: bold; background-color: #EDF1E3; color: #669933; border-bottom: 1px solid #96BB7A;">' . claro_utf8_encode($topicInfo['topic_title']) . '</th>' . '</tr>' . "\n";
foreach ($postsList as $post) {
$htmlContent .= '<tr>' . "\n" . '<td style="width: 150px; background-color: #EEEEEE;">' . "\n" . '<div style="font-weight: bold;">' . claro_utf8_encode($post['firstname'] . ' ' . $post['lastname'], get_conf('charset')) . '</div>' . "\n" . '<small>' . claro_html_localised_date(get_locale('dateTimeFormatLong'), datetime_to_timestamp($post['post_time'])) . '</small>' . "\n" . '</td>' . "\n" . '<td style="width: 354px;">' . claro_utf8_encode(claro_parse_user_text(strip_tags($post['post_text'])), get_conf('charset')) . '</td>' . "\n" . '</tr>' . "\n";
}
$htmlContent .= '</tbody>' . "\n" . '</table>' . "\n" . '</p>';
//exit( claro_utf8_decode($htmlContent) );
$this->pdf->writeHTML($htmlContent, true, 0, true, 0);
switch ($this->output) {
case 'screen':
$this->pdf->Output(claro_utf8_encode($topicInfo['topic_id'] . '_' . $topicInfo['topic_title'] . '.pdf'), 'D');
break;
default:
$path = get_conf('rootSys') . get_conf('tmpPathSys') . '/forum_export/';
claro_mkdir($path);
$this->pdf->Output($path . claro_utf8_encode(replace_dangerous_char($topicInfo['topic_id'] . '_' . $topicInfo['topic_title']) . '.pdf'), 'F');
break;
}
return true;
}
开发者ID:rhertzog,项目名称:lcs,代码行数:25,代码来源:export.pdf.class.php
示例5: get_textzone_file_path
/**
* Build the file path of a textzone in a given context
*
* @param string $key
* @param array $context specify the context to build the path.
* @param array $right specify an array of right to specify the file
* @return file path
*/
public static function get_textzone_file_path($key, $context = null, $right = null)
{
$textZoneFile = null;
$key .= '.';
if (!is_null($right) && is_array($right)) {
foreach ($right as $context => $rightInContext) {
if (is_array($rightInContext)) {
$key .= $context . '_';
foreach ($rightInContext as $rightName => $rightValue) {
if (is_bool($rightValue)) {
$key .= $rightValue ? $rightName : 'not_' . $rightName;
} else {
$key .= $rightName . '_' . $rightValue;
}
$key .= '.';
}
}
}
}
if (is_array($context) && array_key_exists(CLARO_CONTEXT_COURSE, $context)) {
if (is_array($context) && array_key_exists(CLARO_CONTEXT_GROUP, $context)) {
$textZoneFile = get_conf('coursesRepositorySys') . claro_get_course_group_path($context) . '/textzone/' . $key . 'inc.html';
} else {
$textZoneFile = get_conf('coursesRepositorySys') . claro_get_course_path($context[CLARO_CONTEXT_COURSE]) . '/textzone/' . $key . 'inc.html';
}
}
if (is_null($textZoneFile)) {
$textZoneFile = get_path('rootSys') . 'platform/textzone/' . $key . 'inc.html';
}
pushClaroMessage($textZoneFile);
return $textZoneFile;
}
开发者ID:rhertzog,项目名称:lcs,代码行数:40,代码来源:textzone.lib.php
示例6: ClaroPHPMailer
function ClaroPHPMailer()
{
//prevent phpMailer from echo'ing anything
parent::__construct(true);
// set charset
$this->CharSet = get_locale('charset');
if (get_conf('smtp_host') != '') {
// set smtp mode and smtp host
$this->IsSMTP();
$this->Host = get_conf('smtp_host');
if (get_conf('smtp_username') != '') {
// SMTP authentification
$this->SMTPAuth = true;
// turn on SMTP
$this->Username = get_conf('smtp_username');
// SMTP username
$this->Password = get_conf('smtp_password');
// SMTP password
}
if (get_conf('smtp_port') != '') {
$this->Port = (int) get_conf('smtp_port');
}
if (get_conf('smtp_secure') != '') {
$this->SMTPSecure = get_conf('smtp_secure');
}
} else {
// set sendmail mode
$this->IsMail();
}
}
开发者ID:rhertzog,项目名称:lcs,代码行数:30,代码来源:sendmail.lib.php
示例7: setAuthDriverOptions
/**
* Set the authentication profile options. Contains
* $data['courseRegistrationAllowed'] with value true, false or null (let the platform decide)
* $data['courseEnrolmentMode'] with value 'open', 'close', 'validation' or null (let the platform decide)
* $data['defaultCourseProfile'] profile attributed by default to the user when registering to a new course or null
* $data['editableProfileFields'] array of editable fileds in the user profile or null
* @return $this
*/
public function setAuthDriverOptions($data)
{
if (isset($data['courseEnrolmentMode'])) {
$this->courseEnrolmentMode = $data['courseEnrolmentMode'];
} else {
$this->courseEnrolmentMode = null;
}
if (isset($data['defaultCourseProfile']) && !is_null($data['defaultCourseProfile'])) {
$this->defaultCourseProfile = $data['defaultCourseProfile'];
} else {
$this->defaultCourseProfile = 'user';
}
if (isset($data['editableProfileFields']) && !empty($data['editableProfileFields'])) {
$this->editableProfileFields = $data['editableProfileFields'];
} else {
load_kernel_config('user_profile');
if (empty($data['readonlyProfileFields'])) {
$this->editableProfileFields = get_conf('profile_editable');
} else {
$baseProfileFeilds = get_conf('profile_editable');
$this->editableProfileFields = array();
foreach ($baseProfileFeilds as $profileField) {
if (!in_array($profileField, $data['readonlyProfileFields'])) {
$this->editableProfileFields[] = $profileField;
}
}
}
}
if (isset($data['courseRegistrationAllowed']) && !is_null($data['courseRegistrationAllowed'])) {
$this->courseRegistrationAllowed = $data['courseRegistrationAllowed'];
} else {
$this->courseRegistrationAllowed = get_conf('allowToSelfEnroll', true);
}
return $this;
}
开发者ID:rhertzog,项目名称:lcs,代码行数:43,代码来源:authprofile.lib.php
示例8: CLANN_write_ical
/**
* CLAROLINE
*
* @version $Revision: 13708 $
* @copyright (c) 2001-2011, Universite catholique de Louvain (UCL)
* @license http://www.gnu.org/copyleft/gpl.html (GPL) GENERAL PUBLIC LICENSE
* @package CLANN
* @subpackage CLICAL
* @author Claro Team <[email protected]>
*/
function CLANN_write_ical($iCal, $context)
{
if (is_array($context) && count($context) > 0) {
$courseId = array_key_exists(CLARO_CONTEXT_COURSE, $context) ? $context[CLARO_CONTEXT_COURSE] : claro_get_current_course_id();
}
require_once dirname(__FILE__) . '/../lib/announcement.lib.php';
$courseData = claro_get_course_data($courseId);
$toolNameList = claro_get_tool_name_list();
$announcementList = announcement_get_item_list($context, 'DESC');
$organizer = (array) array($courseData['titular'], $courseData['email']);
$attendees = array();
$categories = array(get_conf('siteName'), $courseData['officialCode'], trim($toolNameList['CLANN']));
foreach ($announcementList as $announcementItem) {
if ('SHOW' == $announcementItem['visibility']) {
/*
$rssList[] = array( 'title' => trim($announcementItem['title'])
, 'category' => trim($toolNameList['CLANN'])
, 'guid' => get_module_url('CLANN') . '/announcements.php?cidReq='.claro_get_current_course_id().'&l#ann'.$announcementItem['id']
, 'link' => get_module_url('CLANN') . '/announcements.php?cidReq='.claro_get_current_course_id().'&l#ann'.$announcementItem['id']
, 'description' => trim(str_replace('<!-- content: html -->','',$announcementItem['content']))
, 'pubDate' => date('r', stripslashes(strtotime($announcementItem['time'])))
//, 'author' => $_course['email']
);
*/
$iCal->addJournal(trim($announcementItem['title']), trim(str_replace('<!-- content: html -->', '', $announcementItem['content'])), strtotime($announcementItem['time']), strtotime($announcementItem['time']), time(), 1, 1, $organizer, $attendees, $categories, 5, 10, 1, array(), 0, '', get_path('rootWeb') . get_module_url('CLANN') . '/announcements.php?cidReq=' . $courseId . '&l#ann' . $announcementItem['id'], get_locale('iso639_1_code'), '');
}
}
return $iCal;
}
开发者ID:rhertzog,项目名称:lcs,代码行数:39,代码来源:ical.write.cnr.php
示例9: render
public function render()
{
if ($this->hidden) {
return '<!-- footer hidden -->' . "\n";
}
$currentCourse = claro_get_current_course_data();
if (claro_is_in_a_course()) {
$courseManagerOutput = '<div id="courseManager">' . get_lang('Manager(s) for %course_code', array('%course_code' => $currentCourse['officialCode'])) . ' : ';
$currentCourseTitular = empty($currentCourse['titular']) ? get_lang('Course manager') : $currentCourse['titular'];
if (empty($currentCourse['email'])) {
$courseManagerOutput .= '<a href="' . get_module_url('CLUSR') . '/user.php">' . $currentCourseTitular . '</a>';
} else {
$courseManagerOutput .= '<a href="mailto:' . $currentCourse['email'] . '?body=' . $currentCourse['officialCode'] . '&subject=[' . rawurlencode(get_conf('siteName')) . ']' . '">' . $currentCourseTitular . '</a>';
}
$courseManagerOutput .= '</div>';
$this->assign('courseManager', $courseManagerOutput);
} else {
$this->assign('courseManager', '');
}
$platformManagerOutput = '<div id="platformManager">' . get_lang('Administrator for %site_name', array('%site_name' => get_conf('siteName'))) . ' : ' . '<a href="mailto:' . get_conf('administrator_email') . '?subject=[' . rawurlencode(get_conf('siteName')) . ']' . '">' . get_conf('administrator_name') . '</a>';
if (get_conf('administrator_phone') != '') {
$platformManagerOutput .= '<br />' . "\n" . get_lang('Phone : %phone_number', array('%phone_number' => get_conf('administrator_phone')));
}
$platformManagerOutput .= '</div>';
$this->assign('platformManager', $platformManagerOutput);
$poweredByOutput = '<span class="poweredBy">' . get_lang('Powered by') . ' <a href="http://www.claroline.net" target="_blank">Claroline</a> ' . '© 2001 - 2013' . '</span>';
$this->assign('poweredBy', $poweredByOutput);
return parent::render();
}
开发者ID:rhertzog,项目名称:lcs,代码行数:29,代码来源:footer.lib.php
示例10: export
public function export()
{
$postsList = $this->loadTopic($this->getTopicId());
$topicInfo = get_topic_settings($this->getTopicId());
$css = $this->importCss();
$form = new PhpTemplate(get_module_path('CLFRM') . '/templates/forum_export.tpl.php');
$form->assign('forum_id', $topicInfo['forum_id']);
$form->assign('topic_id', $topicInfo['topic_id']);
$form->assign('notification_bloc', false);
$form->assign('topic_subject', $topicInfo['topic_title']);
$form->assign('postList', $postsList);
$form->assign('claro_notifier', false);
$form->assign('is_allowedToEdit', false);
$form->assign('date', null);
$out = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' . "\n" . '<html>' . "\n" . '<head>' . "\n" . '<meta http-equiv="Content-Type" content="text/HTML; charset=' . get_conf('charset') . '" />' . "\n" . '<style type="text/css">' . $css . '</style>' . "\n" . '<title>' . $topicInfo['topic_title'] . '</title>' . "\n" . '</head>' . "\n" . '<body><div id="forumExport">' . "\n";
$out .= $form->render();
$out .= '</div></body>' . "\n" . '</html>';
$path = get_conf('rootSys') . get_conf('tmpPathSys') . '/forum_export/';
$filename = $path . replace_dangerous_char(str_replace(' ', '_', $topicInfo['topic_title']) . '_' . $topicInfo['topic_id']) . '.html';
claro_mkdir($path);
file_put_contents($filename, $out);
switch ($this->output) {
case 'screen':
header('Content-Description: File Transfer');
header('Content-Type: application/force-download');
header('Content-Length: ' . filesize($filename));
header('Content-Disposition: attachment; filename=' . basename($filename));
readfile($filename);
claro_delete_file($filename);
break;
case 'file':
break;
}
return true;
}
开发者ID:rhertzog,项目名称:lcs,代码行数:35,代码来源:export.html.class.php
示例11: __construct
public function __construct()
{
if (get_conf('course_order_by') == 'official_code') {
$this->orderBy = self::ORDER_BY_OFFICIAL_CODE;
} else {
$this->orderBy = self::ORDER_BY_TITLE;
}
}
开发者ID:rhertzog,项目名称:lcs,代码行数:8,代码来源:courselist.lib.php
示例12: testCurlDo
public function testCurlDo()
{
$res = \CashWay\cURL::curlDo(get_conf()['API_URL'], array());
$tr = json_decode($res['body'], true);
$this->assertEquals('GET', $tr['method']);
$this->assertEquals('/', $tr['request']);
$this->assertEquals('200', $res['code']);
}
开发者ID:vAugagneur,项目名称:plugins,代码行数:8,代码来源:HTTPTest.php
示例13: get_xml_charset
/**
* CLAROLINE
*
* @version 1.11 $Revision: 14315 $
* @copyright (c) 2001-2012, Universite catholique de Louvain (UCL)
* @license http://www.gnu.org/copyleft/gpl.html (GPL) GENERAL PUBLIC LICENSE
* @author Piraux Sebastien <[email protected]>
* @author Lederer Guillaume <[email protected]>
* @package CLLNP
*/
function get_xml_charset($xml)
{
$regex = '/<\\?xml(?:.*?)encoding="([a-zA-Z0-9\\-]+)"(?:.*?)\\s*\\?>/';
if (preg_match($regex, $xml, $matches)) {
return $matches[1];
} else {
return get_conf('charset');
}
}
开发者ID:rhertzog,项目名称:lcs,代码行数:19,代码来源:importLearningPath.php
示例14: sql_clean
/**
* 针对指定配置执行sql
* @param unknown_type $module
* @param unknown_type $sql
*/
protected function sql_clean($module, $sql)
{
$conf = get_conf($module);
$ipaddr = $conf["mysql"]["ipaddr"];
$db = $conf["mysql"]["db"];
$user = $conf["mysql"]["user"];
$pwd = $conf["mysql"]["pwd"];
sql_execute($ipaddr, $db, $user, $pwd, $sql);
}
开发者ID:sdgdsffdsfff,项目名称:stplatform,代码行数:14,代码来源:basetest.php
示例15: error
public static function error($message)
{
// claro_failure::set_failure( $message );
if (claro_debug_mode()) {
pushClaroMessage($message, self::ERROR);
}
if (get_conf('log_report_level', self::REPORT_LEVEL_ALL) >= self::REPORT_LEVEL_ERROR) {
Claroline::log(self::ERROR, $message);
}
}
开发者ID:rhertzog,项目名称:lcs,代码行数:10,代码来源:console.lib.php
示例16: buildRecords
function buildRecords($exportUserInfo = true)
{
$tbl_mdb_names = claro_sql_get_main_tbl();
$tbl_user = $tbl_mdb_names['user'];
$tbl_rel_course_user = $tbl_mdb_names['rel_course_user'];
$tbl_cdb_names = claro_sql_get_course_tbl(claro_get_course_db_name_glued($this->course_id));
$tbl_team = $tbl_cdb_names['group_team'];
$tbl_rel_team_user = $tbl_cdb_names['group_rel_team_user'];
$username = claro_is_platform_admin() && get_conf('export_sensitive_data_for_admin', false) || get_conf('export_user_username', false) ? "`U`.`username` AS `username`," : "";
if (claro_is_platform_admin() && get_conf('export_sensitive_data_for_admin', false) || get_conf('export_user_password', false)) {
if (claro_is_platform_admin() && get_conf('export_sensitive_data_for_admin', false) || get_conf('export_user_password_encrypted', true)) {
$password = "MD5(`U`.`password`) AS `password`,";
} else {
$password = "`U`.`password` AS `password`,";
}
} else {
$password = '';
}
// get user list
$sql = "SELECT `U`.`user_id` AS `userId`,\n `U`.`nom` AS `lastname`,\n `U`.`prenom` AS `firstname`,\n {$username}\n {$password}\n `U`.`email` AS `email`,\n `U`.`officialCode` AS `officialCode`,\n GROUP_CONCAT(`G`.`id`) AS `groupId`,\n GROUP_CONCAT(`G`.`name`) AS `groupName`\n FROM\n (\n `" . $tbl_user . "` AS `U`,\n `" . $tbl_rel_course_user . "` AS `CU`\n )\n LEFT JOIN `" . $tbl_rel_team_user . "` AS `GU`\n ON `U`.`user_id` = `GU`.`user`\n LEFT JOIN `" . $tbl_team . "` AS `G`\n ON `GU`.`team` = `G`.`id`\n WHERE `U`.`user_id` = `CU`.`user_id`\n AND `CU`.`code_cours`= '" . claro_sql_escape($this->course_id) . "'\n GROUP BY U.`user_id`\n ORDER BY U.`user_id`";
$userList = claro_sql_query_fetch_all($sql);
// build recordlist with good values for answers
if (is_array($userList) && !empty($userList)) {
// add titles at row 0, for that get the keys of the first row of array
$this->recordList[0] = array_keys($userList[0]);
$i = 1;
$userIdList = array();
foreach ($userList as $user) {
$userIdList[$user['userId']] = $i;
if (!(claro_is_platform_admin() && get_conf('export_sensitive_data_for_admin', false) || get_conf('export_user_id', false))) {
$user['userId'] = $i;
}
// $this->recordList is defined in parent class csv
$this->recordList[$i] = $user;
$i++;
}
if ($exportUserInfo) {
$userInfoList = new UserInfoList($this->course_id);
$userInfoLabelList = $userInfoList->getUserInfoLabels();
foreach ($userInfoLabelList as $catId => $catTitle) {
$this->recordList[0][] = $catTitle;
$userCatInfo = $userInfoList->getUserInfo($catId);
foreach ($userCatInfo as $userCatInfo) {
$this->recordList[$userIdList[$userCatInfo['userId']]][] = $userCatInfo['content'];
}
}
}
}
if (is_array($this->recordList) && !empty($this->recordList)) {
return true;
} else {
return false;
}
}
开发者ID:rhertzog,项目名称:lcs,代码行数:54,代码来源:export.lib.php
示例17: country_conf_currency
function country_conf_currency($html = false)
{
$id = get_conf(__FILE__, __LINE__, 'country');
$country = new country($id);
$curr_lett = $country->data['currency_letter'];
if (!$html) {
return $curr_lett;
}
$curr_html = $country->data['currency_html'];
if (empty($curr_html)) {
return $curr_lett;
}
return $curr_html;
}
开发者ID:jaimeivan,项目名称:smart-restaurant,代码行数:14,代码来源:countries_class.php
示例18: course_description_get_item_list
/**
* get all the items
*
* @param $courseId string glued dbName of the course to affect default: current course
*
* @return array of arrays with data of the item
*
* @author Christophe Gesché <[email protected]>
*
*/
function course_description_get_item_list($courseId = null)
{
$tbl = claro_sql_get_course_tbl(claro_get_course_db_name_glued($courseId));
$tblCourseDescription = $tbl['course_description'];
if (get_conf('cldsc_use_new_ordering_of_labels')) {
// sort first the principal categories
$sql = "SELECT `cd`.`id`,\n\t `cd`.`category`,\n\t `cd`.`title`,\n\t `cd`.`content`,\n\t UNIX_TIMESTAMP(cd.`lastEditDate`)\n\t AS `unix_lastEditDate`,\n\t `cd`.`visibility`\n\t FROM `" . $tblCourseDescription . "` AS `cd`\n\t WHERE `cd`.`category` != '-1'\n\t ORDER BY `cd`.`category` ASC";
// and then the "other" category ... by title
$sql2 = "SELECT cd.`id`,\n\t cd.`category`,\n\t cd.`title`,\n\t cd.`content`,\n\t UNIX_TIMESTAMP(`cd`.`lastEditDate`)\n\t AS `unix_lastEditDate`,\n\t `cd`.`visibility`\n\t FROM `" . $tblCourseDescription . "` AS `cd`\n\t WHERE `cd`.`category` = '-1'\n\t ORDER BY `cd`.`title` ASC";
return array_merge(claro_sql_query_fetch_all($sql), claro_sql_query_fetch_all($sql2));
} else {
$sql = "SELECT `cd`.`id`,\n\t `cd`.`category`,\n\t `cd`.`title`,\n\t `cd`.`content`,\n\t UNIX_TIMESTAMP(cd.`lastEditDate`)\n\t AS `unix_lastEditDate`,\n\t `cd`.`visibility`\n\t FROM `" . $tblCourseDescription . "` AS `cd`\n\t ORDER BY `cd`.`category` ASC";
return claro_sql_query_fetch_all($sql);
}
}
开发者ID:rhertzog,项目名称:lcs,代码行数:25,代码来源:courseDescription.lib.php
示例19: setForUser
public static function setForUser($_uid)
{
$tbl = claro_sql_get_main_tbl();
$ssoCookieExpireTime = time() + get_conf('ssoCookiePeriodValidity', 3600);
$ssoCookieValue = md5(time() . rand(100, 1000000));
$sql = "UPDATE `{$tbl['sso']}`\n" . "SET cookie = '" . $ssoCookieValue . "',\n" . "rec_time = NOW()\n" . "WHERE user_id = " . (int) $_uid;
$affectedRowCount = claro_sql_query_affected_rows($sql);
if ($affectedRowCount < 1) {
$sql = "INSERT INTO `{$tbl['sso']}`\n" . "SET cookie = '" . $ssoCookieValue . "',\n" . "rec_time = NOW(),\n" . "user_id = " . (int) $_uid;
claro_sql_query($sql);
}
return setcookie(get_conf('ssoCookieName', 'clarolineSsoCookie'), $ssoCookieValue, $ssoCookieExpireTime, get_conf('ssoCookiePath', '/'), get_conf('ssoCookieDomain', 'sso.claroline.net'));
// Note. $ssoCookieName, $ssoCookieValussoCookieExpireTime,
// $soCookiePath and $ssoCookieDomain are coming from
// claroline/inc/conf/auth.conf.php
}
开发者ID:rhertzog,项目名称:lcs,代码行数:16,代码来源:cookie.lib.php
示例20: loadFromDatabase
/**
* Load user properties from database
*/
public function loadFromDatabase()
{
$tbl = claro_sql_get_main_tbl();
$sqlUserId = (int) $this->_userId;
$sql = "SELECT " . "`user`.`user_id` AS userId,\n" . "`user`.`username`,\n" . "`user`.`prenom` AS firstName,\n" . "`user`.`nom` AS lastName,\n" . "`user`.`email`AS `mail`,\n" . "`user`.`officialEmail` AS `officialEmail`,\n" . "`user`.`language`,\n" . "`user`.`isCourseCreator`,\n" . "`user`.`isPlatformAdmin`,\n" . "`user`.`creatorId` AS creatorId,\n" . "`user`.`officialCode`,\n" . "`user`.`language`,\n" . "`user`.`authSource`,\n" . "`user`.`phoneNumber` AS `phone`,\n" . "`user`.`pictureUri` AS `picture`,\n" . (get_conf('is_trackingEnabled') ? "UNIX_TIMESTAMP(`tracking`.`date`) " : "DATE_SUB(CURDATE(), INTERVAL 1 DAY) ") . "AS lastLogin\n" . "FROM `{$tbl['user']}` AS `user`\n" . (get_conf('is_trackingEnabled') ? "LEFT JOIN `{$tbl['tracking_event']}` AS `tracking`\n" . "ON `user`.`user_id` = `tracking`.`user_id`\n" . "AND `tracking`.`type` = 'user_login'\n" : '') . "WHERE `user`.`user_id` = " . $sqlUserId . "\n" . (get_conf('is_trackingEnabled') ? "ORDER BY `tracking`.`date` DESC LIMIT 1" : '');
$userData = Claroline::getDatabase()->query($sql)->fetch();
if (!$userData) {
throw new Exception("Cannot load user data for {$this->_userId}");
} else {
$userData['isPlatformAdmin'] = (bool) $userData['isPlatformAdmin'];
$userData['isCourseCreator'] = (bool) $userData['isCourseCreator'];
$this->_rawData = $userData;
pushClaroMessage("User {$this->_userId} loaded from database", 'debug');
$this->loadUserProperties();
}
}
开发者ID:rhertzog,项目名称:lcs,代码行数:19,代码来源:user.lib.php
注:本文中的get_conf函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论