本文整理汇总了PHP中get_conf函数的典型用法代码示例。如果您正苦于以下问题:PHP get_conf函数的具体用法?PHP get_conf怎么用?PHP get_conf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_conf函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
}
示例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;
}
示例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 <cvs@claroline.net>
*/
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;
}
示例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();
}
示例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;
}
示例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;
}
}
示例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']);
}
示例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 <pir@cerdecam.be>
* @author Lederer Guillaume <led@cerdecam.be>
* @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');
}
}
示例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);
}
示例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);
}
}