本文整理汇总了PHP中get_module_path函数的典型用法代码示例。如果您正苦于以下问题:PHP get_module_path函数的具体用法?PHP get_module_path怎么用?PHP get_module_path使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_module_path函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($courseId)
{
$this->courseId = $courseId;
$courseCode = ClaroCourse::getCodeFromId($this->courseId);
$tbl_mdb_names = claro_sql_get_main_tbl();
$tbl_rel_course_portlet = $tbl_mdb_names['rel_course_portlet'];
$sql = "SELECT id, courseId, rank, label, visible\n FROM `{$tbl_rel_course_portlet}`\n WHERE `courseId` = {$this->courseId}\n ORDER BY `rank` ASC";
$result = Claroline::getDatabase()->query($sql);
foreach ($result as $portletInfos) {
// Require the proper portlet class
$portletPath = get_module_path($portletInfos['label']) . '/connector/coursehomepage.cnr.php';
$portletName = $portletInfos['label'] . '_Portlet';
if (file_exists($portletPath)) {
require_once $portletPath;
} else {
echo "Le fichier {$portletPath} est introuvable<br/>";
}
if (class_exists($portletName)) {
$portlet = new $portletName($portletInfos['id'], $courseCode, $portletInfos['courseId'], $portletInfos['rank'], $portletInfos['label'], $portletInfos['visible']);
$this->portlets[] = $portlet;
} else {
echo "Can't find the class {$portletName}_portlet<br/>";
return false;
}
}
}
开发者ID:rhertzog,项目名称:lcs,代码行数:26,代码来源:coursehomepageportletiterator.class.php
示例2: 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
示例3: get_icon_url
/**
* Returns the url of the given icon
*
* @param string $fileName file name with or without extension
* @param string $moduleLabel label of the module (optional)
* @return string icon url
* mixed null if icon not found
*/
function get_icon_url($fileName, $moduleLabel = null)
{
$fileInfo = pathinfo($fileName);
$currentModuleLabel = get_current_module_label();
$imgPath = array();
// Search kernel first for performance !
// claroline theme iconset
$imgPath[get_current_iconset_path()] = get_current_iconset_url();
// claroline web/img <--- is now the default location find using get_current_iconset_url
//$imgPath[get_path( 'rootSys' ) . 'web/img/'] = get_path('url') . '/web/img/';
if (!empty($moduleLabel)) {
// module img directory
$imgPath[get_module_path($moduleLabel) . '/img/'] = get_module_url($moduleLabel) . '/img/';
// module root directory
$imgPath[get_module_path($moduleLabel) . '/'] = get_module_url($moduleLabel) . '/';
}
if (!empty($currentModuleLabel)) {
// module img directory
$imgPath[get_module_path($currentModuleLabel) . '/img/'] = get_module_url($currentModuleLabel) . '/img/';
// module root directory
$imgPath[get_module_path($currentModuleLabel) . '/'] = get_module_url($currentModuleLabel) . '/';
}
// img directory in working directory
$imgPath['./img/'] = './img/';
// working directory
$imgPath['./'] = './';
if (!empty($fileInfo['extension'])) {
$img = array($fileName);
} else {
$img = array($fileName . '.png', $fileName . '.gif');
}
foreach ($imgPath as $tryPath => $tryUrl) {
foreach ($img as $tryImg) {
if (claro_debug_mode()) {
pushClaroMessage("Try " . $tryPath . $tryImg, 'debug');
}
if (file_exists($tryPath . $tryImg)) {
if (claro_debug_mode()) {
pushClaroMessage("Using " . $tryPath . $tryImg, 'debug');
}
return $tryUrl . $tryImg . '?' . filemtime($tryPath . $tryImg);
}
}
}
if (claro_debug_mode()) {
pushClaroMessage("Icon {$fileName} not found", 'error');
}
// WORKAROUND : avoid double submission if missing image !!!!
return 'image_not_found.png';
}
开发者ID:rhertzog,项目名称:lcs,代码行数:58,代码来源:icon.lib.php
示例4: loadModuleManager
private function loadModuleManager($cidReq = null)
{
$toolList = claro_get_main_course_tool_list();
foreach ($toolList as $tool) {
if (!is_null($tool['label'])) {
$file = get_module_path($tool['label']) . '/connector/trackingManager.cnr.php';
if (file_exists($file)) {
require_once $file;
if (claro_debug_mode()) {
pushClaroMessage('Tracking : ' . $tool['label'] . ' tracking managers loaded', 'debug');
}
}
}
}
}
开发者ID:rhertzog,项目名称:lcs,代码行数:15,代码来源:trackingManagerRegistry.class.php
示例5: load_current_module_listeners
/**
* Load the event listener of the current module
*/
function load_current_module_listeners()
{
$claroline = Claroline::getInstance();
$path = get_module_path(Claroline::getInstance()->currentModuleLabel()) . '/connector/eventlistener.cnr.php';
if (file_exists($path)) {
if (claro_debug_mode()) {
pushClaroMessage('Load listeners for : ' . Claroline::getInstance()->currentModuleLabel(), 'debug');
}
include $path;
} else {
if (claro_debug_mode()) {
pushClaroMessage('No listeners for : ' . Claroline::getInstance()->currentModuleLabel(), 'warning');
}
}
}
开发者ID:rhertzog,项目名称:lcs,代码行数:18,代码来源:notify.lib.php
示例6: current
public function current()
{
$portlet = $this->portlets->current();
$portletObj = '';
// Require the proper portlet class
$portletPath = get_module_path($portlet['label']) . '/connector/coursehomepage.cnr.php';
$portletName = $portlet['label'] . '_Portlet';
if (file_exists($portletPath)) {
require_once $portletPath;
} else {
throw new Exception("Can\\'t find the file %portletPath", array('%portletPath' => $portletPath));
}
if (class_exists($portletName)) {
$courseCode = ClaroCourse::getCodeFromId($this->courseId);
$portletObj = new $portletName($portlet['id'], $courseCode, $portlet['courseId'], $portlet['rank'], $portlet['label'], $portlet['visible']);
return $portletObj;
} else {
echo get_lang("Can't find the class %portletName_portlet", array('%portletName' => $portletName));
return false;
}
}
开发者ID:rhertzog,项目名称:lcs,代码行数:21,代码来源:coursehomepageportletiterator.class.php
示例7: load
public function load()
{
$tblNameList = claro_sql_get_main_tbl();
$sql = "SELECT M.`label` AS `label`,\n" . "M.`script_url` AS `entry`,\n" . "M.`name` AS `name`,\n" . "M.`activation` AS `activation`,\n" . "D.`name` AS `dock`\n" . "FROM `" . $tblNameList['dock'] . "` AS D\n" . "LEFT JOIN `" . $tblNameList['module'] . "` AS M\n" . "ON D.`module_id` = M.`id`\n" . "ORDER BY D.`rank` ";
$appletList = claro_sql_query_fetch_all_rows($sql);
if ($appletList) {
$dockAppletList = array();
foreach ($appletList as $key => $applet) {
if (!array_key_exists($applet['dock'], $dockAppletList)) {
$dockAppletList[$applet['dock']] = array();
}
$entryPath = get_module_path($applet['label']) . '/' . $applet['entry'];
if (file_exists($entryPath)) {
$applet['path'] = $entryPath;
// $appletList[$key] = $applet;
$dockAppletList[$applet['dock']][] = $applet;
}
}
$this->_dockAppletList = $dockAppletList;
}
}
开发者ID:rhertzog,项目名称:lcs,代码行数:21,代码来源:dock.lib.php
示例8: export_modules
public function export_modules()
{
$parent = $this->parent->get('parent');
//record the "menu interface" of object client
//$interfaces_object = $this->parent->get(\get_constant('\platform\config\interfac3::_namespace'));
foreach (get_constant('\\platform\\config\\interfac3::_i_' . $this->name) as $module) {
if (module_exist($module)) {
$module_path = get_module_path($module);
$parent->lib2namespace($module_path, $parent->name . '.' . get_constant('\\platform\\config\\interfac3::_module_namespace'), build_extension(get_constant('\\platform\\config\\interfac3::_valid_module_extension'), 1));
//update the "menu interface" of object client
//$interfaces_object->{$this->name}->{$module} = get_module_description($module);
} else {
//update the "menu interface" of object client
//$interfaces_object->{$this->name}->{$module} = get_constant('\platform\config\interfac3::_no_module_description_msg');
}
// if($this->slots > $this->slots_max){
// throw new \Exception;
// }else{
// $this->slots_number += $module->slots_number;
// }
}
}
开发者ID:guillaum3f,项目名称:codie,代码行数:22,代码来源:interfac3.class.php
示例9: claro_disp_auth_form
* @see http://www.claroline.net/wiki/CLDSC/
* @author Claro Team <[email protected]>
* @package CLDSC
* @since 1.9
*/
// TODO add config var to allow multiple post of same type
$tlabelReq = 'CLDSC';
require '../inc/claro_init_global.inc.php';
if (!claro_is_in_a_course() || !claro_is_course_allowed()) {
claro_disp_auth_form(true);
}
claro_set_display_mode_available(true);
$is_allowedToEdit = claro_is_allowed_to_edit();
//-- Tool libraries
include_once get_module_path($tlabelReq) . '/lib/courseDescription.class.php';
include_once get_module_path($tlabelReq) . '/lib/courseDescription.lib.php';
//-- Get $tipList
$tipList = get_tiplistinit();
/*
* init request vars
*/
$acceptedCmdList = array('rqEdit', 'exEdit', 'exDelete', 'mkVis', 'mkInvis');
if (isset($_REQUEST['cmd']) && in_array($_REQUEST['cmd'], $acceptedCmdList)) {
$cmd = $_REQUEST['cmd'];
} else {
$cmd = null;
}
if (isset($_REQUEST['descId']) && is_numeric($_REQUEST['descId'])) {
$descId = (int) $_REQUEST['descId'];
} else {
$descId = null;
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:index.php
示例10: dirname
* @author Claro Team <[email protected]>
* @since 1.9
*/
// Reset session variables
$cidReset = true;
// course id
$gidReset = true;
// group id
$tidReset = true;
// tool id
// Load Claroline kernel
require_once dirname(__FILE__) . '/../inc/claro_init_global.inc.php';
// Build the breadcrumb
$nameTools = get_lang('Headlines');
// Initialisation of variables and used classes and libraries
require_once get_module_path('CLTI') . '/lib/toolintroductioniterator.class.php';
$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
$cmd = !empty($_REQUEST['cmd']) ? $_REQUEST['cmd'] : null;
$isAllowedToEdit = claro_is_allowed_to_edit();
set_current_module_label('CLINTRO');
// Init linker
FromKernel::uses('core/linker.lib');
ResourceLinker::init();
// Javascript confirm pop up declaration for header
JavascriptLanguage::getInstance()->addLangVar('Are you sure to delete %name ?');
JavascriptLoader::getInstance()->load('tool_intro');
// Instanciate dialog box
$dialogBox = new DialogBox();
$toolIntroForm = '';
if (isset($cmd) && $isAllowedToEdit) {
// Set linker's params
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:index.php
示例11: create_required_profile
include_once 'init_profile_right.lib.php';
create_required_profile();
/**
* ADD MODULES
*/
$preInstalledTools = array('CLDSC', 'CLCAL', 'CLANN', 'CLDOC', 'CLQWZ', 'CLLNP', 'CLWRK', 'CLFRM', 'CLGRP', 'CLUSR', 'CLWIKI');
if (file_exists(get_path('rootSys') . 'module')) {
$moduleDirIterator = new DirectoryIterator(get_path('rootSys') . 'module');
foreach ($moduleDirIterator as $moduleDir) {
if ($moduleDir->isDir() && !$moduleDir->isDot()) {
$preInstalledTools[] = $moduleDir->getFilename();
}
}
}
foreach ($preInstalledTools as $claroLabel) {
$modulePath = get_module_path($claroLabel);
if (file_exists($modulePath)) {
$moduleId = register_module($modulePath);
if (false !== activate_module($moduleId)) {
trigger_error('module (id:' . $moduleId . ' ) not activated ', E_USER_WARNING);
}
} else {
trigger_error('module path not found', E_USER_WARNING);
}
}
// init default right profile
init_default_right_profile();
/***
* Generate module conf from definition files.
*/
$config_code_list = get_config_code_list('module');
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:do_install.inc.php
示例12: removeUserIdListFromCourse
/**
* Remove a list of users given their user id from the cours
* @param array $userIdList list of user ids to add
* @param Claro_Class $class execute class unregistration instead of individual registration if given (default:null)
* @param bool $keepTrackingData tracking data will be deleted if set to false (default:true, i.e. keep data)
* @param array $moduleDataToPurge list of module_label => (purgeTracking => bool, purgeData => bool)
* @param bool $unregisterFromSourceIfLastSession remove users that are in no other session course from the source course if any
* @return boolean
*/
public function removeUserIdListFromCourse($userIdList, $class = null, $keepTrackingData = true, $moduleDataToPurge = array(), $unregisterFromSourceIfLastSession = true)
{
if (!count($userIdList)) {
return false;
}
$classMode = is_null($class) ? false : true;
$courseCode = $this->course->courseId;
$sqlCourseCode = $this->database->quote($courseCode);
if ($classMode && !$class->isRegisteredToCourse($courseCode)) {
$this->result->addError(get_lang("Class not registered to course"));
$this->result->setStatus(Claro_BatchRegistrationResult::STATUS_ERROR_NOTHING_TO_DO);
return false;
}
// update user registration counts
$cntToChange = $classMode ? 'count_class_enrol' : 'count_user_enrol';
$this->database->exec("\n UPDATE\n `{$this->tableNames['rel_course_user']}`\n SET\n `{$cntToChange}` = `{$cntToChange}` - 1\n WHERE\n `code_cours` = {$sqlCourseCode}\n AND\n `{$cntToChange}` > 0\n AND\n `user_id` IN (" . implode(',', $userIdList) . ")\n ");
// get the user ids to remove
$userListToRemove = $this->database->query("\n SELECT \n `user_id`\n FROM\n `{$this->tableNames['rel_course_user']}`\n WHERE\n `count_class_enrol` <= 0\n AND\n `count_user_enrol` <= 0\n AND\n `code_cours` = {$sqlCourseCode}\n ");
if ($userListToRemove->numRows()) {
$userIdListToRemove = array();
foreach ($userListToRemove as $user) {
$userIdListToRemove[] = $user['user_id'];
}
$sqlList = array();
$sqlList[] = "DELETE FROM `{$this->tableNames['bb_rel_topic_userstonotify']}` WHERE user_id IN (" . implode(',', $userIdListToRemove) . ")";
$sqlList[] = "DELETE FROM `{$this->tableNames['userinfo_content']}` WHERE user_id IN (" . implode(',', $userIdListToRemove) . ")";
$sqlList[] = "UPDATE `{$this->tableNames['group_team']}` SET `tutor` = NULL WHERE `tutor` IN (" . implode(',', $userIdListToRemove) . ")";
$sqlList[] = "DELETE FROM `{$this->tableNames['group_rel_team_user']}` WHERE user IN (" . implode(',', $userIdListToRemove) . ")";
if (!$keepTrackingData) {
$sqlList[] = "DELETE FROM `{$this->tableNames['tracking_event']}` WHERE user_id IN (" . implode(',', $userIdListToRemove) . ")";
}
$sqlList[] = "DELETE FROM `{$this->tableNames['rel_course_user']}` WHERE user_id IN (" . implode(',', $userIdListToRemove) . ") AND `code_cours` = {$sqlCourseCode}";
foreach ($sqlList as $sql) {
$this->database->exec($sql);
}
if (!empty($moduleDataToPurge)) {
foreach ($moduleDataToPurge as $moduleData) {
$connectorPath = get_module_path($moduleData['label']) . '/connector/adminuser.cnr.php';
if (file_exists($connectorPath)) {
require_once $connectorPath;
$connectorClass = $moduleData['label'] . '_AdminUser';
if (class_exist($connectorClass)) {
$connector = new $connectorClass($this->database);
if ($moduleData['purgeTracking']) {
$connector->purgeUserListCourseTrackingData($userIdListToRemove, $this->course->courseId);
}
if ($moduleData['purgeResources']) {
$connector->purgeUserListCourseResources($userIdListToRemove, $this->course->courseId);
}
} else {
Console::warning("Class {$connectorClass} not found");
}
} else {
Console::warning("No user delete connector found for module {$moduleData['label']}");
}
}
}
$this->result->addDeleted($userIdListToRemove);
if ($this->course->isSourceCourse()) {
$sessionCourseIterator = $this->course->getChildren();
foreach ($sessionCourseIterator as $sessionCourse) {
$batchReg = new self($sessionCourse, $this->database);
$batchReg->removeUserIdListFromCourse($userIdListToRemove, $class, $keepTrackingData, $moduleDataToPurge, $unregisterFromSourceIfLastSession);
$this->result->mergeResult($batchReg->getResult());
}
}
if ($this->course->hasSourceCourse() && $unregisterFromSourceIfLastSession) {
$sourceCourse = $this->course->getSourceCourse();
$sessionCourseIterator = $sourceCourse->getChildren();
$foundSessionWithClass = false;
if ($classMode) {
foreach ($sessionCourseIterator as $sessionCourse) {
if ($sessionCourse->courseId != $this->course->courseId && $class->isRegisteredToCourse($sessionCourse->courseId)) {
$foundSessionWithClass = true;
}
}
if (!$foundSessionWithClass) {
$batchReg = new self($sourceCourse, $this->database);
$batchReg->removeUserIdListFromCourse($userIdListToRemove, $class, $keepTrackingData, $moduleDataToPurge, $unregisterFromSourceIfLastSession);
}
} else {
// get userids registered in other sessions than the current one
$sessionList = $sourceCourse->getChildrenList();
if (count($sessionList)) {
$userIdListToRemoveFromSource = array();
$sessionIdList = array_keys($sessionList);
$sqlCourseCode = $this->database->quote($this->course->courseId);
$usersInOtherSessions = $this->database->query("\n SELECT\n user_id\n FROM\n `{$this->tableNames['rel_course_user']}`\n WHERE\n user_id IN (" . implode(',', $userIdListToRemove) . ")\n AND\n code_cours IN ('" . implode("','", $sessionIdList) . "')\n AND\n code_cours != {$sqlCourseCode}\n ");
// loop on $userIdList and keep only those who are not in another session and inject them in $userIdListToRemoveFromSource
$usersInOtherSessionsList = array();
foreach ($usersInOtherSessions as $userNotToRemove) {
//.........这里部分代码省略.........
开发者ID:rhertzog,项目名称:lcs,代码行数:101,代码来源:userlist.lib.php
示例13: get_path
// Include specific CSS if any
if (file_exists(get_conf('coursesRepositorySys') . $_course['path'] . '/css/course.css')) {
$claroline->display->header->addHtmlHeader('<link rel="stylesheet" media="screen" type="text/css" href="' . get_path('url') . '/' . get_path('coursesRepositoryAppend') . $_course['path'] . '/css/course.css" />');
}
// Instantiate course
$thisCourse = new ClaroCourse();
$thisCourse->load($cidReq);
include claro_get_conf_repository() . 'rss.conf.php';
// Include the course home page special CSS
CssLoader::getInstance()->load('coursehomepage', 'all');
$toolRepository = get_path('clarolineRepositoryWeb');
claro_set_display_mode_available(true);
// Manage portlets
if (claro_is_course_manager() && !empty($portletClass)) {
// Require the right class
$portletPath = get_module_path($portletLabel) . '/connector/coursehomepage.cnr.php';
if (file_exists($portletPath)) {
require_once $portletPath;
} else {
throw new Exception(get_lang('Cannot find this portlet'));
}
if ($portletCmd == 'exAdd') {
$portlet = new $portletClass();
$portlet->handleForm();
if ($portlet->save()) {
$dialogBox->success(get_lang('Portlet created'));
} else {
$dialogBox->error(get_lang('Can\'t create this portlet (%portlet)', array('%portlet' => $portlet->getLabel())));
}
} elseif ($portletCmd == 'delete' && !empty($portletId) && class_exists($portletClass)) {
$portlet = new $portletClass();
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:index.php
示例14: get_module_label_list
if (class_exists($className)) {
$portlet = new $className($portletInDB['label']);
if ($portlet->getLabel()) {
$portletList->addPortlet($portlet->getLabel(), $portlet->getName());
} else {
Console::warning("Portlet {$className} has no label !");
}
}
} else {
continue;
}
}
$moduleList = get_module_label_list();
if (is_array($moduleList)) {
foreach ($moduleList as $moduleId => $moduleLabel) {
$portletPath = get_module_path($moduleLabel) . '/connector/desktop.cnr.php';
if (file_exists($portletPath)) {
require_once $portletPath;
$className = "{$moduleLabel}_Portlet";
// Load portlet from database
$portletInDB = $portletList->loadPortlet($className);
// If it's not in DB, add it
if (!$portletInDB) {
if (class_exists($className)) {
$portlet = new $className($portletInDB['label']);
if ($portlet->getLabel()) {
$portletList->addPortlet($portlet->getLabel(), $portlet->getName());
} else {
Console::warning("Portlet {$className} has no label !");
}
}
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:index.php
示例15: load_module_translation
public static function load_module_translation($moduleLabel = null, $language = null)
{
global $_lang;
$moduleLabel = is_null($moduleLabel) ? get_current_module_label() : $moduleLabel;
// In a module
if (!empty($moduleLabel)) {
$module_path = get_module_path($moduleLabel);
$language = is_null($language) ? language::current_language() : $language;
// load english by default if exists
if (file_exists($module_path . '/lang/lang_english.php')) {
/* FIXME : DEPRECATED !!!!! */
$mod_lang = array();
include $module_path . '/lang/lang_english.php';
$_lang = array_merge($_lang, $mod_lang);
if (claro_debug_mode()) {
pushClaroMessage(__FUNCTION__ . "::" . $moduleLabel . '::' . 'English lang file loaded', 'debug');
}
} else {
// no language file to load
if (claro_debug_mode()) {
pushClaroMessage(__FUNCTION__ . "::" . $moduleLabel . '::' . 'English lang file not found', 'debug');
}
}
// load requested language if exists
if ($language != 'english' && file_exists($module_path . '/lang/lang_' . $language . '.php')) {
/* FIXME : CODE DUPLICATION see 263-274 !!!!! */
/* FIXME : DEPRECATED !!!!! */
$mod_lang = array();
include $module_path . '/lang/lang_' . $language . '.php';
$_lang = array_merge($_lang, $mod_lang);
if (claro_debug_mode()) {
pushClaroMessage(__FUNCTION__ . "::" . $moduleLabel . '::' . ucfirst($language) . ' lang file loaded', 'debug');
}
} elseif ($language != 'english') {
// no language file to load
if (claro_debug_mode()) {
pushClaroMessage(__FUNCTION__ . "::" . $moduleLabel . '::' . ucfirst($language) . ' lang file not found', 'debug');
}
} else {
// nothing to do
}
} else {
// Not in a module
}
}
开发者ID:rhertzog,项目名称:lcs,代码行数:45,代码来源:language.lib.php
示例16: secure_file_path
}
if (empty($requestUrl)) {
$isDownloadable = false;
$dialogBox->error(get_lang('Missing parameters'));
} else {
if (isset($_REQUEST['moduleLabel']) && !empty($_REQUEST['moduleLabel'])) {
$moduleLabel = $_REQUEST['moduleLabel'];
} else {
if (!claro_is_in_a_course()) {
$moduleLabel = null;
} else {
$moduleLabel = 'CLDOC';
}
}
if ($moduleLabel) {
$connectorPath = secure_file_path(get_module_path($moduleLabel) . '/connector/downloader.cnr.php');
if (file_exists($connectorPath)) {
require_once $connectorPath;
$className = $moduleLabel . '_Downloader';
$downloader = new $className($moduleLabel);
} else {
$downloader = false;
// $downloader = new Claro_Generic_Module_Downloader($moduleLabel);
pushClaroMessage('No downloader found for module ' . strip_tags($moduleLabel), 'warning');
}
} else {
$downloader = new Claro_PlatformDocumentsDownloader();
}
if ($downloader && $downloader->isAllowedToDownload($requestUrl)) {
$pathInfo = $downloader->getFilePath($requestUrl);
// use slashes instead of backslashes in file path
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:download.php
示例17: upgrade_disp_auth_form
// Security Check
if (!claro_is_platform_admin()) {
upgrade_disp_auth_form();
}
if (isset($_REQUEST['cmd']) && $_REQUEST['cmd'] == 'run') {
// DB tables definition
$tbl_mdb_names = claro_sql_get_main_tbl();
$tbl_module = $tbl_mdb_names['module'];
$tbl_module_info = $tbl_mdb_names['module_info'];
$tbl_module_contexts = $tbl_mdb_names['module_contexts'];
$modules = claro_sql_query_fetch_all("SELECT label, id, name FROM `{$tbl_module}`");
$deactivatedModules = array();
$readOnlyModules = array('CLDOC', 'CLGRP', 'CLUSR');
$version = '';
foreach ($modules as $module) {
$manifest = readModuleManifest(get_module_path($module['label']));
if ($manifest) {
$version = array_key_exists('CLAROLINE_MAX_VERSION', $manifest) ? $manifest['CLAROLINE_MAX_VERSION'] : $manifest['CLAROLINE_MIN_VERSION'];
if (!in_array($module['label'], $readOnlyModules) && !preg_match($patternVarVersion, $version)) {
deactivate_module($module['id']);
$deactivatedModules[] = $module;
}
}
}
$display = DISPLAY_RESULT_SUCCESS_PANEL;
}
// Display Header
echo upgrade_disp_header();
// Display Content
switch ($display) {
case DISPLAY_WELCOME_PANEL:
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:upgrade_modules.php
示例18: create_group
/**
* Create a new group
*
* @param string $groupName - name of the group
* @param integer $maxMember - max user allowed for this group
* @return integer : id of the new group
*
* @copyright (c) 2001-2011, Universite catholique de Louvain (UCL)
*/
function create_group($prefixGroupName, $maxMember)
{
require_once dirname(__FILE__) . '/forum.lib.php';
require_once dirname(__FILE__) . '/fileManage.lib.php';
$tbl_cdb_names = claro_sql_get_course_tbl();
$tbl_groups = $tbl_cdb_names['group_team'];
// Check name of group
$sql = "SELECT name FROM `" . $tbl_groups . "` WHERE name LIKE '" . claro_sql_escape($prefixGroupName) . "%'";
$existingGroupList = claro_sql_query_fetch_all_cols($sql);
$existingGroupList = $existingGroupList['name'];
$i = 1;
do {
$groupName = $prefixGroupName . str_pad($i, 4, ' ', STR_PAD_LEFT);
$i++;
if ($i - 2 > count($existingGroupList)) {
die($groupName . 'infiniteloop');
}
} while (in_array($groupName, $existingGroupList));
/**
* Create a directory allowing group student to upload documents
*/
// Create a Unique ID path preventing other enter
$globalPath = $GLOBALS['coursesRepositorySys'] . $GLOBALS['currentCourseRepository'] . '/group/';
do {
$groupRepository = str_replace(' ', '_', substr(uniqid(substr($groupName, 0, 19) . ' ', ''), 0, 30));
} while (check_name_exist($globalPath . $groupRepository));
claro_mkdir($globalPath . $groupRepository, CLARO_FILE_PERMISSIONS);
/*
* Insert a new group in the course group table and keep its ID
*/
$sql = "INSERT INTO `" . $tbl_groups . "`\n SET name = '" . $groupName . "',\n `maxStudent` = " . (is_null($maxMember) ? 'NULL' : "'" . (int) $maxMember . "'") . ",\n secretDirectory = '" . claro_sql_escape($groupRepository) . "'";
$createdGroupId = claro_sql_query_insert_id($sql);
/*
* Create a forum for the group in the forum table
*/
if (is_tool_activated_in_course(get_tool_id_from_module_label('CLFRM'), claro_get_current_course_id()) && is_tool_activated_in_groups(claro_get_current_course_id(), 'CLFRM')) {
create_forum($groupName . ' - ' . strtolower(get_lang('Forum')), '', 2, (int) GROUP_FORUMS_CATEGORY, '', $createdGroupId);
}
if (is_tool_activated_in_course(get_tool_id_from_module_label('CLWIKI'), claro_get_current_course_id()) && is_tool_activated_in_groups(claro_get_current_course_id(), 'CLWIKI')) {
require_once get_module_path('CLWIKI') . '/lib/lib.createwiki.php';
create_wiki($createdGroupId, $groupName . ' - Wiki');
}
return $createdGroupId;
}
开发者ID:rhertzog,项目名称:lcs,代码行数:53,代码来源:group.lib.inc.php
示例19: install_module_at_course_creation
/**
* Install module databases at course creation
*/
function install_module_at_course_creation($moduleLabel, $courseDbName, $language, $courseDirectory)
{
$sqlPath = get_module_path($moduleLabel) . '/setup/course_install.sql';
$phpPath = get_module_path($moduleLabel) . '/setup/course_install.php';
if (file_exists($sqlPath)) {
if (!execute_sql_at_course_creation($sqlPath, $courseDbName)) {
return false;
}
}
if (file_exists($phpPath)) {
// include the language file with all language variables
language::load_translation($language);
language::load_locale_settings($language);
language::load_module_translation($moduleLabel, $language);
// define tables to use in php install scripts
$courseDbName = get_conf('courseTablePrefix') . $courseDbName . get_conf('dbGlu');
$moduleCourseTblList = claro_sql_get_course_tbl($courseDbName);
/*
* @todo select database should not be needed if the setup scripts are
* well written !
*/
if (!get_conf('singleDbEnabled')) {
claro_sql_select_db($courseDbName);
}
require_once $phpPath;
}
return true;
}
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:add_course.lib.inc.php
示例20: loadModuleRenderer
/**
* Search in all activated modules
*
* @param string $cidReq
*/
private function loadModuleRenderer()
{
if (!is_null($this->courseId)) {
$profileId = claro_get_current_user_profile_id_in_course($this->courseId);
$toolList = claro_get_course_tool_list($this->courseId, $profileId);
} else {
$toolList = claro_get_main_course_tool_list();
}
foreach ($toolList as $tool) {
if (!is_null($tool['label'])) {
$file = get_module_path($tool['label']) . '/connector/tracking.cnr.php';
if (file_exists($file)) {
require_once $file;
if (claro_debug_mode()) {
pushClaroMessage('Tracking : ' . $tool['label'] . ' tracking renderers loaded', 'debug');
}
}
}
}
}
开发者ID:rhertzog,项目名称:lcs,代码行数:25,代码来源:trackingRendererRegistry.class.php
注:本文中的get_module_path函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论